-
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
stamping results in different digest with remote cache #1451
Comments
In theory yes I expect rebuilding the same image using a remote cache should result in the same digest. However, I think I'll need more information to figure out what's wrong here. Could you try debugging this with modifying the digester here to dump |
Printing
After a
Only I noticed that two processes are running locally:
|
I'm thinking this issue might be caused by bazelbuild/bazel#10075 The scenario is certainly similar. |
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. |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
It looks like i have been experiencing similar issues. However mine is due to the use of |
@jinhong- I think the problem here is actually that rules_docker unconditionally stamps (for My understanding after spending a bunch of time getting this right in rules_nodejs is that we should be doing the same thing as rules_go. I'll work up a PR but it's a breaking change so I'll need to work with other maintainers to figure out how we'll roll it out. |
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute was removed from some providers - the stamp attribute was deprecated on container_push and container_bundle, it is now removed - the stamp attribute was removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute was removed from some providers - the stamp attribute was deprecated on container_push and container_bundle, it is now removed - the stamp attribute was removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute was removed from some providers - the stamp attribute was deprecated on container_push and container_bundle, it is now removed - the stamp attribute was removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute was removed from some providers - the stamp attribute was deprecated on container_push and container_bundle, it is now removed - the stamp attribute was removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute was already deprecated on container_push and container_bundle, it is now removed - the stamp attribute is removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute was already deprecated on container_push and container_bundle, it is now removed - the stamp attribute is removed from container_image, there is no replacement Fixes bazelbuild#1451
…he rule This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute was already deprecated on container_push and container_bundle, it is now removed - the stamp attribute is removed from container_image, there is no replacement Fixes bazelbuild#1451
I have read through #1878. In addition to just solving the problem directly, I would suggest to add some documentation around rules_docker and remote caching/RBE best practices:
Perhaps a dedicated Markdown file for FAQ and/or open up Github's Discussion feature? WDYT? |
Not sure i quite understand this. Am i correct to say that for me to fix this now, I would add Also, I am not sure if I understand how stamping would result in different hashes On a separate note, maybe I have a different issue after all. My issue is that the SHA256 generated into the .digest does not match the actual digest of the actual image that is being uploaded. And this issue seem to happen because of of |
This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute is now trinary Fixes bazelbuild#1451
This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute is now trinary Fixes bazelbuild#1451
This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute is now trinary Fixes bazelbuild#1451
This follows the example of rules_go and rules_nodejs. It means we don't produce cache-busting outputs unless the user explicitly requests non-deteriminism in the build with --stamp. BREAKING CHANGE: - To get stamped outputs, users must now call bazel with `--stamp` - the stamp attribute is removed from some providers - the stamp attribute is now trinary Fixes #1451
Stamping a container image results in a different sha256 on each build. That may not be surprising in a local build scenario, but I expect the remote cache to serve up the files necessary to NOT generate a different sha256.
Repro steps:
Note that the digest is different between builds. I would expect the remote cache results in the same build stamped as before.
BUILD file:
The text was updated successfully, but these errors were encountered: