https://prefect.io logo
Title
j

James Brady

08/12/2022, 12:50 PM
What's the recommended / expected way to update a deployment in Prefect 2? I have an existing deployment, and used
prefect deployment apply …
after updating Python files, but I can see in the S3 bucket that the Python files aren't being updated to match what's on my local computer.
1
d

Deceivious

08/12/2022, 12:52 PM
Weirdly, building the deployment again refreshes the files in s3. I have opted to make a python script that 1. builds the deployment 2. Changes the yaml file with required changes in yaml ie schedules and description 3. and applies the deployment The team is working on
Deployment
python module to help ease the process. <---will have to ask the team 😄
j

James Brady

08/12/2022, 12:54 PM
Huh, but I have several customisations to my deployment file – you're saying you automatically re-make those customisations every time you want to deploy new code, because you need to do a
prefect deployment build …
?
o

Oscar Björhn

08/12/2022, 12:54 PM
I suppose I can add that calling apply after the build only appears to be necessary if you've changed anything such as your default parameters, s3 bucket path to the flow, the docker image tag or similar. Otherwise build alone seems to do it for me.
d

Deceivious

08/12/2022, 12:54 PM
I think this is the related issue. https://github.com/PrefectHQ/prefect/issues/6376
j

James Brady

08/12/2022, 12:58 PM
I see, thanks all! I'm surprised this made it into a GA release! Also seems like something they can't fix before 2.1 or maybe even 3 if they're following semver
Oh, I can use a pre-existing infrastructure block to make it safe to re-build the deployment YAML every time 👍
o

Oscar Björhn

08/12/2022, 1:10 PM
Yeah, 2.0.4 was great in that regard, it let me handle the deployment files as a temporary build artifact rather than something I need to keep in source control.