blob: 90f42077c47a67de7951094065c7fced3fad47e9 [file] [log] [blame]
Alpha Lam79adf592016-02-10 15:38:59 +00001// Copyright 2016 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package com.google.devtools.build.lib.remote;
16
David Ostrovsky82859b02017-09-25 03:55:01 -040017import com.google.devtools.build.lib.util.OptionsUtils;
18import com.google.devtools.build.lib.vfs.PathFragment;
Alpha Lam79adf592016-02-10 15:38:59 +000019import com.google.devtools.common.options.Option;
ccalvarin3bc15472017-06-27 17:58:35 +020020import com.google.devtools.common.options.OptionDocumentationCategory;
ccalvarinc82a1972017-07-17 21:13:39 +020021import com.google.devtools.common.options.OptionEffectTag;
Alpha Lam79adf592016-02-10 15:38:59 +000022import com.google.devtools.common.options.OptionsBase;
23
Ola Rozenfeld72d117d2016-09-19 15:02:32 +000024/** Options for remote execution and distributed caching. */
Alpha Lam79adf592016-02-10 15:38:59 +000025public final class RemoteOptions extends OptionsBase {
26 @Option(
Jakob Buchgraber905e3072017-12-19 05:50:11 -080027 name = "remote_http_cache",
28 oldName = "remote_rest_cache",
Dan Fabulich81c9dc92016-07-22 12:46:08 +000029 defaultValue = "null",
ccalvarin3bc15472017-06-27 17:58:35 +020030 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
31 effectTags = {OptionEffectTag.UNKNOWN},
Dan Fabulich81c9dc92016-07-22 12:46:08 +000032 help =
Jakob Buchgraber905e3072017-12-19 05:50:11 -080033 "A base URL of a HTTP caching service. Both http:// and https:// are supported. BLOBs are "
34 + "stored with PUT and retrieved with GET. See remote/README.md for more information."
Dan Fabulich81c9dc92016-07-22 12:46:08 +000035 )
Jakob Buchgraber905e3072017-12-19 05:50:11 -080036 public String remoteHttpCache;
Dan Fabulich81c9dc92016-07-22 12:46:08 +000037
38 @Option(
buchgra7ffccd2018-07-11 06:02:17 -070039 name = "remote_cache_proxy",
40 defaultValue = "null",
41 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
42 effectTags = {OptionEffectTag.UNKNOWN},
43 help =
44 "Connect to the remote cache through a proxy. Currently this flag can only be used to "
45 + "configure a Unix domain socket (unix:/path/to/socket) for the HTTP cache."
46 )
47 public String remoteCacheProxy;
48
49 @Option(
buchgrff008f42018-06-02 14:13:43 -070050 name = "remote_max_connections",
buchgrd3228b62018-07-02 09:02:08 -070051 defaultValue = "100",
buchgrff008f42018-06-02 14:13:43 -070052 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
53 effectTags = {OptionEffectTag.HOST_MACHINE_RESOURCE_OPTIMIZATIONS},
54 help =
55 "The max. number of concurrent network connections to the remote cache/executor. By "
buchgrd3228b62018-07-02 09:02:08 -070056 + "default Bazel limits the number of TCP connections to 100. Setting this flag to "
57 + "0 will make Bazel choose the number of connections automatically.")
buchgrff008f42018-06-02 14:13:43 -070058 public int remoteMaxConnections;
Benjamin Peterson9ef15212017-06-27 14:41:26 +020059
60 @Option(
buchgrc30b38e2017-05-19 17:30:10 +020061 name = "remote_executor",
Alpha Lam79adf592016-02-10 15:38:59 +000062 defaultValue = "null",
ccalvarin3bc15472017-06-27 17:58:35 +020063 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
64 effectTags = {OptionEffectTag.UNKNOWN},
buchgrc30b38e2017-05-19 17:30:10 +020065 help = "HOST or HOST:PORT of a remote execution endpoint."
Alpha Lam79adf592016-02-10 15:38:59 +000066 )
buchgrc30b38e2017-05-19 17:30:10 +020067 public String remoteExecutor;
Ola Rozenfeld72d117d2016-09-19 15:02:32 +000068
69 @Option(
Ola Rozenfeldde32ae72016-09-20 14:13:56 +000070 name = "remote_cache",
71 defaultValue = "null",
ccalvarin3bc15472017-06-27 17:58:35 +020072 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
73 effectTags = {OptionEffectTag.UNKNOWN},
buchgrc30b38e2017-05-19 17:30:10 +020074 help = "HOST or HOST:PORT of a remote caching endpoint."
Ola Rozenfeldde32ae72016-09-20 14:13:56 +000075 )
76 public String remoteCache;
77
78 @Option(
buchgrc30b38e2017-05-19 17:30:10 +020079 name = "remote_timeout",
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +000080 defaultValue = "60",
ccalvarin3bc15472017-06-27 17:58:35 +020081 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
82 effectTags = {OptionEffectTag.UNKNOWN},
buchgrc30b38e2017-05-19 17:30:10 +020083 help = "The maximum number of seconds to wait for remote execution and cache calls."
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +000084 )
buchgrc30b38e2017-05-19 17:30:10 +020085 public int remoteTimeout;
Ola Rozenfeld1c44aa62016-12-12 22:02:30 +000086
87 @Option(
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +000088 name = "remote_accept_cached",
89 defaultValue = "true",
ccalvarin3bc15472017-06-27 17:58:35 +020090 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
91 effectTags = {OptionEffectTag.UNKNOWN},
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +000092 help = "Whether to accept remotely cached action results."
93 )
Ola Rozenfeld1c44aa62016-12-12 22:02:30 +000094 public boolean remoteAcceptCached;
Ola Rozenfeldfb9d52c2016-12-12 23:20:37 +000095
96 @Option(
buchgrc30b38e2017-05-19 17:30:10 +020097 name = "remote_local_fallback",
ulfjack4cc7b772017-06-09 08:37:51 -040098 defaultValue = "false",
ccalvarin3bc15472017-06-27 17:58:35 +020099 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
100 effectTags = {OptionEffectTag.UNKNOWN},
buchgrc30b38e2017-05-19 17:30:10 +0200101 help = "Whether to fall back to standalone local execution strategy if remote execution fails."
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000102 )
buchgrc30b38e2017-05-19 17:30:10 +0200103 public boolean remoteLocalFallback;
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000104
105 @Option(
buchgrc30b38e2017-05-19 17:30:10 +0200106 name = "remote_upload_local_results",
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000107 defaultValue = "true",
ccalvarin3bc15472017-06-27 17:58:35 +0200108 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
109 effectTags = {OptionEffectTag.UNKNOWN},
buchgrc30b38e2017-05-19 17:30:10 +0200110 help = "Whether to upload locally executed action results to the remote cache."
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000111 )
buchgrc30b38e2017-05-19 17:30:10 +0200112 public boolean remoteUploadLocalResults;
Ola Rozenfeldf3d09052017-03-13 13:15:30 +0000113
114 @Option(
olaola460a1052017-06-09 04:33:25 +0200115 name = "remote_instance_name",
116 defaultValue = "",
ccalvarin3bc15472017-06-27 17:58:35 +0200117 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
118 effectTags = {OptionEffectTag.UNKNOWN},
olaola460a1052017-06-09 04:33:25 +0200119 help = "Value to pass as instance_name in the remote execution API."
120 )
121 public String remoteInstanceName;
olaolafdd66ef2017-06-30 05:07:13 +0200122
123 @Option(
124 name = "experimental_remote_retry",
125 defaultValue = "true",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200126 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
127 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200128 help = "Whether to retry transient remote execution/cache errors."
129 )
130 public boolean experimentalRemoteRetry;
131
132 @Option(
133 name = "experimental_remote_retry_start_delay_millis",
134 defaultValue = "100",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200135 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
136 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200137 help = "The initial delay before retrying a transient error."
138 )
139 public long experimentalRemoteRetryStartDelayMillis;
140
141 @Option(
142 name = "experimental_remote_retry_max_delay_millis",
143 defaultValue = "5000",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200144 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
145 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200146 help = "The maximum delay before retrying a transient error."
147 )
148 public long experimentalRemoteRetryMaxDelayMillis;
149
150 @Option(
151 name = "experimental_remote_retry_max_attempts",
152 defaultValue = "5",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200153 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
154 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200155 help = "The maximum number of attempts to retry a transient error."
156 )
157 public int experimentalRemoteRetryMaxAttempts;
158
159 @Option(
160 name = "experimental_remote_retry_multiplier",
161 defaultValue = "2",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200162 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
163 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200164 help = "The multiplier by which to increase the retry delay on transient errors."
165 )
166 public double experimentalRemoteRetryMultiplier;
167
168 @Option(
169 name = "experimental_remote_retry_jitter",
170 defaultValue = "0.1",
ccalvarin59a0e4f2017-06-30 16:01:36 +0200171 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
172 effectTags = {OptionEffectTag.UNKNOWN},
olaolafdd66ef2017-06-30 05:07:13 +0200173 help = "The random factor to apply to retry delays on transient errors."
174 )
175 public double experimentalRemoteRetryJitter;
ulfjackcd98d612017-07-06 09:05:07 -0400176
ulfjackcdf118a2018-05-28 03:02:06 -0700177 @Deprecated
ulfjack9274cba2017-08-11 23:19:48 +0200178 @Option(
179 name = "experimental_remote_spawn_cache",
180 defaultValue = "false",
ulfjack9274cba2017-08-11 23:19:48 +0200181 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
ulfjackcdf118a2018-05-28 03:02:06 -0700182 effectTags = {OptionEffectTag.NO_OP},
ccalvarinb0440162018-03-28 08:09:07 -0700183 help =
184 "Whether to use the experimental spawn cache infrastructure for remote caching. "
185 + "Enabling this flag makes Bazel ignore any setting for remote_executor."
ulfjack9274cba2017-08-11 23:19:48 +0200186 )
187 public boolean experimentalRemoteSpawnCache;
188
David Ostrovsky82859b02017-09-25 03:55:01 -0400189 @Option(
David Ostrovsky4ee7f112018-05-02 03:30:11 -0700190 name = "disk_cache",
David Ostrovsky82859b02017-09-25 03:55:01 -0400191 defaultValue = "null",
David Ostrovsky82859b02017-09-25 03:55:01 -0400192 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
193 effectTags = {OptionEffectTag.UNKNOWN},
194 converter = OptionsUtils.PathFragmentConverter.class,
David Ostrovsky4ee7f112018-05-02 03:30:11 -0700195 help =
196 "A path to a directory where Bazel can read and write actions and action outputs. "
197 + "If the directory does not exist, it will be created."
David Ostrovsky82859b02017-09-25 03:55:01 -0400198 )
David Ostrovsky4ee7f112018-05-02 03:30:11 -0700199 public PathFragment diskCache;
ulfjack8896d2e2018-01-19 02:55:21 -0800200
201 @Option(
202 name = "experimental_guard_against_concurrent_changes",
ulfjackd844e652018-01-22 06:52:46 -0800203 defaultValue = "false",
ulfjack8896d2e2018-01-19 02:55:21 -0800204 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
205 effectTags = {OptionEffectTag.UNKNOWN},
ccalvarinb0440162018-03-28 08:09:07 -0700206 help =
207 "Turn this off to disable checking the ctime of input files of an action before "
208 + "uploading it to a remote cache. There may be cases where the Linux kernel delays "
209 + "writing of files, which could cause false positives."
ulfjack8896d2e2018-01-19 02:55:21 -0800210 )
211 public boolean experimentalGuardAgainstConcurrentChanges;
Googler8fd53fb2018-03-29 14:59:43 -0700212
213 @Option(
214 name = "experimental_remote_grpc_log",
215 defaultValue = "",
216 category = "remote",
217 documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
218 effectTags = {OptionEffectTag.UNKNOWN},
219 help =
220 "If specified, a path to a file to log gRPC call related details. This log consists "
221 + "of a sequence of serialized "
222 + "com.google.devtools.build.lib.remote.logging.RemoteExecutionLog.LogEntry "
223 + "protobufs with each message prefixed by a varint denoting the size of the following "
224 + "serialized protobuf message, as performed by the method "
225 + "LogEntry.writeDelimitedTo(OutputStream)."
226 )
227 public String experimentalRemoteGrpcLog;
Benjamin Petersondd3ddb02018-05-03 09:20:08 -0700228
229 @Option(
230 name = "remote_allow_symlink_upload",
231 defaultValue = "true",
232 category = "remote",
233 documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,
234 effectTags = {OptionEffectTag.EXECUTION},
235 help =
236 "If true, upload action symlink outputs to the remote cache. "
237 + "The remote cache currently doesn't support symlinks, "
238 + "so symlink outputs are converted into regular files. "
239 + "If this option is not enabled, "
240 + "otherwise cachable actions that output symlinks will fail."
241 )
242 public boolean allowSymlinkUpload;
Alpha Lam79adf592016-02-10 15:38:59 +0000243}