-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[7.4.0] Implement disk cache garbage collection. #23833
Changes from all commits
3855b82
57a4b61
2af4a4b
011199e
b6e89ba
72c7020
165c480
a337a5a
9baaea3
2b002ea
50185c3
b296cac
883a903
09ae592
cc773a3
86a2408
53839d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ tasks: | |
- "//src:bazel_jdk_minimal" | ||
- "//src:test_repos" | ||
- "//src/main/java/..." | ||
- "//src/tools/diskcache/..." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .bazelci/postsubmit.yml |
||
- "//src/tools/execlog/..." | ||
test_flags: | ||
- "--config=ci-linux" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .bazelci/presubmit.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,8 @@ | |
import com.google.devtools.build.lib.remote.circuitbreaker.CircuitBreakerFactory; | ||
import com.google.devtools.build.lib.remote.common.RemoteCacheClient; | ||
import com.google.devtools.build.lib.remote.common.RemoteExecutionClient; | ||
import com.google.devtools.build.lib.remote.disk.DiskCacheClient; | ||
import com.google.devtools.build.lib.remote.disk.DiskCacheGarbageCollectorIdleTask; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. src/BUILD |
||
import com.google.devtools.build.lib.remote.downloader.GrpcRemoteDownloader; | ||
import com.google.devtools.build.lib.remote.http.DownloadTimeoutException; | ||
import com.google.devtools.build.lib.remote.http.HttpException; | ||
|
@@ -335,6 +337,14 @@ public void beforeCommand(CommandEnvironment env) throws AbruptExitException { | |
} | ||
} | ||
|
||
if (enableDiskCache) { | ||
var gcIdleTask = | ||
DiskCacheGarbageCollectorIdleTask.create(remoteOptions, env.getWorkingDirectory()); | ||
if (gcIdleTask != null) { | ||
env.addIdleTask(gcIdleTask); | ||
} | ||
} | ||
|
||
if (!enableDiskCache && !enableHttpCache && !enableGrpcCache && !enableRemoteExecution) { | ||
// Quit if no remote caching or execution was enabled. | ||
actionContextProvider = | ||
|
@@ -954,9 +964,9 @@ public void afterCommand() { | |
} | ||
|
||
private static void afterCommandTask( | ||
RemoteActionContextProvider actionContextProvider, | ||
TempPathGenerator tempPathGenerator, | ||
AsynchronousMessageOutputStream<LogEntry> rpcLogFile) | ||
@Nullable RemoteActionContextProvider actionContextProvider, | ||
@Nullable TempPathGenerator tempPathGenerator, | ||
@Nullable AsynchronousMessageOutputStream<LogEntry> rpcLogFile) | ||
throws AbruptExitException { | ||
if (actionContextProvider != null) { | ||
actionContextProvider.afterCommand(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,17 @@ java_library( | |
name = "disk", | ||
srcs = glob(["*.java"]), | ||
deps = [ | ||
"//src/main/java/com/google/devtools/build/lib/concurrent", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. src/main/java/com/google/devtools/build/lib/remote/disk/BUILD |
||
"//src/main/java/com/google/devtools/build/lib/exec:spawn_runner", | ||
"//src/main/java/com/google/devtools/build/lib/remote:store", | ||
"//src/main/java/com/google/devtools/build/lib/remote/common", | ||
"//src/main/java/com/google/devtools/build/lib/remote/common:cache_not_found_exception", | ||
"//src/main/java/com/google/devtools/build/lib/remote/options", | ||
"//src/main/java/com/google/devtools/build/lib/remote/util", | ||
"//src/main/java/com/google/devtools/build/lib/server:idle_task", | ||
"//src/main/java/com/google/devtools/build/lib/util:string", | ||
"//src/main/java/com/google/devtools/build/lib/vfs", | ||
"//third_party:flogger", | ||
"//third_party:guava", | ||
"//third_party:jsr305", | ||
"//third_party/protobuf:protobuf_java", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .bazelci/postsubmit.yml |
||
|
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.
.bazelci/postsubmit.yml