https://prefect.io logo
Title
v

Volker L

06/08/2022, 9:03 PM
Hi. is it possible in prefect 2.0 to delete all deployments at once? Thanks
1
a

Anna Geller

06/08/2022, 9:42 PM
Why would you want to do this?
You may do:
prefect orion database reset -y
if you want to entirely delete everything and start from scratch
Otherwise, deleting deployments in such a manner would require first listing all deployments via an API call, then deleting those in a for-loop - all doable but I would be very curious why would you need that - is this for some Terraform style CI use case?
v

Volker L

06/08/2022, 9:46 PM
Because the deployments failed to run, due to a missing import. I tried to update the deployments after I have fixed my code (added the missing import), but did not work unfortunately.
a

Anna Geller

06/08/2022, 9:48 PM
it might be you only need to update your docker image used by your docker/lubernetes flow runner, or conda/venv in a subprocess flow runner?
v

Volker L

06/08/2022, 9:48 PM
Furthermore, I deleted the orion db with
prefect orion database reset -y
And deleted the
.prefect
folder
a

Anna Geller

06/08/2022, 9:48 PM
this doesn't delete the DB, it only resets everything
v

Volker L

06/08/2022, 9:51 PM
I am using a subprocess flow runner. How can I update my conda env? Simply create a new conda env?
a

Anna Geller

06/08/2022, 11:45 PM
yup, or even make changes to the existing one which makes things even easier
f

flurven

06/09/2022, 8:34 AM
What happens if you just remove the deployment table in the Orion database? Will it be recreated on the next run?
a

Anna Geller

06/09/2022, 10:45 AM
I'm afraid your schema will be broken since the tables have FK relationships between each other - either reset the DB or don't touch it directly, only interact with your database via API/CLI/UI or Orion client - this would be my recommendation
👍 1