Hey there :wave: I'm currently trying to create a...
# google-cloud
g
Hey there 👋 I'm currently trying to create a cloud run service with pulumi and want to create an image from my docker file (contains a go api) that my cloud run service will reference. I've been looking at https://www.pulumi.com/learn/pulumi-fundamentals/create-docker-images/ and https://www.pulumi.com/learn/pulumi-fundamentals/configure-and-provision/ but it's hard for me to understand how to pass my local dockerfile to the images I am creating. Is there some documentation I am missing or a different approach I should be taking?
b
your image should be publically available, so create it locally and push it to a repo
☝️ 1
f
In my setup, I'm setting up a cloud build trigger to do the build/push step, then the cloud run action to run it. The cloud build can trigger a new revision too if you want
q
I've been doing something similar, but using Github Actions--
docker/build-push-action@v3
to build and push it to Google Artifact Registry, then using that action's output as an env var in my pulumi action. But that doesn't seem to be working as I thought it would. Perhaps I should use the pulumi docker module instead to get the digest by hand in the script, like in the example
f
Do you need to have pulumi as the "deployment" mechanism? Google lets you pub/sub on artifact registry push, and then trigger a new revision. Usually I let the Infra-as-code (pulumi), set up the process, but it doesn't need to be invoked in order to deploy, that is entirely triggered by git events (push to a specific branch, or a tag)
Not that there's inherently anything wrong with using pulumi to deploy, it's just not how my infra is setup right now
q
So you just use pulumi up to create the service the first time and apply any env, secret, other container settings like ram and cpu and concurrency etc? But then deploy fresh revisions pointing to new builds using Google tools?
I feared not letting Pulumi handle everything would make it out of sync and upset.
f
Yep, that's exactly how I do it. I set an ignore on the image field in the cloud run action spec, so that pulumi doesn't mind if the image changes, and doesn't try to override it.
q
Maybe that's simpler.
f
It's working for me, but that doesn't mean it's "correct" 🙂
q
Well, the way I'm doing it is not working, much to my chagrin after I finally noticed.
But that's probably my bug--hence wishing I'd kept it simpler.
👍 1
Hopefully Lewis has everything working too! I'm getting stuck with things like
pulumi update
never completing.
f
Cloud run has been rather finnicky for me. If the cloud run instance fails to start up, it seems to hang in Pulumi
q
In my case, I needed to use
autogenerate_revision_name=True
-- Pulumi was trying to update an existing, running revision, instead of deploying a new one.
f
👍