https://prefect.io logo
d

datamongus

09/01/2023, 4:42 PM
What is the recommended approach to deploying prefect agents on Kubernetes that require specific python packages to be installed. Previously in prefect 1.0 an engineer would create a custom docker image with the python packages already installed. This quickly became a problem due to now having to maintain the installed version of prefect during each release across all custom docker images.
1
n

Nate

09/01/2023, 5:24 PM
hi @datamongus - the quick solution is to have something like this
Copy code
FROM prefecthq/prefect:2-latest

RUN pip install -r requirements.txt
and
docker build
that and
push
it to some registry that you can set as the
image
on your k8s work pool (or as a deployment-level override of the
image
field on the k8s work pool like this) alternatively (this would be my production recommendation), you can avoid pulling
latest
(which can be risky) and have an image pipeline in your CI that builds
FROM
static prefect image tags you know are okay and pushes to a static image tag in your registry - so that way you can update prefect image tags in your CI as you verify that our releases are working for you without having to update your work pool
image
every time you do so
🙌 1
d

datamongus

09/02/2023, 11:12 AM
Thank you for the information. I’ll give the image CICD route a try.
2 Views