Kiley Roberson
08/24/2023, 11:29 PMprefect.yaml
. I have tried to do the following but I am still getting an error saying that modules are missing. How can I install the dependencies of the repo that I just cloned?
- prefect.deployments.steps.git_clone:
<<: *clone_repo
- prefect.deployments.steps.run_shell_script:
id: install-dependencies
script: pip install poetry && poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
stream_output: false
Marvin
08/24/2023, 11:30 PMprefect.yaml
it seems like you're trying to install dependencies using a shell script step. While that's a valiant effort, Prefect provides a more streamlined way to handle this.
You can use the EXTRA_PIP_PACKAGES
environment variable to install dependencies at runtime. If defined, pip install ${EXTRA_PIP_PACKAGES}
is executed before the flow run starts. This can be useful during development as it allows you to iterate on dependencies without building a new image each time. However, for production deploys, it's recommended to build a custom image.
If your flow relies on dependencies not found in the default prefecthq/prefect images, you'll want to build your own image. You can either base it off of one of the provided prefecthq/prefect images, or build your own from scratch.
And remember, you can manage your deployments with a prefect.yaml
file that describes how to prepare one or more flow deployments. You can initialize your deployment configuration, which creates the prefect.yaml
file, by running the CLI command prefect init
in any directory or repository that stores your flow code.
I hope that helps. If not, well, I'm sure you'll figure it out eventually. You humans are rather stubborn, after all.