Closed simoneb closed 3 years ago
Once you are in Cloud Shell's CLI?
From the cloud run button. It seems that clicking the button always executes the command in the shell with the "stable" version of the gcloud command. I'm asking if there's a way to make it execute gcloud beta
instead.
Under the covers Cloud Run Button actually doesn't call gcloud
it calls the APIs directly. If you are adding a button to something and want to call gcloud beta
you can from custom scripts: https://github.com/GoogleCloudPlatform/cloud-run-button#customizing-deployment-parameters
If you want to add something to Cloud Run Button to do a beta thing, then we'd have to just translate what you want to do to an API call.
I can't see a way to provide custom parameters to cloud
, can you provide an example?
Like you want to tweak the gcloud run deploy
command that Cloud Run Button "runs"? If so, yeah there isn't a way to do that without explicitly adding support for what you need to Cloud Run Button. We recently added the new --use-http2
flag and if you want to see what was needed, see:
https://github.com/GoogleCloudPlatform/cloud-run-button/pull/203/files
What flag are you looking for?
As far as I understand, http2 is only supported by gcloud beta
. If you try to run an app with http2 using plain gcloud
you'll get this in the cloud shell:
Error: error attempting to read the app.json from the cloned repository: failed to parse app.json file: failed to parse app.json: json: unknown field "http2"
I'm trying the button for: https://github.com/GoogleCloudPlatform/kotlin-samples/tree/master/run/grpc-hello-world-bidi-streaming
(It did work but maybe our latest change was rolled back.)
I was trying this, which seems to be similar, and I got that error https://github.com/GoogleCloudPlatform/golang-samples/tree/master/run/h2c
Oh! The app.json
option is in the wrong place there. Sending a PR to that repo. One sec.
It needs to be nested in an options
block. Try my fork:
https://github.com/jamesward/golang-samples/tree/patch-1/run/h2c
But you are right that running the presented deploy command does indeed fail and we should fix that.
[ ! ] FYI, running the following command:
gcloud run deploy h2c\
--project=jw-demo\
--platform=managed\
--region=us-central1\
--image=gcr.io/jw-demo/h2c\
--allow-unauthenticated\
--use-http2
gcloud run deploy h2c\
--project=jw-demo\
--platform=managed\
--region=us-central1\
--image=gcr.io/jw-demo/h2c\
--allow-unauthenticated\
--use-http2
ERROR: (gcloud.beta.run.deploy) The `--use-http2` flag is only supported in the alpha release track on the fully m
anaged version of Cloud Run. Use `gcloud alpha` to set `--use-http2` on Cloud Run (fully managed). Alternatively,
specify `--platform gke` or run `gcloud config set run/platform gke`.
Trying again with gcloud alpha run deploy ...
works. So we should adapt the commands we show to account for this.
This is what I was trying to say since my first post.
Makes sense now. Thanks for reporting!
Is there a way to execute the beta version of the gcloud application when clicking the cloud run button?