-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add a remote repo contents cache #26860
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
Conversation
bb85d69 to
17ed3a6
Compare
b79c111 to
17af177
Compare
5b3c3d0 to
1ba11a0
Compare
3a0b2e0 to
9cfb892
Compare
Wyverald
left a comment
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.
some initial comments. will review deeper later, probably after the PR split (see below)
src/main/java/com/google/devtools/build/lib/remote/RemoteExternalOverlayFileSystem.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/cache/LocalRepoContentsCache.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/RemoteRepoContentsCache.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/remote/RemoteRepoContentsCacheImpl.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/runtime/RepositoryRemoteHelpersFactory.java
Show resolved
Hide resolved
a3e7e98 to
2057ed6
Compare
|
Looks like I broke a test. I'll investigate that and also improve the recovery in case of a failed materialization. |
|
@Wyverald Should be fixed. Failing materialization should not have written out the marker file, so this should be fine as well. |
|
Nice. I'll start the import myself. |
|
@fmeum Bazel 9.0.0 rc1 cut is scheduled for Thursday. Please merge your fix by then to include it in rc1, or it will be cherry-picked into a later RC. If the fix won't make the Bazel 9 release deadline, then please remove this issue from the milestone. Thanks! |
cf6a283 to
1ad9f54
Compare
Please note: The rc1 cut date has been rescheduled to Monday, November 3rd. |
|
@bazel-io fork 9.0.0 |
This cache supports some results of repo rules being cached remotely Details: bazelbuild/bazel#26860 MODULAR_ORIG_COMMIT_REV_ID: c1ce81166e00b5a888a0922aa4e19f6581fabf15
Repositories are cached in a regular remote cache as AC entries for a synthetic command with the predeclared input hash as the salt. The contents are represented as an output file for the marker file and an output directory for the contents.
Upon a cache hit, the metadata of the files comprising the repository is downloaded and injected into an in-memory file system that is overlaid on the
externaldirectory on the native file system. Downloads of file contents only occur when Bazel needs to read a file (e.g., a BUILD or .bzl file) or if a file is an input to an action executed locally. This can save time taken to execute repo rules and compute file digests and disk space required to store the contents of external repositories.The output of
du -h $(bazel info output_base)afterbazel build //src:bazel-devand a fully up-to-date remote cacheSome repos are still materialized eagerly, which may not be necessary. Patched
http_archivealso can't be cached yet, so these numbers are likely to improve with further work on this feature.TODO:
Fixes #6359
Fixes #22366
RELNOTES[NEW]: The results of reproducible repository rules without dependencies added at runtime (e.g., via
repository_ctx.watchor.getenv) can now be cached in a regular HTTP or gRPC remote cache if the new--experimental_remote_repo_contents_cachestartup option is provided.