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

Discard cache for rules affected by --experimental_docker_image #9868

Closed
allada opened this issue Oct 7, 2019 · 4 comments
Closed

Discard cache for rules affected by --experimental_docker_image #9868

allada opened this issue Oct 7, 2019 · 4 comments
Labels
more data needed team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request untriaged

Comments

@allada
Copy link
Contributor

allada commented Oct 7, 2019

Description of the problem / feature request:

--experimental_docker_image should discard cache on actions that run inside docker.

We are using this feature because our builds are not fully hermetic and efforts to do so keep increasing the complexity of our workspace/build rules, so we decided to rely on docker (for now) to do it for us.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Setup docker + bazel (like in this link: https://docs.bazel.build/versions/master/remote-execution-sandbox.html)
  2. Run a build bazel build //...
  3. Clean build bazel clean
  4. Make small change to docker image so you get a new container id and setup bazel to use it
  5. Run a build bazel build //...

At this point it will reuse the same cache from the old container, but it should discard cache.

What operating system are you running Bazel on?

Any

What's the output of bazel info release?

0.26.1 (but according to documentation happens on latest)

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Cannot, private repo.

Any other information, logs, or outputs that you want to share?

The current work around is to wrap the bazel command in a custom python script (we already do this to inject --experimental_docker_image={docker_image_id}, so it always grabs the docker image for the checkedout build), and append --platform_suffix={my_image_hash} to the build on behalf of the user.

The down side of doing this is that we update our image about once a week, and our bazel-out is on the order of 100G, resulting in many hundreds of gigs of stale cache. We fix this by having our clean up the stale/old folders in bazel-out.

@iirina iirina added team-Remote-Exec Issues and PRs for the Execution (Remote) team untriaged labels Oct 10, 2019
@buchgr
Copy link
Contributor

buchgr commented Oct 28, 2019

Hi there, do I understand correctly the issue is that changing the value of --experimental_docker_image does not invalidate the cache? That's a known problem across all execution strategies. I believe @aragos is working on a solution.

@buchgr buchgr added team-Configurability platforms, toolchains, cquery, select(), config transitions and removed team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Oct 28, 2019
@allada
Copy link
Contributor Author

allada commented Oct 29, 2019

@buchgr, Yes that is correct. As stated before, there is a workaround so severity is not terribly high.

@katre katre added more data needed P2 We'll consider working on this in future. (Assignee optional) type: feature request and removed untriaged labels Nov 8, 2019
@katre
Copy link
Member

katre commented Nov 8, 2019

@aragos, please confirm if this is something your work on execution strategies will affect.

@meisterT meisterT added untriaged and removed P2 We'll consider working on this in future. (Assignee optional) labels May 12, 2020
@katre
Copy link
Member

katre commented May 18, 2020

Commenting: yes, this will be affected by the work on execution strategies and platforms.

I'm closing this now and redirecting you to #11432 as the tracking bug for that effort.

@katre katre closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more data needed team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request untriaged
Projects
None yet
Development

No branches or pull requests

6 participants