-
Notifications
You must be signed in to change notification settings - Fork 691
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
Change image rule to copy config instead of symlink #1571
Change image rule to copy config instead of symlink #1571
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
/gcbrun |
It appears the test in https://github.com/bazelbuild/rules_docker/blob/master/tests/contrib/repro_imgs.yaml now fails, specifically, the following step:
I think the problem is in the readlink here
In the test, this resolves to the command:
which results in:
not sure why though. |
Originally it followed the symlink and at the symlink target there existed this *.sha256 file. Made it so the digest file is also copied for the final layer and exposed so test can use it. |
command = "cp %s %s" % (config_file.path, output_config.path), | ||
) | ||
output_config_digest = ctx.outputs.config_digest | ||
ctx.actions.run_shell( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this seems to be causing a failure :(:
[1A�[K(08:51:50) �[35mWARNING: �[0merrors encountered while analyzing target '//tests/docker/toolchain_container:test-rbe-test-xenial-with-pkgs': it will not be built
(08:51:50) �[32mAnalyzing:�[0m 613 targets (355 packages loaded, 12039 targets configured)
�[1A�[K(08:51:50) �[31m�[1mERROR: �[0mfile 'tests/docker/package_managers/ubuntu_gpg_image.json.sha256' is generated by these conflicting actions:
Label: //tests/docker/package_managers:ubuntu_gpg_image
RuleClass: add_apt_key rule
Configuration: d769d4f1658740e0d5d58d8b62919a32f8f9956cb28577a4c785dd8ea1acb1b5
Mnemonic: Action
Action key: ee4f0b4cb4c32de3f26b7455d961b208ac208084ed6be011fedd92a71e84a38b, 0aa9d5a6def5441bff64d39dd00fe787186a9fff26033595220095eb40734680
Progress message: Action tests/docker/package_managers/ubuntu_gpg_image.json.sha256
PrimaryInput: File:[[<execution_root>]bazel-out/k8-fastbuild/bin]tests/docker/package_managers/ubuntu_gpg_image.0.config.sha256, File:[[<execution_root>]bazel-out/k8-fastbuild/bin]tests/docker/package_managers/ubuntu_gpg_image.key.0.config.sha256
PrimaryOutput: File:[[<execution_root>]bazel-out/k8-fastbuild/bin]tests/docker/package_managers/ubuntu_gpg_image.json.sha256
looks like the digest file is already generated elsewhere and that action needs to be updated instead of adding a new one here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with fixes for duplicates.
Btw should I be able to run something like bazel test //...
locally? It doesn't work out of the box for me at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we have some nested workspaces used by e2e tests that's probably messes up "..." invocations. What error do you get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For bazel test //...
I get
ERROR: /data/rules_docker/testing/new_pusher_tests/BUILD:17:15: no such package '@verify_new_pusher_image_contents//image': The repository '@verify_new_pusher_image_contents' could not be resolved and referenced by '//testing/new_pusher_tests:new_push_verify_pushed_configs_and_files.image'
ERROR: Analysis of target '//testing/new_pusher_tests:new_push_verify_pushed_configs_and_files.image' failed; build aborted: Analysis failed
and if I try bazel test //tests/...
I get
ERROR: /data/rules_docker/tests/container/BUILD:283:16: in env attribute of container_image_ rule //tests/container:set_env_make_vars: $(ENV_KEY) not defined. Since this rule was created by the macro 'container_image', the error might have been caused by the macro implementation
ERROR: /data/rules_docker/tests/container/BUILD:283:16: in env attribute of container_image_ rule //tests/container:set_env_make_vars: $(ENV_VALUE) not defined. Since this rule was created by the macro 'container_image', the error might have been caused by the macro implementation
The image rule in container/image.bzl was symlinking the config file for strutcture tests. This caused remote execution with --remote_download_minimal to fail as symlinks aren't yet supported.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: exoson, smukherj1 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/gcbrun |
The image rule in container/image.bzl was symlinking the config file for
strutcture tests. This caused remote execution with
--remote_download_minimal to fail as symlinks aren't yet supported.