Keith Smith
10/28/2024, 1:12 PM/bin/bash -c 'pip install prefect-azure && prefect worker start --pool <work-pool-name> --type azure-container-instance'
and for flows dependencies are setup on a per flow basis? i.e. I think in prefect 2 I installed all possible extra packages on the agent and flows used those. I have been having success configuring the job variables in the cloud UI and PIP EXTRA PACKAGES but I wanted to confirm that's the most efficient way. Any help much appreciated!Bianca Hoch
10/28/2024, 2:26 PMjob_variables.
If your dependencies change down the line, however, you would need to remember to go and manually change the packages you defined. For managing flow dependencies, typically we recommend creating a docker image that has all of them baked in (especially if you're using a containerized work pool type).Bianca Hoch
10/28/2024, 2:30 PM.deploy()
it will build a docker image that contains your flow code and dependencies (the ones listed out in your requirements.txt
file) by default.Keith Smith
10/28/2024, 3:50 PMBianca Hoch
10/28/2024, 6:42 PMBianca Hoch
10/28/2024, 6:44 PMprefect deploy
, you can set a pull
step in your prefect.yaml
that installs dependencies after cloning the repoBianca Hoch
10/28/2024, 6:44 PMpull:
- prefect.deployments.steps.git_clone:
id: clone-step # needed to be referenced in subsequent steps
repository: <https://github.com/org/repo.git>
- prefect.deployments.steps.pip_install_requirements:
directory: "{{ clone-step.directory }}" # `clone-step` is a user-provided `id` field
requirements_file: requirements.txt
Keith Smith
10/28/2024, 6:46 PMKeith Smith
10/28/2024, 6:47 PM