Add cleanup before docker run in incremental loader#793
Add cleanup before docker run in incremental loader#793smukherj1 merged 1 commit intobazelbuild:masterfrom
Conversation
|
Hi @clintharrison. Thanks for your PR. I'm waiting for a bazelbuild member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Hi @clintharrison, Thanks for your PR. The change LGTM. Could you explain what you mean by
Are you referring to the tag statements here? I thought these statements are executed synchronously. Why would they introduce a race condition? |
|
@smukherj1 yes, exactly those: imagine the scenario
At the end of this, we'd end up running a different image than we originally tagged. Since we have the digest, we could instead do |
|
@clintharrison Ok I see. I'm not sure if we actually support building the same target across different bazel invocations in the same WORKSPACE. @nlopezgi any idea what bazel does in this scenario? Regardless, this change LGTM until we figure out if we need to fix the race condition you described |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clintharrison, smukherj1 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This change is causing the cleanup to run twice in the cases where there are no run_statements defined. (second time will fail with an error since the files are already removed) |
|
Ahh, I totally see how that happens :( Let me send a follow-up PR. |
When #667 was merged, the assumption was that the cleanup handler does not do anything -- but we've since seen a lot of files left around in /tmp on our CI machines from this change.
Since we've already loaded the layers into the docker daemon before
docker runing, we can run the cleanup before weexec docker.As an aside...
I'm slightly hesitant that the cleanup step could take a while, which means we're making the race condition from
docker tagand a much-delayeddocker runworse.Maybe the
tag_referencein the builtrun_statementsshould usetag@sha256:digestformat, since we do have the digest available?