rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

Missing contributor guidelines

Open mindaugasrukas opened this issue 4 years ago • 2 comments

🐞 bug report

Affected Rule

Testing the repository and missing contributor guidelines.

Is this a regression?

I don't know.

Description

I want to contribute to this repository but found difficulties in running tests.

First, it looks like it's not testable on macOS. I found a comment in the run-bazel-in-docker.sh saying that tests will fail on non-Linux environments:


# Runs bazel in a docker container, with this repository's workspace mounted in its file system.
# This is useful because rules_docker assumes the host environment is linux, and tests will fail on other environments.
# Running bazel in docker is slower, but allows for the build and tests to execute on non-linux environments.

Later after I found a Linux box to test on. It's still not working:


$ git clone https://github.com/bazelbuild/rules_docker.git
$ cd rules_docker
$ bazel test //tests/...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 73cb2efb-4ce2-4708-bd0c-4750f5d92dbb
DEBUG: /home/user/.cache/bazel/_bazel_user/5e184aea21a9eb5699227e7c322d8bc1/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /home/user/.cache/bazel/_bazel_user/5e184aea21a9eb5699227e7c322d8bc1/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:125:14: buildkite_config not using checked in configs; Bazel version 4.2.1 was picked/selected but no checked in config was found in map {"0.20.0": ["8.0.0"], "0.21.0": ["8.0.0"], "0.22.0": ["8.0.0", "9.0.0"], "0.23.0": ["8.0.0", "9.0.0"], "0.23.1": ["8.0.0", "9.0.0"], "0.23.2": ["9.0.0"], "0.24.0": ["9.0.0"], "0.24.1": ["9.0.0"], "0.25.0": ["9.0.0"], "0.25.1": ["9.0.0"], "0.25.2": ["9.0.0"], "0.26.0": ["9.0.0"], "0.26.1": ["9.0.0"], "0.27.0": ["9.0.0"], "0.27.1": ["9.0.0"], "0.28.0": ["9.0.0"], "0.28.1": ["9.0.0"], "0.29.0": ["9.0.0"], "0.29.1": ["9.0.0", "10.0.0"], "1.0.0": ["9.0.0", "10.0.0"], "1.0.1": ["10.0.0"], "1.1.0": ["10.0.0"], "1.2.0": ["10.0.0"], "1.2.1": ["10.0.0"], "2.0.0": ["10.0.0"], "2.1.0": ["10.0.0"], "2.1.1": ["10.0.0", "11.0.0"], "2.2.0": ["11.0.0"], "3.0.0": ["11.0.0"], "3.1.0": ["11.0.0"], "3.2.0": ["11.0.0"], "3.3.0": ["11.0.0"], "3.3.1": ["11.0.0"], "3.4.1": ["11.0.0"], "3.5.0": ["11.0.0"], "3.5.1": ["11.0.0"], "3.6.0": ["11.0.0"], "3.7.0": ["11.0.0"], "3.7.1": ["11.0.0"], "3.7.2": ["11.0.0"], "4.0.0": ["11.0.0"]}
DEBUG: /home/user/bazelbuild/rules_docker/cc/image.bzl:79:14: cc_image does not benefit from layers=[], got: [":cc_image_library"]
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:20:13: in srcs attribute of java_library rule //tests/container/java:java_image_library: please do not import '//testdata:Library.java' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:26:13: in srcs attribute of java_library rule //tests/container/java:java_bin_as_lib: please do not import '//testdata:Binary.java' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:83:13: in srcs attribute of java_library rule //tests/container/java:java_runfiles_as_lib: please do not import '//testdata:Runfiles.java' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:71:11: in srcs attribute of java_binary rule //tests/container/java:java_runfiles_image.binary: please do not import '//testdata:Runfiles.java' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'java_image', the error might have been caused by the macro implementation
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:54:11: in srcs attribute of java_binary rule //tests/container/java:java_classpath_as_file_image.binary: please do not import '//testdata:Binary.java' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'java_image', the error might have been caused by the macro implementation
WARNING: /home/user/bazelbuild/rules_docker/tests/container/java/BUILD:38:11: in srcs attribute of java_binary rule //tests/container/java:java_image.binary: please do not import '//testdata:Binary.java' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'java_image', the error might have been caused by the macro implementation
ERROR: /home/user/bazelbuild/rules_docker/tests/contrib/BUILD:137:17: in container_bundle_ rule //tests/contrib:create_empty_bundle:
Traceback (most recent call last):
	File "/home/user/bazelbuild/rules_docker/container/bundle.bzl", line 67, column 15, in _container_bundle_impl
		_incr_load(
	File "/home/user/bazelbuild/rules_docker/container/layer_tools.bzl", line 232, column 28, in incremental_load
		run_tag = images.keys()[0]
Error: index out of range (index is 0, but sequence has 0 elements)
ERROR: Analysis of target '//tests/contrib:create_empty_bundle' failed; build aborted: Analysis of target '//tests/contrib:create_empty_bundle' failed
INFO: Elapsed time: 30.783s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (338 packages loaded, 11688 targets configured)
FAILED: Build did NOT complete successfully (338 packages loaded, 11688 targets configured)
    Fetching @loaded_dockerfile_image_docker; fetching 17s
    Fetching @rust_linux_x86_64; fetching 17s
    Fetching ...x86_64; Extracting /home/user/.cache/bazel/_bazel_user/5e184aea21a9eb5699227e7c322d8bc1/external/rust_linux_x86_64/rust-1.56.0\
-x86_64-unknown-linux-gnu.tar.gz 5s

Even if I reduce the test scope to //tests/docker/... I can't get it to work:


$ bazel test //tests/docker/...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: c20f8cdf-b12a-402d-9b80-e578502b2c86
DEBUG: /home/user/.cache/bazel/_bazel_user/5e184aea21a9eb5699227e7c322d8bc1/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /home/user/.cache/bazel/_bazel_user/5e184aea21a9eb5699227e7c322d8bc1/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:125:14: buildkite_config not using checked in configs; Bazel version 4.2.1 was picked/selected but no checked in config was found in map {"0.20.0": ["8.0.0"], "0.21.0": ["8.0.0"], "0.22.0": ["8.0.0", "9.0.0"], "0.23.0": ["8.0.0", "9.0.0"], "0.23.1": ["8.0.0", "9.0.0"], "0.23.2": ["9.0.0"], "0.24.0": ["9.0.0"], "0.24.1": ["9.0.0"], "0.25.0": ["9.0.0"], "0.25.1": ["9.0.0"], "0.25.2": ["9.0.0"], "0.26.0": ["9.0.0"], "0.26.1": ["9.0.0"], "0.27.0": ["9.0.0"], "0.27.1": ["9.0.0"], "0.28.0": ["9.0.0"], "0.28.1": ["9.0.0"], "0.29.0": ["9.0.0"], "0.29.1": ["9.0.0", "10.0.0"], "1.0.0": ["9.0.0", "10.0.0"], "1.0.1": ["10.0.0"], "1.1.0": ["10.0.0"], "1.2.0": ["10.0.0"], "1.2.1": ["10.0.0"], "2.0.0": ["10.0.0"], "2.1.0": ["10.0.0"], "2.1.1": ["10.0.0", "11.0.0"], "2.2.0": ["11.0.0"], "3.0.0": ["11.0.0"], "3.1.0": ["11.0.0"], "3.2.0": ["11.0.0"], "3.3.0": ["11.0.0"], "3.3.1": ["11.0.0"], "3.4.1": ["11.0.0"], "3.5.0": ["11.0.0"], "3.5.1": ["11.0.0"], "3.6.0": ["11.0.0"], "3.7.0": ["11.0.0"], "3.7.1": ["11.0.0"], "3.7.2": ["11.0.0"], "4.0.0": ["11.0.0"]}
INFO: Analyzed 47 targets (121 packages loaded, 7652 targets configured).
INFO: Found 32 targets and 15 test targets...
INFO: From Action tests/docker/util/test_container_extract/foo.txt:
Loaded image: bazel/image:image
6716011efcf83c477ca9c397c4b149e14a0dfa40bf1a244838e5b1b4c0d6cf79
INFO: From RunAndCommitLayer tests/docker/util/test_container_commit_layer-layer.tar:
The image bazel/image:image already exists, renaming the old one with ID sha256:aefd7f02ae24739b95f77c488de70465c54653f394097b9859acede976c80e03 to empty string
Loaded image: bazel/image:image
sha256:9275f6ef7e17b7ff1194b68e8e497013f5f5784f41de90283d40e2faf2d9ba5d
d154f22e392db7b0d5e027f898e3ad4c1be6f142900a5efb53439def82301b81
Untagged: bazel/tests/docker/util:test_container_commit_layer
Deleted: sha256:e252dae06d2076ff43d1ac456733db719756918c30676ef40e8d2bbb989bec28
24aaef1cf6c04b6cd0f84dff14a7870993899a3403abc583c594ddb3b09b1604
INFO: From Action tests/docker/util/test_container_commit_commit.tar:
Loaded image: bazel/image:image
sha256:03c5a2eabd3ec9d59c8f49a56fe25fc38c434133195653f17a0330a6c78c9cc7
d2a680823969c9afe44abfd3db36aac795f2875cbc6e130d69380e26d8a96c55
INFO: From Action tests/docker/util/test_container_commit_commit.tar:
Loaded image: bazel/image:image
sha256:8e43c1dbedd47439e4bf67ebf7681f32ed68ea0636d4ff6691cd8b9a45f415e8
a585138ded4f118f712fc6ea53dd2ea213757196d19863a496280cc4826b329c
ERROR: /home/user/bazelbuild/rules_docker/tests/docker/util/BUILD:100:31: RunAndCommitLayer tests/docker/util/test_container_commit_layer-layer.tar failed: (Exit 1): test_container_commit_layer.build failed: error executing command bazel-out/k8-fastbuild-ST-6390b2712f3f/bin/tests/docker/util/test_container_commit_layer.build

Use --sandbox_debug to see verbose messages from the sandbox
Error: No such image: bazel/tests/docker/util:test_container_commit_layer
Loaded image: bazel/image:image
sha256:e252dae06d2076ff43d1ac456733db719756918c30676ef40e8d2bbb989bec28
475ab3294c92ac2bb6fcf6a100321c3e9605e30665df20b1511450482527e048
ERROR: /home/user/bazelbuild/rules_docker/tests/docker/util/BUILD:118:16 Middleman _middlemen/tests_Sdocker_Sutil_Stest_Ucontainer_Ucommit_Ulayer_Uimage.executable-runfiles failed: (Exit 1): test_container_commit_layer.build failed: error executing command bazel-out/k8-fastbuild-ST-6390b2712f3f/bin/tests/docker/util/test_container_commit_layer.build

Use --sandbox_debug to see verbose messages from the sandbox
INFO: Elapsed time: 41.609s, Critical Path: 11.53s
INFO: 309 processes: 11 remote cache hit, 186 internal, 112 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
//tests/docker/package_managers:download_pkgs_run_test                NO STATUS
//tests/docker/package_managers:download_pkgs_with_additional_repos_run_test NO STATUS
//tests/docker/package_managers:gpg_test                              NO STATUS
//tests/docker/package_managers:install_pkgs_reproducibility_test     NO STATUS
//tests/docker/util:test_container_commit_layer_metadata              NO STATUS
//tests/docker/util:test_container_commit_metadata                    NO STATUS
//tests/docker/package_managers:test_download_pkgs_docker_cp             PASSED in 0.1s
//tests/docker/package_managers:test_download_pkgs_docker_run            PASSED in 0.1s
//tests/docker/package_managers:test_download_pkgs_rule                  PASSED in 0.0s
//tests/docker/package_managers:test_install_pkgs_rule                   PASSED in 0.1s
//tests/docker/util:test_container_commit_layer_rule                     PASSED in 0.1s
//tests/docker/util:test_container_commit_rule                           PASSED in 0.1s
//tests/docker/util:test_container_extract_rule                          PASSED in 0.1s
//tests/docker/util:test_extract_script                                  PASSED in 0.1s
//tests/docker/util:test_extracted_file                                  PASSED in 0.1s

Executed 9 out of 15 tests: 9 tests pass and 6 were skipped.
FAILED: Build did NOT complete successfully

Could you provide steps on how to make it work and update contributor guidelines?

🔬 Minimal Reproduction


$ git clone https://github.com/bazelbuild/rules_docker.git
$ cd rules_docker
$ bazel test //tests/...

🌍 Your Environment

Operating System:

  
$ uname -a
Linux rukas 5.4.129+ #1 SMP Wed Aug 18 19:58:18 PDT 2021 x86_64 GNU/Linux
  

Output of bazel version:

  
$ bazel version
Build label: 4.2.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Aug 30 15:17:47 2021 (1630336667)
Build timestamp: 1630336667
Build timestamp as int: 1630336667
  

Rules_docker version:

  
$ git rev-parse HEAD
40d40363189166657be436714688d29aa0131d1e
  

mindaugasrukas avatar Jan 12 '22 00:01 mindaugasrukas

I want to understand how to run those tests as ./testing/e2e.sh also fails for many reasons. How to reproduce:

$ git clone https://github.com/bazelbuild/rules_docker.git
$ cd rules_docker
$ ./testing/e2e.sh
...

mindaugasrukas avatar Jan 13 '22 23:01 mindaugasrukas

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

github-actions[bot] avatar Jul 13 '22 03:07 github-actions[bot]

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"

github-actions[bot] avatar Aug 13 '22 03:08 github-actions[bot]