Alpha Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | package com.google.devtools.build.lib.remote; |
| 16 | |
| 17 | import com.google.devtools.common.options.Option; |
| 18 | import com.google.devtools.common.options.OptionsBase; |
| 19 | |
Ola Rozenfeld | 72d117d | 2016-09-19 15:02:32 +0000 | [diff] [blame] | 20 | /** Options for remote execution and distributed caching. */ |
Alpha Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 21 | public final class RemoteOptions extends OptionsBase { |
| 22 | @Option( |
Dan Fabulich | 81c9dc9 | 2016-07-22 12:46:08 +0000 | [diff] [blame] | 23 | 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 Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 33 | 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 Fabulich | 2c12327 | 2016-07-15 14:13:58 +0000 | [diff] [blame] | 41 | 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 Lam | c1b4175 | 2016-05-20 14:35:37 +0000 | [diff] [blame] | 49 | 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 Lam | a1a79cb | 2016-05-15 19:13:52 +0000 | [diff] [blame] | 59 | name = "remote_worker", |
Alpha Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 60 | defaultValue = "null", |
| 61 | category = "remote", |
Alpha Lam | a1a79cb | 2016-05-15 19:13:52 +0000 | [diff] [blame] | 62 | help = |
| 63 | "Hostname and port number of remote worker in the form of host:port. " |
| 64 | + "For client mode only." |
Alpha Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 65 | ) |
Alpha Lam | a1a79cb | 2016-05-15 19:13:52 +0000 | [diff] [blame] | 66 | public String remoteWorker; |
Ola Rozenfeld | 72d117d | 2016-09-19 15:02:32 +0000 | [diff] [blame] | 67 | |
| 68 | @Option( |
Ola Rozenfeld | de32ae7 | 2016-09-20 14:13:56 +0000 | [diff] [blame] | 69 | 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 Rozenfeld | 399ff5b | 2017-03-02 16:38:36 +0000 | [diff] [blame^] | 103 | 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 Rozenfeld | 1c44aa6 | 2016-12-12 22:02:30 +0000 | [diff] [blame] | 108 | public int grpcTimeoutSeconds; |
| 109 | |
| 110 | @Option( |
Ola Rozenfeld | 399ff5b | 2017-03-02 16:38:36 +0000 | [diff] [blame^] | 111 | name = "remote_accept_cached", |
| 112 | defaultValue = "true", |
| 113 | category = "remote", |
| 114 | help = "Whether to accept remotely cached action results." |
| 115 | ) |
Ola Rozenfeld | 1c44aa6 | 2016-12-12 22:02:30 +0000 | [diff] [blame] | 116 | public boolean remoteAcceptCached; |
Ola Rozenfeld | fb9d52c | 2016-12-12 23:20:37 +0000 | [diff] [blame] | 117 | |
| 118 | @Option( |
Ola Rozenfeld | 399ff5b | 2017-03-02 16:38:36 +0000 | [diff] [blame^] | 119 | 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 Rozenfeld | fb9d52c | 2016-12-12 23:20:37 +0000 | [diff] [blame] | 124 | public boolean remoteAllowLocalFallback; |
Ola Rozenfeld | 399ff5b | 2017-03-02 16:38:36 +0000 | [diff] [blame^] | 125 | |
| 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 Lam | 79adf59 | 2016-02-10 15:38:59 +0000 | [diff] [blame] | 133 | } |