I am playing with Amazon Managed Workflows for Apache Airflow (MWAA) for the first time, so I could be missing some basics.
If I had a python application, which I had organised/spread across 2 files/scripts so it looked like this:
my_script_1.py
import my_script_2
print('This is script 1')
my_script_2.print_me()
my_script_2.py
def print_me():
print('I am script 2')
When this runs locally I get:
% python my_script_1.py
This is script 1
I am script 2
How would I deploy/organise this for MWAA if I want to run my_script_1.py and have it call/invoke my_script_2.py?
If I turn my_script_1.py into a DAG and upload the DAG to the DAG folder on my S3 bucket, how do I provide my_script_2.py to MWAA.
my_script_2.py:
- is not a python library on a library repo like pypi.org
- is not a wheel file Python wheels (.whl)
- is not a hosted on a private PyPi/PEP-503 Compliant Repo on your environment
I got that list from Python dependencies overview.
Is the solution to just upload my_script_2.py into the DAG folder on my S3 bucket, and expect MWAA to replicate my_script_2.py to a location/path which my_script_1.py will have access to at run time?
Does this link from airflow.apache.org apply to MWAA environments Typical structure of packages?