Hi, I am scoping out the work need to upgrade fro...
# ask-community
m
Hi, I am scoping out the work need to upgrade from agents to workers and had a few questions. I am curious how long we can wait to perform this upgrade if we are not creating new agent work pools or infrastructure blocks. • ‘you can continue to use existing agents’ -> would we be able to re-deploy an Agent, what defines an ‘existing agent’? • ‘new minor versions of the Prefect Python package will not include agents’ -> if we did upgrade to a major version, would we still be able to use our agent-based deployments? • More of a confirmation here, with the deprecation of ‘deployment build’ command, we must now use the ‘prefect deploy’ command and simply point the Flow at the current agent WorkPool. Appreciate any help here!
👀 1
n
hi @Matthew Millendorf - here are a couple thoughts that are hopefully helpful • agents and infra blocks and
prefect deployment build
are all used together (in 2.x) • workers and work pools and
prefect deploy
are all used together (in later 2.x and 3.x) ◦ you can use a
default-agent-pool
as a work pool so that you can continue using an agent to listen for scheduled runs, but this is purely meant as intermediate compatibility, and I would not recommend transitioning to this (agent with work pools) setup from agents + infra blocks (instead, I'd recommend migrating to workers + work pools) • you can continue to use agents on 2.x versions released before Sept 2024 (6 months after the deprecation started) ◦ you will need to pin 2.x if you cannot upgrade by Sept 2024 • only workers are supported in 3.x versions these docs may be helpful
feel free to ask any follow ups here!
c
@Nate do you mean if we still use 2.x, we can use prefect agent even after Sep 2024?
Because we got a message a few months ago, so I want to confirm it "WARNING: The 'deployment build' command has been deprecated. It will not be available after Sep 2024. Use 'prefect deploy' to deploy flows via YAML instead."
m
Hi @Nate, thanks for the great reply. Just to clarify the warning Claude posted above, what does ‘deprecated’ mean here? If ‘prefect deployment build’ is still available in 2.x, can we continue to use that command with our current agents and work blocks, kicking the can down the road on the upgrade? I know this is not recommended but we only saw the WARNING message recently and are unsure if we can perform the necessary upgrade by Sep. and wanted to see how risky it would be for us to have our current setup until mid-October / November.
n
let me make sure i’m correct about what’s being removed from later 2.x versions, i’ll get back here. deprecating for us means that something is still technically around for use, but will soon be entirely removed
m
Got it, thank you
we’re on 2.16.8 for reference
n
hi @Claude Jiang @Matthew Millendorf - good callout. I updated my message to be slightly more accurate and clarify > • you will need to pin 2.x if you cannot upgrade by Sept 2024 since we will remove agents from 2.x versions after Sept 2024. but you can use your pinned version of 2.x with cloud indefinitely
m
Got it - one last total confirmation here @Nate, so long as we pin 2.16.8, our current version, we can continue using agents and infra blocks and prefect deployment build. HOWEVER, we totally need to upgrade to worker and work pools ASAP
n
correct on both counts 🙂
m
Shweet, thanks for the help Nate!
n
sure thing
c
@Nate Thank you, it sounds great. I'm also trying to migrate to worker, but I found that the worker mode is more unstable than agents. I submitted 5 flow run on a same deployment, 2 of them cannot be submitted successfully. and have the error message on Prefect Cloud UI. "Submission failed. ValueError: Process cannot be run with empty command"
n
hey @Claude Jiang if you wouldn’t mind creating a new thread with your version info i can look into it
m
Hi @Nate, one last follow up (hopefully), what defines an ‘existing agent’. For example, if we tear down then start an agent with the same work queue, does that count as an existing agent or will this now be a new agent. The concern being , even if we pin our prefect version, we may need to briefly take down the agent then start it back up and are wondering if we’ll experience issues with that.
n
agents/workers are ephemeral, you should not any problems starting and stopping them
m
Cool thank you!
Hey @Nate one last quick question here. From the release notes on March 16: “After September 14, Prefect Cloud users will not be able to create new agent work pools or infrastructure blocks” This is infra blocks for agents right? I can still create, say, an AWSCredentials block?
n
correct! blocks in general will still be around by infrastructure blocks we mean specifically blocks whose purpose was to "be the infra config" for deployments, e.g.
DockerContainer
KubernetesJob
etc that'd you'd have used in the past like
prefect deployment build -ib kubernetes-job/foo
m
Cool thank you!