blob: ad2cde591f434526aa1c142abc4f7f153108e207 [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
17import com.google.devtools.common.options.Option;
18import com.google.devtools.common.options.OptionsBase;
19
Ola Rozenfeld72d117d2016-09-19 15:02:32 +000020/** Options for remote execution and distributed caching. */
Alpha Lam79adf592016-02-10 15:38:59 +000021public final class RemoteOptions extends OptionsBase {
22 @Option(
Dan Fabulich81c9dc92016-07-22 12:46:08 +000023 name = "rest_cache_url",
24 defaultValue = "null",
25 category = "remote",
26 help =
27 "A base URL for a RESTful cache server for storing build artifacts."
28 + "It has to support PUT, GET, and HEAD requests."
29 )
30 public String restCacheUrl;
31
32 @Option(
Alpha Lam79adf592016-02-10 15:38:59 +000033 name = "hazelcast_node",
34 defaultValue = "null",
35 category = "remote",
36 help = "A comma separated list of hostnames of hazelcast nodes. For client mode only."
37 )
38 public String hazelcastNode;
39
40 @Option(
Dan Fabulich2c123272016-07-15 14:13:58 +000041 name = "hazelcast_client_config",
42 defaultValue = "null",
43 category = "remote",
44 help = "A file path to a hazelcast client config XML file. For client mode only."
45 )
46 public String hazelcastClientConfig;
47
48 @Option(
Alpha Lamc1b41752016-05-20 14:35:37 +000049 name = "hazelcast_standalone_listen_port",
50 defaultValue = "0",
51 category = "build_worker",
52 help =
53 "Runs an embedded hazelcast server that listens to this port. The server does not join"
54 + " any cluster. This is useful for testing."
55 )
56 public int hazelcastStandaloneListenPort;
57
58 @Option(
Alpha Lama1a79cb2016-05-15 19:13:52 +000059 name = "remote_worker",
Alpha Lam79adf592016-02-10 15:38:59 +000060 defaultValue = "null",
61 category = "remote",
Alpha Lama1a79cb2016-05-15 19:13:52 +000062 help =
63 "Hostname and port number of remote worker in the form of host:port. "
64 + "For client mode only."
Alpha Lam79adf592016-02-10 15:38:59 +000065 )
Alpha Lama1a79cb2016-05-15 19:13:52 +000066 public String remoteWorker;
Ola Rozenfeld72d117d2016-09-19 15:02:32 +000067
68 @Option(
Ola Rozenfeldde32ae72016-09-20 14:13:56 +000069 name = "remote_cache",
70 defaultValue = "null",
71 category = "remote",
72 help =
73 "Hostname and port number of remote gRPC cache in the form of host:port. "
74 + "For client mode only."
75 )
76 public String remoteCache;
77
78 @Option(
79 name = "grpc_max_chunk_size_bytes",
80 defaultValue = "400000", // <4MB. Bounded by the gRPC size limit on the overall message.
81 category = "remote",
82 help = "The maximal number of bytes to be sent in a single message. For client mode only."
83 )
84 public int grpcMaxChunkSizeBytes;
85
86 @Option(
87 name = "grpc_max_batch_inputs",
88 defaultValue = "100",
89 category = "remote",
90 help = "The maximal number of input file to be sent in a single batch. For client mode only."
91 )
92 public int grpcMaxBatchInputs;
93
94 @Option(
95 name = "grpc_max_batch_size_bytes",
96 defaultValue = "10485760", // 10MB
97 category = "remote",
98 help = "The maximal number of input bytes to be sent in a single batch. For client mode only."
99 )
100 public int grpcMaxBatchSizeBytes;
101
102 @Option(
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000103 name = "grpc_timeout_seconds",
104 defaultValue = "60",
105 category = "remote",
106 help = "The maximal number of seconds to wait for remote calls. For client mode only."
107 )
Ola Rozenfeld1c44aa62016-12-12 22:02:30 +0000108 public int grpcTimeoutSeconds;
109
110 @Option(
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000111 name = "remote_accept_cached",
112 defaultValue = "true",
113 category = "remote",
114 help = "Whether to accept remotely cached action results."
115 )
Ola Rozenfeld1c44aa62016-12-12 22:02:30 +0000116 public boolean remoteAcceptCached;
Ola Rozenfeldfb9d52c2016-12-12 23:20:37 +0000117
118 @Option(
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000119 name = "remote_allow_local_fallback",
120 defaultValue = "true",
121 category = "remote",
122 help = "Whether to fall back to standalone strategy if remote fails."
123 )
Ola Rozenfeldfb9d52c2016-12-12 23:20:37 +0000124 public boolean remoteAllowLocalFallback;
Ola Rozenfeld399ff5b2017-03-02 16:38:36 +0000125
126 @Option(
127 name = "remote_local_exec_upload_results",
128 defaultValue = "true",
129 category = "remote",
130 help = "Whether to upload action results to the remote cache after executing locally."
131 )
132 public boolean remoteLocalExecUploadResults;
Alpha Lam79adf592016-02-10 15:38:59 +0000133}