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

google-cloud-sdk: include docker-credential-gcloud script #44886

Merged
merged 1 commit into from Aug 17, 2018

Conversation

benley
Copy link
Member

@benley benley commented Aug 11, 2018

This is required if you want to push images to gcr.io.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

This is required if you want to push images to gcr.io.
@kalbasit
Copy link
Member

@benley there's a derivation for docker-credential-gcr isn't the same thing?

@benley
Copy link
Member Author

benley commented Aug 11, 2018

Oh, oops. Is there a reason not to just include the script in the main google-cloud-sdk derivation?

@benley benley closed this Aug 11, 2018
@benley
Copy link
Member Author

benley commented Aug 11, 2018

I see it's distributed as a separate git repo, so yeah it might as well be a different derivation.

@kalbasit
Copy link
Member

@benley Also, I don't use any of google's services but do depend on some images hosted on gcr, it makes sense to have it stand-alone :)

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: google-cloud-sdk

Partial log (click to expand)

/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/.bq-wrapped: interpreter directive changed from "/bin/sh" to "/nix/store/56nrxy58wbhvs2sy3rir1jqa68p0kkm5-bash-4.4-p23/bin/sh"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/.git-credential-gcloud.sh-wrapped: interpreter directive changed from "/bin/sh" to "/nix/store/56nrxy58wbhvs2sy3rir1jqa68p0kkm5-bash-4.4-p23/bin/sh"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/endpointscfg.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9qjc0d5557h3dkpsvfq98b2k96lnb6pw-python-2.7.15/bin/python"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/.docker-credential-gcloud-wrapped: interpreter directive changed from "/bin/sh" to "/nix/store/56nrxy58wbhvs2sy3rir1jqa68p0kkm5-bash-4.4-p23/bin/sh"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/.gcloud-wrapped: interpreter directive changed from "/bin/sh" to "/nix/store/56nrxy58wbhvs2sy3rir1jqa68p0kkm5-bash-4.4-p23/bin/sh"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/bootstrapping/bq.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9qjc0d5557h3dkpsvfq98b2k96lnb6pw-python-2.7.15/bin/python"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/bootstrapping/install.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9qjc0d5557h3dkpsvfq98b2k96lnb6pw-python-2.7.15/bin/python"
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0/google-cloud-sdk/bin/bootstrapping/gsutil.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9qjc0d5557h3dkpsvfq98b2k96lnb6pw-python-2.7.15/bin/python"
checking for references to /build in /nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0...
/nix/store/d5nc4sy0c97jj99ccz67mrbfnc39ci8j-google-cloud-sdk-206.0.0

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: google-cloud-sdk

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@nicknovitski
Copy link
Contributor

@kalbasit @benley I don't think that the two binaries are the same thing, and that both serve a purpose, and that this PR should be re-opened and applied.

I use the sdk subcommand gcloud docker, and recent versions have started printing a deprecation warning:

WARNING: `gcloud docker` will not be supported for Docker client versions above 18.03.

As an alternative, use `gcloud auth configure-docker` to configure `docker` to
use `gcloud` as a credential helper, then use `docker` as you would for non-GCR
registries, e.g. `docker pull gcr.io/project-id/my-image`. Add
`--verbosity=error` to silence this warning: `gcloud docker
--verbosity=error -- pull gcr.io/project-id/my-image`.

See: https://cloud.google.com/container-registry/docs/support/deprecation-notices#gcloud-docker

That command, gcloud auth configure-docker, wants you to have *-gcloud in your path, not *-gcr:

$ nix run nixpkgs.docker nixpkgs.google-cloud-sdk nixpkgs.docker-credential-gcr --command gcloud auth configure-docker
WARNING: `docker-credential-gcloud` not in system PATH.
gcloud's Docker credential helper can be configured but it will not work until this is corrected.
# ...

Finally, I tried simply renaming the *-gcr binary to *-gcloud, and it did not work.

It's true that *-gcr has its own source repository, and is useful for people who don't use the cloud sdk, but the latter is shipped with the sdk, and seems like it will soon be required by those of us who do use it.

So, again, I think this PR should be re-opened and applied. :)

@kalbasit
Copy link
Member

kalbasit commented Aug 16, 2018

excerpt from https://github.com/GoogleCloudPlatform/docker-credential-gcr

Note: docker-credential-gcr is primarily intended for users wishing to authenticate with GCR in the absence of gcloud, though they are not mutually exclusive. For normal development setups, users are encouraged to use gcloud auth configure-docker, instead.

@nicknovitski I'm fine re-opening the PR, it does not conflict with the other derivation so it's all good.

@benley benley reopened this Aug 17, 2018
@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: google-cloud-sdk

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: google-cloud-sdk

Partial log (click to expand)

/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/gsutil: interpreter directive changed from "/usr/bin/env python" to "/nix/store/f01rhaxdfip9c49k4mhfjgfrwl5lcamn-python-2.7.15/bin/python"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/apitools/samples/storage_sample/generate_clients.sh: interpreter directive changed from "/bin/bash" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/oauth2client/scripts/run.sh: interpreter directive changed from "/bin/bash" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/oauth2client/scripts/build_docs.sh: interpreter directive changed from "/bin/bash" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/oauth2client/scripts/run_system_tests.sh: interpreter directive changed from "/bin/bash" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/oauth2client/scripts/install.sh: interpreter directive changed from "/bin/bash" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/gsutil/third_party/rsa/speed.sh: interpreter directive changed from "/bin/bash -e" to "/nix/store/79b6s2wql94lwk8dyib2jc4fq8ixl13f-bash-4.4-p23/bin/bash -e"
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0/google-cloud-sdk/platform/bq/bq.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/f01rhaxdfip9c49k4mhfjgfrwl5lcamn-python-2.7.15/bin/python"
checking for references to /build in /nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0...
/nix/store/yn9d9rqb71d9khwmrq25ldcli6hhyh8s-google-cloud-sdk-206.0.0

@benley benley merged commit 9baaa51 into NixOS:master Aug 17, 2018
@benley benley deleted the docker-credential-gcloud branch August 17, 2018 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants