https://prefect.io logo
Title
b

Benny Warlick

07/31/2022, 1:21 AM
Hey all, I created a simple example showing how to deploy a Prefect agent to a docker on Google Cloud Compute Engine, using Github Actions. Flow stored in Google Cloud Storage. I had previously posted this when Prefect 2 was in beta, and just updated it for 2.0.1. https://github.com/BennyJW/prefect2-docker-gce
🎉 9
:marvin: 2
👏 2
:thank-you: 3
🙌 8
a

Anna Geller

07/31/2022, 9:07 AM
regarding: "Google will keep copying new docker images to the machine;" - I wonder if you could leverage image_pull_policy to solve it?
b

Benny Warlick

07/31/2022, 2:24 PM
@Anna Geller, yes you're right on those lines. It was just to confirm the connection to Prefect Cloud.
👍 1
k

Khuyen Tran

07/31/2022, 4:50 PM
This looks awesome! I’ll try it out @Benny Warlick
b

Benny Warlick

07/31/2022, 5:43 PM
@Anna Geller I don't know about image_pull_policy. One alternative is the docker prune command. The problem is that when Google updates a Compute Engine with a new docker image, it doesn't delete the old images. So eventually your Compute Engine will fill up with old images. https://stackoverflow.com/questions/69246222/remove-old-containers-for-google-container-os
a

Anna Geller

07/31/2022, 6:03 PM
ahh you're right, since your tag is GITHUB_SHA 🤔
still, it seems a bit drastic measure to delete VM every time. Perhaps you can run some maintenance flow that does docker image prune as shell command?
b

Benny Warlick

07/31/2022, 6:06 PM
Yes, and that would make the flow faster
🙌 1