I am starting out with Google Cloud Composer environment. I want to organize my projects as follow:
dags/
├── project-1
| ├── dist
| | ├── my_custom-0.0.1-py3-none-any.whl
| ├── src
| | ├── project_1_dag.py
| ├── config
| | ├── config.ini
| ├── test
| | ├── test_dag.py
├── project-2
| ├── dist
| | ├── my_custom-0.0.2-py3-none-any.whl
| ├── src
| | ├── project_2_dag.py
| ├── config
| | ├── config.ini
| ├── test
| | ├── test_dag.py
└── project-n
The whl file contains the common utility classes and functions that I wrote for services like BigQuery, GCS, paramiko etc.
By following the above structure, I can isolate the dependencies and their versions, apply changes and improvements to existing classes and functions over time without affecting other projects.
As per the airflow documentation, I can not use PythonVirtualOperator
since most of the my codebase are classes. I did not find any other reference to achieve this.
My questions are follow:
- How can I achieve this?
- How to install and manage different versions of whl files in same composer environment?
Please note:
- My company's security policy does not allow me to host these whl files on public PyPI repo.
- I have already looked into importing from local dependencies approach, but I would like to explore whl versioning approach first for the reason I mentioned above.