Please drastically speed up gcloud installs

This issue has been tracked since 2023-01-26.

TL;DR

Since the gke-gcloud-auth-plugin is required our build times in quite many places got way worse. I have some jobs where google-github-actions/[email protected] takes over a minute, and all the other steps are less than 5s.

Detailed design

The step we are currently using to install gcloud sdk:

    - name: "Setup gcloud sdk"
      uses: google-github-actions/[email protected]
      with:
        version: '412.0.0'
        install_components: gke-gcloud-auth-plugin

Additional information

No response

sethvargo wrote this answer on 2023-02-02

Hi @andaag

Unfortunately there's nothing we can do to improve gcloud download times. The gcloud binary is a few hundred megabytes (gigabytes for Windows). It's just downloading and decompressing a tarball, so there's no room for optimization.

sethvargo wrote this answer on 2023-02-02

Hi @andaag

If you don't need a specific version, you can skip setup-gcloud and use the system-provided version (by GitHub) instead. Then just manually install the component:

run: 'gcloud components install foo bar --quiet'

The next version of setup-gcloud will let you pass skip_install: true, if that's helpful.

andaag wrote this answer on 2023-02-03

Ah that is very helpful, thank you!

Klaitos wrote this answer on 2023-02-06

Hello @sethvargo, the skip install flag seems not working neither :

Run google-github-actions/[email protected]
Skipping installation ("skip_install" was true)
Error: google-github-actions/setup-gcloud failed with: failed to execute command `gcloud --quiet components install beta`: ERROR: (gcloud.components.install) 
You cannot perform this action because the Google Cloud CLI component manager 
is disabled for this installation. You can run the following command 
to achieve the same result for this installation: 

sudo apt-get install google-cloud-sdk

Using runner ubuntu-latest (22)

Am i missing something ?

Thanks

sethvargo wrote this answer on 2023-02-06

Hmm - that's interesting. It looks like GitHub might install gcloud from apt instead of from the sources.

More Details About Repo
Owner Name google-github-actions
Repo Name setup-gcloud
Full Name google-github-actions/setup-gcloud
Language TypeScript
Created Date 2019-11-05
Updated Date 2023-03-23
Star Count 1505
Watcher Count 65
Fork Count 548
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date