Hey all, I created a simple example showing how to...
# show-and-tell
b
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
marvin 2
👏 2
🙏 3
🎉 9
🙌 8
a
regarding: "Google will keep copying new docker images to the machine;" - I wonder if you could leverage image_pull_policy to solve it?
b
@Anna Geller, yes you're right on those lines. It was just to confirm the connection to Prefect Cloud.
👍 1
k
This looks awesome! I’ll try it out @Benny Warlick
b
@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
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
Yes, and that would make the flow faster
🙌 1