google-github-actions / setup-gcloud

A GitHub Action for installing and configuring the gcloud CLI.

Home Page:https://cloud.google.com/sdk/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Speed of setup is suboptimal

antony opened this issue · comments

TL;DR

Basically, waiting 50 seconds to install an SDK accounts for half of my overall build time. It's difficult to build a fast feedback loop when deploying projects to google cloud as a result.

Some sort of caching or faster API responses built-in to this action would be great

Expected behavior

As fast an install as possible.

Observed behavior

I wait nearly a minute every build just to install the SDK.

Action YAML

n/a

Log output

n/a

Additional information

No response

Hi @antony - this is a duplicate of #610, #635, #610, #545.

We have to download the SDK in order to run gcloud commands, and on the bandwidth of GitHub Actions, that takes a long time. Unfortunately there's not much we can do to fix this, since we don't control the size of the SDK or the bandwidth speeds of the GitHub Actions runners. You could use a self-hosted runner that has the SDK pre-installed, but that's pretty much the only option for "speeding up" things.

Depending on the complexity of what you're doing, it may be faster and easier to call the API directly (or write a small application that does it for you).

There is a version of gcloud that is pre-installed by GitHub on the runners, but it is old and then have discussed removing it in future releases. So you could skip setup-gcloud action, but that has a future risk of breaking or being very far behind on new features.

Hi @sethvargo - thanks for your detailed response, and apologies for the duplication - I didn't search closed issues, my bad.

Is there an opportunity for Google to somewhat modularise key parts of the cloud SDK? I feel like the SDK has become so huge, which isn't representative of the way the underlying services are organised.

A small part to deal with auth, with some optional modules - you could specify which as part of the action config, even.

Appreciate this is no small task and may represent a part of google over which you don't have oversight, but it seems a shame.

I might look into the API solution in the meantime - but I enjoyed the relative predictability of using a google-provided action to authenticate my services.

Is there an opportunity for Google to somewhat modularise key parts of the cloud SDK? I feel like the SDK has become so huge, which isn't representative of the way the underlying services are organised.

Hi @antony - that is beyond the scope of the GitHub Action or the decisions we can make here 😄. I'd recommend providing this feedback to the Cloud SDK team at https://cloud.google.com/sdk/docs/getting-support (there are links toward the bottom).

auth will inject Application Default Credentials, so any tools or apps that use Google Cloud client libraries will "just work" after running "auth".