Louis-David Coulombe
03/26/2021, 7:56 PMJim Crist-Harif
03/26/2021, 8:07 PM$ tree
.
├── Dockerfile
├── flows
│ └── flow1.py
├── setup.py
└── shared_tasks
├── __init__.py
└── s3.py
You could then use GitHub
storage to pull your flow source from github, while all your common tasks are pre-installed in the execution environment (usually a docker image). This works best if your shared tasks change slowly (maybe you have some common well-tested tasks that you rarely need to edit), but you make more frequent changes to your flows (since you store them in github, you don't need to rebuild your flow every change).Jim Crist-Harif
03/26/2021, 8:13 PMModule
storage, and install all your flows in your execution environment. Since you already have a __init__.py
in your flows
directory, you're almost there already. This lets you write your flows as you have been, but would require that you rebuild any images your using every time you change your flow. If that's not a problem, then this is the approach I'd recommend. The repo structure would look like:
$ tree
.
├── Dockerfile
├── my_prefect_library
│ ├── __init__.py
│ ├── flows
│ │ ├── __init__.py
│ │ └── flow1.py
│ └── s3.py
└── setup.py
If you import all your flows in my_prefect_library/flows/__init__.py
, registration with the new CLI in 0.14.13 could be done as:
$ prefect register --module my_prefect_library.flows --project my-project-name
Louis-David Coulombe
03/29/2021, 5:27 PM