Hello! Has anyone had success modifying the base ...
# ask-community
n
Hello! Has anyone had success modifying the base job template for different flow deployments using the Python sdk? I'm using the worker model with prefect version
2.12.1
on kubernetes and deploy my flows using the
Deployment.build_from_flow()
method. Basically, I'd like to provision more or less mem/cpu based on what I know about each flow deployment. Thanks in advance for any help!
n
hi @Nathan (nice name btw 🙂 ) can you explain what you mean by
the worker model
? if you're deploying your flows to work pools for workers to pick up, you won't want to use the
build_from_flow
method (an older deployment UX specifically for deployments executed by agents via infra blocks that will eventually be deprecated) as far as kubernetes,
Flow.deploy
should cover the same (declarative python deployment definition) use case for you (which is the recommended approach for worker-based deployments)
n
Hey Nate (nice name!). Thanks for the tip! I'll look into the
Flow.deploy
method instead. Is there a mechanism to modify the k8s job templates though on a per-deployment basis? I've had a hard time finding that in the docs.
n
job_variables
contains the
job_manifest
that i assume you'd like to modify here
n
Awesome. Thank you very much. I'll take a look!
n
sure thing - one last note, if you want to get a high level view of the structure of the work pool config, the advanced tab on your k8s work pool can be a good visual reference
n
Nate, is there a way to use
Flow.deploy
without it building a Docker image? I'd rather it just pull an image that's already built on runtime.
there will be after the OSS release today 🙂
n
Haha nice timing!