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

make docker-build-dev fails #624

Closed
joejulian opened this issue Mar 6, 2019 · 16 comments
Closed

make docker-build-dev fails #624

joejulian opened this issue Mar 6, 2019 · 16 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@joejulian
Copy link
Contributor

/kind bug

What steps did you take and what happened:

make docker-build-dev
$ make docker-build-dev
bazel run //:gazelle 
INFO: Invocation ID: 9b6078c5-fa20-4039-bbde-dd0c35aa9db4
INFO: Analysed target //:gazelle (3 packages loaded, 86 targets configured).
INFO: Found 1 target...
Target //:gazelle up-to-date:
  bazel-bin/gazelle-runner.bash
  bazel-bin/gazelle
INFO: Elapsed time: 2.166s, Critical Path: 0.11s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
gazelle: open /home/jjulian/dev/go/src/sigs.k8s.io/cluster-api-provider-aws/vendor/k8s.io/kubernetes/BUILD.bazel: no such file or directory
Repository is set up correctly
Checking status of dependencies
INFO: Invocation ID: 49163eea-a85b-465d-8dd1-01aebb3d22fd
INFO: Analysed target //:dep (45 packages loaded, 742 targets configured).
INFO: Found 1 target...
Target //:dep up-to-date:
  bazel-bin/dep_script
  bazel-bin/dep
INFO: Elapsed time: 2.118s, Critical Path: 0.12s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Finished verifying dependencies
GOPATH=/home/jjulian/dev/go bazel run //:generate 
INFO: Invocation ID: b9b598e0-6c6d-48ad-b1a1-9495d4007aea
INFO: Analysed target //:generate (0 packages loaded, 2 targets configured).
INFO: Found 1 target...
Target //:generate up-to-date:
  bazel-bin/generate_script
  bazel-bin/generate
INFO: Elapsed time: 1.155s, Critical Path: 0.08s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
make dep-ensure
make[1]: Entering directory '/home/jjulian/dev/go/src/sigs.k8s.io/cluster-api-provider-aws'
Repository is set up correctly
Checking status of dependencies
INFO: Invocation ID: 949135c3-99cc-4dd6-8eb2-1601972ac4ad
INFO: Analysed target //:dep (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:dep up-to-date:
  bazel-bin/dep_script
  bazel-bin/dep
INFO: Elapsed time: 1.023s, Critical Path: 0.08s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Finished verifying dependencies
make[1]: Leaving directory '/home/jjulian/dev/go/src/sigs.k8s.io/cluster-api-provider-aws'
bazel build  //pkg/cloud/aws/services/mocks:go_mock_interfaces \
	//pkg/cloud/aws/services/ec2/mock_ec2iface:go_default_library \
	//pkg/cloud/aws/services/elb/mock_elbiface:go_default_library
INFO: Invocation ID: 1cd8949d-262b-43d1-b7bc-4d8db974a0dd
INFO: Analysed 3 targets (140 packages loaded, 1905 targets configured).
INFO: Found 3 targets...
INFO: Elapsed time: 2.266s, Critical Path: 0.40s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
cp -Rf bazel-genfiles/pkg/* pkg/
bazel run //cmd/manager:manager-image-dev  --define=REGISTRY_DEV=gcr.io/genial-analogy-137814 
INFO: Invocation ID: 81636e39-cd0a-49a6-9d93-5988c4375bb4
INFO: Build option --define has changed, discarding analysis cache.
ERROR: /home/jjulian/dev/go/src/sigs.k8s.io/cluster-api-provider-aws/cmd/manager/BUILD.bazel:50:1: no such package '@golang-image//image': Pull command failed: Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/__main__.py", line 30, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/containerregistry/client/__init__.py", line 23, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/containerregistry/client/docker_creds_.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 906, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1280, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/httplib2/__init__.py", line 988
    raise socket.error, msg
                      ^
SyntaxError: invalid syntax
 (/usr/bin/python /home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded --directory /home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/golang-image/image --os linux --os-version  --os-features  --architecture amd64 --variant  --features  --name registry.hub.docker.com/library/golang:1.10-alpine) and referenced by '//cmd/manager:manager-amd64'
ERROR: Analysis of target '//cmd/manager:manager-image-dev' failed; build aborted: no such package '@golang-image//image': Pull command failed: Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/__main__.py", line 30, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/containerregistry/client/__init__.py", line 23, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/containerregistry/client/docker_creds_.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 906, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1280, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location
  File "/home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded/httplib2/__init__.py", line 988
    raise socket.error, msg
                      ^
SyntaxError: invalid syntax
 (/usr/bin/python /home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/puller/file/downloaded --directory /home/jjulian/.cache/bazel/_bazel_jjulian/2d290004655f418111cd06abc2d9caef/external/golang-image/image --os linux --os-version  --os-features  --architecture amd64 --variant  --features  --name registry.hub.docker.com/library/golang:1.10-alpine)
INFO: Elapsed time: 1.625s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (13 packages loaded, 359 targets configured)
FAILED: Build did NOT complete successfully (13 packages loaded, 359 targets configured)
    Fetching @golang-image; fetching
make: *** [Makefile:115: docker-build-dev] Error 1

What did you expect to happen:
I expected a container image to be built

Anything else you would like to add:
I'm guessing there's an env variable that should be set? If so, these should be asserted in the makefile before bazel is run.

Environment:

  • Cluster-api-provider-aws version:
    master@13b5457
  • Kubernetes version: (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
  • OS (e.g. from /etc/os-release):
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 6, 2019
@ashish-amarnath
Copy link
Contributor

/assign

@ashish-amarnath
Copy link
Contributor

/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 Mar 6, 2019
@joejulian
Copy link
Contributor Author

joejulian commented Mar 6, 2019

Looks like this has to do with python versions. Arch's default python is 3.7.2.
By updating httplib2 to the python3 version from v0.12.1 I was able to get past that syntax error and on to the next one.
Replacing concurrent with the built-in from the python tree, I was able to successfully download.

I don't use bazel so I don't know the "right" way to do that. I just replaced the files in the zip file (downloaded).

@randomvariable
Copy link
Member

randomvariable commented Mar 6, 2019

Yes, need to have Python 2 as the active python in the shell for Bazel's Docker rules to succeed.

@randomvariable
Copy link
Member

Previous tickets on the same issue: #347 and #361

Open to suggestions on how to make this clearer to developers.

@ashish-amarnath
Copy link
Contributor

ashish-amarnath commented Mar 6, 2019 via email

@joejulian
Copy link
Contributor Author

One possibility is to force a virtualenv as part of the Makefile

@randomvariable
Copy link
Member

Not in favour of forcing virtualenv on people if they have other ways to get Py 2.7 (system. pyenv, Nix, Guix etc...) to work.

Rather, google/containerregistry#109 or similar should be merged.

@detiber detiber added this to the Next milestone Mar 8, 2019
@ashish-amarnath
Copy link
Contributor

ashish-amarnath commented Mar 11, 2019

I've documented this in the development doc till we have the correct fix in place. #639

@ashish-amarnath
Copy link
Contributor

/remove-lifecycle active

@k8s-ci-robot k8s-ci-robot removed the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label Mar 12, 2019
@vincepri vincepri added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Mar 12, 2019
@randomvariable
Copy link
Member

As per google/containerregistry#109 (comment), there is the possibility to resolve this upstream with the current release of Bazel. The Python mismatch issue is real and documented.

Think this is more of a priority/long-term as we have a workaround.

@detiber
Copy link
Member

detiber commented Mar 13, 2019

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Mar 13, 2019
@detiber detiber removed the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Mar 13, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 11, 2019
@vincepri
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 12, 2019
@chuckha
Copy link
Contributor

chuckha commented Jul 1, 2019

we now force to python 2

/close

@k8s-ci-robot
Copy link
Contributor

@chuckha: Closing this issue.

In response to this:

we now force to python 2

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

No branches or pull requests

8 participants