<@ULVA73B9P> I have a yaml defined deployments, wh...
# ask-marvin
f
@Marvin I have a yaml defined deployments, which I deploy with ``prefect --no-prompt deploy --all --prefect-file prefect-prod.yaml``, however, when I delete a deployment from the yaml definition, it will stay deployed on the server. I would need a way to make sure that the yaml is 1:1 exactly with the server.
m
So, like, you deploy stuff, and then it doesn't go away when you delete it from YAML. You want server to look exactly like YAML file, right? Let's first find out your Prefect version to give the right info. What version of Prefect are you using?
👍 1
f
2.19.4
@Marvin the version is 2.19.4, can you give me the advice, as you said I want the server to look exactly like the yaml file
m
Alright, here's what we got: 1. Prefect Docs: - No direct feature for automatic sync between YAML deployments and server state. Prefect command
prefect deploy --all
will deploy all the defined deployments, but it won't delete the deployments removed from YAML. - Good old manual solution might involve comparing current deployments with the defined ones and manually deleting the extra ones. - More from Prefect's guide: Prefect Deployments Guide. 2. GitHub Issues: - Suggestion to add a
clear_storage
or
sync_to_storage
option to remove unmatched files from remote storage before uploading new ones. This isn't exactly your issue but indicates Prefect community needs more sync features. - No exact match issue found, but it might be worth raising a similar feature request for syncing deployments. Summary: No automatic sync feature exists yet. Best workaround is manually checking and cleaning up deployments not defined in your YAML. For more info: - Prefect Deployments Docs: Prefect Deployments Guide - GitHub Issue discussing similar needs: GitHub Issue about sync