Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please drastically speed up gcloud installs #610

Closed
andaag opened this issue Jan 26, 2023 · 6 comments · Fixed by #615
Closed

Please drastically speed up gcloud installs #610

andaag opened this issue Jan 26, 2023 · 6 comments · Fixed by #615
Assignees
Labels
enhancement New feature or request

Comments

@andaag
Copy link

andaag commented Jan 26, 2023

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/setup-gcloud@v1 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/setup-gcloud@v1
      with:
        version: '412.0.0'
        install_components: gke-gcloud-auth-plugin

Additional information

No response

@andaag andaag added the enhancement New feature or request label Jan 26, 2023
@sethvargo
Copy link
Member

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
Copy link
Member

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
Copy link
Author

andaag commented Feb 3, 2023

Ah that is very helpful, thank you!

@Klaitos
Copy link

Klaitos commented Feb 6, 2023

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

Run google-github-actions/setup-gcloud@v1
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
Copy link
Member

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

@simenandre
Copy link

Hello 👋

I've created a simple GitHub Action that installs the gke-gcloud-auth-plugin component with apt. Feel free to use this until someone integrates this into get-gke-credentials (or something else). I'll try to keep users of simenandre/setup-gke-gcloud-auth-plugin updated on using gke-gcloud-auth-plugin with GitHub Actions as we go.

To get started, drop this in your workflow:

- uses: simenandre/setup-gke-gcloud-auth-plugin@v1

Feel free to open issues and PRs here: https://github.com/simenandre/setup-gke-gcloud-auth-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

4 participants