aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Ola Rozenfeld <olaola@google.com>2017-03-02 16:38:36 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-03 10:35:56 +0000
commit399ff5b3922f1bbbdc43103e4a4d9d40327d3d0d (patch)
tree261a29c4c5f84d4b882d73209e91188d3c0c5d3c /src/main/java/com
parentc3102b722af6fba2a67fdfed55426471c0927ab8 (diff)
Adding a small flag allowing to control remote caching without remote execution. Usually it is enabled, and will be triggered whenever a remote_cache is specified, but a remote_worker is not; however, this flag allows to specifically disable it for the cases where remote_worker is defined, but something went wrong and we were forced to execute locally. This is useful to save time when the remote API does not actually support setting the remote action result.
-- PiperOrigin-RevId: 149007755 MOS_MIGRATED_REVID=149007755
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java38
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java2
2 files changed, 24 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
index 53fb4a967d..ad2cde591f 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
@@ -100,26 +100,34 @@ public final class RemoteOptions extends OptionsBase {
public int grpcMaxBatchSizeBytes;
@Option(
- name = "grpc_timeout_seconds",
- defaultValue = "60",
- category = "remote",
- help = "The maximal number of seconds to wait for remote calls. For client mode only."
- )
+ name = "grpc_timeout_seconds",
+ defaultValue = "60",
+ category = "remote",
+ help = "The maximal number of seconds to wait for remote calls. For client mode only."
+ )
public int grpcTimeoutSeconds;
@Option(
- name = "remote_accept_cached",
- defaultValue = "true",
- category = "remote",
- help = "Whether to accept remotely cached action results."
- )
+ name = "remote_accept_cached",
+ defaultValue = "true",
+ category = "remote",
+ help = "Whether to accept remotely cached action results."
+ )
public boolean remoteAcceptCached;
@Option(
- name = "remote_allow_local_fallback",
- defaultValue = "true",
- category = "remote",
- help = "Whether to fall back to standalone strategy if remote fails."
- )
+ name = "remote_allow_local_fallback",
+ defaultValue = "true",
+ category = "remote",
+ help = "Whether to fall back to standalone strategy if remote fails."
+ )
public boolean remoteAllowLocalFallback;
+
+ @Option(
+ name = "remote_local_exec_upload_results",
+ defaultValue = "true",
+ category = "remote",
+ help = "Whether to upload action results to the remote cache after executing locally."
+ )
+ public boolean remoteLocalExecUploadResults;
}
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
index 15ed8ff0bc..b38e29cecc 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
@@ -111,7 +111,7 @@ final class RemoteSpawnStrategy implements SpawnActionContext {
Spawn spawn, ActionExecutionContext actionExecutionContext, RemoteActionCache actionCache,
ActionKey actionKey) throws ExecException, InterruptedException {
standaloneStrategy.exec(spawn, actionExecutionContext);
- if (actionCache != null && actionKey != null) {
+ if (options.remoteLocalExecUploadResults && actionCache != null && actionKey != null) {
ArrayList<Path> outputFiles = new ArrayList<>();
for (ActionInput output : spawn.getOutputFiles()) {
outputFiles.add(execRoot.getRelative(output.getExecPathString()));