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

No local image when make docker-build - SyntaxError on make docker-push-dev with python3 #361

Closed
echarles opened this issue Nov 5, 2018 · 5 comments · Fixed by #362
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor.

Comments

@echarles
Copy link
Contributor

echarles commented Nov 5, 2018

/kind bug

What steps did you take and what happened:

make docker-build

No error returned but image not listed with docker images

make docker-push-dev
export DEV_DOCKER_REPO=docker.io
export MANAGER_IMAGE_NAME=datalayer/cluster-api-aws-controller
export MANAGER_IMAGE_TAG=latest
make docker-push-dev

returns:

 File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/home/datalayer/.cache/bazel/_bazel_datalayer/991af353125ff5dca82d9f35abab139e/external/puller/file/downloaded/containerregistry/client/docker_creds_.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 894, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1157, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1131, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1112, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 544, in spec_from_file_location
  File "/home/datalayer/.cache/bazel/_bazel_datalayer/991af353125ff5dca82d9f35abab139e/external/puller/file/downloaded/httplib2/__init__.py", line 942
    print "connect: (%s, %s) ************" % (self.host, self.port)
                                         ^
SyntaxError: invalid syntax
 (/opt/miniconda3/envs/datalayer/bin/python /home/datalayer/.cache/bazel/_bazel_datalayer/991af353125ff5dca82d9f35abab139e/external/puller/file/downloaded --directory /home/datalayer/.cache/bazel/_bazel_datalayer/991af353125ff5dca82d9f35abab139e/external/golang-image/image --name registry.hub.docker.com/library/golang:1.10-alpine)
INFO: Elapsed time: 0.931s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

Btw no such error with python2.7 but 0 bytes to push...

INFO: Build completed successfully, 1 total action
docker.io/datalayer/cluster-api-aws-controller:latest was resolved to docker.io/datalayer/cluster-api-aws-controller:latest
docker.io/datalayer/cluster-api-aws-controller:{GIT_VERSION} was resolved to docker.io/datalayer/cluster-api-aws-controller:v1.0.0-alpha.2.27-e74f4f96463735-dirty
E1105 16:27:00.538907    6183 docker_session_.py:332] Error during upload of: docker.io/datalayer/cluster-api-aws-controller:v1.0.0-alpha.2.27-e74f4f96463735-dirty
F1105 16:27:00.539144    6183 fast_pusher_.py:186] Error publishing docker.io/datalayer/cluster-api-aws-controller:v1.0.0-alpha.2.27-e74f4f96463735-dirty: response: {'status': '301', 'connection': 'close', 'content-length': '0', 'location': 'https://www.docker.com/v2/datalayer/cluster-api-aws-controller/blobs/uploads/'}
: None
E1105 16:27:00.553980    6184 docker_session_.py:332] Error during upload of: docker.io/datalayer/cluster-api-aws-controller:latest
F1105 16:27:00.554163    6184 fast_pusher_.py:186] Error publishing docker.io/datalayer/cluster-api-aws-controller:latest: response: {'status': '301', 'connection': 'close', 'content-length': '0', 'location': 'https://www.docker.com/v2/datalayer/cluster-api-aws-controller/blobs/uploads/'}
: None
Makefile:109: recipe for target 'docker-push-dev' failed

What did you expect to happen:

A local docker image should be build and available on my local env.

Environment:

  • Cluster-api-provider-aws version: e74f4f9
  • OS (e.g. from /etc/os-release): Ubuntu 18.04.1
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 5, 2018
@randomvariable
Copy link
Member

We need to update the documentation here as loads of people will trip over it.

The Bazel docker rules only support Python 2.

@randomvariable
Copy link
Member

Actually, it's Google's containeregistry tool.

Open PR at google/containerregistry#109

@echarles
Copy link
Contributor Author

echarles commented Nov 5, 2018

@randomvariable I will open a doc PR for tomorrow with this.

But still not local image available even with python 2 when I run make docker-build. Or am I missing something (docker images command does not show new image)?

@randomvariable
Copy link
Member

Bazel probably doesn't use image tags at all and the state is purely a reference somewhere in its cache so you won't see the image locally.

make docker-build is a slight holdover from pre-Bazel and maybe we should remove it to prevent confusion.

So I think we have two issues here - if you don't care about pivoting, we no longer have a usable local docker image, and if you don't have pyenv or similar set up, you'll get bitten by errors in containerregistry.

@randomvariable
Copy link
Member

I'll try and resolve the former.

/assign
/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants