https://prefect.io logo
Title
h

Hamza Naanani

08/26/2022, 8:50 AM
Hello Everyone, I'm seeing a weird behavior in Prefect 2.0. So I have a CI/CD runner that takes flow codes and deploy them to Prefect Cloud + S3, so that AWS agents can pick it up and run it as a job on a K8S cluster. The thing is, the runner can't apply a deployment if it doesn't have all the python dependencies of the code already installed, which is weird, considering the fact that it's only job is to create a deployment.yaml file and send it to prefect cloud + S3 and not run the flows. I find this behavior really disturbing and unpractical since people usually have one CI/CD runner and many flows (with different python versions and different package dependencies).
✅ 1
👀 2
a

Andreas Nigg

08/26/2022, 9:38 AM
I can also confirm this issue. This is also reproducible locally. 1. Have a python environment where only prefect is installed 2. Have a flow which needs an external dependency which is not installed with prefect (let's say sengrid) 3. Run prefect build and apply --> One of the commands fails with "sendgrid not available". (It's clear that you can't run this flow, as the dependency is missing. However I guess build or applying should be possible without any dependencies other than prefect?) I worked around this issue by using my prefect agent docker image as build agent - but this seems like quite a hack 😄 Count me in if we don't need all the dependencies of a flow during build time in the future!
j

Jeff Hale

08/26/2022, 11:11 AM
This issue is open for tracking extra pip packages. Thank you both for chiming in. I’ll add your messages, but feel free to watch/elaborate there.
a

Andreas Nigg

08/26/2022, 11:15 AM
Hey @Jeff Hale thanks for that Issue! However I think this here is something different, it's not related to Jobs or Runs. It's only about building and apply deployments. The issue is, that in the build environment, one needs ALL the dependencies of the flow - even though we don't want to run the flow at the build environment - only building and applying deployments. It would reduce complexity of the build environments, if we don't need all python dependencies during build time, but only during run-time.
👍 1
j

Jeff Hale

08/26/2022, 11:22 AM
Ah, gotcha @Andreas Nigg. Thank you. Interesting. I can see how that would be helpful. Are you able to open another issue with the feature request?
h

Hamza Naanani

08/29/2022, 1:41 PM
The workaround I'm doing right now is that I run my build jobs inside the same docker images that I'm creating for my flows. That solves the issue with having 1 runner that can span multiple docker images for each build, but it would be easier if the build runner could build and apply deployments without project dependencies
a

Andreas Nigg

08/30/2022, 6:24 AM
For anyone monitoring this thread, I added the feature request: https://github.com/PrefectHQ/prefect/issues/6613
👍 1
:thank-you: 1