-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
base: master
Are you sure you want to change the base?
Conversation
bb85d69
to
17ed3a6
Compare
public FileSystem getFileSystemForBuildArtifacts(FileSystem nativeFs) { | ||
if (!useRemoteRepoContentsCache) { | ||
return null; | ||
} | ||
return new RemoteOverlayFileSystem( | ||
outputBase.getRelative(LabelConstants.EXTERNAL_REPOSITORY_LOCATION), nativeFs); | ||
} |
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.
Hmm, this feels very "heavy-handed", especially after reading the fsForPath
below.
What if we first refactor BlazeRuntime to add a dedicated "external repo" entry to ServerDirectories, then make it configurable 🤔
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.
Been there, but I couldn't get it to work. The problem is that lots of SkyValue
s have Path
s in their corresponding SkyKey
s, which means that there needs to be a singleton file system used everywhere for the lifetime of the server. Otherwise you would need to keep some other global object around that knows how to map a logical path to the correct file system for the respective key and add special handling for each file operation that may cross file system boundaries. Pretty much like fsForPath
, but not just in a single location.
b79c111
to
17af177
Compare
ad8c6ba
to
5b3c3d0
Compare
5b3c3d0
to
1ba11a0
Compare
RELNOTES[NEW]: The results of reproducible repository rules without dependencies added at runtime (e.g., via
repository_ctx.watch
or.getenv
) can now be cached in a regular HTTP or gRPC remote cache if the new--experimental_remote_repo_contents_cache
startup option is provided.The output of
du -h $(bazel info output_base)
afterbazel build //src:bazel-dev
and a fully up-to-date remote cacheSome repos are still materialized eagerly, which may not be necessary. Patched
http_archive
also can't be cached yet, so these numbers are likely to improve with further work on this feature.TODO:
archive_override
removes all files from the archive root #26450Fixes #6359