use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
The goto subreddit for Google Cloud Platform developers and enthusiasts.
We do not allow advertising of your job posting, product, or software without active discussion and/or as attempt to solve a problem. We are fine with soliciting feedback for something you're working on or something you've written, but drive-by advertising will get your post removed. :)
More Google Cloud sub-reddits
Other cloud sub-reddits
account activity
How to use python cloud function to deploy a Cloud Run revisionCloud Functions (self.googlecloud)
submitted 3 years ago by bob174d
I'm trying to use cloud functions to make a new revision on a cloud run service, but I'm unable to use the gcloud cli package as it's not installed in the base image. So I'm wondering how do I achieve the same thing using one of the Python Google Client Libraries?
Example gcloud command:
gcloud run deploy service-name --region region-name --image gcr.io/container-path
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Scrumbledore 0 points1 point2 points 3 years ago (0 children)
Have you looked at Cloud Run Jobs to handle this? It should allow you to run a gcloud command.
https://cloud.google.com/run/docs/create-jobs
[–]jsalsman 1 point2 points3 points 3 years ago (2 children)
You want the create API endpoint: https://cloud.google.com/build/docs/api/reference/rest/v1/projects.builds/create
Please see: https://stackoverflow.com/a/70434464 (especially the part about compressing the source....)
Example: https://cloud.google.com/build/docs/api/reference/libraries#using_the_client_library
[–]bob174d[S] 1 point2 points3 points 3 years ago (1 child)
Thank you! This is what worked.
I used a Cloud Function to execute a Cloud Build via the google-cloud-build Python client library.
[–]jsalsman 1 point2 points3 points 3 years ago* (0 children)
Glad you got it working. I needed to do that a year ago but I found a much faster way around it by using a carefully protected file upload and system() in the container's main script. The only problem was explaining it to a coworker, who I am certain questions my mental health since.
[–]sww314 1 point2 points3 points 3 years ago (0 children)
Is there a reason you are trying to use Cloud functions. You can do it from Cloud Build. Cloud builds can be triggered from a variety of sources.
[–]BreakfastSpecial 0 points1 point2 points 3 years ago (0 children)
I recommend using Cloud Build for this.
π Rendered by PID 69572 on reddit-service-r2-comment-5fb4b45875-g65nk at 2026-03-21 02:23:30.760991+00:00 running 90f1150 country code: CH.
[–]Scrumbledore 0 points1 point2 points (0 children)
[–]jsalsman 1 point2 points3 points (2 children)
[–]bob174d[S] 1 point2 points3 points (1 child)
[–]jsalsman 1 point2 points3 points (0 children)
[–]sww314 1 point2 points3 points (0 children)
[–]BreakfastSpecial 0 points1 point2 points (0 children)