14

I'm trying to build a Dockerfile that installs requirements via pip into the container it builds. I think something may not be set up right in the google's SDK / cloud console. I get this error:

me@cloud-q2smart:~/github/jokepkg/test$ sudo pip install -r test-ggl-install/requirements.txt 
Obtaining funniest from git+https://source.developers.google.com/p/cloud-q2smart/r/jokepkg#egg=funniest-0.1 (from -r test-ggl-install/requirements.txt (line 1))
Updating ./src/funniest clone
git: 'credential-gcloud.sh' is not a git command. See 'git --help'.
Username for 'https://source.developers.google.com':

The message looks like something is trying to pass 'credential-gcloud.sh' to git, and git is responding that it has no idea what that is supposed to mean to it. It looks like some internal means that google has set up for authentication is broken.

I'd really like to have it installing correctly from the private repos. I don't want the development team to have to change their process to something more cumbersome just because the authentication mechanism is broken.

... but it's tricky ... because pip does something behind the scenes to call git, and it looks like google is trying to do something behind the scenes to tell git how to authenticate.

I created a project that attempts to install a simple python package in a private repo in google cloud source. The instructions to run it are below:

( Start up google cloud shell )
$ git clone https://github.com/jnorment-q2/jokepkg.git
# pull down my sample package
$ cd jokepkg
# ( create repo in cloud )
$ git remote add google https://source.developers.google.com/p/cloud-q2smart/r/jokepkg
$ git push google master
# Change to test directory and attempt to build Dockerfile
$ cd test
$ docker build -t test --no-cache .

This should attempt to build a requirements-based dependency in the exact same kind of container that my Jenkins CI creates to use as an ephemeral build environment. It will be successful for the first one, as that one is a public repo, and there's nothing to configure for security. It will fail when it gets to the google version. I'm not sure how to resolve this from a Dockerfile.

If anyone can steer me in the right direction, I'd appreciate it.

I'm fine with pushing a credential file into the build environment / build slave, but whatever google is doing seems to be taking precedence to the creds that I've set for git through:

git config --local credential.username google-svc-account
git config --local credential.helper store --file=/tmp/creds

... I'd rather not tie the requirements.txt file to a particular user id.

Tobi
  • 904
  • 1
  • 8
  • 29
Cognitiaclaeves
  • 808
  • 10
  • 16

1 Answers1

0

Try to reset the git configuration

git config --global --unset credential.helper

git config --global --add --path credential.helper gcloud
Ashok
  • 3,190
  • 15
  • 31