From 82a485fca83c49a084074bc6d050f97b4a10417f Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 2 Jun 2023 20:37:01 -0400 Subject: [PATCH 001/214] Handle null Throwable message in asExecutionStatus (#1357) Throwable indicates that the response to getMessage() may be null. --- src/main/java/build/buildfarm/common/Actions.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/Actions.java b/src/main/java/build/buildfarm/common/Actions.java index ab3c3d8432..d6d1f18ba0 100644 --- a/src/main/java/build/buildfarm/common/Actions.java +++ b/src/main/java/build/buildfarm/common/Actions.java @@ -71,7 +71,12 @@ public static Status asExecutionStatus(Throwable t) { status.setCode(grpcStatus.getCode().value()); } - return status.setMessage(t.getMessage()).build(); + String message = t.getMessage(); + if (message != null) { + status.setMessage(message); + } + + return status.build(); } public static boolean isRetriable(Status status) { From 4b5f2a97f5548b3f89f8f41632549527bee6a780 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 4 Jun 2023 10:22:18 -0400 Subject: [PATCH 002/214] Update docs to include redis requirement (#1359) Cleaned up some links and language --- _site/docs/quick_start.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/_site/docs/quick_start.md b/_site/docs/quick_start.md index 2e32dc30ce..5383c31199 100644 --- a/_site/docs/quick_start.md +++ b/_site/docs/quick_start.md @@ -6,7 +6,19 @@ nav_order: 3 # Quick Start -Here we describe how to use bazel remote caching or remote execution with buildfarm. We'll start by creating a single workspace that can be used for both. +Here we describe how to use bazel remote caching or remote execution with buildfarm. We will create a single client workspace that can be used for both. + +## Setup + +You can run this quick start on a single computer running nearly any flavor of linux. This computer is the localhost for the rest of the description. + +### Backplane + +Buildfarm requires a backplane to store information that is shared between cluster members. A [redis](https://redis.io) server can be used to meet this requirement. + +Download/Install a redis-server instance and run it on your localhost. The default redis port of 6379 will be used by the default buildfarm configs. + +## Workspace Let's start with a bazel workspace with a single file to compile into an executable: @@ -68,7 +80,7 @@ INFO: 2 processes: 2 remote cache hit. ## Remote Execution (and caching) -Now we will use buildfarm for remote execution with a minimal configuration - a single memory instance, with a host-colocated worker that can execute a single process at a time - via a bazel invocation on our workspace. +Now we will use buildfarm for remote execution with a minimal configuration - a single memory instance, with a worker on the localhost that can execute a single process at a time - via a bazel invocation on our workspace. First, we should restart the buildfarm server to ensure that we get remote execution (this can also be forced from the client by using `--noremote_accept_cached`). From the buildfarm server prompt and directory: @@ -107,7 +119,7 @@ To stop the containers, run: ## Buildfarm Manager -You can now easily launch a new Buildfarm cluster locally or in AWS using an open sourced Buildfarm Manager. +You can now easily launch a new Buildfarm cluster locally or in AWS using an open sourced [Buildfarm Manager](https://github.com/80degreeswest/bfmgr). ``` wget https://github.com/80degreeswest/bfmgr/releases/download/1.0.7/bfmgr-1.0.7.jar From 74455c872fad0f3f43fe4bad0d13b1c9fa3c144d Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 5 Jun 2023 23:07:27 -0400 Subject: [PATCH 003/214] Update worker image tag to jammy-java11-gcc (#1362) --- BUILD | 4 ++-- images.bzl | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/BUILD b/BUILD index 380d6b8564..f552ea9d7b 100644 --- a/BUILD +++ b/BUILD @@ -148,14 +148,14 @@ oss_audit( # Download cgroup-tools so that the worker is able to restrict actions via control groups. download_pkgs( name = "worker_pkgs", - image_tar = "@ubuntu-bionic//image", + image_tar = "@ubuntu-jammy//image", packages = ["cgroup-tools"], tags = ["container"], ) install_pkgs( name = "worker_pkgs_image", - image_tar = "@ubuntu-bionic//image", + image_tar = "@ubuntu-jammy//image", installables_tar = ":worker_pkgs.tar", installation_cleanup_commands = "rm -rf /var/lib/apt/lists/*", output_image_name = "worker_pkgs_image", diff --git a/images.bzl b/images.bzl index 89d5fd22da..9ab0a8b0b7 100644 --- a/images.bzl +++ b/images.bzl @@ -34,6 +34,14 @@ def buildfarm_images(): tag = "bionic-java11-gcc", ) + container_pull( + name = "ubuntu-jammy", + digest = "sha256:da847ee259ebe7f00631a2f0146d9add60ff0f94b031a2e522ce94c78b1335c2", + registry = "index.docker.io", + repository = "bazelbuild/buildfarm-worker-base", + tag = "jammy-java11-gcc", + ) + container_pull( name = "amazon_corretto_java_image_base", registry = "index.docker.io", From 0f512d36ba2cff602d8d334b262ca6786d0ae6e6 Mon Sep 17 00:00:00 2001 From: "Jacob(Jianqiu) Mou" <54453872+jacobmou@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:34:03 -0400 Subject: [PATCH 004/214] [docs]Update troubleshooting-bazel-remote-execution.md (#1361) --- _site/docs/tools/troubleshooting-bazel-remote-execution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_site/docs/tools/troubleshooting-bazel-remote-execution.md b/_site/docs/tools/troubleshooting-bazel-remote-execution.md index 3c18e9432c..0d8661561e 100644 --- a/_site/docs/tools/troubleshooting-bazel-remote-execution.md +++ b/_site/docs/tools/troubleshooting-bazel-remote-execution.md @@ -11,7 +11,7 @@ A typical use case: Something works locally, but breaks when remote execution is ## bazel logging -Use `bazel [build|run|test] --experimental_remote_grpc_log=` to produce a binary log of all of the grpc activity bazel performs during an invocation. This log is written to at the completion of each request, and may not contain a complete picture if a build is interrupted, or a request is currently ongoing. +Use `bazel [build|run|test] --remote_grpc_log=` (`--experimental_remote_grpc_log=` if you are using bazel older than 6.0 release) to produce a binary log of all of the grpc activity bazel performs during an invocation. This log is written to at the completion of each request, and may not contain a complete picture if a build is interrupted, or a request is currently ongoing. ## Dumping the log From bb6ba79abb543eb4cd72dcf5ac8c640838e7e15b Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 13 Jun 2023 00:37:42 -0400 Subject: [PATCH 005/214] Remove unused ActionAmounts (#1366) --- .../build/buildfarm/instance/shard/RedisShardBackplane.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 5c5e06d01a..d4c239efe1 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -122,12 +122,6 @@ public class RedisShardBackplane implements Backplane { .add(PreconditionFailure.getDescriptor()) .build()); - private static class ActionAmounts { - Integer build = 0; - Integer test = 0; - Integer unknown = 0; - } - private final String source; // used in operation change publication private final Function onPublish; private final Function onComplete; From c084fa17c9cc41ae47a32b52696e41c860f614e6 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 14 Jun 2023 08:04:59 -0400 Subject: [PATCH 006/214] Correct executeWorkers removal and expire (#1367) Removed short circuit for executeWorkers which should never inspire publish Added memoized recentExecuteWorkers which will be delayed by currently const workerSetMaxAge Cleaned up getStorageWorkers, used grpc Deadline as premium, though already expired is awkward Storage removal is overzealous and will remove matching execute workers. Received worker changes continue to only affect storage. --- .../instance/shard/RedisShardBackplane.java | 89 +++++++++++++------ 1 file changed, 61 insertions(+), 28 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index d4c239efe1..681cda1325 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -15,6 +15,7 @@ package build.buildfarm.instance.shard; import static java.lang.String.format; +import static java.util.concurrent.TimeUnit.SECONDS; import build.bazel.remote.execution.v2.ActionResult; import build.bazel.remote.execution.v2.Digest; @@ -56,6 +57,8 @@ import build.buildfarm.v1test.ShardWorker; import build.buildfarm.v1test.WorkerChange; import build.buildfarm.v1test.WorkerType; +import com.google.common.base.Suppliers; +import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; @@ -73,6 +76,7 @@ import com.google.rpc.Code; import com.google.rpc.PreconditionFailure; import com.google.rpc.Status; +import io.grpc.Deadline; import java.io.IOException; import java.time.Instant; import java.util.ArrayList; @@ -83,7 +87,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -99,6 +102,7 @@ public class RedisShardBackplane implements Backplane { private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); + private static final int workerSetMaxAge = 3; // seconds private static final JsonFormat.Parser operationParser = JsonFormat.parser() .usingTypeRegistry( @@ -135,8 +139,9 @@ public class RedisShardBackplane implements Backplane { private ExecutorService subscriberService = null; private @Nullable RedisClient client = null; + private Deadline storageWorkersDeadline = null; private final Set storageWorkerSet = Collections.synchronizedSet(new HashSet<>()); - private long workerSetExpiresAt = 0; + private final Supplier> recentExecuteWorkers; private DistributedState state = new DistributedState(); @@ -157,6 +162,17 @@ public RedisShardBackplane( this.onPublish = onPublish; this.onComplete = onComplete; this.jedisClusterFactory = jedisClusterFactory; + recentExecuteWorkers = + Suppliers.memoizeWithExpiration( + () -> { + try { + return client.call(this::fetchAndExpireExecuteWorkers); + } catch (IOException e) { + throw new RuntimeException(e); + } + }, + workerSetMaxAge, + SECONDS); } @SuppressWarnings("NullableProblems") @@ -477,7 +493,7 @@ private void startFailsafeOperationThread() { () -> { while (!Thread.currentThread().isInterrupted()) { try { - TimeUnit.SECONDS.sleep(10); + SECONDS.sleep(10); client.run(this::updateWatchers); } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -530,7 +546,7 @@ public synchronized void stop() throws InterruptedException { } if (subscriberService != null) { subscriberService.shutdown(); - subscriberService.awaitTermination(10, TimeUnit.SECONDS); + subscriberService.awaitTermination(10, SECONDS); log.log(Level.FINE, "subscriberService has been stopped"); } if (client != null) { @@ -597,12 +613,14 @@ private boolean addWorkerByType(JedisCluster jedis, ShardWorker shardWorker, Str return result; } - private boolean removeWorkerAndPublish(JedisCluster jedis, String name, String changeJson) { - if (state.storageWorkers.remove(jedis, name) || state.executeWorkers.remove(jedis, name)) { + private boolean removeWorkerAndPublish( + JedisCluster jedis, String name, String changeJson, boolean storage) { + boolean removedAny = state.executeWorkers.remove(jedis, name); + if (storage && state.storageWorkers.remove(jedis, name)) { jedis.publish(configs.getBackplane().getWorkerChannel(), changeJson); return true; } - return false; + return removedAny; } @SuppressWarnings("ConstantConditions") @@ -615,7 +633,8 @@ public boolean removeWorker(String name, String reason) throws IOException { .build(); String workerChangeJson = JsonFormat.printer().print(workerChange); return subscriber.removeWorker(name) - && client.call(jedis -> removeWorkerAndPublish(jedis, name, workerChangeJson)); + && client.call( + jedis -> removeWorkerAndPublish(jedis, name, workerChangeJson, /* storage=*/ true)); } @SuppressWarnings("ConstantConditions") @@ -665,20 +684,26 @@ public void deregisterWorker(String workerName) throws IOException { @SuppressWarnings("ConstantConditions") @Override public synchronized Set getStorageWorkers() throws IOException { - long now = System.currentTimeMillis(); - if (now < workerSetExpiresAt) { - return new HashSet<>(storageWorkerSet); + if (storageWorkersDeadline == null || storageWorkersDeadline.isExpired()) { + synchronized (storageWorkerSet) { + Set newWorkerSet = client.call(jedis -> fetchAndExpireStorageWorkers(jedis)); + storageWorkerSet.clear(); + storageWorkerSet.addAll(newWorkerSet); + } + storageWorkersDeadline = Deadline.after(workerSetMaxAge, SECONDS); } + return new HashSet<>(storageWorkerSet); + } - synchronized (storageWorkerSet) { - Set newWorkerSet = client.call(jedis -> fetchAndExpireStorageWorkers(jedis, now)); - storageWorkerSet.clear(); - storageWorkerSet.addAll(newWorkerSet); + private synchronized Set getExecuteWorkers() throws IOException { + try { + return recentExecuteWorkers.get(); + } catch (RuntimeException e) { + // unwrap checked exception mask + Throwable cause = e.getCause(); + Throwables.throwIfInstanceOf(cause, IOException.class); + throw e; } - - // fetch every 3 seconds - workerSetExpiresAt = now + 3000; - return new HashSet<>(storageWorkerSet); } // When performing a graceful scale down of workers, the backplane can provide worker names to the @@ -701,7 +726,8 @@ public static List randomN(List list, int n) { .collect(Collectors.toList()); } - private void removeInvalidWorkers(JedisCluster jedis, long testedAt, List workers) { + private void removeInvalidWorkers( + JedisCluster jedis, long testedAt, List workers, boolean storage) { if (!workers.isEmpty()) { for (ShardWorker worker : workers) { String name = worker.getEndpoint(); @@ -716,7 +742,7 @@ private void removeInvalidWorkers(JedisCluster jedis, long testedAt, List fetchAndExpireStorageWorkers(JedisCluster jedis, long now) { + private Set fetchAndExpireStorageWorkers(JedisCluster jedis) { + return fetchAndExpireWorkers(jedis, state.storageWorkers.asMap(jedis), /* storage=*/ true); + } + + private Set fetchAndExpireExecuteWorkers(JedisCluster jedis) { + return fetchAndExpireWorkers(jedis, state.executeWorkers.asMap(jedis), /* storage=*/ false); + } + + private Set fetchAndExpireWorkers( + JedisCluster jedis, Map workers, boolean publish) { + long now = System.currentTimeMillis(); Set returnWorkers = Sets.newConcurrentHashSet(); ImmutableList.Builder invalidWorkers = ImmutableList.builder(); - for (Map.Entry entry : state.storageWorkers.asMap(jedis).entrySet()) { + for (Map.Entry entry : workers.entrySet()) { String json = entry.getValue(); String name = entry.getKey(); try { @@ -747,7 +783,7 @@ private Set fetchAndExpireStorageWorkers(JedisCluster jedis, long now) { invalidWorkers.add(ShardWorker.newBuilder().setEndpoint(name).build()); } } - removeInvalidWorkers(jedis, now, invalidWorkers.build()); + removeInvalidWorkers(jedis, now, invalidWorkers.build(), publish); return returnWorkers; } @@ -1390,10 +1426,7 @@ public boolean canPrequeue() throws IOException { @Override public BackplaneStatus backplaneStatus() throws IOException { BackplaneStatus.Builder builder = BackplaneStatus.newBuilder(); - builder.addAllActiveWorkers( - client.call( - jedis -> - Sets.union(state.executeWorkers.keys(jedis), state.storageWorkers.keys(jedis)))); + builder.addAllActiveWorkers(Sets.union(getExecuteWorkers(), getStorageWorkers())); builder.setDispatchedSize(client.call(jedis -> state.dispatchedOperations.size(jedis))); builder.setOperationQueue(state.operationQueue.status(client.call(jedis -> jedis))); builder.setPrequeue(state.prequeue.status(client.call(jedis -> jedis))); From d0b1d1df9df0f5ba50e0cb2bc2389beb699e6f9e Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 14 Jun 2023 22:57:18 -0400 Subject: [PATCH 007/214] Adjust Server/Worker configs after parser (#1370) Adjustments will make use of options. Ensure that they have the specified values from the commandline, and they have no checked exception throws. --- .../java/build/buildfarm/common/config/BuildfarmConfigs.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 081722cbac..432a11a90a 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -68,7 +68,6 @@ public static BuildfarmConfigs loadServerConfigs(String[] args) throws Configura ServerOptions options = parser.getOptions(ServerOptions.class); try { buildfarmConfigs = loadConfigs(getConfigurationPath(parser)); - adjustServerConfigs(buildfarmConfigs); } catch (IOException e) { log.severe("Could not parse yml configuration file." + e); throw new RuntimeException(e); @@ -79,6 +78,7 @@ public static BuildfarmConfigs loadServerConfigs(String[] args) throws Configura if (options.port > 0) { buildfarmConfigs.getServer().setPort(options.port); } + adjustServerConfigs(buildfarmConfigs); return buildfarmConfigs; } @@ -87,7 +87,6 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura ShardWorkerOptions options = parser.getOptions(ShardWorkerOptions.class); try { buildfarmConfigs = loadConfigs(getConfigurationPath(parser)); - adjustWorkerConfigs(buildfarmConfigs); } catch (IOException e) { log.severe("Could not parse yml configuration file." + e); throw new RuntimeException(e); @@ -95,6 +94,7 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura if (!Strings.isNullOrEmpty(options.publicName)) { buildfarmConfigs.getWorker().setPublicName(options.publicName); } + adjustWorkerConfigs(buildfarmConfigs); return buildfarmConfigs; } From d953f424708af7a567f202ffbe61a39eb6d12af3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 17 Jun 2023 22:21:54 -0400 Subject: [PATCH 008/214] Handle oversized FMBs in StubInstance by splitting (#1377) FMBs over a specified size limit (4MB in practice from grpc limits) will be split log2n until under the limit to make requests. Tests added to verify this. Coverage of split behavior confirmed. Fixes #1375 --- .../buildfarm/instance/stub/StubInstance.java | 24 ++++++++++--- .../instance/stub/StubInstanceTest.java | 35 ++++++++++++++++++- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/stub/StubInstance.java b/src/main/java/build/buildfarm/instance/stub/StubInstance.java index 0cde9a0d41..219e5d54ec 100644 --- a/src/main/java/build/buildfarm/instance/stub/StubInstance.java +++ b/src/main/java/build/buildfarm/instance/stub/StubInstance.java @@ -18,6 +18,7 @@ import static build.buildfarm.common.grpc.TracingMetadataUtils.attachMetadataInterceptor; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import static com.google.common.util.concurrent.Futures.allAsList; import static com.google.common.util.concurrent.Futures.catching; import static com.google.common.util.concurrent.Futures.transform; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; @@ -105,6 +106,7 @@ import com.google.bytestream.ByteStreamGrpc.ByteStreamStub; import com.google.bytestream.ByteStreamProto.ReadRequest; import com.google.bytestream.ByteStreamProto.ReadResponse; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Functions; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; @@ -164,6 +166,8 @@ public class StubInstance implements Instance { private boolean isStopped = false; private final long maxBatchUpdateBlobsSize = Size.mbToBytes(3); + @VisibleForTesting long maxRequestSize = Size.mbToBytes(4); + public StubInstance(String name, DigestUtil digestUtil, ManagedChannel channel) { this(name, "no-identifier", digestUtil, channel, Durations.fromDays(DEFAULT_DEADLINE_DAYS)); } @@ -412,11 +416,16 @@ public ListenableFuture> findMissingBlobs( .setInstanceName(getName()) .addAllBlobDigests(digests) .build(); - if (request.getSerializedSize() > Size.mbToBytes(4)) { - throw new IllegalStateException( - String.format( - "FINDMISSINGBLOBS IS TOO LARGE: %d digests are required in one request!", - request.getBlobDigestsCount())); + if (request.getSerializedSize() > maxRequestSize) { + // log2n partition for size reduction as needed + int partitionSize = (request.getBlobDigestsCount() + 1) / 2; + return transform( + allAsList( + Iterables.transform( + Iterables.partition(digests, partitionSize), + subDigests -> findMissingBlobs(subDigests, requestMetadata))), + subMissings -> Iterables.concat(subMissings), + directExecutor()); } return transform( deadlined(casFutureStub) @@ -586,6 +595,7 @@ public void getBlob( ServerCallStreamObserver blobObserver, RequestMetadata requestMetadata) { throwIfStopped(); + checkNotNull(io.grpc.Context.current().getDeadline()); bsStub .get() .withInterceptors(attachMetadataInterceptor(requestMetadata)) @@ -886,6 +896,7 @@ public WorkerProfileMessage getWorkerProfile() { @Override public WorkerListMessage getWorkerList() { + checkNotNull(io.grpc.Context.current().getDeadline()); return workerProfileBlockingStub.get().getWorkerList(WorkerListRequest.newBuilder().build()); } @@ -897,6 +908,7 @@ public GetClientStartTimeResult getClientStartTime(GetClientStartTimeRequest req @Override public CasIndexResults reindexCas() { throwIfStopped(); + checkNotNull(io.grpc.Context.current().getDeadline()); ReindexCasRequestResults proto = adminBlockingStub.get().reindexCas(ReindexCasRequest.newBuilder().build()); CasIndexResults results = new CasIndexResults(); @@ -910,6 +922,7 @@ public CasIndexResults reindexCas() { @Override public void deregisterWorker(String workerName) { throwIfStopped(); + checkNotNull(io.grpc.Context.current().getDeadline()); adminBlockingStub .get() .shutDownWorkerGracefully( @@ -919,6 +932,7 @@ public void deregisterWorker(String workerName) { @Override public PrepareWorkerForGracefulShutDownRequestResults shutDownWorkerGracefully() { throwIfStopped(); + checkNotNull(io.grpc.Context.current().getDeadline()); return shutDownWorkerBlockingStub .get() .prepareWorkerForGracefulShutdown( diff --git a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java index e50e3f0028..e3845494b8 100644 --- a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java @@ -64,6 +64,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -98,7 +99,7 @@ public void tearDown() throws InterruptedException { fakeServer.awaitTermination(); } - private Instance newStubInstance(String instanceName) { + private StubInstance newStubInstance(String instanceName) { return new StubInstance( instanceName, DIGEST_UTIL, @@ -197,6 +198,38 @@ public void findMissingBlobs( instance.stop(); } + @Test + public void findMissingBlobsOverSizeLimitRecombines() + throws ExecutionException, InterruptedException { + AtomicReference reference = new AtomicReference<>(); + serviceRegistry.addService( + new ContentAddressableStorageImplBase() { + @Override + public void findMissingBlobs( + FindMissingBlobsRequest request, + StreamObserver responseObserver) { + reference.set(request); + responseObserver.onNext( + FindMissingBlobsResponse.newBuilder() + .addAllMissingBlobDigests(request.getBlobDigestsList()) + .build()); + responseObserver.onCompleted(); + } + }); + StubInstance instance = newStubInstance("findMissingBlobs-test"); + instance.maxRequestSize = 1024; + ImmutableList.Builder builder = ImmutableList.builder(); + // generates digest size * 1024 serialized size at least + for (int i = 0; i < 1024; i++) { + ByteString content = ByteString.copyFromUtf8("Hello, World! " + UUID.randomUUID()); + builder.add(DIGEST_UTIL.compute(content)); + } + ImmutableList digests = builder.build(); + assertThat(instance.findMissingBlobs(digests, RequestMetadata.getDefaultInstance()).get()) + .containsExactlyElementsIn(digests); + instance.stop(); + } + @Test public void outputStreamWrites() throws IOException, InterruptedException { AtomicReference writtenContent = new AtomicReference<>(); From dd52f13072384eff5c15d35c0a3c4cf2f4bf50cf Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 18 Jun 2023 10:29:13 -0400 Subject: [PATCH 009/214] Missing directories not visited in validation (#1378) A directory which is missing during the course of validation should not be identified as missing. This prevents a NPE and inspires validation to emit one MISSING violation per path to a missing directory for preconditions. Fixes #1374 --- .../server/AbstractServerInstance.java | 5 +- .../server/AbstractServerInstanceTest.java | 47 ++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java index 388c18ab77..52cb1448e6 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java @@ -934,7 +934,10 @@ private static void validateActionInputDirectoryDigest( preconditionFailure); } pathDigests.pop(); - visited.add(directoryDigest); + if (directory != null) { + // missing directories are not visited and will appear in violations list each time + visited.add(directoryDigest); + } } protected ListenableFuture getTreeFuture( diff --git a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java index f8e46e5d0f..dcd4936c1f 100644 --- a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java @@ -16,6 +16,7 @@ import static build.buildfarm.common.Actions.checkPreconditionFailure; import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; +import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; import static build.buildfarm.instance.server.AbstractServerInstance.ACTION_INPUT_ROOT_DIRECTORY_PATH; import static build.buildfarm.instance.server.AbstractServerInstance.DIRECTORY_NOT_SORTED; import static build.buildfarm.instance.server.AbstractServerInstance.DUPLICATE_DIRENT; @@ -365,7 +366,6 @@ public void duplicateDirectoryInputIsInvalid() { /* onInputDigests=*/ digest -> {}, preconditionFailure); - assertThat(preconditionFailure.getViolationsCount()).isEqualTo(1); assertThat(preconditionFailure.getViolationsCount()).isEqualTo(1); Violation violation = preconditionFailure.getViolationsList().get(0); assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_INVALID); @@ -519,6 +519,51 @@ public void undeclaredWorkingDirectoryIsInvalid() { assertThat(violation.getDescription()).isEqualTo("working directory is not an input directory"); } + /** + * / -> valid dir bar/ -> missing dir with digest 'missing' and non-zero size foo/ -> missing dir + * with digest 'missing' and non-zero size + */ + @Test + public void multipleIdenticalDirectoryMissingAreAllPreconditionFailures() { + Digest missingDirectoryDigest = Digest.newBuilder().setHash("missing").setSizeBytes(1).build(); + PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); + Directory root = + Directory.newBuilder() + .addAllDirectories( + ImmutableList.of( + DirectoryNode.newBuilder() + .setName("bar") + .setDigest(missingDirectoryDigest) + .build(), + DirectoryNode.newBuilder() + .setName("foo") + .setDigest(missingDirectoryDigest) + .build())) + .build(); + AbstractServerInstance.validateActionInputDirectory( + ACTION_INPUT_ROOT_DIRECTORY_PATH, + root, + /* pathDigests=*/ new Stack<>(), + /* visited=*/ Sets.newHashSet(), + /* directoriesIndex=*/ ImmutableMap.of(), + /* onInputFiles=*/ file -> {}, + /* onInputDirectories=*/ directory -> {}, + /* onInputDigests=*/ digest -> {}, + preconditionFailure); + + String missingSubject = "blobs/" + DigestUtil.toString(missingDirectoryDigest); + String missingFmt = "The directory `/%s` was not found in the CAS."; + assertThat(preconditionFailure.getViolationsCount()).isEqualTo(2); + Violation violation = preconditionFailure.getViolationsList().get(0); + assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_MISSING); + assertThat(violation.getSubject()).isEqualTo(missingSubject); + assertThat(violation.getDescription()).isEqualTo(String.format(missingFmt, "bar")); + violation = preconditionFailure.getViolationsList().get(1); + assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_MISSING); + assertThat(violation.getSubject()).isEqualTo(missingSubject); + assertThat(violation.getDescription()).isEqualTo(String.format(missingFmt, "foo")); + } + @SuppressWarnings("unchecked") private static void doBlob( ContentAddressableStorage contentAddressableStorage, From 212e8a55c437d0e42991e462435895758e8a5fb8 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 18 Jun 2023 12:24:13 -0400 Subject: [PATCH 010/214] Guard directory revisit with empty/missing checks (#1379) Directories reevaluated only under the enumeration hierarchy must still be guarded against empty child directories in their checks, and must handle child directories missing in the index safely, with precondition failures matching their outputs. Order is not guaranteed in precondition output, but tests now guard this case. Fixes #1299 --- .../server/AbstractServerInstance.java | 38 ++++++++--- .../server/AbstractServerInstanceTest.java | 68 ++++++++++++++++++- 2 files changed, 94 insertions(+), 12 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java index 52cb1448e6..95b737725b 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java @@ -739,7 +739,8 @@ private static void enumerateActionInputDirectory( Directory directory, Map directoriesIndex, Consumer onInputFile, - Consumer onInputDirectory) { + Consumer onInputDirectory, + PreconditionFailure.Builder preconditionFailure) { Stack directoriesStack = new Stack<>(); directoriesStack.addAll(directory.getDirectoriesList()); @@ -751,15 +752,29 @@ private static void enumerateActionInputDirectory( directoryPath.isEmpty() ? directoryName : (directoryPath + "/" + directoryName); onInputDirectory.accept(subDirectoryPath); - for (FileNode fileNode : directoriesIndex.get(directoryDigest).getFilesList()) { - String fileName = fileNode.getName(); - String filePath = subDirectoryPath + "/" + fileName; - onInputFile.accept(filePath); + Directory subDirectory; + if (directoryDigest.getSizeBytes() == 0) { + subDirectory = Directory.getDefaultInstance(); + } else { + subDirectory = directoriesIndex.get(directoryDigest); } - for (DirectoryNode subDirectoryNode : - directoriesIndex.get(directoryDigest).getDirectoriesList()) { - directoriesStack.push(subDirectoryNode); + if (subDirectory == null) { + preconditionFailure + .addViolationsBuilder() + .setType(VIOLATION_TYPE_MISSING) + .setSubject("blobs/" + DigestUtil.toString(directoryDigest)) + .setDescription("The directory `/" + subDirectoryPath + "` was not found in the CAS."); + } else { + for (FileNode fileNode : subDirectory.getFilesList()) { + String fileName = fileNode.getName(); + String filePath = subDirectoryPath + "/" + fileName; + onInputFile.accept(filePath); + } + + for (DirectoryNode subDirectoryNode : subDirectory.getDirectoriesList()) { + directoriesStack.push(subDirectoryNode); + } } } } @@ -881,7 +896,12 @@ public static void validateActionInputDirectory( subDirectory = directoriesIndex.get(directoryDigest); } enumerateActionInputDirectory( - subDirectoryPath, subDirectory, directoriesIndex, onInputFile, onInputDirectory); + subDirectoryPath, + subDirectory, + directoriesIndex, + onInputFile, + onInputDirectory, + preconditionFailure); } else { validateActionInputDirectoryDigest( subDirectoryPath, diff --git a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java index dcd4936c1f..add9136633 100644 --- a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java @@ -519,9 +519,10 @@ public void undeclaredWorkingDirectoryIsInvalid() { assertThat(violation.getDescription()).isEqualTo("working directory is not an input directory"); } - /** - * / -> valid dir bar/ -> missing dir with digest 'missing' and non-zero size foo/ -> missing dir - * with digest 'missing' and non-zero size + /*- + * / -> valid dir + * bar/ -> missing dir with digest 'missing' and non-zero size + * foo/ -> missing dir with digest 'missing' and non-zero size */ @Test public void multipleIdenticalDirectoryMissingAreAllPreconditionFailures() { @@ -564,6 +565,67 @@ public void multipleIdenticalDirectoryMissingAreAllPreconditionFailures() { assertThat(violation.getDescription()).isEqualTo(String.format(missingFmt, "foo")); } + /*- + * / -> valid dir + * bar/ -> valid dir + * baz/ -> missing dir with digest 'missing-empty' and zero size + * quux/ -> missing dir with digest 'missing' and non-zero size + * foo/ -> valid dir with digest from /bar/, making it a copy of above + * + * Only duplicated-bar appears in the index + * Empty directory needs short circuit in all cases + * Result should be 2 missing directory paths, no errors + */ + @Test + public void validationRevisitReplicatesPreconditionFailures() { + Digest missingEmptyDirectoryDigest = Digest.newBuilder().setHash("missing-empty").build(); + Digest missingDirectoryDigest = Digest.newBuilder().setHash("missing").setSizeBytes(1).build(); + Directory foo = + Directory.newBuilder() + .addAllDirectories( + ImmutableList.of( + DirectoryNode.newBuilder() + .setName("baz") + .setDigest(missingEmptyDirectoryDigest) + .build(), + DirectoryNode.newBuilder() + .setName("quux") + .setDigest(missingDirectoryDigest) + .build())) + .build(); + Digest fooDigest = DIGEST_UTIL.compute(foo); + PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); + Directory root = + Directory.newBuilder() + .addAllDirectories( + ImmutableList.of( + DirectoryNode.newBuilder().setName("bar").setDigest(fooDigest).build(), + DirectoryNode.newBuilder().setName("foo").setDigest(fooDigest).build())) + .build(); + AbstractServerInstance.validateActionInputDirectory( + ACTION_INPUT_ROOT_DIRECTORY_PATH, + root, + /* pathDigests=*/ new Stack<>(), + /* visited=*/ Sets.newHashSet(), + /* directoriesIndex=*/ ImmutableMap.of(fooDigest, foo), + /* onInputFiles=*/ file -> {}, + /* onInputDirectories=*/ directory -> {}, + /* onInputDigests=*/ digest -> {}, + preconditionFailure); + + String missingSubject = "blobs/" + DigestUtil.toString(missingDirectoryDigest); + String missingFmt = "The directory `/%s` was not found in the CAS."; + assertThat(preconditionFailure.getViolationsCount()).isEqualTo(2); + Violation violation = preconditionFailure.getViolationsList().get(0); + assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_MISSING); + assertThat(violation.getSubject()).isEqualTo(missingSubject); + assertThat(violation.getDescription()).isEqualTo(String.format(missingFmt, "bar/quux")); + violation = preconditionFailure.getViolationsList().get(1); + assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_MISSING); + assertThat(violation.getSubject()).isEqualTo(missingSubject); + assertThat(violation.getDescription()).isEqualTo(String.format(missingFmt, "foo/quux")); + } + @SuppressWarnings("unchecked") private static void doBlob( ContentAddressableStorage contentAddressableStorage, From fe0fe8b5ffe51b661ab64933f4a76b4c68a01d02 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 18 Jun 2023 13:26:31 -0400 Subject: [PATCH 011/214] Output additions to RequestMetadata (#1380) Include Action Mnemonic, Target Id, and Configuration Id in the bf-cat output suite for RequestMetadata. --- src/main/java/build/buildfarm/tools/Cat.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/build/buildfarm/tools/Cat.java b/src/main/java/build/buildfarm/tools/Cat.java index b8008e434a..399ca7f1fb 100644 --- a/src/main/java/build/buildfarm/tools/Cat.java +++ b/src/main/java/build/buildfarm/tools/Cat.java @@ -483,6 +483,9 @@ private static void printRequestMetadata(RequestMetadata metadata) { System.out.println("ActionId: " + metadata.getActionId()); System.out.println("ToolInvocationId: " + metadata.getToolInvocationId()); System.out.println("CorrelatedInvocationsId: " + metadata.getCorrelatedInvocationsId()); + System.out.println("ActionMnemonic: " + metadata.getActionMnemonic()); + System.out.println("TargetId: " + metadata.getTargetId()); + System.out.println("ConfigurationId: " + metadata.getConfigurationId()); } private static void printStatus(com.google.rpc.Status status) From 5a1747dac027d4f021b3400619eaee8e2d068973 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 20 Jun 2023 14:51:18 -0400 Subject: [PATCH 012/214] SEVERE for app.run failure (#1382) An invocation of app.run which fails for any reason in the spring framework will exit silently. Ensure that errors are presented before exiting the application. --- src/main/java/build/buildfarm/server/BuildFarmServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index 76b36d5366..d0d26a6f52 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -218,6 +218,10 @@ public static void main(String[] args) throws ConfigurationException { springConfig.put("server.port", configs.getUi().getPort()); app.setDefaultProperties(springConfig); - app.run(args); + try { + app.run(args); + } catch (Throwable t) { + log.log(SEVERE, "Error running application", t); + } } } From e99878b76b663c9bb78e056946864a5603428317 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Wed, 21 Jun 2023 12:25:06 -0700 Subject: [PATCH 013/214] Enable custom latency buckets (#1376) * Enable custom latency buckets * run formatter * Remove unused load from build * Run buildifier * update example config with infinity bucket --------- Co-authored-by: Trevor Hickey --- examples/config.yml | 6 ++- .../buildfarm/common/config/GrpcMetrics.java | 8 +++- .../java/build/buildfarm/common/config/BUILD | 13 +++++++ .../common/config/GrpcMetricsTest.java | 37 +++++++++++++++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 src/test/java/build/buildfarm/common/config/BUILD create mode 100644 src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java diff --git a/examples/config.yml b/examples/config.yml index bdd92e6697..3c435fccc7 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -9,8 +9,9 @@ server: actionCacheReadOnly: false port: 8980 grpcMetrics: - enabled: false - provideLatencyHistograms: false + enabled: true + provideLatencyHistograms: true + latencyBuckets: [0.001, 0.01, 0.1, 1, 5, 10, 20, 40, 60, +Infinity] maxInboundMessageSizeBytes: 0 maxInboundMetadataSize: 0 casWriteTimeout: 3600 @@ -93,6 +94,7 @@ worker: grpcMetrics: enabled: false provideLatencyHistograms: false + latencyBuckets: [0.001, 0.005, 0.01, 0.05, 0.075, 0.1, 0.25, 0.5, 1.0, 2.0, 5.0, 10.0] capabilities: cas: true execution: true diff --git a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java index cdd8f05f30..a028035673 100644 --- a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java +++ b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java @@ -9,6 +9,7 @@ public class GrpcMetrics { private boolean enabled = false; private boolean provideLatencyHistograms = false; + private double[] latencyBuckets; public static void handleGrpcMetricIntercepts( ServerBuilder serverBuilder, GrpcMetrics grpcMetrics) { @@ -21,7 +22,12 @@ public static void handleGrpcMetricIntercepts( // Enable latency buckets. if (grpcMetrics.isProvideLatencyHistograms()) { - grpcConfig = grpcConfig.allMetrics(); + grpcConfig = Configuration.allMetrics(); + } + + // provide custom latency buckets + if (grpcMetrics.getLatencyBuckets() != null) { + grpcConfig.withLatencyBuckets(grpcMetrics.getLatencyBuckets()); } // Apply config to create an interceptor and apply it to the GRPC server. diff --git a/src/test/java/build/buildfarm/common/config/BUILD b/src/test/java/build/buildfarm/common/config/BUILD new file mode 100644 index 0000000000..4819a6bca8 --- /dev/null +++ b/src/test/java/build/buildfarm/common/config/BUILD @@ -0,0 +1,13 @@ +java_test( + name = "tests", + srcs = glob(["*Test.java"]), + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/common/config", + "//src/test/java/build/buildfarm:test_runner", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_testing", + "@maven//:me_dinowernli_java_grpc_prometheus", + "@maven//:org_mockito_mockito_core", + ], +) diff --git a/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java b/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java new file mode 100644 index 0000000000..5301b82608 --- /dev/null +++ b/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java @@ -0,0 +1,37 @@ +package build.buildfarm.common.config; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import io.grpc.ServerBuilder; +import me.dinowernli.grpc.prometheus.MonitoringServerInterceptor; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class GrpcMetricsTest { + @Mock private ServerBuilder serverBuilder; + private final GrpcMetrics grpcMetrics = new GrpcMetrics(); + + @Test + public void testHandleGrpcMetricIntercepts_disabled() { + grpcMetrics.setEnabled(false); + + GrpcMetrics.handleGrpcMetricIntercepts(serverBuilder, grpcMetrics); + verify(serverBuilder, never()).intercept(any(MonitoringServerInterceptor.class)); + } + + @Test + public void testHandleGrpcMetricIntercepts_withLatencyBucket() { + grpcMetrics.setEnabled(true); + grpcMetrics.setProvideLatencyHistograms(true); + grpcMetrics.setLatencyBuckets(new double[] {1, 2, 3}); + + GrpcMetrics.handleGrpcMetricIntercepts(serverBuilder, grpcMetrics); + verify(serverBuilder, times(1)).intercept(any(MonitoringServerInterceptor.class)); + } +} From 3d72cbdad63c96a87396462f44d14036f2563c2b Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 21 Jun 2023 17:06:37 -0400 Subject: [PATCH 014/214] Require fileStore for Directories interactions (#1385) Avoid fileStore recalculation for entire trees to be deleted, instead expect the callers to provide a fileStore, and that the entire tree exists within it. --- .../build/buildfarm/cas/cfc/CASFileCache.java | 12 +++++----- .../buildfarm/common/io/Directories.java | 23 ++++++++++--------- .../worker/shard/CFCExecFileSystem.java | 14 +++++++---- .../buildfarm/cas/cfc/CASFileCacheTest.java | 3 ++- .../buildfarm/common/io/DirectoriesTest.java | 19 +++++++++++---- .../build/buildfarm/common/io/UtilsTest.java | 3 ++- 6 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index e0af926bc3..f570b300f3 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -1271,7 +1271,7 @@ public StartupCacheResults start( loadResults = loadCache(onStartPut, removeDirectoryService); } else { // Skip loading the cache and ensure it is empty - Directories.remove(root, removeDirectoryService); + Directories.remove(root, fileStore, removeDirectoryService); initializeRootDirectory(); } @@ -1336,7 +1336,7 @@ private void deleteInvalidFileContent(List files, ExecutorService removeDi try { for (Path path : files) { if (Files.isDirectory(path)) { - Directories.remove(path, removeDirectoryService); + Directories.remove(path, fileStore, removeDirectoryService); } else { Files.delete(path); } @@ -1936,7 +1936,7 @@ private ListenableFuture expireDirectory(Digest digest, ExecutorService se return immediateFuture(null); } - return Directories.remove(getDirectoryPath(digest), service); + return Directories.remove(getDirectoryPath(digest), fileStore, service); } @SuppressWarnings("ConstantConditions") @@ -2062,7 +2062,7 @@ private void removeFilePath(Path path) throws IOException { if (Files.exists(path)) { if (Files.isDirectory(path)) { log.log(Level.FINE, "removing existing directory " + path + " for fetch"); - Directories.remove(path); + Directories.remove(path, fileStore); } else { Files.delete(path); } @@ -2295,7 +2295,7 @@ private ListenableFuture putDirectorySynchronized( fetchFuture, (result) -> { try { - disableAllWriteAccess(path); + disableAllWriteAccess(path, fileStore); } catch (IOException e) { log.log(Level.SEVERE, "error while disabling write permissions on " + path, e); return immediateFailedFuture(e); @@ -2326,7 +2326,7 @@ private ListenableFuture putDirectorySynchronized( } try { log.log(Level.FINE, "removing directory to roll back " + path); - Directories.remove(path); + Directories.remove(path, fileStore); } catch (IOException removeException) { log.log( Level.SEVERE, diff --git a/src/main/java/build/buildfarm/common/io/Directories.java b/src/main/java/build/buildfarm/common/io/Directories.java index 9e7b272d70..b861664e25 100644 --- a/src/main/java/build/buildfarm/common/io/Directories.java +++ b/src/main/java/build/buildfarm/common/io/Directories.java @@ -48,8 +48,8 @@ public class Directories { private Directories() {} - private static void makeWritable(Path dir, boolean writable) throws IOException { - FileStore fileStore = Files.getFileStore(dir); + private static void makeWritable(Path dir, boolean writable, FileStore fileStore) + throws IOException { if (fileStore.supportsFileAttributeView("posix")) { if (writable) { Files.setPosixFilePermissions(dir, writablePerms); @@ -82,14 +82,15 @@ private static void makeWritable(Path dir, boolean writable) throws IOException } } - public static ListenableFuture remove(Path path, ExecutorService service) { + public static ListenableFuture remove( + Path path, FileStore fileStore, ExecutorService service) { String suffix = UUID.randomUUID().toString(); Path filename = path.getFileName(); String tmpFilename = filename + ".tmp." + suffix; Path tmpPath = path.resolveSibling(tmpFilename); try { // MacOS does not permit renames unless the directory is permissioned appropriately - makeWritable(path, true); + makeWritable(path, true, fileStore); // rename must be synchronous to call Files.move(path, tmpPath); } catch (IOException e) { @@ -99,7 +100,7 @@ public static ListenableFuture remove(Path path, ExecutorService service) .submit( () -> { try { - remove(tmpPath); + remove(tmpPath, fileStore); } catch (IOException e) { log.log(Level.SEVERE, "error removing directory " + tmpPath, e); } @@ -107,14 +108,14 @@ public static ListenableFuture remove(Path path, ExecutorService service) null); } - public static void remove(Path directory) throws IOException { + public static void remove(Path directory, FileStore fileStore) throws IOException { Files.walkFileTree( directory, new SimpleFileVisitor() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - makeWritable(dir, true); + makeWritable(dir, true, fileStore); return FileVisitResult.CONTINUE; } @@ -158,12 +159,12 @@ public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOExce }); } - public static void disableAllWriteAccess(Path directory) throws IOException { - forAllPostDirs(directory, dir -> makeWritable(dir, false)); + public static void disableAllWriteAccess(Path directory, FileStore fileStore) throws IOException { + forAllPostDirs(directory, dir -> makeWritable(dir, false, fileStore)); } - public static void enableAllWriteAccess(Path directory) throws IOException { - forAllPostDirs(directory, dir -> makeWritable(dir, true)); + public static void enableAllWriteAccess(Path directory, FileStore fileStore) throws IOException { + forAllPostDirs(directory, dir -> makeWritable(dir, true, fileStore)); } public static void setAllOwner(Path directory, UserPrincipal owner) throws IOException { diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index b8400fa8a2..525d696d5c 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -49,6 +49,7 @@ import com.google.common.util.concurrent.ListenableFuture; import java.io.IOException; import java.io.InputStream; +import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.UserPrincipal; @@ -80,6 +81,7 @@ class CFCExecFileSystem implements ExecFileSystem { private final ExecutorService fetchService = BuildfarmExecutors.getFetchServicePool(); private final ExecutorService removeDirectoryService; private final ExecutorService accessRecorder; + private FileStore fileStore; // initialized with start CFCExecFileSystem( Path root, @@ -102,9 +104,10 @@ class CFCExecFileSystem implements ExecFileSystem { @Override public void start(Consumer> onDigests, boolean skipLoad) throws IOException, InterruptedException { + fileStore = Files.getFileStore(root); List dirents = null; try { - dirents = readdir(root, /* followSymlinks= */ false, Files.getFileStore(root)); + dirents = readdir(root, /* followSymlinks= */ false, fileStore); } catch (IOException e) { log.log(Level.SEVERE, "error reading directory " + root.toString(), e); } @@ -116,7 +119,8 @@ public void start(Consumer> onDigests, boolean skipLoad) String name = dirent.getName(); Path child = root.resolve(name); if (!child.equals(fileCache.getRoot())) { - removeDirectoryFutures.add(Directories.remove(root.resolve(name), removeDirectoryService)); + removeDirectoryFutures.add( + Directories.remove(root.resolve(name), fileStore, removeDirectoryService)); } } @@ -364,7 +368,7 @@ public Path createExecDir( Path execDir = root.resolve(operationName); if (Files.exists(execDir)) { - Directories.remove(execDir); + Directories.remove(execDir, fileStore); } Files.createDirectories(execDir); @@ -416,7 +420,7 @@ public Path createExecDir( } finally { if (!success) { fileCache.decrementReferences(inputFiles.build(), inputDirectories.build()); - Directories.remove(execDir); + Directories.remove(execDir, fileStore); } } @@ -451,7 +455,7 @@ public void destroyExecDir(Path execDir) throws IOException, InterruptedExceptio inputDirectories == null ? ImmutableList.of() : inputDirectories); } if (Files.exists(execDir)) { - Directories.remove(execDir); + Directories.remove(execDir, fileStore); } } } diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index 07971e50cd..7631118fdb 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -175,10 +175,11 @@ protected InputStream newExternalInput(Compressor.Value compressor, Digest diges @After public void tearDown() throws IOException, InterruptedException { + FileStore fileStore = Files.getFileStore(root); // bazel appears to have a problem with us creating directories under // windows that are marked as no-delete. clean up after ourselves with // our utils - Directories.remove(root); + Directories.remove(root, fileStore); if (!shutdownAndAwaitTermination(putService, 1, SECONDS)) { throw new RuntimeException("could not shut down put service"); } diff --git a/src/test/java/build/buildfarm/common/io/DirectoriesTest.java b/src/test/java/build/buildfarm/common/io/DirectoriesTest.java index 1c7e55ba63..1759154bef 100644 --- a/src/test/java/build/buildfarm/common/io/DirectoriesTest.java +++ b/src/test/java/build/buildfarm/common/io/DirectoriesTest.java @@ -22,26 +22,35 @@ import com.google.common.jimfs.Jimfs; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import org.junit.After; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; class DirectoriesTest { protected final Path root; + protected FileStore fileStore; protected DirectoriesTest(Path root) { this.root = root; } + @Before + public void setUp() throws IOException { + fileStore = Files.getFileStore(root); + } + @After public void tearDown() throws IOException { // restore write permissions if (Files.exists(root)) { - Directories.enableAllWriteAccess(root); + Directories.enableAllWriteAccess(root, fileStore); } + fileStore = null; } @Test @@ -56,7 +65,7 @@ public void removeDirectoryDeletesTree() throws IOException { ImmutableList.of("A file in a subdirectory"), StandardCharsets.UTF_8); - Directories.remove(tree); + Directories.remove(tree, fileStore); assertThat(Files.exists(tree)).isFalse(); } @@ -75,11 +84,11 @@ public void changePermissionsForDelete() throws IOException { StandardCharsets.UTF_8); // remove write permissions - Directories.disableAllWriteAccess(tree); + Directories.disableAllWriteAccess(tree, fileStore); // directories are able to be removed, because the algorithm // changes the write permissions before performing the delete. - Directories.remove(tree); + Directories.remove(tree, fileStore); assertThat(Files.exists(tree)).isFalse(); } @@ -114,7 +123,7 @@ public void checkWriteDisabled() throws IOException { assertThat(Files.isWritable(subdir)).isTrue(); // remove write permissions - Directories.disableAllWriteAccess(tree); + Directories.disableAllWriteAccess(tree, fileStore); // check that write conditions have changed // If the unit tests were run as root, diff --git a/src/test/java/build/buildfarm/common/io/UtilsTest.java b/src/test/java/build/buildfarm/common/io/UtilsTest.java index 34896e1eab..1422f27e35 100644 --- a/src/test/java/build/buildfarm/common/io/UtilsTest.java +++ b/src/test/java/build/buildfarm/common/io/UtilsTest.java @@ -47,7 +47,8 @@ public void setUp() throws IOException { @After public void tearDown() throws IOException { - Directories.remove(root); + fileStore = Files.getFileStore(root); + Directories.remove(root, fileStore); } @Test From 58044625c4dc1594db1799633132826ae4d570d4 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 21 Jun 2023 17:13:28 -0400 Subject: [PATCH 015/214] Unwrap EEs on PutDirectoryException creation (#1386) ExceutionExceptions wrap the actual exceptions of futures experienced during putDirectory, and add no tracing capacity. Unwrap these when thrown from failed futures. --- src/main/java/build/buildfarm/cas/cfc/CASFileCache.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index f570b300f3..77360c0182 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -2275,7 +2275,10 @@ private ListenableFuture putDirectorySynchronized( try { putFutures.get(i).get(); // should never get here + } catch (ExecutionException e) { + failures.add(e.getCause()); } catch (Throwable t) { + // cancelled or interrupted during get failures.add(t); } } From 7e9dd51eb27277680c344d97b1ed5ad7c7493cc1 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 07:22:54 -0400 Subject: [PATCH 016/214] Retry downloads in CFC with copyExternalInput (#1387) Bleed grpc exposure into a retrier for copyExternalInput invocations, and ensure that enough bytes have been provided from the requested blob before returning. --- .../cas/ContentAddressableStorages.java | 4 +- .../build/buildfarm/cas/cfc/CASFileCache.java | 41 +++++++++- .../build/buildfarm/common/grpc/Retrier.java | 9 +++ .../java/build/buildfarm/tools/CacheLoad.java | 2 +- .../worker/shard/ShardCASFileCache.java | 4 +- .../buildfarm/cas/cfc/CASFileCacheTest.java | 81 +++++++++++++++++-- 6 files changed, 124 insertions(+), 17 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java b/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java index 3d766017a6..ade381ff50 100644 --- a/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java +++ b/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java @@ -88,8 +88,8 @@ public static ContentAddressableStorage createFilesystemCAS(Cas config) /* expireService=*/ newDirectExecutorService(), /* accessRecorder=*/ directExecutor()) { @Override - protected InputStream newExternalInput(Compressor.Value compressor, Digest digest) - throws IOException { + protected InputStream newExternalInput( + Compressor.Value compressor, Digest digest, long offset) throws IOException { throw new NoSuchFileException(digest.getHash()); } }; diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 77360c0182..ce157645fe 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -63,6 +63,8 @@ import build.buildfarm.common.ZstdCompressingInputStream; import build.buildfarm.common.ZstdDecompressingOutputStream; import build.buildfarm.common.config.Cas; +import build.buildfarm.common.grpc.Retrier; +import build.buildfarm.common.grpc.Retrier.Backoff; import build.buildfarm.common.io.CountingOutputStream; import build.buildfarm.common.io.Directories; import build.buildfarm.common.io.FeedbackOutputStream; @@ -87,6 +89,8 @@ import com.google.common.util.concurrent.UncheckedExecutionException; import com.google.protobuf.ByteString; import io.grpc.Deadline; +import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; import io.grpc.stub.ServerCallStreamObserver; import io.prometheus.client.Counter; import io.prometheus.client.Gauge; @@ -2425,11 +2429,40 @@ Path putAndCopy(Digest digest, boolean isExecutable) throws IOException, Interru return getPath(key); } + private void copyExternalInputProgressive(Digest digest, CancellableOutputStream out) + throws IOException, InterruptedException { + try (InputStream in = newExternalInput(Compressor.Value.IDENTITY, digest, out.getWritten())) { + ByteStreams.copy(in, out); + } + } + + private static Exception extractStatusException(IOException e) { + for (Throwable cause = e.getCause(); cause != null; cause = cause.getCause()) { + if (cause instanceof StatusException) { + return (StatusException) cause; + } else if (cause instanceof StatusRuntimeException) { + return (StatusRuntimeException) cause; + } + } + return e; + } + private void copyExternalInput(Digest digest, CancellableOutputStream out) throws IOException, InterruptedException { + Retrier retrier = new Retrier(Backoff.sequential(5), Retrier.DEFAULT_IS_RETRIABLE); log.log(Level.FINE, format("downloading %s", DigestUtil.toString(digest))); - try (InputStream in = newExternalInput(Compressor.Value.IDENTITY, digest)) { - ByteStreams.copy(in, out); + try { + retrier.execute( + () -> { + while (out.getWritten() < digest.getSizeBytes()) { + try { + copyExternalInputProgressive(digest, out); + } catch (IOException e) { + throw extractStatusException(e); + } + } + return null; + }); } catch (IOException e) { out.cancel(); log.log( @@ -3070,8 +3103,8 @@ public DirectoryEntry(Directory directory, Deadline existsDeadline) { } } - protected abstract InputStream newExternalInput(Compressor.Value compressor, Digest digest) - throws IOException; + protected abstract InputStream newExternalInput( + Compressor.Value compressor, Digest digest, long offset) throws IOException; // CAS fallback methods diff --git a/src/main/java/build/buildfarm/common/grpc/Retrier.java b/src/main/java/build/buildfarm/common/grpc/Retrier.java index 72960e9f9c..6fd7802e79 100644 --- a/src/main/java/build/buildfarm/common/grpc/Retrier.java +++ b/src/main/java/build/buildfarm/common/grpc/Retrier.java @@ -98,6 +98,15 @@ public int getRetryAttempts() { } }; + static Supplier sequential(int maxAttempts) { + return exponential( + /* initial=*/ Duration.ZERO, + /* max=*/ Duration.ZERO, + /* multiplier=*/ 1.1, + /* jitter=*/ 0.0, + maxAttempts); + } + /** * Creates a Backoff supplier for an optionally jittered exponential backoff. The supplier is * ThreadSafe (non-synchronized calls to get() are fine), but the returned Backoff is not. diff --git a/src/main/java/build/buildfarm/tools/CacheLoad.java b/src/main/java/build/buildfarm/tools/CacheLoad.java index 0c7a866d72..1694f32da9 100644 --- a/src/main/java/build/buildfarm/tools/CacheLoad.java +++ b/src/main/java/build/buildfarm/tools/CacheLoad.java @@ -48,7 +48,7 @@ private static class LocalCASFileCache extends CASFileCache { } @Override - protected InputStream newExternalInput(Compressor.Value compressor, Digest digest) + protected InputStream newExternalInput(Compressor.Value compressor, Digest digest, long offset) throws IOException { throw new IOException(); } diff --git a/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java b/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java index 191612342e..c1a56beb06 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java @@ -83,8 +83,8 @@ private static InputStreamFactory createInputStreamFactory( } @Override - protected InputStream newExternalInput(Compressor.Value compressor, Digest digest) + protected InputStream newExternalInput(Compressor.Value compressor, Digest digest, long offset) throws IOException { - return inputStreamFactory.newInput(compressor, digest, 0); + return inputStreamFactory.newInput(compressor, digest, offset); } } diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index 7631118fdb..984275f3f3 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -64,6 +64,7 @@ import com.google.common.util.concurrent.SettableFuture; import com.google.protobuf.ByteString; import io.grpc.Deadline; +import io.grpc.Status; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -159,14 +160,14 @@ public void setUp() throws IOException, InterruptedException { delegate, /* delegateSkipLoad=*/ false) { @Override - protected InputStream newExternalInput(Compressor.Value compressor, Digest digest) - throws IOException { + protected InputStream newExternalInput( + Compressor.Value compressor, Digest digest, long offset) throws IOException { ByteString content = blobs.get(digest); if (content == null) { - return fileCache.newTransparentInput(compressor, digest, 0); + return fileCache.newTransparentInput(compressor, digest, offset); } checkArgument(compressor == Compressor.Value.IDENTITY); - return content.substring((int) (long) 0).newInput(); + return content.substring((int) offset).newInput(); } }; // do this so that we can remove the cache root dir @@ -1102,6 +1103,70 @@ public void findMissingBlobsPopulatesUnknownSize() throws Exception { assertThat(responseDigest).isEqualTo(blob.getDigest()); } + @Test + public void copyExternalInputRetries() throws Exception { + CASFileCache flakyExternalCAS = + new CASFileCache( + root, + /* maxSizeInBytes=*/ 1024, + /* maxEntrySizeInBytes=*/ 1024, + /* hexBucketLevels=*/ 1, + storeFileDirsIndexInMemory, + /* publishTtlMetric=*/ false, + /* execRootFallback=*/ false, + DIGEST_UTIL, + expireService, + /* accessRecorder=*/ directExecutor(), + storage, + /* directoriesIndexDbName=*/ ":memory:", + /* onPut=*/ digest -> {}, + /* onExpire=*/ digests -> {}, + /* delegate=*/ null, + /* delegateSkipLoad=*/ false) { + boolean throwUnavailable = true; + + @Override + protected InputStream newExternalInput( + Compressor.Value compressor, Digest digest, long offset) throws IOException { + ByteString content = blobs.get(digest); + if (throwUnavailable) { + throwUnavailable = false; + return new InputStream() { + int count = 0; + + @Override + public int read(byte[] buf) throws IOException { + return read(buf, 0, buf.length); + } + + @Override + public int read() { + throw new UnsupportedOperationException(); + } + + @Override + public int read(byte[] buf, int offset, int len) throws IOException { + if (count >= digest.getSizeBytes() / 2) { + throw new IOException(Status.UNAVAILABLE.asRuntimeException()); + } + len = Math.min((int) digest.getSizeBytes() / 2 - count, len); + content.substring(count, count + len).copyTo(buf, offset); + count += len; + return len; + } + }; + } + return content.substring((int) offset).newInput(); + } + }; + flakyExternalCAS.initializeRootDirectory(); + ByteString blob = ByteString.copyFromUtf8("Flaky Entry"); + Digest blobDigest = DIGEST_UTIL.compute(blob); + blobs.put(blobDigest, blob); + Path path = flakyExternalCAS.put(blobDigest, false); + assertThat(Files.exists(path)).isTrue(); // would not have been created if not valid + } + @Test public void newInputThrowsNoSuchFileExceptionWithoutDelegate() throws Exception { ContentAddressableStorage undelegatedCAS = @@ -1123,14 +1188,14 @@ public void newInputThrowsNoSuchFileExceptionWithoutDelegate() throws Exception /* delegate=*/ null, /* delegateSkipLoad=*/ false) { @Override - protected InputStream newExternalInput(Compressor.Value compressor, Digest digest) - throws IOException { + protected InputStream newExternalInput( + Compressor.Value compressor, Digest digest, long offset) throws IOException { ByteString content = blobs.get(digest); if (content == null) { - return fileCache.newTransparentInput(compressor, digest, 0); + return fileCache.newTransparentInput(compressor, digest, offset); } checkArgument(compressor == Compressor.Value.IDENTITY); - return content.substring((int) (long) 0).newInput(); + return content.substring((int) offset).newInput(); } }; ByteString blob = ByteString.copyFromUtf8("Missing Entry"); From 7be02644c1781a866bc0ebf9f042c2801a0c0aa1 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 10:32:41 -0400 Subject: [PATCH 017/214] Skip isReadOnlyExecutable on symlinks (#1383) The only presence of arbitrary symlinks in the CAS Filesystem is under directories. Symlinks are explicitly identified as non-readonly-executables. Prevent a dead symlink from throwing NSFE due to the readonly check. --- src/main/java/build/buildfarm/common/io/Utils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/io/Utils.java b/src/main/java/build/buildfarm/common/io/Utils.java index 64a4ebcf50..3457cc3d62 100644 --- a/src/main/java/build/buildfarm/common/io/Utils.java +++ b/src/main/java/build/buildfarm/common/io/Utils.java @@ -291,7 +291,8 @@ public static FileStatus stat(final Path path, final boolean followSymlinks, Fil boolean isReadOnlyExecutable; try { attributes = Files.readAttributes(path, BasicFileAttributes.class, linkOpts(followSymlinks)); - isReadOnlyExecutable = EvenMoreFiles.isReadOnlyExecutable(path, fileStore); + isReadOnlyExecutable = + !attributes.isSymbolicLink() && EvenMoreFiles.isReadOnlyExecutable(path, fileStore); } catch (java.nio.file.FileSystemException e) { throw new NoSuchFileException(path + ERR_NO_SUCH_FILE_OR_DIR); } From 6de1473b91393f07825fcff61761d2c259c28b43 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 11:13:01 -0400 Subject: [PATCH 018/214] Support UTF8 Strings in ffiReaddir (#1388) Files are delivered via readdir in utf8 encoding (on linux for xfs at least), assume that posix will mandate this. --- src/main/java/build/buildfarm/common/io/FFIdirent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/io/FFIdirent.java b/src/main/java/build/buildfarm/common/io/FFIdirent.java index d3880b2722..6c9fd7ddf5 100644 --- a/src/main/java/build/buildfarm/common/io/FFIdirent.java +++ b/src/main/java/build/buildfarm/common/io/FFIdirent.java @@ -32,5 +32,5 @@ public java.lang.String getName() { public final Signed64 d_off = new Signed64(); public final Unsigned16 d_reclen = new Unsigned16(); public final Unsigned8 d_type = new Unsigned8(); - public final AsciiString d_name = new AsciiString(MAX_NAME_LEN); + public final UTF8String d_name = new UTF8String(MAX_NAME_LEN); } From ee8b171841e124249d7eaaeaea9d11aef4e02a53 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 14:30:58 -0400 Subject: [PATCH 019/214] Revert context deadline guarantee from (#1377)" (#1389) This reverts mistakenly added checks for non-null deadlines in StubInstance. --- .../buildfarm/instance/stub/StubInstance.java | 19 +++------- .../instance/stub/StubInstanceTest.java | 35 +------------------ 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/stub/StubInstance.java b/src/main/java/build/buildfarm/instance/stub/StubInstance.java index 219e5d54ec..ee8ca9523f 100644 --- a/src/main/java/build/buildfarm/instance/stub/StubInstance.java +++ b/src/main/java/build/buildfarm/instance/stub/StubInstance.java @@ -18,7 +18,6 @@ import static build.buildfarm.common.grpc.TracingMetadataUtils.attachMetadataInterceptor; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -import static com.google.common.util.concurrent.Futures.allAsList; import static com.google.common.util.concurrent.Futures.catching; import static com.google.common.util.concurrent.Futures.transform; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; @@ -106,7 +105,6 @@ import com.google.bytestream.ByteStreamGrpc.ByteStreamStub; import com.google.bytestream.ByteStreamProto.ReadRequest; import com.google.bytestream.ByteStreamProto.ReadResponse; -import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Functions; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; @@ -166,8 +164,6 @@ public class StubInstance implements Instance { private boolean isStopped = false; private final long maxBatchUpdateBlobsSize = Size.mbToBytes(3); - @VisibleForTesting long maxRequestSize = Size.mbToBytes(4); - public StubInstance(String name, DigestUtil digestUtil, ManagedChannel channel) { this(name, "no-identifier", digestUtil, channel, Durations.fromDays(DEFAULT_DEADLINE_DAYS)); } @@ -416,16 +412,11 @@ public ListenableFuture> findMissingBlobs( .setInstanceName(getName()) .addAllBlobDigests(digests) .build(); - if (request.getSerializedSize() > maxRequestSize) { - // log2n partition for size reduction as needed - int partitionSize = (request.getBlobDigestsCount() + 1) / 2; - return transform( - allAsList( - Iterables.transform( - Iterables.partition(digests, partitionSize), - subDigests -> findMissingBlobs(subDigests, requestMetadata))), - subMissings -> Iterables.concat(subMissings), - directExecutor()); + if (request.getSerializedSize() > Size.mbToBytes(4)) { + throw new IllegalStateException( + String.format( + "FINDMISSINGBLOBS IS TOO LARGE: %d digests are required in one request!", + request.getBlobDigestsCount())); } return transform( deadlined(casFutureStub) diff --git a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java index e3845494b8..e50e3f0028 100644 --- a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java @@ -64,7 +64,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -99,7 +98,7 @@ public void tearDown() throws InterruptedException { fakeServer.awaitTermination(); } - private StubInstance newStubInstance(String instanceName) { + private Instance newStubInstance(String instanceName) { return new StubInstance( instanceName, DIGEST_UTIL, @@ -198,38 +197,6 @@ public void findMissingBlobs( instance.stop(); } - @Test - public void findMissingBlobsOverSizeLimitRecombines() - throws ExecutionException, InterruptedException { - AtomicReference reference = new AtomicReference<>(); - serviceRegistry.addService( - new ContentAddressableStorageImplBase() { - @Override - public void findMissingBlobs( - FindMissingBlobsRequest request, - StreamObserver responseObserver) { - reference.set(request); - responseObserver.onNext( - FindMissingBlobsResponse.newBuilder() - .addAllMissingBlobDigests(request.getBlobDigestsList()) - .build()); - responseObserver.onCompleted(); - } - }); - StubInstance instance = newStubInstance("findMissingBlobs-test"); - instance.maxRequestSize = 1024; - ImmutableList.Builder builder = ImmutableList.builder(); - // generates digest size * 1024 serialized size at least - for (int i = 0; i < 1024; i++) { - ByteString content = ByteString.copyFromUtf8("Hello, World! " + UUID.randomUUID()); - builder.add(DIGEST_UTIL.compute(content)); - } - ImmutableList digests = builder.build(); - assertThat(instance.findMissingBlobs(digests, RequestMetadata.getDefaultInstance()).get()) - .containsExactlyElementsIn(digests); - instance.stop(); - } - @Test public void outputStreamWrites() throws IOException, InterruptedException { AtomicReference writtenContent = new AtomicReference<>(); From 41a90bed1dc2c71148827be64bfcf9a9171ffd75 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 15:00:18 -0400 Subject: [PATCH 020/214] Rollback ensure deadline (#1390) * Guard against fetchBlobFromWorker orphanization Any exception thrown by fetchBlobFromWorker will leave the blobObserver hanging. Ensure that the observer sees a failure and does not hang. * Restore FMB functionality included in revert. --- .../instance/shard/ShardInstance.java | 18 +++++++--- .../buildfarm/instance/stub/StubInstance.java | 24 +++++++------ .../instance/stub/StubInstanceTest.java | 35 ++++++++++++++++++- 3 files changed, 62 insertions(+), 15 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index 3ec8f98da5..26c7928c24 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -1037,7 +1037,8 @@ public void onError(Throwable t) { @Override public void onQueue(Deque workers) { ctx.run( - () -> + () -> { + try { fetchBlobFromWorker( compressor, blobDigest, @@ -1045,7 +1046,11 @@ public void onQueue(Deque workers) { offset, count, checkedChunkObserver, - requestMetadata)); + requestMetadata); + } catch (Exception e) { + onFailure(e); + } + }); } @Override @@ -1070,7 +1075,8 @@ public void onCompleted() { @Override public void onQueue(Deque workers) { ctx.run( - () -> + () -> { + try { fetchBlobFromWorker( compressor, blobDigest, @@ -1078,7 +1084,11 @@ public void onQueue(Deque workers) { offset, count, chunkObserver, - requestMetadata)); + requestMetadata); + } catch (Exception e) { + onFailure(e); + } + }); } @Override diff --git a/src/main/java/build/buildfarm/instance/stub/StubInstance.java b/src/main/java/build/buildfarm/instance/stub/StubInstance.java index ee8ca9523f..dd647a327d 100644 --- a/src/main/java/build/buildfarm/instance/stub/StubInstance.java +++ b/src/main/java/build/buildfarm/instance/stub/StubInstance.java @@ -18,6 +18,7 @@ import static build.buildfarm.common.grpc.TracingMetadataUtils.attachMetadataInterceptor; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import static com.google.common.util.concurrent.Futures.allAsList; import static com.google.common.util.concurrent.Futures.catching; import static com.google.common.util.concurrent.Futures.transform; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; @@ -105,6 +106,7 @@ import com.google.bytestream.ByteStreamGrpc.ByteStreamStub; import com.google.bytestream.ByteStreamProto.ReadRequest; import com.google.bytestream.ByteStreamProto.ReadResponse; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Functions; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; @@ -164,6 +166,8 @@ public class StubInstance implements Instance { private boolean isStopped = false; private final long maxBatchUpdateBlobsSize = Size.mbToBytes(3); + @VisibleForTesting long maxRequestSize = Size.mbToBytes(4); + public StubInstance(String name, DigestUtil digestUtil, ManagedChannel channel) { this(name, "no-identifier", digestUtil, channel, Durations.fromDays(DEFAULT_DEADLINE_DAYS)); } @@ -412,11 +416,16 @@ public ListenableFuture> findMissingBlobs( .setInstanceName(getName()) .addAllBlobDigests(digests) .build(); - if (request.getSerializedSize() > Size.mbToBytes(4)) { - throw new IllegalStateException( - String.format( - "FINDMISSINGBLOBS IS TOO LARGE: %d digests are required in one request!", - request.getBlobDigestsCount())); + if (request.getSerializedSize() > maxRequestSize) { + // log2n partition for size reduction as needed + int partitionSize = (request.getBlobDigestsCount() + 1) / 2; + return transform( + allAsList( + Iterables.transform( + Iterables.partition(digests, partitionSize), + subDigests -> findMissingBlobs(subDigests, requestMetadata))), + subMissings -> Iterables.concat(subMissings), + directExecutor()); } return transform( deadlined(casFutureStub) @@ -586,7 +595,6 @@ public void getBlob( ServerCallStreamObserver blobObserver, RequestMetadata requestMetadata) { throwIfStopped(); - checkNotNull(io.grpc.Context.current().getDeadline()); bsStub .get() .withInterceptors(attachMetadataInterceptor(requestMetadata)) @@ -887,7 +895,6 @@ public WorkerProfileMessage getWorkerProfile() { @Override public WorkerListMessage getWorkerList() { - checkNotNull(io.grpc.Context.current().getDeadline()); return workerProfileBlockingStub.get().getWorkerList(WorkerListRequest.newBuilder().build()); } @@ -899,7 +906,6 @@ public GetClientStartTimeResult getClientStartTime(GetClientStartTimeRequest req @Override public CasIndexResults reindexCas() { throwIfStopped(); - checkNotNull(io.grpc.Context.current().getDeadline()); ReindexCasRequestResults proto = adminBlockingStub.get().reindexCas(ReindexCasRequest.newBuilder().build()); CasIndexResults results = new CasIndexResults(); @@ -913,7 +919,6 @@ public CasIndexResults reindexCas() { @Override public void deregisterWorker(String workerName) { throwIfStopped(); - checkNotNull(io.grpc.Context.current().getDeadline()); adminBlockingStub .get() .shutDownWorkerGracefully( @@ -923,7 +928,6 @@ public void deregisterWorker(String workerName) { @Override public PrepareWorkerForGracefulShutDownRequestResults shutDownWorkerGracefully() { throwIfStopped(); - checkNotNull(io.grpc.Context.current().getDeadline()); return shutDownWorkerBlockingStub .get() .prepareWorkerForGracefulShutdown( diff --git a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java index e50e3f0028..e3845494b8 100644 --- a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java @@ -64,6 +64,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -98,7 +99,7 @@ public void tearDown() throws InterruptedException { fakeServer.awaitTermination(); } - private Instance newStubInstance(String instanceName) { + private StubInstance newStubInstance(String instanceName) { return new StubInstance( instanceName, DIGEST_UTIL, @@ -197,6 +198,38 @@ public void findMissingBlobs( instance.stop(); } + @Test + public void findMissingBlobsOverSizeLimitRecombines() + throws ExecutionException, InterruptedException { + AtomicReference reference = new AtomicReference<>(); + serviceRegistry.addService( + new ContentAddressableStorageImplBase() { + @Override + public void findMissingBlobs( + FindMissingBlobsRequest request, + StreamObserver responseObserver) { + reference.set(request); + responseObserver.onNext( + FindMissingBlobsResponse.newBuilder() + .addAllMissingBlobDigests(request.getBlobDigestsList()) + .build()); + responseObserver.onCompleted(); + } + }); + StubInstance instance = newStubInstance("findMissingBlobs-test"); + instance.maxRequestSize = 1024; + ImmutableList.Builder builder = ImmutableList.builder(); + // generates digest size * 1024 serialized size at least + for (int i = 0; i < 1024; i++) { + ByteString content = ByteString.copyFromUtf8("Hello, World! " + UUID.randomUUID()); + builder.add(DIGEST_UTIL.compute(content)); + } + ImmutableList digests = builder.build(); + assertThat(instance.findMissingBlobs(digests, RequestMetadata.getDefaultInstance()).get()) + .containsExactlyElementsIn(digests); + instance.stop(); + } + @Test public void outputStreamWrites() throws IOException, InterruptedException { AtomicReference writtenContent = new AtomicReference<>(); From b0ca1c2b9691c8c60baa72c70986ed335a17d374 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 24 Jun 2023 23:09:03 -0400 Subject: [PATCH 021/214] Interpret ExecDirException to Status (#1391) Handle ExecDirExceptions in InputFetcher such that the client can observe a FAILED_PRECONDITION with PreconditionFailures that include Violations with VIOLATION_TYPE_MISSING to inspire virtuous loop reestablishment. A ViolationException acts as a container for this, and can be extended to include the components of a putDirectory. Interpret PutDirectoryExceptions with their imposed violations. Missing inputs at the time of execute, whether linked as immediate files or through the directory cache, will be interpreted as VIOLATION_TYPE_MISSING. --- .../build/buildfarm/cas/cfc/CASFileCache.java | 33 ----- .../cas/cfc/PutDirectoryException.java | 53 +++++++ .../java/build/buildfarm/common/Errors.java | 3 + .../buildfarm/common/OperationFailer.java | 35 +---- .../server/AbstractServerInstance.java | 4 +- src/main/java/build/buildfarm/worker/BUILD | 1 + .../buildfarm/worker/ExecDirException.java | 139 ++++++++++++++++++ .../build/buildfarm/worker/InputFetcher.java | 32 ++-- .../worker/shard/CFCExecFileSystem.java | 88 +++++------ .../buildfarm/cas/cfc/CASFileCacheTest.java | 1 - src/test/java/build/buildfarm/worker/BUILD | 2 + .../buildfarm/worker/InputFetcherTest.java | 135 +++++++++++++++++ .../buildfarm/worker/StubWorkerContext.java | 7 +- 13 files changed, 405 insertions(+), 128 deletions(-) create mode 100644 src/main/java/build/buildfarm/cas/cfc/PutDirectoryException.java create mode 100644 src/main/java/build/buildfarm/worker/ExecDirException.java create mode 100644 src/test/java/build/buildfarm/worker/InputFetcherTest.java diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index ce157645fe..84fd0f3382 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -2159,39 +2159,6 @@ private boolean directoryEntryExists( return false; } - static class PutDirectoryException extends IOException { - private final Path path; - private final Digest digest; - private final List exceptions; - - PutDirectoryException(Path path, Digest digest, List exceptions) { - // When printing the exception, show the captured sub-exceptions. - super(getErrorMessage(path, exceptions)); - this.path = path; - this.digest = digest; - this.exceptions = exceptions; - for (Throwable exception : exceptions) { - addSuppressed(exception); - } - } - - Path getPath() { - return path; - } - - Digest getDigest() { - return digest; - } - - List getExceptions() { - return exceptions; - } - } - - private static String getErrorMessage(Path path, List exceptions) { - return String.format("%s: %d %s: %s", path, exceptions.size(), "exceptions", exceptions); - } - @SuppressWarnings("ConstantConditions") private ListenableFuture putDirectorySynchronized( Path path, Digest digest, Map directoriesByDigest, ExecutorService service) diff --git a/src/main/java/build/buildfarm/cas/cfc/PutDirectoryException.java b/src/main/java/build/buildfarm/cas/cfc/PutDirectoryException.java new file mode 100644 index 0000000000..d635a7217b --- /dev/null +++ b/src/main/java/build/buildfarm/cas/cfc/PutDirectoryException.java @@ -0,0 +1,53 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.cas.cfc; + +import build.bazel.remote.execution.v2.Digest; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; + +public class PutDirectoryException extends IOException { + private final Path path; + private final Digest digest; + private final List exceptions; + + private static String getErrorMessage(Path path, List exceptions) { + return String.format("%s: %d %s: %s", path, exceptions.size(), "exceptions", exceptions); + } + + public PutDirectoryException(Path path, Digest digest, List exceptions) { + // When printing the exception, show the captured sub-exceptions. + super(getErrorMessage(path, exceptions)); + this.path = path; + this.digest = digest; + this.exceptions = exceptions; + for (Throwable exception : exceptions) { + addSuppressed(exception); + } + } + + Path getPath() { + return path; + } + + public Digest getDigest() { + return digest; + } + + public List getExceptions() { + return exceptions; + } +} diff --git a/src/main/java/build/buildfarm/common/Errors.java b/src/main/java/build/buildfarm/common/Errors.java index 24932b994e..603c015d23 100644 --- a/src/main/java/build/buildfarm/common/Errors.java +++ b/src/main/java/build/buildfarm/common/Errors.java @@ -19,5 +19,8 @@ public final class Errors { public static final String VIOLATION_TYPE_INVALID = "INVALID"; + public static final String MISSING_INPUT = + "A requested input (or the `Action` or its `Command`) was not found in the CAS."; + private Errors() {} } diff --git a/src/main/java/build/buildfarm/common/OperationFailer.java b/src/main/java/build/buildfarm/common/OperationFailer.java index d3a2f33639..c06b0f2dcc 100644 --- a/src/main/java/build/buildfarm/common/OperationFailer.java +++ b/src/main/java/build/buildfarm/common/OperationFailer.java @@ -20,8 +20,7 @@ import build.buildfarm.v1test.ExecuteEntry; import com.google.longrunning.Operation; import com.google.protobuf.Any; -import com.google.rpc.PreconditionFailure; -import io.grpc.Status.Code; +import com.google.rpc.Status; /** * @class OperationFailer @@ -30,20 +29,14 @@ * finished and failed. */ public class OperationFailer { - public static Operation get( - Operation operation, - ExecuteEntry executeEntry, - String failureType, - String failureMessage, - String failureDetails) { + public static Operation get(Operation operation, ExecuteEntry executeEntry, Status status) { return operation .toBuilder() - .setName(executeEntry.getOperationName()) .setDone(true) + .setName(executeEntry.getOperationName()) .setMetadata( Any.pack(executeOperationMetadata(executeEntry, ExecutionStage.Value.COMPLETED))) - .setResponse( - Any.pack(failResponse(executeEntry, failureType, failureMessage, failureDetails))) + .setResponse(Any.pack(ExecuteResponse.newBuilder().setStatus(status).build())) .build(); } @@ -56,24 +49,4 @@ private static ExecuteOperationMetadata executeOperationMetadata( .setStage(stage) .build(); } - - private static ExecuteResponse failResponse( - ExecuteEntry executeEntry, String failureType, String failureMessage, String failureDetails) { - PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); - preconditionFailureBuilder - .addViolationsBuilder() - .setType(failureType) - .setSubject("blobs/" + DigestUtil.toString(executeEntry.getActionDigest())) - .setDescription(failureDetails); - PreconditionFailure preconditionFailure = preconditionFailureBuilder.build(); - - return ExecuteResponse.newBuilder() - .setStatus( - com.google.rpc.Status.newBuilder() - .setCode(Code.FAILED_PRECONDITION.value()) - .setMessage(failureMessage) - .addDetails(Any.pack(preconditionFailure)) - .build()) - .build(); - } } diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java index 95b737725b..57d827ffa8 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java @@ -16,6 +16,7 @@ import static build.buildfarm.common.Actions.asExecutionStatus; import static build.buildfarm.common.Actions.checkPreconditionFailure; +import static build.buildfarm.common.Errors.MISSING_INPUT; import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; import static build.buildfarm.common.Trees.enumerateTreeFileDigests; @@ -177,9 +178,6 @@ public abstract class AbstractServerInstance implements Instance { public static final String ENVIRONMENT_VARIABLES_NOT_SORTED = "The `Command`'s `environment_variables` are not correctly sorted by `name`."; - public static final String MISSING_INPUT = - "A requested input (or the `Action` or its `Command`) was not found in the CAS."; - public static final String MISSING_ACTION = "The action was not found in the CAS."; public static final String MISSING_COMMAND = "The command was not found in the CAS."; diff --git a/src/main/java/build/buildfarm/worker/BUILD b/src/main/java/build/buildfarm/worker/BUILD index 3ab09723b7..417d530e9a 100644 --- a/src/main/java/build/buildfarm/worker/BUILD +++ b/src/main/java/build/buildfarm/worker/BUILD @@ -4,6 +4,7 @@ java_library( plugins = ["//src/main/java/build/buildfarm/common:lombok"], visibility = ["//visibility:public"], deps = [ + "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/instance", diff --git a/src/main/java/build/buildfarm/worker/ExecDirException.java b/src/main/java/build/buildfarm/worker/ExecDirException.java new file mode 100644 index 0000000000..40c625232c --- /dev/null +++ b/src/main/java/build/buildfarm/worker/ExecDirException.java @@ -0,0 +1,139 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker; + +import static build.buildfarm.common.Errors.MISSING_INPUT; +import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; +import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; +import static java.util.logging.Level.SEVERE; + +import build.bazel.remote.execution.v2.Digest; +import build.buildfarm.cas.cfc.PutDirectoryException; +import build.buildfarm.common.DigestUtil; +import com.google.protobuf.Any; +import com.google.rpc.Code; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.PreconditionFailure.Violation; +import com.google.rpc.Status; +import java.io.IOException; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.util.List; +import lombok.extern.java.Log; + +@Log +public class ExecDirException extends IOException { + private final Path path; + private final List exceptions; + + public static class ViolationException extends Exception { + private final Digest digest; + private final Path path; + private final boolean isExecutable; + + public ViolationException(Digest digest, Path path, boolean isExecutable, Throwable cause) { + super(cause); + this.digest = digest; + this.path = path; + this.isExecutable = isExecutable; + } + + private static String getDescription(Path path, boolean isExecutable) { + if (path != null) { + return "The file `/" + path + (isExecutable ? "*" : "") + "` was not found in the CAS."; + } + return MISSING_INPUT; + } + + static void toViolation( + Violation.Builder violation, Throwable cause, Path path, boolean isExecutable) { + if (cause instanceof NoSuchFileException) { + violation + .setType(VIOLATION_TYPE_MISSING) + .setDescription(getDescription(path, isExecutable)); + } else { + violation.setType(VIOLATION_TYPE_INVALID).setDescription(cause.getMessage()); + } + } + + public Violation getViolation() { + Violation.Builder violation = Violation.newBuilder(); + toViolation(violation, getCause(), path, isExecutable); + violation.setSubject("blobs/" + DigestUtil.toString(digest)); + return violation.build(); + } + } + + private static String getErrorMessage(Path path, List exceptions) { + return String.format("%s: %d %s: %s", path, exceptions.size(), "exceptions", exceptions); + } + + public ExecDirException(Path path, List exceptions) { + // When printing the exception, show the captured sub-exceptions. + super(getErrorMessage(path, exceptions)); + this.path = path; + this.exceptions = exceptions; + for (Throwable exception : exceptions) { + addSuppressed(exception); + } + } + + Path getPath() { + return path; + } + + List getExceptions() { + return exceptions; + } + + Status.Builder toStatus(Status.Builder status) { + status.setCode(Code.FAILED_PRECONDITION.getNumber()); + + // aggregate into a single preconditionFailure + PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); + for (Throwable exception : exceptions) { + if (exception instanceof ViolationException) { + ViolationException violationException = (ViolationException) exception; + preconditionFailure.addViolations(violationException.getViolation()); + } else if (exception instanceof PutDirectoryException) { + PutDirectoryException putDirException = (PutDirectoryException) exception; + for (Throwable putDirCause : putDirException.getExceptions()) { + if (putDirCause instanceof IOException) { + Violation.Builder violation = preconditionFailure.addViolationsBuilder(); + ViolationException.toViolation( + violation, putDirCause, /* path=*/ null, /* isExecutable=*/ false); + if (putDirCause instanceof NoSuchFileException) { + violation.setSubject("blobs/" + putDirCause.getMessage()); + } else { + log.log(SEVERE, "unrecognized put dir cause exception", putDirCause); + violation.setSubject("blobs/" + DigestUtil.toString(putDirException.getDigest())); + } + } else { + log.log(SEVERE, "unrecognized put dir exception", putDirCause); + status.setCode(Code.INTERNAL.getNumber()); + } + } + } else { + log.log(SEVERE, "unrecognized exec dir exception", exception); + status.setCode(Code.INTERNAL.getNumber()); + } + } + if (preconditionFailure.getViolationsCount() > 0) { + status.addDetails(Any.pack(preconditionFailure.build())); + } + + return status; + } +} diff --git a/src/main/java/build/buildfarm/worker/InputFetcher.java b/src/main/java/build/buildfarm/worker/InputFetcher.java index 667ccfa0e5..1c99df6a91 100644 --- a/src/main/java/build/buildfarm/worker/InputFetcher.java +++ b/src/main/java/build/buildfarm/worker/InputFetcher.java @@ -15,7 +15,6 @@ package build.buildfarm.worker; import static build.bazel.remote.execution.v2.ExecutionStage.Value.QUEUED; -import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; import static java.lang.String.format; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.MICROSECONDS; @@ -30,13 +29,17 @@ import build.bazel.remote.execution.v2.FileNode; import build.buildfarm.common.OperationFailer; import build.buildfarm.common.ProxyDirectoriesIndex; +import build.buildfarm.v1test.ExecuteEntry; import build.buildfarm.v1test.QueuedOperation; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Stopwatch; import com.google.common.collect.Iterables; import com.google.longrunning.Operation; import com.google.protobuf.Duration; import com.google.protobuf.util.Durations; import com.google.protobuf.util.Timestamps; +import com.google.rpc.Code; +import com.google.rpc.Status; import io.grpc.Deadline; import java.io.IOException; import java.nio.file.Path; @@ -162,7 +165,8 @@ static String getExecutablePath( return null; } - private long fetchPolled(Stopwatch stopwatch) throws InterruptedException { + @VisibleForTesting + long fetchPolled(Stopwatch stopwatch) throws InterruptedException { String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); log.log(Level.FINE, format("fetching inputs: %s", operationName)); @@ -196,8 +200,15 @@ private long fetchPolled(Stopwatch stopwatch) throws InterruptedException { queuedOperation.getAction(), queuedOperation.getCommand()); } catch (IOException e) { - log.log(Level.SEVERE, format("error creating exec dir for %s", operationName), e); - failOperation("Error creating exec dir", e.toString()); + Status.Builder status = Status.newBuilder().setMessage("Error creating exec dir"); + if (e instanceof ExecDirException) { + ExecDirException execDirEx = (ExecDirException) e; + execDirEx.toStatus(status); + } else { + status.setCode(Code.INTERNAL.getNumber()); + log.log(Level.SEVERE, format("error creating exec dir for %s", operationName), e); + } + failOperation(status.build()); return 0; } success = true; @@ -311,15 +322,10 @@ public void run() { } } - private void failOperation(String failureMessage, String failureDetails) - throws InterruptedException { + private void failOperation(Status status) throws InterruptedException { + ExecuteEntry executeEntry = operationContext.queueEntry.getExecuteEntry(); Operation failedOperation = - OperationFailer.get( - operationContext.operation, - operationContext.queueEntry.getExecuteEntry(), - VIOLATION_TYPE_INVALID, - failureMessage, - failureDetails); + OperationFailer.get(operationContext.operation, executeEntry, status); try { workerContext.putOperation(failedOperation); @@ -327,7 +333,7 @@ private void failOperation(String failureMessage, String failureDetails) operationContext.toBuilder().setOperation(failedOperation).build(); owner.error().put(newOperationContext); } catch (Exception e) { - String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); + String operationName = executeEntry.getOperationName(); log.log(Level.SEVERE, format("Cannot report failed operation %s", operationName), e); } } diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 525d696d5c..c8336f7481 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -21,10 +21,12 @@ import static com.google.common.collect.Iterables.concat; import static com.google.common.collect.Iterables.filter; import static com.google.common.util.concurrent.Futures.allAsList; +import static com.google.common.util.concurrent.Futures.catchingAsync; import static com.google.common.util.concurrent.Futures.immediateFailedFuture; import static com.google.common.util.concurrent.Futures.immediateFuture; import static com.google.common.util.concurrent.Futures.transform; import static com.google.common.util.concurrent.Futures.transformAsync; +import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static com.google.common.util.concurrent.MoreExecutors.listeningDecorator; import static com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination; import static java.util.concurrent.TimeUnit.MINUTES; @@ -35,7 +37,6 @@ import build.bazel.remote.execution.v2.Digest; import build.bazel.remote.execution.v2.Directory; import build.bazel.remote.execution.v2.DirectoryNode; -import build.bazel.remote.execution.v2.FileNode; import build.bazel.remote.execution.v2.SymlinkNode; import build.buildfarm.cas.ContentAddressableStorage; import build.buildfarm.cas.cfc.CASFileCache; @@ -43,6 +44,8 @@ import build.buildfarm.common.DigestUtil; import build.buildfarm.common.io.Directories; import build.buildfarm.common.io.Dirent; +import build.buildfarm.worker.ExecDirException; +import build.buildfarm.worker.ExecDirException.ViolationException; import build.buildfarm.worker.OutputDirectory; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; @@ -181,30 +184,26 @@ private ListenableFuture putSymlink(Path path, SymlinkNode symlinkNode) { @SuppressWarnings("ConstantConditions") private ListenableFuture put( - Path path, FileNode fileNode, ImmutableList.Builder inputFiles) { - Path filePath = path.resolve(fileNode.getName()); - Digest digest = fileNode.getDigest(); + Digest digest, Path path, boolean isExecutable, Consumer onKey) { if (digest.getSizeBytes() == 0) { return listeningDecorator(fetchService) .submit( () -> { - Files.createFile(filePath); + Files.createFile(path); // ignore executable return null; }); } - String key = fileCache.getKey(digest, fileNode.getIsExecutable()); + String key = fileCache.getKey(digest, isExecutable); return transformAsync( - fileCache.put(digest, fileNode.getIsExecutable(), fetchService), + fileCache.put(digest, isExecutable, fetchService), (fileCachePath) -> { checkNotNull(key); // we saw null entries in the built immutable list without synchronization - synchronized (inputFiles) { - inputFiles.add(key); - } - if (fileNode.getDigest().getSizeBytes() != 0) { + onKey.accept(key); + if (digest.getSizeBytes() != 0) { try { - Files.createLink(filePath, fileCachePath); + Files.createLink(path, fileCachePath); } catch (IOException e) { return immediateFailedFuture(e); } @@ -214,12 +213,29 @@ private ListenableFuture put( fetchService); } + private ListenableFuture catchingPut( + Digest digest, Path root, Path path, boolean isExecutable, Consumer onKey) { + return catchingAsync( + put(digest, path, isExecutable, onKey), + Throwable.class, // required per docs + t -> { + if (t instanceof IOException) { + return immediateFailedFuture( + new ViolationException( + digest, root.relativize(path), isExecutable, (IOException) t)); + } + return immediateFailedFuture(t); + }, + directExecutor()); + } + private Iterable> fetchInputs( + Path root, Path path, Digest directoryDigest, Map directoriesIndex, OutputDirectory outputDirectory, - ImmutableList.Builder inputFiles, + Consumer onKey, ImmutableList.Builder inputDirectories) throws IOException { Directory directory = directoriesIndex.get(directoryDigest); @@ -231,7 +247,14 @@ private Iterable> fetchInputs( Iterable> downloads = directory.getFilesList().stream() - .map(fileNode -> put(path, fileNode, inputFiles)) + .map( + fileNode -> + catchingPut( + fileNode.getDigest(), + root, + path.resolve(fileNode.getName()), + fileNode.getIsExecutable(), + onKey)) .collect(ImmutableList.toImmutableList()); downloads = @@ -253,11 +276,12 @@ private Iterable> fetchInputs( concat( downloads, fetchInputs( + root, dirPath, digest, directoriesIndex, childOutputDirectory, - inputFiles, + onKey, inputDirectories)); } else { downloads = @@ -294,33 +318,6 @@ private ListenableFuture linkDirectory( fetchService); } - private static class ExecDirException extends IOException { - private final Path path; - private final List exceptions; - - ExecDirException(Path path, List exceptions) { - // When printing the exception, show the captured sub-exceptions. - super(getErrorMessage(path, exceptions)); - this.path = path; - this.exceptions = exceptions; - for (Throwable exception : exceptions) { - addSuppressed(exception); - } - } - - Path getPath() { - return path; - } - - List getExceptions() { - return exceptions; - } - } - - private static String getErrorMessage(Path path, List exceptions) { - return String.format("%s: %d %s: %s", path, exceptions.size(), "exceptions", exceptions); - } - private static void checkExecErrors(Path path, List errors) throws ExecDirException { if (!errors.isEmpty()) { throw new ExecDirException(path, errors); @@ -378,11 +375,16 @@ public Path createExecDir( log.log(Level.FINE, "ExecFileSystem::createExecDir(" + operationName + ") calling fetchInputs"); Iterable> fetchedFutures = fetchInputs( + execDir, execDir, inputRootDigest, directoriesIndex, outputDirectory, - inputFiles, + key -> { + synchronized (inputFiles) { + inputFiles.add(key); + } + }, inputDirectories); boolean success = false; try { diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index 984275f3f3..1bd1791999 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -43,7 +43,6 @@ import build.buildfarm.cas.DigestMismatchException; import build.buildfarm.cas.cfc.CASFileCache.CancellableOutputStream; import build.buildfarm.cas.cfc.CASFileCache.Entry; -import build.buildfarm.cas.cfc.CASFileCache.PutDirectoryException; import build.buildfarm.cas.cfc.CASFileCache.StartupCacheResults; import build.buildfarm.common.DigestUtil; import build.buildfarm.common.DigestUtil.HashFunction; diff --git a/src/test/java/build/buildfarm/worker/BUILD b/src/test/java/build/buildfarm/worker/BUILD index e8307784b6..999aea0910 100644 --- a/src/test/java/build/buildfarm/worker/BUILD +++ b/src/test/java/build/buildfarm/worker/BUILD @@ -17,6 +17,7 @@ java_test( plugins = ["//src/main/java/build/buildfarm/common:lombok"], test_class = "build.buildfarm.AllTests", deps = [ + "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/instance", @@ -25,6 +26,7 @@ java_test( "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "//src/test/java/build/buildfarm:test_runner", "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", "@maven//:com_github_jnr_jnr_constants", "@maven//:com_github_jnr_jnr_ffi", "@maven//:com_github_serceman_jnr_fuse", diff --git a/src/test/java/build/buildfarm/worker/InputFetcherTest.java b/src/test/java/build/buildfarm/worker/InputFetcherTest.java new file mode 100644 index 0000000000..ec69ad2f0e --- /dev/null +++ b/src/test/java/build/buildfarm/worker/InputFetcherTest.java @@ -0,0 +1,135 @@ +// Copyright 2018 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker; + +import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import build.bazel.remote.execution.v2.Action; +import build.bazel.remote.execution.v2.Command; +import build.bazel.remote.execution.v2.Digest; +import build.bazel.remote.execution.v2.Directory; +import build.bazel.remote.execution.v2.ExecuteResponse; +import build.buildfarm.cas.cfc.PutDirectoryException; +import build.buildfarm.v1test.ExecuteEntry; +import build.buildfarm.v1test.QueueEntry; +import build.buildfarm.v1test.QueuedOperation; +import build.buildfarm.worker.ExecDirException.ViolationException; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.rpc.Code; +import com.google.rpc.DebugInfo; +import com.google.rpc.Help; +import com.google.rpc.LocalizedMessage; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.RequestInfo; +import com.google.rpc.ResourceInfo; +import com.google.rpc.Status; +import java.io.IOException; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class InputFetcherTest { + @Test + public void onlyMissingFilesIsViolationMissingFailedPrecondition() throws Exception { + PipelineStage error = mock(PipelineStage.class); + Operation operation = Operation.newBuilder().setName("missing-inputs").build(); + ExecuteEntry executeEntry = + ExecuteEntry.newBuilder().setOperationName(operation.getName()).build(); + QueueEntry queueEntry = QueueEntry.newBuilder().setExecuteEntry(executeEntry).build(); + OperationContext operationContext = + OperationContext.newBuilder().setQueueEntry(queueEntry).setOperation(operation).build(); + Command command = Command.newBuilder().addArguments("/bin/false").build(); + QueuedOperation queuedOperation = QueuedOperation.newBuilder().setCommand(command).build(); + AtomicReference failedOperationRef = new AtomicReference<>(); + WorkerContext workerContext = + new StubWorkerContext() { + @Override + public QueuedOperation getQueuedOperation(QueueEntry queueEntry) { + return queuedOperation; + } + + @Override + public boolean putOperation(Operation operation) { + return failedOperationRef.compareAndSet(null, operation); + } + + @Override + public Path createExecDir( + String operationName, + Map directoriesIndex, + Action action, + Command command) + throws IOException { + Path root = Paths.get(operationName); + throw new ExecDirException( + Paths.get(operationName), + ImmutableList.of( + new ViolationException( + Digest.getDefaultInstance(), + root.resolve("input"), + /* isExecutable=*/ false, + new NoSuchFileException("input-digest")), + new PutDirectoryException( + root.resolve("dir"), + Digest.getDefaultInstance(), + ImmutableList.of(new NoSuchFileException("dir/input-digest"))))); + } + + @Override + public int getInputFetchStageWidth() { + return 1; + } + }; + InputFetchStage owner = new InputFetchStage(workerContext, /* output=*/ null, error); + InputFetcher inputFetcher = new InputFetcher(workerContext, operationContext, owner); + inputFetcher.fetchPolled(/* stopwatch=*/ null); + Operation failedOperation = checkNotNull(failedOperationRef.get()); + verify(error, times(1)).put(any(OperationContext.class)); + ExecuteResponse executeResponse = failedOperation.getResponse().unpack(ExecuteResponse.class); + Status status = executeResponse.getStatus(); + assertThat(status.getCode()).isEqualTo(Code.FAILED_PRECONDITION.getNumber()); + for (Any detail : status.getDetailsList()) { + if (!(detail.is(DebugInfo.class) + || detail.is(Help.class) + || detail.is(LocalizedMessage.class) + || detail.is(RequestInfo.class) + || detail.is(ResourceInfo.class))) { + assertThat(detail.is(PreconditionFailure.class)).isTrue(); + PreconditionFailure preconditionFailure = detail.unpack(PreconditionFailure.class); + assertThat(preconditionFailure.getViolationsCount()).isGreaterThan(0); + assertThat( + Iterables.all( + preconditionFailure.getViolationsList(), + violation -> violation.getType().equals(VIOLATION_TYPE_MISSING))) + .isTrue(); + } + } + } +} diff --git a/src/test/java/build/buildfarm/worker/StubWorkerContext.java b/src/test/java/build/buildfarm/worker/StubWorkerContext.java index 1b0272a0b6..d288d67a6f 100644 --- a/src/test/java/build/buildfarm/worker/StubWorkerContext.java +++ b/src/test/java/build/buildfarm/worker/StubWorkerContext.java @@ -34,6 +34,7 @@ import com.google.longrunning.Operation; import com.google.protobuf.Duration; import io.grpc.Deadline; +import java.io.IOException; import java.nio.file.Path; import java.util.List; import java.util.Map; @@ -142,10 +143,8 @@ public QueuedOperation getQueuedOperation(QueueEntry queueEntry) { @Override public Path createExecDir( - String operationName, - Map directoriesIndex, - Action action, - Command command) { + String operationName, Map directoriesIndex, Action action, Command command) + throws IOException, InterruptedException { throw new UnsupportedOperationException(); } From 653da3f119071d8ab95b76b90ea5a6239c913db0 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 25 Jun 2023 00:57:23 -0400 Subject: [PATCH 022/214] Initialize fileStore when skipping load (#1392) --- src/main/java/build/buildfarm/cas/cfc/CASFileCache.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 84fd0f3382..225a4bdcfa 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -1275,6 +1275,7 @@ public StartupCacheResults start( loadResults = loadCache(onStartPut, removeDirectoryService); } else { // Skip loading the cache and ensure it is empty + fileStore = Files.getFileStore(root); Directories.remove(root, fileStore, removeDirectoryService); initializeRootDirectory(); } From ccee33bd746bcaa97f4459aae33ec41aa97a4d33 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:10:54 -0700 Subject: [PATCH 023/214] Handle inaccurate information in backplane for fmb call (#1381) ### Problem When workers die, their stored references are not removed from the backplane. This creates the possibility that new workers may come up with the same IP address or use an IP address previously used by another terminated host. As a result, the backplane becomes unreliable, requiring us to query each worker individually to find missing blobs. Clearly, this approach is not scalable since any problems encountered by a single worker can significantly impact the performance of the buildfarm. ### Past Work We made code modifications for the `findMissingBlobs` function to exclusively query the backplane, prs: #1310, #1333, and #1342. This update implemented the `findMissingViaBackplane` flag. However, the above issues made the `findMissingViaBackplane` flag ineffective. ### Solution To address the issue of imposter workers, updated code to compare the start time of each worker (first_registered_at) with the insertion time of the digest. Any worker whose start time is later than the digest insertion time is considered an imposter worker. Also, the code removes imposter workers associated with the digest in the same function call. **first_registered_at**: Added new field first_registered_at to the worker data type. This field stores the initial start time of the worker. Worker informs the backplane about its start time, which is the same as the creation time of the cache directory (where all digests are stored) on the worker's disk. **digest insert time**: The digest insertion time is calculated using the Time to Live (TTL) of the digest and the casExpire time. The formula for determining the digest insertion time is now() - configured casExpire + remaining ttl. In the current implementation, each worker updates the TTL of the digest upon completing the write operation. This means that the cas insert time in the backplane corresponds to the time when the last worker finished writing the digest on its disk. ### Testing Deployed the change to our buildfarm staging, and ran full monorepo build. To make sure that the code change solve terminated worker problem, terminated bunch of workers in the middle of build. This caused temporary not_found `error`, which eventually faded away (fmb call autocorrect blob location). Screenshot 2023-06-21 at 12 36 47 PM In the above graph terminated workers during first build. ### Future Improvement The above solution might not work if user updates `cas_expire` time between two deployments as algorithm to calculate `digest_insert_time` depends to `cas_expire` time. closes #1371 --- .../build/buildfarm/backplane/Backplane.java | 6 ++ .../buildfarm/common/redis/RedisHashMap.java | 12 ++++ .../instance/shard/CasWorkerMap.java | 8 +++ .../instance/shard/JedisCasWorkerMap.java | 7 ++ .../instance/shard/RedisShardBackplane.java | 36 +++++++++- .../instance/shard/RedissonCasWorkerMap.java | 7 ++ .../instance/shard/ShardInstance.java | 49 +++++++++++-- .../build/buildfarm/worker/shard/Worker.java | 14 ++++ .../build/buildfarm/v1test/buildfarm.proto | 2 + .../common/redis/RedisHashMapTest.java | 15 ++++ .../shard/RedisShardBackplaneTest.java | 53 ++++++++++++++ .../instance/shard/ShardInstanceTest.java | 72 +++++++++++++------ 12 files changed, 252 insertions(+), 29 deletions(-) diff --git a/src/main/java/build/buildfarm/backplane/Backplane.java b/src/main/java/build/buildfarm/backplane/Backplane.java index 411a971766..557a7dc163 100644 --- a/src/main/java/build/buildfarm/backplane/Backplane.java +++ b/src/main/java/build/buildfarm/backplane/Backplane.java @@ -98,6 +98,12 @@ FindOperationsResults findEnrichedOperations(Instance instance, String filterPre Iterable> getOperations(Set operationIds) throws IOException; + /** Returns a map of the worker name and its start time for given workers. */ + Map getWorkersStartTimeInEpochSecs(Set workerNames) throws IOException; + + /** Returns the insert time epoch in seconds for the digest. */ + long getDigestInsertTime(Digest blobDigest) throws IOException; + /** Returns a set of the names of all active storage workers. */ Set getStorageWorkers() throws IOException; diff --git a/src/main/java/build/buildfarm/common/redis/RedisHashMap.java b/src/main/java/build/buildfarm/common/redis/RedisHashMap.java index 64ab462fbe..374a64131a 100644 --- a/src/main/java/build/buildfarm/common/redis/RedisHashMap.java +++ b/src/main/java/build/buildfarm/common/redis/RedisHashMap.java @@ -14,6 +14,8 @@ package build.buildfarm.common.redis; +import com.google.common.collect.Iterables; +import java.util.List; import java.util.Map; import java.util.Set; import redis.clients.jedis.JedisCluster; @@ -136,4 +138,14 @@ public Set keys(JedisCluster jedis) { public Map asMap(JedisCluster jedis) { return jedis.hgetAll(name); } + + /** + * @brief Get values associated with the specified fields from the hashmap. + * @param jedis Jedis cluster client. + * @param fields The name of the fields. + * @return Values associated with the specified fields + */ + public List mget(JedisCluster jedis, Iterable fields) { + return jedis.hmget(name, Iterables.toArray(fields, String.class)); + } } diff --git a/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java index 4e6f7bb617..794b296a1f 100644 --- a/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java @@ -94,6 +94,14 @@ void removeAll(RedisClient client, Iterable blobDigests, String workerNa */ Set get(RedisClient client, Digest blobDigest) throws IOException; + /** + * @brief Get insert time for the digest. + * @param client Client used for interacting with redis when not using cacheMap. + * @param blobDigest The blob digest to lookup for insert time. + * @return insert time of the digest. + */ + long insertTime(RedisClient client, Digest blobDigest) throws IOException; + /** * @brief Get all of the key values as a map from the digests given. * @details If there are no workers for the digest, the key is left out of the returned map. diff --git a/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java index 097bc2e085..d035d10491 100644 --- a/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java @@ -20,6 +20,7 @@ import build.buildfarm.common.redis.RedisClient; import com.google.common.collect.ImmutableMap; import java.io.IOException; +import java.time.Instant; import java.util.Map; import java.util.Set; import redis.clients.jedis.JedisClusterPipeline; @@ -189,6 +190,12 @@ public Set get(RedisClient client, Digest blobDigest) throws IOException return client.call(jedis -> jedis.smembers(key)); } + @Override + public long insertTime(RedisClient client, Digest blobDigest) throws IOException { + String key = redisCasKey(blobDigest); + return Instant.now().getEpochSecond() - keyExpiration_s + client.call(jedis -> jedis.ttl(key)); + } + /** * @brief Get all of the key values as a map from the digests given. * @details If there are no workers for the digest, the key is left out of the returned map. diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 681cda1325..864c808369 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -79,12 +79,14 @@ import io.grpc.Deadline; import java.io.IOException; import java.time.Instant; +import java.util.AbstractMap; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.function.Consumer; @@ -686,7 +688,7 @@ public void deregisterWorker(String workerName) throws IOException { public synchronized Set getStorageWorkers() throws IOException { if (storageWorkersDeadline == null || storageWorkersDeadline.isExpired()) { synchronized (storageWorkerSet) { - Set newWorkerSet = client.call(jedis -> fetchAndExpireStorageWorkers(jedis)); + Set newWorkerSet = client.call(this::fetchAndExpireStorageWorkers); storageWorkerSet.clear(); storageWorkerSet.addAll(newWorkerSet); } @@ -695,6 +697,38 @@ public synchronized Set getStorageWorkers() throws IOException { return new HashSet<>(storageWorkerSet); } + @Override + public Map getWorkersStartTimeInEpochSecs(Set workerNames) + throws IOException { + if (workerNames.isEmpty()) { + return Collections.emptyMap(); + } + List workerList = client.call(jedis -> state.storageWorkers.mget(jedis, workerNames)); + + return workerList.stream() + .filter(Objects::nonNull) + .map( + workerJson -> { + try { + ShardWorker.Builder builder = ShardWorker.newBuilder(); + JsonFormat.parser().merge(workerJson, builder); + ShardWorker worker = builder.build(); + return new AbstractMap.SimpleEntry<>( + worker.getEndpoint(), worker.getFirstRegisteredAt() / 1000L); + } catch (InvalidProtocolBufferException e) { + return null; + } + }) + .filter(Objects::nonNull) + .collect( + Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue)); + } + + @Override + public long getDigestInsertTime(Digest blobDigest) throws IOException { + return state.casWorkerMap.insertTime(client, blobDigest); + } + private synchronized Set getExecuteWorkers() throws IOException { try { return recentExecuteWorkers.get(); diff --git a/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java index 8800a051da..234e15fb15 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java @@ -18,6 +18,7 @@ import build.buildfarm.common.DigestUtil; import build.buildfarm.common.redis.RedisClient; import com.google.common.collect.ImmutableMap; +import java.time.Instant; import java.util.Map; import java.util.Random; import java.util.Set; @@ -169,6 +170,12 @@ public Set get(RedisClient client, Digest blobDigest) { return cacheMap.get(key).readAll(); } + @Override + public long insertTime(RedisClient client, Digest blobDigest) { + String key = cacheMapCasKey(blobDigest); + return Instant.now().getEpochSecond() - keyExpiration_s + cacheMap.get(key).remainTimeToLive(); + } + /** * @brief Get all of the key values as a map from the digests given. * @details If there are no workers for the digest, the key is left out of the returned map. diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index 26c7928c24..129741d00e 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -132,6 +132,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.time.Instant; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; @@ -660,7 +661,7 @@ public ListenableFuture> findMissingBlobs( // risk of returning expired workers despite filtering by active workers below. This is because // the strategy may return workers that have expired in the last 30 seconds. However, checking // workers directly is not a guarantee either since workers could leave the cluster after being - // queried. Ultimitely, it will come down to the client's resiliency if the backplane is + // queried. Ultimately, it will come down to the client's resiliency if the backplane is // out-of-date and the server lies about which blobs are actually present. We provide this // alternative strategy for calculating missing blobs. @@ -670,15 +671,45 @@ public ListenableFuture> findMissingBlobs( nonEmptyDigests.forEach(uniqueDigests::add); Map> foundBlobs = backplane.getBlobDigestsWorkers(uniqueDigests); Set workerSet = backplane.getStorageWorkers(); + Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerSet); return immediateFuture( uniqueDigests.stream() .filter( // best effort to present digests only missing on active workers - digest -> - Sets.intersection( - foundBlobs.getOrDefault(digest, Collections.emptySet()), workerSet) - .isEmpty()) + digest -> { + try { + Set initialWorkers = + foundBlobs.getOrDefault(digest, Collections.emptySet()); + Set activeWorkers = Sets.intersection(initialWorkers, workerSet); + long insertTime = backplane.getDigestInsertTime(digest); + Set workersStartedBeforeDigestInsertion = + activeWorkers.stream() + .filter( + worker -> + workersStartTime.getOrDefault( + worker, Instant.now().getEpochSecond()) + < insertTime) + .collect(Collectors.toSet()); + Set workersToBeRemoved = + Sets.difference(initialWorkers, workersStartedBeforeDigestInsertion) + .immutableCopy(); + if (!workersToBeRemoved.isEmpty()) { + log.log( + Level.INFO, format("adjusting locations for the digest %s", digest)); + backplane.adjustBlobLocations( + digest, Collections.emptySet(), workersToBeRemoved); + } + return workersStartedBeforeDigestInsertion.isEmpty(); + } catch (IOException e) { + // Treat error as missing digest. + log.log( + Level.WARNING, + format("failed to get digest (%s) insertion time", digest)); + return true; + } + }) .collect(Collectors.toList())); } catch (Exception e) { + log.log(Level.SEVERE, "find missing blob via backplane failed", e); return immediateFailedFuture(Status.fromThrowable(e).asException()); } } @@ -855,13 +886,19 @@ public void onError(Throwable t) { } else if (status.getCode() == Code.NOT_FOUND) { casMissCounter.inc(); log.log( - Level.FINE, worker + " did not contain " + DigestUtil.toString(blobDigest)); + configs.getServer().isEnsureOutputsPresent() ? Level.WARNING : Level.FINE, + worker + " did not contain " + DigestUtil.toString(blobDigest)); // ignore this, the worker will update the backplane eventually } else if (status.getCode() != Code.DEADLINE_EXCEEDED && SHARD_IS_RETRIABLE.test(status)) { // why not, always workers.addLast(worker); } else { + log.log( + Level.WARNING, + format( + "DEADLINE_EXCEEDED: read(%s) on worker %s after %d bytes of content", + DigestUtil.toString(blobDigest), worker, received)); blobObserver.onError(t); return; } diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 271ee47b16..e1b0919fda 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -72,7 +72,9 @@ import java.io.File; import java.io.IOException; import java.nio.file.FileSystem; +import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.UserPrincipal; import java.util.Arrays; import java.util.List; @@ -448,6 +450,7 @@ private void startFailsafeRegistration() { String endpoint = configs.getWorker().getPublicName(); ShardWorker.Builder worker = ShardWorker.newBuilder().setEndpoint(endpoint); worker.setWorkerType(configs.getWorker().getWorkerType()); + worker.setFirstRegisteredAt(loadWorkerStartTimeInMillis()); int registrationIntervalMillis = 10000; int registrationOffsetMillis = registrationIntervalMillis * 3; new Thread( @@ -512,6 +515,17 @@ public void run() { .start(); } + private long loadWorkerStartTimeInMillis() { + try { + File cache = new File(configs.getWorker().getRoot() + "/cache"); + return Files.readAttributes(cache.toPath(), BasicFileAttributes.class) + .creationTime() + .toMillis(); + } catch (IOException e) { + return System.currentTimeMillis(); + } + } + public void start() throws ConfigurationException, InterruptedException, IOException { String session = UUID.randomUUID().toString(); ServerBuilder serverBuilder = ServerBuilder.forPort(configs.getWorker().getPort()); diff --git a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto index 15afe1065a..b4c78b3c03 100644 --- a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto +++ b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto @@ -270,6 +270,8 @@ message ShardWorker { int64 expire_at = 2; int32 worker_type = 3; + + int64 first_registered_at = 4; } message WorkerChange { diff --git a/src/test/java/build/buildfarm/common/redis/RedisHashMapTest.java b/src/test/java/build/buildfarm/common/redis/RedisHashMapTest.java index 95a530982c..dc6d559b3e 100644 --- a/src/test/java/build/buildfarm/common/redis/RedisHashMapTest.java +++ b/src/test/java/build/buildfarm/common/redis/RedisHashMapTest.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import org.junit.After; @@ -255,4 +256,18 @@ public void redisRemoveAll() throws Exception { Map elements = map.asMap(redis); assertThat(elements.equals(expected)).isTrue(); } + + @Test + public void redisMget() { + RedisHashMap map = new RedisHashMap("test"); + map.insert(redis, "key1", "value1"); + map.insert(redis, "key2", "value2"); + map.insert(redis, "key3", "value3"); + map.insert(redis, "key4", "value4"); + + Iterable fields = Arrays.asList("key2", "key3"); + List expected = Arrays.asList("value2", "value3"); + + assertThat(map.mget(redis, fields)).containsExactlyElementsIn(expected); + } } diff --git a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java index a893540fd1..97d8fb5d0f 100644 --- a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java +++ b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import build.bazel.remote.execution.v2.Digest; import build.bazel.remote.execution.v2.Platform; import build.bazel.remote.execution.v2.RequestMetadata; import build.buildfarm.common.config.BuildfarmConfigs; @@ -33,11 +34,16 @@ import build.buildfarm.v1test.QueueEntry; import build.buildfarm.v1test.WorkerChange; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import com.google.longrunning.Operation; import com.google.protobuf.util.JsonFormat; import java.io.IOException; +import java.time.Instant; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.UUID; import java.util.function.Supplier; import org.junit.Before; @@ -350,4 +356,51 @@ public void invocationsCanBeBlacklisted() throws IOException { verify(mockJedisClusterFactory, times(1)).get(); verify(jedisCluster, times(1)).exists(invocationBlacklistKey); } + + @Test + public void testGetWorkersStartTime() throws IOException { + JedisCluster jedisCluster = mock(JedisCluster.class); + when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); + backplane = + new RedisShardBackplane("workers-starttime-test", o -> o, o -> o, mockJedisClusterFactory); + backplane.start("startTime/test:0000"); + + Set workerNames = ImmutableSet.of("worker1", "worker2", "missing_worker"); + + String storageWorkerKey = configs.getBackplane().getWorkersHashName() + "_storage"; + List workersJson = + Arrays.asList( + "{\"endpoint\": \"worker1\", \"expireAt\": \"1686981022917\", \"workerType\": 3, \"firstRegisteredAt\": \"1685292624000\"}", + "{\"endpoint\": \"worker2\", \"expireAt\": \"1686981022917\", \"workerType\": 3, \"firstRegisteredAt\": \"1685282624000\"}", + null); + when(jedisCluster.hmget(storageWorkerKey, "worker1", "worker2", "missing_worker")) + .thenReturn(workersJson); + Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerNames); + assertThat(workersStartTime.size()).isEqualTo(2); + assertThat(workersStartTime.get("worker1")).isEqualTo(1685292624L); + assertThat(workersStartTime.get("worker2")).isEqualTo(1685282624L); + assertThat(workersStartTime.get("missing_worker")).isNull(); + } + + @Test + public void getDigestInsertTime() throws IOException { + JedisCluster jedisCluster = mock(JedisCluster.class); + when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); + backplane = + new RedisShardBackplane("digest-inserttime-test", o -> o, o -> o, mockJedisClusterFactory); + backplane.start("startTime/test:0000"); + long ttl = 3600L; + long expirationInSecs = configs.getBackplane().getCasExpire(); + when(jedisCluster.ttl("ContentAddressableStorage:abc/0")).thenReturn(ttl); + + Digest digest = Digest.newBuilder().setHash("abc").build(); + + Long insertTimeInSecs = backplane.getDigestInsertTime(digest); + + // Assuming there could be at most 2s delay in execution of both + // `Instant.now().getEpochSecond()` call. + assertThat(insertTimeInSecs) + .isGreaterThan(Instant.now().getEpochSecond() - expirationInSecs + ttl - 2); + assertThat(insertTimeInSecs).isAtMost(Instant.now().getEpochSecond() - expirationInSecs + ttl); + } } diff --git a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java b/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java index 6613d68fac..1fdb7fc460 100644 --- a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java @@ -79,6 +79,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import com.google.common.util.concurrent.ListenableFuture; import com.google.longrunning.Operation; import com.google.protobuf.Any; @@ -1052,26 +1053,31 @@ public void containsBlobReflectsWorkerWithUnknownSize() throws Exception { @Test public void findMissingBlobsTest_ViaBackPlane() throws Exception { - Set activeWorkers = new HashSet<>(Arrays.asList("worker1", "worker2", "worker3")); - Set expiredWorker = new HashSet<>(Arrays.asList("workerX", "workerY", "workerZ")); + Set activeWorkers = ImmutableSet.of("worker1", "worker2", "worker3"); + Set expiredWorkers = ImmutableSet.of("workerX", "workerY", "workerZ"); + Set imposterWorkers = ImmutableSet.of("imposter1", "imposter2", "imposter3"); Set availableDigests = - new HashSet<>( - Arrays.asList( - Digest.newBuilder().setHash("toBeFound1").setSizeBytes(1).build(), - Digest.newBuilder().setHash("toBeFound2").setSizeBytes(1).build(), - Digest.newBuilder().setHash("toBeFound3").setSizeBytes(1).build(), - // a copy is added in final digest list - Digest.newBuilder().setHash("toBeFoundDuplicate").setSizeBytes(1).build())); + ImmutableSet.of( + Digest.newBuilder().setHash("toBeFound1").setSizeBytes(1).build(), + Digest.newBuilder().setHash("toBeFound2").setSizeBytes(1).build(), + Digest.newBuilder().setHash("toBeFound3").setSizeBytes(1).build(), + // a copy is added in final digest list + Digest.newBuilder().setHash("toBeFoundDuplicate").setSizeBytes(1).build()); Set missingDigests = - new HashSet<>( - Arrays.asList( - Digest.newBuilder().setHash("missing1").setSizeBytes(1).build(), - Digest.newBuilder().setHash("missing2").setSizeBytes(1).build(), - Digest.newBuilder().setHash("missing3").setSizeBytes(1).build(), - // a copy is added in final digest list - Digest.newBuilder().setHash("missingDuplicate").setSizeBytes(1).build())); + ImmutableSet.of( + Digest.newBuilder().setHash("missing1").setSizeBytes(1).build(), + Digest.newBuilder().setHash("missing2").setSizeBytes(1).build(), + Digest.newBuilder().setHash("missing3").setSizeBytes(1).build(), + // a copy is added in final digest list + Digest.newBuilder().setHash("missingDuplicate").setSizeBytes(1).build()); + + Set digestAvailableOnImposters = + ImmutableSet.of( + Digest.newBuilder().setHash("toBeFoundOnImposter1").setSizeBytes(1).build(), + Digest.newBuilder().setHash("toBeFoundOnImposter2").setSizeBytes(1).build(), + Digest.newBuilder().setHash("toBeFoundOnImposter3").setSizeBytes(1).build()); Set emptyDigests = new HashSet<>( @@ -1084,6 +1090,7 @@ public void findMissingBlobsTest_ViaBackPlane() throws Exception { availableDigests, missingDigests, emptyDigests, + digestAvailableOnImposters, Arrays.asList( Digest.newBuilder().setHash("toBeFoundDuplicate").setSizeBytes(1).build(), Digest.newBuilder().setHash("missingDuplicate").setSizeBytes(1).build())); @@ -1094,24 +1101,45 @@ public void findMissingBlobsTest_ViaBackPlane() throws Exception { digestAndWorkersMap.put(digest, getRandomSubset(activeWorkers)); } for (Digest digest : missingDigests) { - digestAndWorkersMap.put(digest, getRandomSubset(expiredWorker)); + digestAndWorkersMap.put(digest, getRandomSubset(expiredWorkers)); + } + for (Digest digest : digestAvailableOnImposters) { + digestAndWorkersMap.put(digest, getRandomSubset(imposterWorkers)); } BuildfarmConfigs buildfarmConfigs = instance.getBuildFarmConfigs(); buildfarmConfigs.getServer().setFindMissingBlobsViaBackplane(true); - when(mockBackplane.getStorageWorkers()).thenReturn(activeWorkers); + Set activeAndImposterWorkers = + Sets.newHashSet(Iterables.concat(activeWorkers, imposterWorkers)); + when(mockBackplane.getStorageWorkers()).thenReturn(activeAndImposterWorkers); when(mockBackplane.getBlobDigestsWorkers(any(Iterable.class))).thenReturn(digestAndWorkersMap); + long serverStartTime = 1686951033L; // june 15th, 2023 + Map workersStartTime = new HashMap<>(); + for (String worker : activeAndImposterWorkers) { + workersStartTime.put(worker, serverStartTime); + } + when(mockBackplane.getWorkersStartTimeInEpochSecs(activeAndImposterWorkers)) + .thenReturn(workersStartTime); + long oneDay = 86400L; + for (Digest digest : availableDigests) { + when(mockBackplane.getDigestInsertTime(digest)).thenReturn(serverStartTime + oneDay); + } + for (Digest digest : digestAvailableOnImposters) { + when(mockBackplane.getDigestInsertTime(digest)).thenReturn(serverStartTime - oneDay); + } + Iterable actualMissingDigests = instance.findMissingBlobs(allDigests, RequestMetadata.getDefaultInstance()).get(); + Iterable expectedMissingDigests = + Iterables.concat(missingDigests, digestAvailableOnImposters); + + assertThat(actualMissingDigests).containsExactlyElementsIn(expectedMissingDigests); for (Digest digest : actualMissingDigests) { assertThat(digest).isNotIn(availableDigests); assertThat(digest).isNotIn(emptyDigests); - assertThat(digest).isIn(missingDigests); - } - for (Digest digest : missingDigests) { - assertThat(digest).isIn(actualMissingDigests); + assertThat(digest).isIn(expectedMissingDigests); } // reset BuildfarmConfigs From e0e7f2ca34ea2b6f9611d4c326e557c5f54dacf0 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 7 May 2023 20:07:44 -0400 Subject: [PATCH 024/214] Attempt to resolve commit vs expire race --- .../build/buildfarm/cas/cfc/CASFileCache.java | 82 +++++++++++++++++-- 1 file changed, 75 insertions(+), 7 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 225a4bdcfa..11b6b3ba23 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -126,6 +126,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Supplier; @@ -175,6 +176,19 @@ public abstract class CASFileCache implements ContentAddressableStorage { private final LockMap locks = new LockMap(); @Nullable private final ContentAddressableStorage delegate; private final boolean delegateSkipLoad; + private final LoadingCache keyLocks = + CacheBuilder.newBuilder() + .expireAfterAccess( + 1, MINUTES) // hopefully long enough for any of our file ops to take place and prevent + // collision + .build( + new CacheLoader() { + @Override + public Lock load(String key) { + // should be sufficient for what we're doing + return new ReentrantLock(); + } + }); private final LoadingCache writes = CacheBuilder.newBuilder() .expireAfterAccess(1, HOURS) @@ -1297,7 +1311,7 @@ public StartupCacheResults start( try { casSizeMetric.set(size()); casEntryCountMetric.set(entryCount()); - TimeUnit.MINUTES.sleep(5); + MINUTES.sleep(5); } catch (InterruptedException e) { Thread.currentThread().interrupt(); break; @@ -1605,7 +1619,7 @@ private void joinThreads(ExecutorService pool, String message) throws Interrupte pool.shutdown(); while (!pool.isTerminated()) { log.log(Level.INFO, message); - pool.awaitTermination(1, TimeUnit.MINUTES); + pool.awaitTermination(1, MINUTES); } } @@ -1687,6 +1701,10 @@ public Path getPath(String filename) { return entryPathStrategy.getPath(filename); } + public Path getRemovingPath(String filename) { + return entryPathStrategy.getPath(filename + "_removed"); + } + private synchronized void dischargeAndNotify(long size) { discharge(size); notify(); @@ -1873,6 +1891,55 @@ private static boolean causedByInterrupted(Exception e) { || e instanceof ClosedByInterruptException; } + private Entry safeStorageInsertion(String key, Entry entry) { + Lock lock; + try { + lock = keyLocks.get(key); + } catch (ExecutionException e) { + // impossible without exception instantiating lock + throw new RuntimeException(e); + } + + lock.lock(); + try { + return storage.putIfAbsent(key, entry); + } finally { + lock.unlock(); + } + } + + private Entry safeStorageRemoval(String key) throws IOException { + Path path = getPath(key); + Path expiredPath = getRemovingPath(key); + boolean deleteExpiredPath = false; + + Lock lock; + try { + lock = keyLocks.get(key); + } catch (ExecutionException e) { + // impossible without exception instantiating lock + throw new IOException(e); + } + + lock.lock(); + try { + Files.createLink(expiredPath, path); + deleteExpiredPath = true; + Files.delete(path); + deleteExpiredPath = false; + return storage.remove(key); + } finally { + if (deleteExpiredPath) { + try { + Files.delete(expiredPath); + } catch (IOException e) { + log.log(Level.SEVERE, "error cleaning up after failed safeStorageRemoval", e); + } + } + lock.unlock(); + } + } + @SuppressWarnings("NonAtomicOperationOnVolatileField") @GuardedBy("this") private ListenableFuture expireEntry(long blobSizeInBytes, ExecutorService service) @@ -1894,7 +1961,7 @@ private ListenableFuture expireEntry(long blobSizeInBytes, ExecutorServic } catch (IOException ioEx) { interrupted = causedByInterrupted(ioEx); } - Entry removedEntry = storage.remove(e.key); + Entry removedEntry = safeStorageRemoval(e.key); // reference compare on purpose if (removedEntry == e) { ListenableFuture entryFuture = dischargeEntryFuture(e, service); @@ -2616,10 +2683,11 @@ private CancellableOutputStream putOrReference( } } - private void deleteExpiredKey(Path path) throws IOException { + private void deleteExpiredKey(String key) throws IOException { // We don't want publishing the metric to delay the deletion of the file. // We publish the metric only after the file has been deleted. long createdTime = 0; + Path path = getRemovingPath(key); if (publishTtlMetric) { createdTime = path.toFile().lastModified(); } @@ -2661,8 +2729,7 @@ private boolean charge(String key, long blobSizeInBytes, AtomicBoolean requiresD (expiredEntry) -> { String expiredKey = expiredEntry.key; try { - Path path = getPath(expiredKey); - deleteExpiredKey(path); + deleteExpiredKey(expiredKey); } catch (NoSuchFileException eNoEnt) { log.log( Level.SEVERE, @@ -2876,8 +2943,9 @@ void commit() throws IOException { Entry existingEntry = null; boolean inserted = false; try { + // acquire the key lock Files.createLink(CASFileCache.this.getPath(key), writePath); - existingEntry = storage.putIfAbsent(key, entry); + existingEntry = safeStorageInsertion(key, entry); inserted = existingEntry == null; } catch (FileAlreadyExistsException e) { log.log(Level.FINE, "file already exists for " + key + ", nonexistent entry will fail"); From 8d858261bf8578de60112de183158024257718a2 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 4 Jun 2023 11:24:09 -0400 Subject: [PATCH 025/214] Exit server on transform token exhaustion When a server cannot acquire a transform token for an extended period of time, assume that it is malfunctioning and initiate a shutdown. --- .../java/build/buildfarm/instance/shard/ShardInstance.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index 129741d00e..bc80520bf5 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -450,8 +450,7 @@ public void onFailure(Throwable t) { public void run() { log.log(Level.FINE, "OperationQueuer: Running"); try { - for (; ; ) { - transformTokensQueue.put(new Object()); + while (transformTokensQueue.offer(new Object(), 5, MINUTES)) { stopwatch.start(); try { iterate() @@ -474,6 +473,7 @@ public void run() { stopwatch.reset(); } } + log.severe("OperationQueuer: Transform lease token timed out"); } catch (InterruptedException e) { // treat with exit operationQueuer = null; From a9936f008d975e0ccb3d1a7bd26e97902b28f080 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Mon, 3 Jul 2023 09:27:32 -0700 Subject: [PATCH 026/214] Fix: custom latency buckets #1376 (#1396) --- src/main/java/build/buildfarm/common/config/GrpcMetrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java index a028035673..8855ae5fdb 100644 --- a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java +++ b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java @@ -27,7 +27,7 @@ public static void handleGrpcMetricIntercepts( // provide custom latency buckets if (grpcMetrics.getLatencyBuckets() != null) { - grpcConfig.withLatencyBuckets(grpcMetrics.getLatencyBuckets()); + grpcConfig = grpcConfig.withLatencyBuckets(grpcMetrics.getLatencyBuckets()); } // Apply config to create an interceptor and apply it to the GRPC server. From f74f270a01397f47409ec0276aaa5c4a611b5c68 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 6 Jul 2023 12:30:09 -0400 Subject: [PATCH 027/214] Supply a basic retrier to remote cas writes Worker loss can signal cascading failure and shutdown for execute-only peers. Ensure that a ReportResultStage seeing an SRE does not close the stage, and that there are basic retries for remote uploads. --- .../buildfarm/worker/ReportResultStage.java | 3 +- .../worker/shard/RemoteCasWriter.java | 43 +++++++++++++------ .../build/buildfarm/worker/shard/Worker.java | 5 ++- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/ReportResultStage.java b/src/main/java/build/buildfarm/worker/ReportResultStage.java index a3d959dc06..d7bf8eeba2 100644 --- a/src/main/java/build/buildfarm/worker/ReportResultStage.java +++ b/src/main/java/build/buildfarm/worker/ReportResultStage.java @@ -35,6 +35,7 @@ import com.google.rpc.Status; import io.grpc.Deadline; import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; import io.grpc.protobuf.StatusProto; import java.io.IOException; import java.nio.channels.ClosedByInterruptException; @@ -99,7 +100,7 @@ private OperationContext reportPolled(OperationContext operationContext) resultBuilder, operationContext.execDir, operationContext.command); - } catch (StatusException e) { + } catch (StatusException | StatusRuntimeException e) { ExecuteResponse executeResponse = operationContext.executeResponse.build(); if (executeResponse.getStatus().getCode() == Code.OK.getNumber() && executeResponse.getResult().getExitCode() == 0) { diff --git a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java index 1ec624dcb4..c7b21bbd0b 100644 --- a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java +++ b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java @@ -23,6 +23,8 @@ import build.bazel.remote.execution.v2.RequestMetadata; import build.buildfarm.common.Size; import build.buildfarm.common.Write; +import build.buildfarm.common.grpc.Retrier; +import build.buildfarm.common.grpc.RetryException; import build.buildfarm.common.io.FeedbackOutputStream; import build.buildfarm.instance.Instance; import com.google.common.base.Throwables; @@ -46,12 +48,15 @@ @Log public class RemoteCasWriter implements CasWriter { - private Set workerSet; - private LoadingCache workerStubs; + private final Set workerSet; + private final LoadingCache workerStubs; + private final Retrier retrier; - public RemoteCasWriter(Set workerSet, LoadingCache workerStubs) { + public RemoteCasWriter( + Set workerSet, LoadingCache workerStubs, Retrier retrier) { this.workerSet = workerSet; this.workerStubs = workerStubs; + this.retrier = retrier; } public void write(Digest digest, Path file) throws IOException, InterruptedException { @@ -63,19 +68,30 @@ public void write(Digest digest, Path file) throws IOException, InterruptedExcep private void insertFileToCasMember(Digest digest, Path file) throws IOException, InterruptedException { try (InputStream in = Files.newInputStream(file)) { - writeToCasMember(digest, in); - } catch (ExecutionException e) { - throw new IOException(Status.RESOURCE_EXHAUSTED.withCause(e).asRuntimeException()); + retrier.execute(() -> writeToCasMember(digest, in)); + } catch (RetryException e) { + Throwable cause = e.getCause(); + Throwables.throwIfInstanceOf(cause, IOException.class); + Throwables.throwIfUnchecked(cause); + throw new RuntimeException(cause); } } - private void writeToCasMember(Digest digest, InputStream in) - throws IOException, InterruptedException, ExecutionException { + private long writeToCasMember(Digest digest, InputStream in) + throws IOException, InterruptedException { // create a write for inserting into another CAS member. String workerName = getRandomWorker(); Write write = getCasMemberWrite(digest, workerName); - streamIntoWriteFuture(in, write, digest).get(); + try { + return streamIntoWriteFuture(in, write, digest).get(); + } catch (ExecutionException e) { + Throwable cause = e.getCause(); + Throwables.throwIfInstanceOf(cause, IOException.class); + // prevent a discard of this frame + Status status = Status.fromThrowable(cause); + throw status.asRuntimeException(); + } } private Write getCasMemberWrite(Digest digest, String workerName) throws IOException { @@ -93,13 +109,12 @@ public void insertBlob(Digest digest, ByteString content) private void insertBlobToCasMember(Digest digest, ByteString content) throws IOException, InterruptedException { try (InputStream in = content.newInput()) { - writeToCasMember(digest, in); - } catch (ExecutionException e) { + retrier.execute(() -> writeToCasMember(digest, in)); + } catch (RetryException e) { Throwable cause = e.getCause(); - Throwables.throwIfUnchecked(cause); Throwables.throwIfInstanceOf(cause, IOException.class); - Status status = Status.fromThrowable(cause); - throw new IOException(status.asException()); + Throwables.throwIfUnchecked(cause); + throw new RuntimeException(cause); } } diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index e1b0919fda..da698726de 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -39,6 +39,8 @@ import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.config.Cas; import build.buildfarm.common.config.GrpcMetrics; +import build.buildfarm.common.grpc.Retrier; +import build.buildfarm.common.grpc.Retrier.Backoff; import build.buildfarm.common.services.ByteStreamService; import build.buildfarm.common.services.ContentAddressableStorageService; import build.buildfarm.instance.Instance; @@ -577,7 +579,8 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep // Create the appropriate writer for the context CasWriter writer; if (!configs.getWorker().getCapabilities().isCas()) { - writer = new RemoteCasWriter(backplane.getStorageWorkers(), workerStubs); + Retrier retrier = new Retrier(Backoff.sequential(5), Retrier.DEFAULT_IS_RETRIABLE); + writer = new RemoteCasWriter(backplane.getStorageWorkers(), workerStubs, retrier); } else { writer = new LocalCasWriter(execFileSystem); } From f7eb74aa55db6158a87c5eb8cfc1c2c51082adfa Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 12 Jul 2023 12:12:08 -0400 Subject: [PATCH 028/214] Update buildfarm-indexer for upstream updates Works with current redis-py-cluster 2.1.3 --- tools/buildfarm-indexer.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/buildfarm-indexer.py b/tools/buildfarm-indexer.py index 824763dd21..b020cb91d5 100755 --- a/tools/buildfarm-indexer.py +++ b/tools/buildfarm-indexer.py @@ -1,5 +1,5 @@ from redis.client import Pipeline -from rediscluster import StrictRedisCluster +from rediscluster import RedisCluster import sys def get_cas_page(r, cursor, count): @@ -15,7 +15,7 @@ def get_cas_page(r, cursor, count): print ("usage: buildfarm-indexer.py ") sys.exit(1) -r = StrictRedisCluster(startup_nodes=[{"host": redis_host, "port": 6379}], skip_full_coverage_check=True) +r = RedisCluster(startup_nodes=[{"host": redis_host, "port": 6379}], skip_full_coverage_check=True) nodes = r.connection_pool.nodes @@ -30,14 +30,15 @@ def get_cas_page(r, cursor, count): slots.remove(slot) node_keys[slot] = str(node_key) -workers = r.hkeys("Workers") +# config f"{backplane.workersHashName}_storage" +workers = r.hkeys("Workers_storage") worker_count = len(workers) print ("%d workers" % worker_count) p = r.pipeline() -for node_key in node_keys.viewvalues(): +for node_key in node_keys.values(): p.delete("{%s}:intersecting-workers" % node_key) p.sadd("{%s}:intersecting-workers" % node_key, *workers) p.execute() @@ -101,8 +102,9 @@ def process(self, cas_names, conn): count = len(cas_names) p = self.pipeline(conn) for i in range(count): - name = cas_names[i] - node_key = node_keys[nodes.keyslot(str(name))] + name = cas_names[i].decode() + keyslot = nodes.keyslot(name) + node_key = node_keys[keyslot] set_key = "{%s}:intersecting-workers" % node_key p.sinterstore(name, set_key, name) p.execute() @@ -116,8 +118,8 @@ def process(self, cas_names, conn): map_cas_page(r, 10000, indexer.process) p = r.pipeline() -for node_key in node_keys.viewvalues(): +for node_key in node_keys.values(): p.delete("{%s}:intersecting-workers" % node_key) p.execute() -print("\n%d processed" % (indexer.processed)) \ No newline at end of file +print("\n%d processed" % (indexer.processed)) From f893b5a270b1e98890bdf572adbce219bca8b3d0 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 12 Jul 2023 13:34:03 -0400 Subject: [PATCH 029/214] Commonize grpc createChannel with TLS selection --- .../build/buildfarm/admin/aws/AwsAdmin.java | 8 ++-- src/main/java/build/buildfarm/admin/aws/BUILD | 2 +- src/main/java/build/buildfarm/cas/BUILD | 1 - .../cas/ContentAddressableStorages.java | 9 +---- .../java/build/buildfarm/common/grpc/BUILD | 1 + .../build/buildfarm/common/grpc/Channels.java | 40 +++++++++++++++++++ .../build/buildfarm/common/services/BUILD | 1 - .../build/buildfarm/instance/server/BUILD | 1 - .../java/build/buildfarm/instance/shard/BUILD | 1 - .../buildfarm/instance/shard/WorkerStubs.java | 10 +---- .../java/build/buildfarm/instance/stub/BUILD | 1 - .../build/buildfarm/operations/finder/BUILD | 1 - .../server/services/AdminService.java | 8 ++-- .../build/buildfarm/server/services/BUILD | 1 - src/main/java/build/buildfarm/tools/Ac.java | 10 +---- src/main/java/build/buildfarm/tools/BUILD | 22 +++++----- .../java/build/buildfarm/tools/Cancel.java | 10 +---- src/main/java/build/buildfarm/tools/Cat.java | 9 +---- .../java/build/buildfarm/tools/Executor.java | 9 +---- .../java/build/buildfarm/tools/Extract.java | 9 +---- .../build/buildfarm/tools/FindOperations.java | 10 +---- .../buildfarm/tools/GracefulShutdownTest.java | 10 +---- src/main/java/build/buildfarm/tools/Hist.java | 10 +---- .../build/buildfarm/tools/IndexWorker.java | 10 +---- .../java/build/buildfarm/tools/Mount.java | 9 +---- .../build/buildfarm/tools/WorkerProfile.java | 11 +---- src/main/java/build/buildfarm/worker/BUILD | 1 - .../java/build/buildfarm/worker/shard/BUILD | 1 - 28 files changed, 78 insertions(+), 138 deletions(-) create mode 100644 src/main/java/build/buildfarm/common/grpc/Channels.java diff --git a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java b/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java index 5b971405cd..ebb3746b63 100644 --- a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java +++ b/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java @@ -14,6 +14,8 @@ package build.buildfarm.admin.aws; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.admin.Admin; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.v1test.AdminGrpc; @@ -41,8 +43,6 @@ import com.amazonaws.services.simplesystemsmanagement.model.SendCommandRequest; import com.google.protobuf.util.Timestamps; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -206,9 +206,7 @@ public void disableHostScaleInProtection(String privateDnsName) { public void disableHostScaleInProtection(String clusterEndpoint, String instanceIp) { ManagedChannel channel = null; try { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(clusterEndpoint).negotiationType(NegotiationType.PLAINTEXT); - channel = builder.build(); + channel = createChannel(clusterEndpoint); AdminGrpc.AdminBlockingStub adminBlockingStub = AdminGrpc.newBlockingStub(channel); adminBlockingStub.disableScaleInProtection( DisableScaleInProtectionRequest.newBuilder().setInstanceName(instanceIp).build()); diff --git a/src/main/java/build/buildfarm/admin/aws/BUILD b/src/main/java/build/buildfarm/admin/aws/BUILD index ea544e0b68..a49e431bfd 100644 --- a/src/main/java/build/buildfarm/admin/aws/BUILD +++ b/src/main/java/build/buildfarm/admin/aws/BUILD @@ -6,6 +6,7 @@ java_library( deps = [ "//src/main/java/build/buildfarm/admin", "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@googleapis//:google_rpc_code_java_proto", @@ -19,7 +20,6 @@ java_library( "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java_util", "@maven//:io_grpc_grpc_api", - "@maven//:io_grpc_grpc_netty", "@maven//:org_projectlombok_lombok", "@maven//:org_springframework_spring_beans", "@maven//:org_springframework_spring_context", diff --git a/src/main/java/build/buildfarm/cas/BUILD b/src/main/java/build/buildfarm/cas/BUILD index 301e922e13..146206caee 100644 --- a/src/main/java/build/buildfarm/cas/BUILD +++ b/src/main/java/build/buildfarm/cas/BUILD @@ -25,7 +25,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:io_prometheus_simpleclient", diff --git a/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java b/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java index ade381ff50..e1df38fae4 100644 --- a/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java +++ b/src/main/java/build/buildfarm/cas/ContentAddressableStorages.java @@ -14,6 +14,7 @@ package build.buildfarm.cas; +import static build.buildfarm.common.grpc.Channels.createChannel; import static build.buildfarm.common.grpc.Retrier.NO_RETRIES; import static com.google.common.collect.Multimaps.synchronizedListMultimap; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; @@ -29,8 +30,6 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.MultimapBuilder; import io.grpc.Channel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.io.IOException; import java.io.InputStream; import java.nio.file.NoSuchFileException; @@ -40,12 +39,6 @@ public final class ContentAddressableStorages { private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - private static Channel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static ContentAddressableStorage createGrpcCAS(Cas cas) { Channel channel = createChannel(cas.getTarget()); ByteStreamUploader byteStreamUploader = diff --git a/src/main/java/build/buildfarm/common/grpc/BUILD b/src/main/java/build/buildfarm/common/grpc/BUILD index 7bff874ad8..af68ba7d63 100644 --- a/src/main/java/build/buildfarm/common/grpc/BUILD +++ b/src/main/java/build/buildfarm/common/grpc/BUILD @@ -13,6 +13,7 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:org_projectlombok_lombok", diff --git a/src/main/java/build/buildfarm/common/grpc/Channels.java b/src/main/java/build/buildfarm/common/grpc/Channels.java new file mode 100644 index 0000000000..0531218f23 --- /dev/null +++ b/src/main/java/build/buildfarm/common/grpc/Channels.java @@ -0,0 +1,40 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.common.grpc; + +import io.grpc.ManagedChannel; +import io.grpc.netty.NegotiationType; +import io.grpc.netty.NettyChannelBuilder; + +public final class Channels { + private static final String GRPCS_URL_PREFIX = "grpcs://"; + private static final String GRPC_URL_PREFIX = "grpc://"; + + private Channels() {} + + public static ManagedChannel createChannel(String target) { + NegotiationType negotiationType = NegotiationType.PLAINTEXT; + if (target.startsWith(GRPCS_URL_PREFIX)) { + target = target.substring(GRPCS_URL_PREFIX.length()); + negotiationType = NegotiationType.TLS; + } else if (target.startsWith(GRPC_URL_PREFIX)) { + target = target.substring(GRPC_URL_PREFIX.length()); + negotiationType = NegotiationType.PLAINTEXT; + } + NettyChannelBuilder builder = + NettyChannelBuilder.forTarget(target).negotiationType(negotiationType); + return builder.build(); + } +} diff --git a/src/main/java/build/buildfarm/common/services/BUILD b/src/main/java/build/buildfarm/common/services/BUILD index f2f643001e..9a885cbafe 100644 --- a/src/main/java/build/buildfarm/common/services/BUILD +++ b/src/main/java/build/buildfarm/common/services/BUILD @@ -23,7 +23,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_services", "@maven//:io_grpc_grpc_stub", diff --git a/src/main/java/build/buildfarm/instance/server/BUILD b/src/main/java/build/buildfarm/instance/server/BUILD index 601519c867..ecff968e79 100644 --- a/src/main/java/build/buildfarm/instance/server/BUILD +++ b/src/main/java/build/buildfarm/instance/server/BUILD @@ -27,7 +27,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:io_netty_netty_codec_http", diff --git a/src/main/java/build/buildfarm/instance/shard/BUILD b/src/main/java/build/buildfarm/instance/shard/BUILD index 9b11f1543e..38e6992aae 100644 --- a/src/main/java/build/buildfarm/instance/shard/BUILD +++ b/src/main/java/build/buildfarm/instance/shard/BUILD @@ -28,7 +28,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:io_prometheus_simpleclient", diff --git a/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java b/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java index 28a29afd7f..e0015f6fc4 100644 --- a/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java +++ b/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java @@ -14,6 +14,7 @@ package build.buildfarm.instance.shard; +import static build.buildfarm.common.grpc.Channels.createChannel; import static com.google.common.util.concurrent.MoreExecutors.listeningDecorator; import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; @@ -28,9 +29,6 @@ import com.google.common.cache.RemovalListener; import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.protobuf.Duration; -import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.util.concurrent.TimeUnit; public final class WorkerStubs { @@ -64,12 +62,6 @@ private static Instance newStubInstance(String worker, DigestUtil digestUtil, Du newStubRetryService()); } - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - private static Retrier newStubRetrier() { return new Retrier( Backoff.exponential( diff --git a/src/main/java/build/buildfarm/instance/stub/BUILD b/src/main/java/build/buildfarm/instance/stub/BUILD index c8b2b82e77..1f5a2b916d 100644 --- a/src/main/java/build/buildfarm/instance/stub/BUILD +++ b/src/main/java/build/buildfarm/instance/stub/BUILD @@ -23,7 +23,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:org_projectlombok_lombok", diff --git a/src/main/java/build/buildfarm/operations/finder/BUILD b/src/main/java/build/buildfarm/operations/finder/BUILD index 5c8342609b..8b6a2cc557 100644 --- a/src/main/java/build/buildfarm/operations/finder/BUILD +++ b/src/main/java/build/buildfarm/operations/finder/BUILD @@ -22,7 +22,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:org_apache_commons_commons_pool2", diff --git a/src/main/java/build/buildfarm/server/services/AdminService.java b/src/main/java/build/buildfarm/server/services/AdminService.java index 968edc1572..94178fbf27 100644 --- a/src/main/java/build/buildfarm/server/services/AdminService.java +++ b/src/main/java/build/buildfarm/server/services/AdminService.java @@ -14,6 +14,8 @@ package build.buildfarm.server.services; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.admin.Admin; import build.buildfarm.admin.aws.AwsAdmin; import build.buildfarm.admin.gcp.GcpAdmin; @@ -39,8 +41,6 @@ import com.google.rpc.Code; import com.google.rpc.Status; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; import java.util.logging.Level; import lombok.extern.java.Log; @@ -191,9 +191,7 @@ public void shutDownWorkerGracefully( private void informWorkerToPrepareForShutdown(String host) { ManagedChannel channel = null; try { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(host).negotiationType(NegotiationType.PLAINTEXT); - channel = builder.build(); + channel = createChannel(host); ShutDownWorkerGrpc.ShutDownWorkerBlockingStub shutDownWorkerBlockingStub = ShutDownWorkerGrpc.newBlockingStub(channel); shutDownWorkerBlockingStub.prepareWorkerForGracefulShutdown( diff --git a/src/main/java/build/buildfarm/server/services/BUILD b/src/main/java/build/buildfarm/server/services/BUILD index aff642ed7a..54b7af993c 100644 --- a/src/main/java/build/buildfarm/server/services/BUILD +++ b/src/main/java/build/buildfarm/server/services/BUILD @@ -30,7 +30,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_services", "@maven//:io_grpc_grpc_stub", diff --git a/src/main/java/build/buildfarm/tools/Ac.java b/src/main/java/build/buildfarm/tools/Ac.java index adfca598ff..9515fe0ec4 100644 --- a/src/main/java/build/buildfarm/tools/Ac.java +++ b/src/main/java/build/buildfarm/tools/Ac.java @@ -14,6 +14,8 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.bazel.remote.execution.v2.ActionResult; import build.buildfarm.common.DigestUtil; import build.buildfarm.common.DigestUtil.HashFunction; @@ -21,18 +23,10 @@ import build.buildfarm.instance.stub.StubInstance; import com.google.protobuf.ByteString; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; // This tool can be used to interact directly with the Action Cache API. // ./tool shard SHA256 class Ac { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static void main(String[] args) throws Exception { // get arguments for establishing an instance String host = args[0]; diff --git a/src/main/java/build/buildfarm/tools/BUILD b/src/main/java/build/buildfarm/tools/BUILD index c2f9d94ece..37c6bdb58a 100644 --- a/src/main/java/build/buildfarm/tools/BUILD +++ b/src/main/java/build/buildfarm/tools/BUILD @@ -5,6 +5,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "//src/main/java/build/buildfarm/worker", @@ -15,7 +16,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], @@ -57,6 +57,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance/stub", "@googleapis//:google_bytestream_bytestream_java_grpc", "@googleapis//:google_bytestream_bytestream_java_proto", @@ -67,7 +68,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_grpc", @@ -90,7 +90,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", @@ -108,6 +107,7 @@ java_binary( deps = [ ":worker-profiler-printer", "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", @@ -119,7 +119,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], @@ -137,6 +136,7 @@ java_binary( ":worker-profiler-printer", "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/common/redis", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/shard", @@ -151,7 +151,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], @@ -168,6 +167,7 @@ java_binary( deps = [ ":worker-profiler-printer", "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", @@ -179,7 +179,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], @@ -191,10 +190,10 @@ java_binary( main_class = "build.buildfarm.tools.GracefulShutdownTest", visibility = ["//visibility:public"], deps = [ + "//src/main/java/build/buildfarm/common/grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@maven//:io_grpc_grpc_api", - "@maven//:io_grpc_grpc_netty", ], ) @@ -205,6 +204,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "@googleapis//:google_longrunning_operations_java_proto", @@ -214,7 +214,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", @@ -228,6 +227,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "@googleapis//:google_longrunning_operations_java_proto", @@ -237,7 +237,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", @@ -251,6 +250,7 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "@googleapis//:google_longrunning_operations_java_proto", @@ -260,7 +260,6 @@ java_binary( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", @@ -281,12 +280,12 @@ java_binary( visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], @@ -313,7 +312,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", ], diff --git a/src/main/java/build/buildfarm/tools/Cancel.java b/src/main/java/build/buildfarm/tools/Cancel.java index 5945df708e..24805034dc 100644 --- a/src/main/java/build/buildfarm/tools/Cancel.java +++ b/src/main/java/build/buildfarm/tools/Cancel.java @@ -14,20 +14,14 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.common.DigestUtil; import build.buildfarm.instance.Instance; import build.buildfarm.instance.stub.StubInstance; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; class Cancel { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static void main(String[] args) throws Exception { String host = args[0]; String instanceName = args[1]; diff --git a/src/main/java/build/buildfarm/tools/Cat.java b/src/main/java/build/buildfarm/tools/Cat.java index 399ca7f1fb..7c8e561454 100644 --- a/src/main/java/build/buildfarm/tools/Cat.java +++ b/src/main/java/build/buildfarm/tools/Cat.java @@ -14,6 +14,7 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; import static build.buildfarm.instance.Utils.getBlob; import static com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination; import static java.lang.String.format; @@ -68,8 +69,6 @@ import io.grpc.Context; import io.grpc.ManagedChannel; import io.grpc.Status; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -86,12 +85,6 @@ import java.util.stream.StreamSupport; class Cat { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - private static void printCapabilities(ServerCapabilities capabilities) { System.out.println(capabilities); } diff --git a/src/main/java/build/buildfarm/tools/Executor.java b/src/main/java/build/buildfarm/tools/Executor.java index 77ca4002c1..4f2f9f3d6f 100644 --- a/src/main/java/build/buildfarm/tools/Executor.java +++ b/src/main/java/build/buildfarm/tools/Executor.java @@ -15,6 +15,7 @@ package build.buildfarm.tools; import static build.bazel.remote.execution.v2.ExecutionStage.Value.EXECUTING; +import static build.buildfarm.common.grpc.Channels.createChannel; import static build.buildfarm.common.io.Utils.stat; import static build.buildfarm.instance.stub.ByteStreamUploader.uploadResourceName; import static com.google.common.base.Preconditions.checkState; @@ -53,8 +54,6 @@ import com.google.rpc.Code; import io.grpc.Channel; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; import java.io.IOException; import java.io.InputStream; @@ -223,12 +222,6 @@ static void executeActions( shutdownAndAwaitTermination(service, 1, SECONDS); } - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - private static void loadFilesIntoCAS(String instanceName, Channel channel, Path blobsDir) throws Exception { ContentAddressableStorageBlockingStub casStub = diff --git a/src/main/java/build/buildfarm/tools/Extract.java b/src/main/java/build/buildfarm/tools/Extract.java index e4de193ae2..fed81ac267 100644 --- a/src/main/java/build/buildfarm/tools/Extract.java +++ b/src/main/java/build/buildfarm/tools/Extract.java @@ -14,6 +14,7 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; import static com.google.common.util.concurrent.MoreExecutors.listeningDecorator; import static java.util.concurrent.Executors.newSingleThreadExecutor; import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; @@ -41,8 +42,6 @@ import io.grpc.ManagedChannel; import io.grpc.Status; import io.grpc.Status.Code; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; import java.io.IOException; import java.io.InputStream; @@ -61,12 +60,6 @@ import java.util.concurrent.atomic.AtomicLong; class Extract { - static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static void main(String[] args) throws Exception { String host = args[0]; String instanceName = args[1]; diff --git a/src/main/java/build/buildfarm/tools/FindOperations.java b/src/main/java/build/buildfarm/tools/FindOperations.java index c858f121f6..f1d8494dff 100644 --- a/src/main/java/build/buildfarm/tools/FindOperations.java +++ b/src/main/java/build/buildfarm/tools/FindOperations.java @@ -14,14 +14,14 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.common.DigestUtil; import build.buildfarm.instance.Instance; import build.buildfarm.instance.stub.StubInstance; import com.google.common.collect.ImmutableList; import com.google.longrunning.Operation; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; // This tool can be used to find Operations based on their particular properties. // For example, it could find all of the operations executed by a particular user or particular @@ -29,12 +29,6 @@ // ./tool shard SHA256 // The operations that match the query will be printed. class FindOperations { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static void main(String[] args) throws Exception { // get arguments for establishing an instance String host = args[0]; diff --git a/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java b/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java index f98cddbde4..85ae5ab78d 100644 --- a/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java +++ b/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java @@ -14,22 +14,16 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.v1test.AdminGrpc; import build.buildfarm.v1test.DisableScaleInProtectionRequest; import build.buildfarm.v1test.PrepareWorkerForGracefulShutDownRequest; import build.buildfarm.v1test.ShutDownWorkerGracefullyRequest; import build.buildfarm.v1test.ShutDownWorkerGrpc; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; class GracefulShutdownTest { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - /** * Example command: GracefulShutdownTest ShutDown workerIp buildfarm-endpoint * diff --git a/src/main/java/build/buildfarm/tools/Hist.java b/src/main/java/build/buildfarm/tools/Hist.java index c8ec6c2bfa..2abdf55f7d 100644 --- a/src/main/java/build/buildfarm/tools/Hist.java +++ b/src/main/java/build/buildfarm/tools/Hist.java @@ -14,6 +14,8 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.bazel.remote.execution.v2.ExecuteOperationMetadata; import build.bazel.remote.execution.v2.ExecutionStage; import build.buildfarm.common.DigestUtil; @@ -23,16 +25,8 @@ import com.google.longrunning.Operation; import com.google.protobuf.InvalidProtocolBufferException; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; class Hist { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - @SuppressWarnings("ConstantConditions") private static void printHistogramValue(int executing) { StringBuilder s = new StringBuilder(); diff --git a/src/main/java/build/buildfarm/tools/IndexWorker.java b/src/main/java/build/buildfarm/tools/IndexWorker.java index a36e3f9217..317a5ff637 100644 --- a/src/main/java/build/buildfarm/tools/IndexWorker.java +++ b/src/main/java/build/buildfarm/tools/IndexWorker.java @@ -14,25 +14,19 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.common.CasIndexResults; import build.buildfarm.common.DigestUtil; import build.buildfarm.instance.Instance; import build.buildfarm.instance.stub.StubInstance; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; // This tool can be used to remove worker entries from the CAS. // This is usually done via the admin service when a worker is departing from the cluster. // ./tool shard SHA256 // The results of the removal are printed after the CAS entries have been removed. class IndexWorker { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - public static void main(String[] args) throws Exception { String host = args[0]; String instanceName = args[1]; diff --git a/src/main/java/build/buildfarm/tools/Mount.java b/src/main/java/build/buildfarm/tools/Mount.java index 43061d12bc..a0a4528d22 100644 --- a/src/main/java/build/buildfarm/tools/Mount.java +++ b/src/main/java/build/buildfarm/tools/Mount.java @@ -14,6 +14,7 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; import static build.buildfarm.instance.Utils.getBlob; import static com.google.common.base.Preconditions.checkArgument; @@ -27,8 +28,6 @@ import build.buildfarm.worker.FuseCAS; import com.google.protobuf.ByteString; import io.grpc.ManagedChannel; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; @@ -37,12 +36,6 @@ import java.util.Map; class Mount { - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - @SuppressWarnings("BusyWait") public static void main(String[] args) throws Exception { String host = args[0]; diff --git a/src/main/java/build/buildfarm/tools/WorkerProfile.java b/src/main/java/build/buildfarm/tools/WorkerProfile.java index d820446a53..ee36bf035a 100644 --- a/src/main/java/build/buildfarm/tools/WorkerProfile.java +++ b/src/main/java/build/buildfarm/tools/WorkerProfile.java @@ -14,6 +14,8 @@ package build.buildfarm.tools; +import static build.buildfarm.common.grpc.Channels.createChannel; + import build.buildfarm.common.DigestUtil; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.config.ShardWorkerOptions; @@ -30,10 +32,7 @@ import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.util.Durations; import com.google.protobuf.util.JsonFormat; -import io.grpc.ManagedChannel; import io.grpc.StatusRuntimeException; -import io.grpc.netty.NegotiationType; -import io.grpc.netty.NettyChannelBuilder; import java.io.IOException; import java.nio.file.Paths; import java.util.HashMap; @@ -46,12 +45,6 @@ class WorkerProfile { private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - private static ManagedChannel createChannel(String target) { - NettyChannelBuilder builder = - NettyChannelBuilder.forTarget(target).negotiationType(NegotiationType.PLAINTEXT); - return builder.build(); - } - /** * Transform worker string from "ip-10-135-31-210.ec2:8981" to "10.135.31.210". * diff --git a/src/main/java/build/buildfarm/worker/BUILD b/src/main/java/build/buildfarm/worker/BUILD index 417d530e9a..c25b9e74d6 100644 --- a/src/main/java/build/buildfarm/worker/BUILD +++ b/src/main/java/build/buildfarm/worker/BUILD @@ -32,7 +32,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", "@maven//:io_prometheus_simpleclient", diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index 3df1ab7e77..beeaaae918 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -32,7 +32,6 @@ java_library( "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_context", "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_services", "@maven//:io_grpc_grpc_stub", From 70903df60f272f807177c46e769894a2fd230849 Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Thu, 29 Jun 2023 00:02:03 -0700 Subject: [PATCH 030/214] Refactor findMissingBlobs method --- .../instance/shard/ShardInstance.java | 178 ++++++++++-------- 1 file changed, 100 insertions(+), 78 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index bc80520bf5..528f29dfa4 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -643,81 +643,42 @@ public ListenableFuture> findMissingBlobs( return immediateFailedFuture(Status.fromThrowable(e).asException()); } - // Empty blobs are an exceptional case. Filter them out. - // If the user only requested empty blobs we can immedaitely tell them we already have it. + // Empty blobs are an exceptional case. Filter them out. + // If the user only requested empty blobs we can immediately tell them we already have it. Iterable nonEmptyDigests = Iterables.filter(blobDigests, (digest) -> digest.getSizeBytes() != 0); if (Iterables.isEmpty(nonEmptyDigests)) { return immediateFuture(ImmutableList.of()); } - // This is a faster strategy to check missing blobs which does not require querying the CAS. - // With hundreds of worker machines, it may be too expensive to query all of them for "find - // missing blobs". - // Workers register themselves with the backplane for a 30-second window, and if they fail to - // re-register within this time frame, they are automatically removed from the backplane. While - // this alternative strategy for finding missing blobs is faster and more cost-effective than - // the exhaustive approach of querying each worker to find the digest, it comes with a higher - // risk of returning expired workers despite filtering by active workers below. This is because - // the strategy may return workers that have expired in the last 30 seconds. However, checking - // workers directly is not a guarantee either since workers could leave the cluster after being - // queried. Ultimately, it will come down to the client's resiliency if the backplane is - // out-of-date and the server lies about which blobs are actually present. We provide this - // alternative strategy for calculating missing blobs. - if (configs.getServer().isFindMissingBlobsViaBackplane()) { - try { - Set uniqueDigests = new HashSet<>(); - nonEmptyDigests.forEach(uniqueDigests::add); - Map> foundBlobs = backplane.getBlobDigestsWorkers(uniqueDigests); - Set workerSet = backplane.getStorageWorkers(); - Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerSet); - return immediateFuture( - uniqueDigests.stream() - .filter( // best effort to present digests only missing on active workers - digest -> { - try { - Set initialWorkers = - foundBlobs.getOrDefault(digest, Collections.emptySet()); - Set activeWorkers = Sets.intersection(initialWorkers, workerSet); - long insertTime = backplane.getDigestInsertTime(digest); - Set workersStartedBeforeDigestInsertion = - activeWorkers.stream() - .filter( - worker -> - workersStartTime.getOrDefault( - worker, Instant.now().getEpochSecond()) - < insertTime) - .collect(Collectors.toSet()); - Set workersToBeRemoved = - Sets.difference(initialWorkers, workersStartedBeforeDigestInsertion) - .immutableCopy(); - if (!workersToBeRemoved.isEmpty()) { - log.log( - Level.INFO, format("adjusting locations for the digest %s", digest)); - backplane.adjustBlobLocations( - digest, Collections.emptySet(), workersToBeRemoved); - } - return workersStartedBeforeDigestInsertion.isEmpty(); - } catch (IOException e) { - // Treat error as missing digest. - log.log( - Level.WARNING, - format("failed to get digest (%s) insertion time", digest)); - return true; - } - }) - .collect(Collectors.toList())); - } catch (Exception e) { - log.log(Level.SEVERE, "find missing blob via backplane failed", e); - return immediateFailedFuture(Status.fromThrowable(e).asException()); - } + return findMissingBlobsViaBackplane(nonEmptyDigests); } - // A more accurate way to verify missing blobs is to ask the CAS participants directly if they - // have the blobs. To do this, we get all of the worker nodes that are particpating in the CAS - // as a random list to begin our search. If there are no workers avaiable, tell the client all - // blobs are missing. + return findMissingBlobsQueryingEachWorker(nonEmptyDigests, requestMetadata); + } + + class FindMissingResponseEntry { + final String worker; + final long elapsedMicros; + final Throwable exception; + final int stillMissingAfter; + + FindMissingResponseEntry( + String worker, long elapsedMicros, Throwable exception, int stillMissingAfter) { + this.worker = worker; + this.elapsedMicros = elapsedMicros; + this.exception = exception; + this.stillMissingAfter = stillMissingAfter; + } + } + + // A more accurate way to verify missing blobs is to ask the CAS participants directly if they + // have the blobs. To do this, we get all the worker nodes that are participating in the CAS + // as a random list to begin our search. If there are no workers available, tell the client all + // blobs are missing. + private ListenableFuture> findMissingBlobsQueryingEachWorker( + Iterable nonEmptyDigests, RequestMetadata requestMetadata) { Deque workers; try { List workersList = new ArrayList<>(backplane.getStorageWorkers()); @@ -730,7 +691,7 @@ public ListenableFuture> findMissingBlobs( return immediateFuture(nonEmptyDigests); } - // Search through all of the workers to decide how many CAS blobs are missing. + // Search through all the workers to decide which CAS blobs are missing. SettableFuture> missingDigestsFuture = SettableFuture.create(); findMissingBlobsOnWorker( UUID.randomUUID().toString(), @@ -744,19 +705,80 @@ public ListenableFuture> findMissingBlobs( return missingDigestsFuture; } - class FindMissingResponseEntry { - final String worker; - final long elapsedMicros; - final Throwable exception; - final int stillMissingAfter; + // This is a faster strategy to check missing blobs which does not require querying the CAS. + // With hundreds of worker machines, it may be too expensive to query all of them for "find + // missing blobs". + // Workers register themselves with the backplane for a 30-second window, and if they fail to + // re-register within this time frame, they are automatically removed from the backplane. While + // this alternative strategy for finding missing blobs is faster and more cost-effective than + // the exhaustive approach of querying each worker to find the digest, it comes with a higher + // risk of returning expired workers despite filtering by active workers below. This is because + // the strategy may return workers that have expired in the last 30 seconds. However, checking + // workers directly is not a guarantee either since workers could leave the cluster after being + // queried. Ultimately, it will come down to the client's resiliency if the backplane is + // out-of-date and the server lies about which blobs are actually present. We provide this + // alternative strategy for calculating missing blobs. + private ListenableFuture> findMissingBlobsViaBackplane( + Iterable nonEmptyDigests) { + try { + Set uniqueDigests = new HashSet<>(); + nonEmptyDigests.forEach(uniqueDigests::add); + Map> foundBlobs = backplane.getBlobDigestsWorkers(uniqueDigests); + Set workerSet = backplane.getStorageWorkers(); + Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerSet); + return immediateFuture( + uniqueDigests.stream() + .filter( // best effort to present digests only missing on active workers + digest -> { + Set initialWorkers = + foundBlobs.getOrDefault(digest, Collections.emptySet()); + return filterAndAdjustWorkersForDigest( + digest, initialWorkers, workerSet, workersStartTime) + .isEmpty(); + }) + .collect(Collectors.toList())); + } catch (Exception e) { + log.log(Level.SEVERE, "find missing blob via backplane failed", e); + return immediateFailedFuture(Status.fromThrowable(e).asException()); + } + } - FindMissingResponseEntry( - String worker, long elapsedMicros, Throwable exception, int stillMissingAfter) { - this.worker = worker; - this.elapsedMicros = elapsedMicros; - this.exception = exception; - this.stillMissingAfter = stillMissingAfter; + private Set filterAndAdjustWorkersForDigest( + Digest digest, + Set originalWorkerSetWithDigest, + Set activeWorkers, + Map workersStartTime) { + long insertTime; + try { + insertTime = backplane.getDigestInsertTime(digest); + } catch (IOException e) { + log.log(Level.WARNING, format("failed to get digest (%s) insertion time", digest)); + return Collections.emptySet(); + } + Set activeWorkersWithDigest = + Sets.intersection(originalWorkerSetWithDigest, activeWorkers); + Set workersStartedBeforeDigestInsertion = + activeWorkersWithDigest.stream() + .filter( + worker -> + workersStartTime.getOrDefault(worker, Instant.now().getEpochSecond()) + < insertTime) + .collect(Collectors.toSet()); + Set workersToBeRemoved = + Sets.difference(originalWorkerSetWithDigest, workersStartedBeforeDigestInsertion) + .immutableCopy(); + if (!workersToBeRemoved.isEmpty()) { + try { + log.log(Level.INFO, format("adjusting locations for the digest %s", digest)); + backplane.adjustBlobLocations(digest, Collections.emptySet(), workersToBeRemoved); + } catch (IOException e) { + log.log( + Level.WARNING, + format("error adjusting blob location for %s", DigestUtil.toString(digest)), + e); + } } + return workersStartedBeforeDigestInsertion; } private void findMissingBlobsOnWorker( From 68318c5f80ecaf5242e9f051188214c35add7a86 Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Wed, 5 Jul 2023 23:27:30 -0700 Subject: [PATCH 031/214] incorporate feedback --- src/main/java/build/buildfarm/instance/shard/ShardInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index 528f29dfa4..bf1a972eb9 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -691,7 +691,7 @@ private ListenableFuture> findMissingBlobsQueryingEachWorker( return immediateFuture(nonEmptyDigests); } - // Search through all the workers to decide which CAS blobs are missing. + // Search through all of the workers to decide which CAS blobs are missing. SettableFuture> missingDigestsFuture = SettableFuture.create(); findMissingBlobsOnWorker( UUID.randomUUID().toString(), From 95719e5ac3f311eff8108f4dbbacc0ff481a7180 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 16 Jul 2023 17:06:38 -0400 Subject: [PATCH 032/214] Upgrade grpc repo/maven deps for java_common Fixes #1403 --- defs.bzl | 4 ++-- deps.bzl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/defs.bzl b/defs.bzl index 8ab50597f1..65087518d5 100644 --- a/defs.bzl +++ b/defs.bzl @@ -107,8 +107,8 @@ def buildfarm_init(name = "buildfarm"): "io.github.lognet:grpc-spring-boot-starter:4.5.4", "org.bouncycastle:bcprov-jdk15on:1.70", "net.jcip:jcip-annotations:1.0", - ] + ["io.netty:netty-%s:4.1.90.Final" % module for module in IO_NETTY_MODULES] + - ["io.grpc:grpc-%s:1.53.0" % module for module in IO_GRPC_MODULES] + + ] + ["io.netty:netty-%s:4.1.94.Final" % module for module in IO_NETTY_MODULES] + + ["io.grpc:grpc-%s:1.56.1" % module for module in IO_GRPC_MODULES] + [ "io.prometheus:simpleclient:0.10.0", "io.prometheus:simpleclient_hotspot:0.10.0", diff --git a/deps.bzl b/deps.bzl index 1a0dd5f80e..28a66281f4 100644 --- a/deps.bzl +++ b/deps.bzl @@ -50,9 +50,9 @@ def archive_dependencies(third_party): # Needed for @grpc_java//compiler:grpc_java_plugin. { "name": "io_grpc_grpc_java", - "sha256": "78bf175f9a8fa23cda724bbef52ad9d0d555cdd1122bcb06484b91174f931239", - "strip_prefix": "grpc-java-1.54.1", - "urls": ["https://github.com/grpc/grpc-java/archive/v1.54.1.zip"], + "sha256": "b8fb7ae4824fb5a5ae6e6fa26ffe2ad7ab48406fdeee54e8965a3b5948dd957e", + "strip_prefix": "grpc-java-1.56.1", + "urls": ["https://github.com/grpc/grpc-java/archive/v1.56.1.zip"], }, { "name": "rules_pkg", From abcd8fc89c9e23e6b39139c15cb504383d346a65 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 26 Jul 2023 06:19:15 -0400 Subject: [PATCH 033/214] Shut down prometheus collector thread on CFC stop Prevents a hang on shutdown when redis is disconnected --- src/main/java/build/buildfarm/cas/cfc/CASFileCache.java | 9 ++++++++- .../build/buildfarm/worker/shard/CFCExecFileSystem.java | 3 ++- .../build/buildfarm/worker/shard/ExecFileSystem.java | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 11b6b3ba23..4e4a8472c5 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -168,7 +168,7 @@ public abstract class CASFileCache implements ContentAddressableStorage { private final Consumer> onExpire; private final Executor accessRecorder; private final ExecutorService expireService; - private Thread prometheusMetricsThread; // TODO make this final, stop on shutdown + private Thread prometheusMetricsThread; private final Map directoryStorage = Maps.newConcurrentMap(); private final DirectoriesIndex directoriesIndex; @@ -1258,6 +1258,13 @@ public void initializeRootDirectory() throws IOException { fileStore = Files.getFileStore(root); } + public void stop() throws InterruptedException { + if (prometheusMetricsThread != null) { + prometheusMetricsThread.interrupt(); + prometheusMetricsThread.join(); + } + } + public StartupCacheResults start(boolean skipLoad) throws IOException, InterruptedException { return start(newDirectExecutorService(), skipLoad); } diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index c8336f7481..96e8f1f218 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -142,7 +142,8 @@ public void start(Consumer> onDigests, boolean skipLoad) } @Override - public void stop() { + public void stop() throws InterruptedException { + fileCache.stop(); if (!shutdownAndAwaitTermination(fetchService, 1, MINUTES)) { log.log(Level.SEVERE, "could not terminate fetchService"); } diff --git a/src/main/java/build/buildfarm/worker/shard/ExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/ExecFileSystem.java index 916b43cef0..b55601d598 100644 --- a/src/main/java/build/buildfarm/worker/shard/ExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/ExecFileSystem.java @@ -30,7 +30,7 @@ public interface ExecFileSystem extends InputStreamFactory { void start(Consumer> onDigests, boolean skipLoad) throws IOException, InterruptedException; - void stop(); + void stop() throws InterruptedException; Path root(); From 9b4bd6f7ef8dbc9e33c83d2b13a9808b97b819cc Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 30 Jul 2023 21:43:38 -0400 Subject: [PATCH 034/214] Output status code name on shard read error Use the proper name for a status code as presented when the read will not be retried. --- .../java/build/buildfarm/instance/shard/ShardInstance.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index bf1a972eb9..edbeb168f3 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -919,8 +919,11 @@ public void onError(Throwable t) { log.log( Level.WARNING, format( - "DEADLINE_EXCEEDED: read(%s) on worker %s after %d bytes of content", - DigestUtil.toString(blobDigest), worker, received)); + "%s: read(%s) on worker %s after %d bytes of content", + status.getCode().name(), + DigestUtil.toString(blobDigest), + worker, + received)); blobObserver.onError(t); return; } From 87106426d567d8d015ffd04fbe7753d63ec7d653 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Tue, 1 Aug 2023 11:31:00 -0400 Subject: [PATCH 035/214] Reduce log levels to make log files more meaningful (#1414) --- .../build/buildfarm/admin/aws/AwsAdmin.java | 2 +- .../build/buildfarm/cas/cfc/CASFileCache.java | 53 ++++++++++--------- .../common/services/ByteStreamService.java | 6 +-- .../ContentAddressableStorageService.java | 2 +- .../common/services/WriteStreamObserver.java | 21 ++++---- .../instance/shard/RedisShardBackplane.java | 20 +++---- .../instance/shard/RedisShardSubscriber.java | 6 +-- .../instance/shard/ShardInstance.java | 44 +++++++-------- .../build/buildfarm/instance/shard/Util.java | 6 +-- .../metrics/AbstractMetricsPublisher.java | 2 +- .../java/build/buildfarm/worker/Executor.java | 6 +-- .../build/buildfarm/worker/InputFetcher.java | 4 +- .../java/build/buildfarm/worker/Pipeline.java | 4 +- .../build/buildfarm/worker/PipelineStage.java | 4 +- .../worker/shard/CFCExecFileSystem.java | 5 +- .../worker/shard/ShardWorkerContext.java | 14 ++--- 16 files changed, 101 insertions(+), 98 deletions(-) diff --git a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java b/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java index ebb3746b63..f40dd72c95 100644 --- a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java +++ b/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java @@ -127,7 +127,7 @@ public GetHostsResult getHosts(String filter, int ageInMinutes, String status) { } resultBuilder.addAllHosts(hosts); resultBuilder.setNumHosts(hosts.size()); - log.log(Level.FINE, String.format("Got %d hosts for filter: %s", hosts.size(), filter)); + log.log(Level.FINER, String.format("Got %d hosts for filter: %s", hosts.size(), filter)); return resultBuilder.build(); } diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 4e4a8472c5..a112c37bb2 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -550,7 +550,7 @@ private InputStream compressorInputStream(Compressor.Value compressor, InputStre @SuppressWarnings("ResultOfMethodCallIgnored") InputStream newLocalInput(Compressor.Value compressor, Digest digest, long offset) throws IOException { - log.log(Level.FINE, format("getting input stream for %s", DigestUtil.toString(digest))); + log.log(Level.FINER, format("getting input stream for %s", DigestUtil.toString(digest))); boolean isExecutable = false; do { String key = getKey(digest, isExecutable); @@ -724,7 +724,7 @@ void invalidateWrite(Digest digest) { public void put(Blob blob, Runnable onExpiration) throws InterruptedException { String key = getKey(blob.getDigest(), false); try { - log.log(Level.FINE, format("put: %s", key)); + log.log(Level.FINER, format("put: %s", key)); OutputStream out = putImpl( Compressor.Value.IDENTITY, @@ -1050,7 +1050,7 @@ CancellableOutputStream newOutput( String key = getKey(digest, false); final CancellableOutputStream cancellableOut; try { - log.log(Level.FINE, format("getWrite: %s", key)); + log.log(Level.FINER, format("getWrite: %s", key)); cancellableOut = putImpl( compressor, @@ -2140,7 +2140,7 @@ private void fetchDirectory( private void removeFilePath(Path path) throws IOException { if (Files.exists(path)) { if (Files.isDirectory(path)) { - log.log(Level.FINE, "removing existing directory " + path + " for fetch"); + log.log(Level.FINER, "removing existing directory " + path + " for fetch"); Directories.remove(path, fileStore); } else { Files.delete(path); @@ -2169,14 +2169,14 @@ public ListenableFuture putDirectory( // Claim the directory path so no other threads try to create/delete it. Path path = getDirectoryPath(digest); Lock l = locks.acquire(path); - log.log(Level.FINE, format("locking directory %s", path.getFileName())); + log.log(Level.FINER, format("locking directory %s", path.getFileName())); try { l.lockInterruptibly(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return immediateFailedFuture(e); } - log.log(Level.FINE, format("locked directory %s", path.getFileName())); + log.log(Level.FINER, format("locked directory %s", path.getFileName())); // Now that a lock has been claimed, we can proceed to create the directory. ListenableFuture putFuture; @@ -2190,7 +2190,7 @@ public ListenableFuture putDirectory( putFuture.addListener( () -> { l.unlock(); - log.log(Level.FINE, format("directory %s has been unlocked", path.getFileName())); + log.log(Level.FINER, format("directory %s has been unlocked", path.getFileName())); }, service); return putFuture; @@ -2238,7 +2238,7 @@ private boolean directoryEntryExists( private ListenableFuture putDirectorySynchronized( Path path, Digest digest, Map directoriesByDigest, ExecutorService service) throws IOException { - log.log(Level.FINE, format("directory %s has been locked", path.getFileName())); + log.log(Level.FINER, format("directory %s has been locked", path.getFileName())); ListenableFuture expireFuture; synchronized (this) { DirectoryEntry e = directoryStorage.get(digest); @@ -2265,7 +2265,7 @@ private ListenableFuture putDirectorySynchronized( } if (e != null) { - log.log(Level.FINE, format("found existing entry for %s", path.getFileName())); + log.log(Level.FINER, format("found existing entry for %s", path.getFileName())); if (directoryEntryExists(path, e, directoriesByDigest)) { return immediateFuture(path); } @@ -2278,7 +2278,7 @@ private ListenableFuture putDirectorySynchronized( decrementReferencesSynchronized(inputsBuilder.build(), ImmutableList.of()); expireFuture = expireDirectory(digest, service); - log.log(Level.FINE, format("expiring existing entry for %s", path.getFileName())); + log.log(Level.FINER, format("expiring existing entry for %s", path.getFileName())); } } @@ -2300,7 +2300,7 @@ private ListenableFuture putDirectorySynchronized( transformAsync( deindexFuture, result -> { - log.log(Level.FINE, format("expiry complete, fetching %s", path.getFileName())); + log.log(Level.FINER, format("expiry complete, fetching %s", path.getFileName())); ImmutableList.Builder> putFuturesBuilder = ImmutableList.builder(); fetchDirectory( @@ -2374,7 +2374,7 @@ private ListenableFuture putDirectorySynchronized( } } try { - log.log(Level.FINE, "removing directory to roll back " + path); + log.log(Level.FINER, "removing directory to roll back " + path); Directories.remove(path, fileStore); } catch (IOException removeException) { log.log( @@ -2390,7 +2390,8 @@ private ListenableFuture putDirectorySynchronized( return transform( rollbackFuture, (results) -> { - log.log(Level.FINE, format("directory fetch complete, inserting %s", path.getFileName())); + log.log( + Level.FINER, format("directory fetch complete, inserting %s", path.getFileName())); DirectoryEntry e = new DirectoryEntry( // might want to have this treatment ahead of this @@ -2442,13 +2443,13 @@ Path putAndCopy(Digest digest, boolean isExecutable) throws IOException, Interru complete = true; } finally { try { - log.log(Level.FINE, format("closing output stream for %s", DigestUtil.toString(digest))); + log.log(Level.FINER, format("closing output stream for %s", DigestUtil.toString(digest))); if (complete) { out.close(); } else { out.cancel(); } - log.log(Level.FINE, format("output stream closed for %s", DigestUtil.toString(digest))); + log.log(Level.FINER, format("output stream closed for %s", DigestUtil.toString(digest))); } catch (IOException e) { if (Thread.interrupted()) { log.log( @@ -2460,7 +2461,7 @@ Path putAndCopy(Digest digest, boolean isExecutable) throws IOException, Interru throw new InterruptedException(); } else { log.log( - Level.FINE, + Level.FINER, format("failed output stream close for %s", DigestUtil.toString(digest)), e); } @@ -2492,7 +2493,7 @@ private static Exception extractStatusException(IOException e) { private void copyExternalInput(Digest digest, CancellableOutputStream out) throws IOException, InterruptedException { Retrier retrier = new Retrier(Backoff.sequential(5), Retrier.DEFAULT_IS_RETRIABLE); - log.log(Level.FINE, format("downloading %s", DigestUtil.toString(digest))); + log.log(Level.FINER, format("downloading %s", DigestUtil.toString(digest))); try { retrier.execute( () -> { @@ -2513,7 +2514,7 @@ private void copyExternalInput(Digest digest, CancellableOutputStream out) e); // prevent burial by early end of stream during close throw e; } - log.log(Level.FINE, format("download of %s complete", DigestUtil.toString(digest))); + log.log(Level.FINER, format("download of %s complete", DigestUtil.toString(digest))); } @FunctionalInterface @@ -2567,7 +2568,7 @@ private CancellableOutputStream putImpl( if (out == DUPLICATE_OUTPUT_STREAM) { return null; } - log.log(Level.FINE, format("entry %s is missing, downloading and populating", key)); + log.log(Level.FINER, format("entry %s is missing, downloading and populating", key)); return newCancellableOutputStream(out); } @@ -2752,7 +2753,7 @@ private boolean charge(String key, long blobSizeInBytes, AtomicBoolean requiresD return immediateFuture(null); } expiredKeyCounter.inc(); - log.log(Level.INFO, format("expired key %s", expiredKey)); + log.log(Level.FINE, format("expired key %s", expiredKey)); return immediateFuture(fileEntryKey.getDigest()); }, expireService)); @@ -2955,7 +2956,7 @@ void commit() throws IOException { existingEntry = safeStorageInsertion(key, entry); inserted = existingEntry == null; } catch (FileAlreadyExistsException e) { - log.log(Level.FINE, "file already exists for " + key + ", nonexistent entry will fail"); + log.log(Level.FINER, "file already exists for " + key + ", nonexistent entry will fail"); } finally { Files.delete(writePath); if (!inserted) { @@ -2980,20 +2981,20 @@ void commit() throws IOException { } if (existingEntry != null) { - log.log(Level.FINE, "lost the race to insert " + key); + log.log(Level.FINER, "lost the race to insert " + key); if (!referenceIfExists(key)) { // we would lose our accountability and have a presumed reference if we returned throw new IllegalStateException("storage conflict with existing key for " + key); } } else if (writeWinner.get()) { - log.log(Level.FINE, "won the race to insert " + key); + log.log(Level.FINER, "won the race to insert " + key); try { onInsert.run(); } catch (RuntimeException e) { throw new IOException(e); } } else { - log.log(Level.FINE, "did not win the race to insert " + key); + log.log(Level.FINER, "did not win the race to insert " + key); } } }; @@ -3047,7 +3048,7 @@ public boolean incrementReference() { "entry " + key + " has " + referenceCount + " references and is being incremented..."); } log.log( - Level.FINER, + Level.FINEST, "incrementing references to " + key + " from " @@ -3077,7 +3078,7 @@ public boolean decrementReference(Entry header) { "entry " + key + " has 0 references and is being decremented..."); } log.log( - Level.FINER, + Level.FINEST, "decrementing references to " + key + " from " diff --git a/src/main/java/build/buildfarm/common/services/ByteStreamService.java b/src/main/java/build/buildfarm/common/services/ByteStreamService.java index 365a9cec2a..4bb944abff 100644 --- a/src/main/java/build/buildfarm/common/services/ByteStreamService.java +++ b/src/main/java/build/buildfarm/common/services/ByteStreamService.java @@ -342,7 +342,7 @@ public void read(ReadRequest request, StreamObserver responseObser long offset = request.getReadOffset(); long limit = request.getReadLimit(); log.log( - Level.FINER, + Level.FINEST, format("read resource_name=%s offset=%d limit=%d", resourceName, offset, limit)); try { @@ -357,7 +357,7 @@ public void queryWriteStatus( QueryWriteStatusRequest request, StreamObserver responseObserver) { String resourceName = request.getResourceName(); try { - log.log(Level.FINE, format("queryWriteStatus(%s)", resourceName)); + log.log(Level.FINER, format("queryWriteStatus(%s)", resourceName)); Write write = getWrite(resourceName); responseObserver.onNext( QueryWriteStatusResponse.newBuilder() @@ -366,7 +366,7 @@ public void queryWriteStatus( .build()); responseObserver.onCompleted(); log.log( - Level.FINE, + Level.FINER, format( "queryWriteStatus(%s) => committed_size = %d, complete = %s", resourceName, write.getCommittedSize(), write.isComplete())); diff --git a/src/main/java/build/buildfarm/common/services/ContentAddressableStorageService.java b/src/main/java/build/buildfarm/common/services/ContentAddressableStorageService.java index 9395d63fea..6e00e39f67 100644 --- a/src/main/java/build/buildfarm/common/services/ContentAddressableStorageService.java +++ b/src/main/java/build/buildfarm/common/services/ContentAddressableStorageService.java @@ -109,7 +109,7 @@ public void onSuccess(FindMissingBlobsResponse.Builder builder) { long elapsedMicros = stopwatch.elapsed(MICROSECONDS); missingBlobs.observe(request.getBlobDigestsList().size()); log.log( - Level.FINE, + Level.FINER, "FindMissingBlobs(" + instance.getName() + ") for " diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index 790603db00..483f266e03 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -110,7 +110,7 @@ public synchronized void onNext(WriteRequest request) { Status status = Status.fromThrowable(e); if (errorResponse(status.asException())) { log.log( - status.getCode() == Status.Code.CANCELLED ? Level.FINE : Level.SEVERE, + status.getCode() == Status.Code.CANCELLED ? Level.FINER : Level.SEVERE, format("error writing %s", (name == null ? request.getResourceName() : name)), e); } @@ -160,7 +160,7 @@ synchronized void commitSynchronized(long committedSize) { if (Context.current().isCancelled()) { log.log( - Level.FINER, + Level.FINEST, format("skipped delivering committed_size to %s for cancelled context", name)); } else { try { @@ -182,7 +182,7 @@ synchronized void commitSynchronized(long committedSize) { Status status = Status.fromThrowable(e); if (errorResponse(status.asException())) { log.log( - status.getCode() == Status.Code.CANCELLED ? Level.FINE : Level.SEVERE, + status.getCode() == Status.Code.CANCELLED ? Level.FINER : Level.SEVERE, format( "%s-%s: %s -> %s -> %s: error committing %s", requestMetadata.getToolDetails().getToolName(), @@ -202,7 +202,8 @@ void commitActive(long committedSize) { if (exception.compareAndSet(null, null)) { try { - log.log(Level.FINER, format("delivering committed_size for %s of %d", name, committedSize)); + log.log( + Level.FINEST, format("delivering committed_size for %s of %d", name, committedSize)); responseObserver.onNext(response); responseObserver.onCompleted(); } catch (Exception e) { @@ -221,9 +222,9 @@ private void initialize(WriteRequest request) throws InvalidResourceNameExceptio name = resourceName; try { write = getWrite(resourceName); - if (log.isLoggable(Level.FINER)) { + if (log.isLoggable(Level.FINEST)) { log.log( - Level.FINER, + Level.FINEST, format( "registering callback for %s: committed_size = %d (transient), complete = %s", resourceName, write.getCommittedSize(), write.isComplete())); @@ -365,7 +366,7 @@ private void handleWrite(String resourceName, long offset, ByteString data, bool data = data.substring(skipBytes); } log.log( - Level.FINER, + Level.FINEST, format( "writing %d to %s at %d%s", bytesToWrite, name, offset, finishWrite ? " with finish_write" : "")); @@ -381,7 +382,7 @@ private void handleWrite(String resourceName, long offset, ByteString data, bool @GuardedBy("this") private void close() { - log.log(Level.FINER, format("closing stream due to finishWrite for %s", name)); + log.log(Level.FINEST, format("closing stream due to finishWrite for %s", name)); try { getOutput().close(); } catch (DigestMismatchException e) { @@ -464,11 +465,11 @@ private FeedbackOutputStream getOutput() throws IOException { @Override public void onError(Throwable t) { - log.log(Level.FINE, format("write error for %s", name), t); + log.log(Level.FINER, format("write error for %s", name), t); } @Override public void onCompleted() { - log.log(Level.FINE, format("write completed for %s", name)); + log.log(Level.FINER, format("write completed for %s", name)); } } diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 864c808369..f0a5ff222e 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -206,7 +206,7 @@ public void visit(String entry) { JsonFormat.parser().merge(entry, executeEntry); visit(executeEntry.build(), entry); } catch (InvalidProtocolBufferException e) { - log.log(Level.FINE, "invalid ExecuteEntry json: " + entry, e); + log.log(Level.FINER, "invalid ExecuteEntry json: " + entry, e); } } } @@ -330,10 +330,10 @@ private void updateWatchers(JedisCluster jedis) { if (!expiringChannels.isEmpty()) { log.log( - Level.FINE, + Level.FINER, format("Scan %d watches, %s, expiresAt: %s", expiringChannels.size(), now, expiresAt)); - log.log(Level.FINE, "Scan prequeue"); + log.log(Level.FINER, "Scan prequeue"); // scan prequeue, pet watches scanPrequeue(jedis, resetChannel); } @@ -342,7 +342,7 @@ private void updateWatchers(JedisCluster jedis) { scanProcessing(jedis, resetChannel, now); if (!expiringChannels.isEmpty()) { - log.log(Level.FINE, "Scan queue"); + log.log(Level.FINER, "Scan queue"); // scan queue, pet watches scanQueue(jedis, resetChannel); } @@ -351,7 +351,7 @@ private void updateWatchers(JedisCluster jedis) { scanDispatching(jedis, resetChannel, now); if (!expiringChannels.isEmpty()) { - log.log(Level.FINE, "Scan dispatched"); + log.log(Level.FINER, "Scan dispatched"); // scan dispatched pet watches scanDispatched(jedis, resetChannel); } @@ -445,7 +445,7 @@ public void updateWatchedIfDone(JedisCluster jedis) { } subscriber.onOperation(operationChannel(operationName), operation, nextExpiresAt(now)); log.log( - Level.FINE, + Level.FINER, format( "operation %s done due to %s", operationName, operation == null ? "null" : "completed")); @@ -537,24 +537,24 @@ public synchronized void stop() throws InterruptedException { if (failsafeOperationThread != null) { failsafeOperationThread.interrupt(); failsafeOperationThread.join(); - log.log(Level.FINE, "failsafeOperationThread has been stopped"); + log.log(Level.FINER, "failsafeOperationThread has been stopped"); } if (operationSubscription != null) { operationSubscription.stop(); if (subscriptionThread != null) { subscriptionThread.join(); } - log.log(Level.FINE, "subscriptionThread has been stopped"); + log.log(Level.FINER, "subscriptionThread has been stopped"); } if (subscriberService != null) { subscriberService.shutdown(); subscriberService.awaitTermination(10, SECONDS); - log.log(Level.FINE, "subscriberService has been stopped"); + log.log(Level.FINER, "subscriberService has been stopped"); } if (client != null) { client.close(); client = null; - log.log(Level.FINE, "client has been closed"); + log.log(Level.FINER, "client has been closed"); } } diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java b/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java index 6ecfdc05d4..637be2a383 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java @@ -137,7 +137,7 @@ public ListenableFuture watch(String channel, TimedWatcher watcher) { new TimedWatchFuture(watcher) { @Override public void unwatch() { - log.log(Level.FINE, format("unwatching %s", channel)); + log.log(Level.FINER, format("unwatching %s", channel)); RedisShardSubscriber.this.unwatch(channel, this); } }; @@ -199,7 +199,7 @@ private void onOperation( @Nullable Instant expiresAt) { List operationWatchers = watchers.get(channel); boolean observe = operation == null || operation.hasMetadata() || operation.getDone(); - log.log(Level.FINE, format("onOperation %s: %s", channel, operation)); + log.log(Level.FINER, format("onOperation %s: %s", channel, operation)); synchronized (watchers) { ImmutableList.Builder> observers = ImmutableList.builder(); for (TimedWatchFuture watchFuture : operationWatchers) { @@ -215,7 +215,7 @@ private void onOperation( executor.execute( () -> { if (observe) { - log.log(Level.FINE, "observing " + operation); + log.log(Level.FINER, "observing " + operation); observer.accept(operation); } }); diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index edbeb168f3..a37e4cb6ad 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -412,14 +412,14 @@ ListenableFuture iterate() throws IOException, InterruptedException { () -> {}, Deadline.after(5, MINUTES)); try { - log.log(Level.FINE, "queueing " + operationName); + log.log(Level.FINER, "queueing " + operationName); ListenableFuture queueFuture = queue(executeEntry, poller, queueTimeout); addCallback( queueFuture, new FutureCallback() { @Override public void onSuccess(Void result) { - log.log(Level.FINE, "successfully queued " + operationName); + log.log(Level.FINER, "successfully queued " + operationName); // nothing } @@ -433,7 +433,7 @@ public void onFailure(Throwable t) { long operationTransformDispatchUSecs = stopwatch.elapsed(MICROSECONDS) - canQueueUSecs; log.log( - Level.FINE, + Level.FINER, format( "OperationQueuer: Dispatched To Transform %s: %dus in canQueue, %dus in transform dispatch", operationName, canQueueUSecs, operationTransformDispatchUSecs)); @@ -448,7 +448,7 @@ public void onFailure(Throwable t) { @Override public void run() { - log.log(Level.FINE, "OperationQueuer: Running"); + log.log(Level.FINER, "OperationQueuer: Running"); try { while (transformTokensQueue.offer(new Object(), 5, MINUTES)) { stopwatch.start(); @@ -481,7 +481,7 @@ public void run() { } catch (Exception t) { log.log(Level.SEVERE, "OperationQueuer: fatal exception during iteration", t); } finally { - log.log(Level.FINE, "OperationQueuer: Exiting"); + log.log(Level.FINER, "OperationQueuer: Exiting"); } operationQueuer = null; try { @@ -566,7 +566,7 @@ public void stop() throws InterruptedException { return; } stopping = true; - log.log(Level.FINE, format("Instance %s is stopping", getName())); + log.log(Level.FINER, format("Instance %s is stopping", getName())); if (operationQueuer != null) { operationQueuer.stop(); } @@ -602,7 +602,7 @@ public void stop() throws InterruptedException { } actionCacheFetchService.shutdownNow(); workerStubs.invalidateAll(); - log.log(Level.FINE, format("Instance %s has been stopped", getName())); + log.log(Level.FINER, format("Instance %s has been stopped", getName())); stopping = false; stopped = true; } @@ -908,7 +908,7 @@ public void onError(Throwable t) { } else if (status.getCode() == Code.NOT_FOUND) { casMissCounter.inc(); log.log( - configs.getServer().isEnsureOutputsPresent() ? Level.WARNING : Level.FINE, + configs.getServer().isEnsureOutputsPresent() ? Level.WARNING : Level.FINER, worker + " did not contain " + DigestUtil.toString(blobDigest)); // ignore this, the worker will update the backplane eventually } else if (status.getCode() != Code.DEADLINE_EXCEEDED @@ -1022,7 +1022,7 @@ public void getBlob( final ListenableFuture> populatedWorkerListFuture; if (emptyWorkerList) { log.log( - Level.FINE, + Level.FINER, format( "worker list was initially empty for %s, attempting to correct", DigestUtil.toString(blobDigest))); @@ -1038,7 +1038,7 @@ public void getBlob( RequestMetadata.getDefaultInstance()), (foundOnWorkers) -> { log.log( - Level.FINE, + Level.FINER, format( "worker list was corrected for %s to be %s", DigestUtil.toString(blobDigest), foundOnWorkers.toString())); @@ -1068,7 +1068,7 @@ public void onError(Throwable t) { workersList.clear(); final ListenableFuture> workersListFuture; log.log( - Level.FINE, + Level.FINER, format( "worker list was depleted for %s, attempting to correct", DigestUtil.toString(blobDigest))); @@ -1084,7 +1084,7 @@ public void onError(Throwable t) { RequestMetadata.getDefaultInstance()), (foundOnWorkers) -> { log.log( - Level.FINE, + Level.FINER, format( "worker list was corrected after depletion for %s to be %s", DigestUtil.toString(blobDigest), foundOnWorkers.toString())); @@ -1383,7 +1383,7 @@ ListenableFuture expectDirectory( @Override public CompletableFuture apply(Digest digest, Executor executor) { log.log( - Level.FINE, + Level.FINER, format( "transformQueuedOperation(%s): fetching directory %s", reason, DigestUtil.toString(directoryBlobDigest))); @@ -1518,7 +1518,7 @@ private ListenableFuture transformQueuedOperation( expectCommand(commandDigest, requestMetadata), (command) -> { log.log( - Level.FINE, + Level.FINER, format("transformQueuedOperation(%s): fetched command", operationName)); if (command != null) { queuedOperationBuilder.setCommand(command); @@ -2003,7 +2003,7 @@ public ListenableFuture execute( executionSuccess.inc(); log.log( - Level.FINE, + Level.FINER, new StringBuilder() .append("ExecutionSuccess: ") .append(requestMetadata.getToolInvocationId()) @@ -2016,7 +2016,7 @@ public ListenableFuture execute( actionCache.invalidate(DigestUtil.asActionKey(actionDigest)); if (!skipCacheLookup && recentCacheServedExecutions.getIfPresent(requestMetadata) != null) { log.log( - Level.FINE, + Level.FINER, format("Operation %s will have skip_cache_lookup = true due to retry", operationName)); skipCacheLookup = true; } @@ -2241,7 +2241,7 @@ public ListenableFuture queue(ExecuteEntry executeEntry, Poller poller, Du poller.pause(); long checkCacheUSecs = stopwatch.elapsed(MICROSECONDS); log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): checkCache(%s): %sus elapsed", getName(), operation.getName(), checkCacheUSecs)); @@ -2268,7 +2268,7 @@ private ListenableFuture transformAndQueue( Digest actionDigest = metadata.getActionDigest(); SettableFuture queueFuture = SettableFuture.create(); log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): queue(%s): fetching action %s", getName(), operation.getName(), actionDigest.getHash())); @@ -2311,7 +2311,7 @@ private ListenableFuture transformAndQueue( actionFuture, (action) -> { log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): queue(%s): fetched action %s transforming queuedOperation", getName(), operation.getName(), actionDigest.getHash())); @@ -2341,7 +2341,7 @@ private ListenableFuture transformAndQueue( queuedFuture, (profiledQueuedMetadata) -> { log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): queue(%s): queuedOperation %s transformed, validating", getName(), @@ -2363,7 +2363,7 @@ private ListenableFuture transformAndQueue( validatedFuture, (profiledQueuedMetadata) -> { log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): queue(%s): queuedOperation %s validated, uploading", getName(), @@ -2415,7 +2415,7 @@ public void onSuccess(ProfiledQueuedOperationMetadata profiledQueuedMetadata) { long elapsedUSecs = stopwatch.elapsed(MICROSECONDS); long queueUSecs = elapsedUSecs - startQueueUSecs; log.log( - Level.FINE, + Level.FINER, format( "ShardInstance(%s): queue(%s): %dus checkCache, %dus transform, %dus validate, %dus upload, %dus queue, %dus elapsed", getName(), diff --git a/src/main/java/build/buildfarm/instance/shard/Util.java b/src/main/java/build/buildfarm/instance/shard/Util.java index 5e3493d0c6..7070097659 100644 --- a/src/main/java/build/buildfarm/instance/shard/Util.java +++ b/src/main/java/build/buildfarm/instance/shard/Util.java @@ -141,7 +141,7 @@ public void onFailure(Throwable t) { } }; log.log( - Level.FINE, + Level.FINER, format( "scanning through %d workers to find %s", workerSet.size(), DigestUtil.toString(digest))); @@ -184,7 +184,7 @@ static void checkMissingBlobOnInstance( public void onSuccess(Iterable missingDigests) { boolean found = Iterables.isEmpty(missingDigests); log.log( - Level.FINE, + Level.FINER, format( "check missing response for %s to %s was %sfound", DigestUtil.toString(digest), worker, found ? "" : "not ")); @@ -197,7 +197,7 @@ public void onFailure(Throwable t) { Status status = Status.fromThrowable(t); if (status.getCode() == Code.UNAVAILABLE) { log.log( - Level.FINE, + Level.FINER, format( "check missing response for %s to %s was not found for unavailable", DigestUtil.toString(digest), worker)); diff --git a/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java b/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java index 5f9422a421..925f4d95bf 100644 --- a/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java +++ b/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java @@ -172,7 +172,7 @@ protected static String formatRequestMetadataToJson( .usingTypeRegistry(typeRegistry) .omittingInsignificantWhitespace() .print(operationRequestMetadata); - log.log(Level.FINE, "{}", formattedRequestMetadata); + log.log(Level.FINER, "{}", formattedRequestMetadata); return formattedRequestMetadata; } } diff --git a/src/main/java/build/buildfarm/worker/Executor.java b/src/main/java/build/buildfarm/worker/Executor.java index 588d38c208..0416c2354d 100644 --- a/src/main/java/build/buildfarm/worker/Executor.java +++ b/src/main/java/build/buildfarm/worker/Executor.java @@ -199,7 +199,7 @@ private long executePolled( Stopwatch stopwatch) throws InterruptedException { /* execute command */ - log.log(Level.FINE, "Executor: Operation " + operation.getName() + " Executing command"); + log.log(Level.FINER, "Executor: Operation " + operation.getName() + " Executing command"); ActionResult.Builder resultBuilder = operationContext.executeResponse.getResultBuilder(); resultBuilder @@ -291,7 +291,7 @@ private long executePolled( long executeUSecs = stopwatch.elapsed(MICROSECONDS); log.log( - Level.FINE, + Level.FINER, String.format( "Executor::executeCommand(%s): Completed command: exit code %d", operationName, resultBuilder.getExitCode())); @@ -309,7 +309,7 @@ private long executePolled( throw e; } } else { - log.log(Level.FINE, "Executor: Operation " + operationName + " Failed to claim output"); + log.log(Level.FINER, "Executor: Operation " + operationName + " Failed to claim output"); boolean wasInterrupted = Thread.interrupted(); try { putError(); diff --git a/src/main/java/build/buildfarm/worker/InputFetcher.java b/src/main/java/build/buildfarm/worker/InputFetcher.java index 1c99df6a91..7be7a29e96 100644 --- a/src/main/java/build/buildfarm/worker/InputFetcher.java +++ b/src/main/java/build/buildfarm/worker/InputFetcher.java @@ -168,7 +168,7 @@ static String getExecutablePath( @VisibleForTesting long fetchPolled(Stopwatch stopwatch) throws InterruptedException { String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); - log.log(Level.FINE, format("fetching inputs: %s", operationName)); + log.log(Level.FINER, format("fetching inputs: %s", operationName)); ExecutedActionMetadata.Builder executedAction = operationContext @@ -278,7 +278,7 @@ private void proceedToOutput(Action action, Command command, Path execDir) } } else { String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); - log.log(Level.FINE, "InputFetcher: Operation " + operationName + " Failed to claim output"); + log.log(Level.FINER, "InputFetcher: Operation " + operationName + " Failed to claim output"); owner.error().put(operationContext); } diff --git a/src/main/java/build/buildfarm/worker/Pipeline.java b/src/main/java/build/buildfarm/worker/Pipeline.java index f266875538..da4eaacfb6 100644 --- a/src/main/java/build/buildfarm/worker/Pipeline.java +++ b/src/main/java/build/buildfarm/worker/Pipeline.java @@ -134,7 +134,7 @@ private void join(boolean closeStage) throws InterruptedException { } } if (stageToClose != null && !stageToClose.isClosed()) { - log.log(Level.FINE, "Closing stage at priority " + maxPriority); + log.log(Level.FINER, "Closing stage at priority " + maxPriority); stageToClose.close(); } } @@ -157,7 +157,7 @@ private void join(boolean closeStage) throws InterruptedException { if (!thread.isAlive()) { log.log( - Level.FINE, + Level.FINER, "Stage " + stage.name() + " has exited at priority " diff --git a/src/main/java/build/buildfarm/worker/PipelineStage.java b/src/main/java/build/buildfarm/worker/PipelineStage.java index d3f23d1b2d..7dd1d6d9ee 100644 --- a/src/main/java/build/buildfarm/worker/PipelineStage.java +++ b/src/main/java/build/buildfarm/worker/PipelineStage.java @@ -145,7 +145,7 @@ protected void logStart(String operationName) { } protected void logStart(String operationName, String message) { - getLogger().log(Level.FINE, String.format("%s: %s", logIterateId(operationName), message)); + getLogger().log(Level.FINER, String.format("%s: %s", logIterateId(operationName), message)); } protected void logComplete(String operationName, long usecs, long stallUSecs, boolean success) { @@ -155,7 +155,7 @@ protected void logComplete(String operationName, long usecs, long stallUSecs, bo protected void logComplete(String operationName, long usecs, long stallUSecs, String status) { getLogger() .log( - Level.FINE, + Level.FINER, String.format( "%s: %g ms (%g ms stalled) %s", logIterateId(operationName), usecs / 1000.0f, stallUSecs / 1000.0f, status)); diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 96e8f1f218..e6d9826f45 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -373,7 +373,8 @@ public Path createExecDir( ImmutableList.Builder inputFiles = new ImmutableList.Builder<>(); ImmutableList.Builder inputDirectories = new ImmutableList.Builder<>(); - log.log(Level.FINE, "ExecFileSystem::createExecDir(" + operationName + ") calling fetchInputs"); + log.log( + Level.FINER, "ExecFileSystem::createExecDir(" + operationName + ") calling fetchInputs"); Iterable> fetchedFutures = fetchInputs( execDir, @@ -431,7 +432,7 @@ public Path createExecDir( rootInputDirectories.put(execDir, inputDirectories.build()); log.log( - Level.FINE, + Level.FINER, "ExecFileSystem::createExecDir(" + operationName + ") stamping output directories"); boolean stamped = false; try { diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 8b4cb1dd1f..143fa09966 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -239,12 +239,12 @@ public void resumePoller( } else { operationPollerCounter.inc(); log.log( - Level.INFO, format("%s: poller: Completed Poll for %s: OK", name, operationName)); + Level.FINE, format("%s: poller: Completed Poll for %s: OK", name, operationName)); } return success; }, () -> { - log.log(Level.INFO, format("%s: poller: Deadline expired for %s", name, operationName)); + log.log(Level.FINE, format("%s: poller: Deadline expired for %s", name, operationName)); onFailure.run(); }, deadline); @@ -483,7 +483,7 @@ private void uploadOutputFile( throws IOException, InterruptedException { String outputFile = actionRoot.relativize(outputPath).toString(); if (!Files.exists(outputPath)) { - log.log(Level.FINE, "ReportResultStage: " + outputFile + " does not exist..."); + log.log(Level.FINER, "ReportResultStage: " + outputFile + " does not exist..."); return; } @@ -491,7 +491,7 @@ private void uploadOutputFile( String message = String.format( "ReportResultStage: %s is a directory but it should have been a file", outputPath); - log.log(Level.FINE, message); + log.log(Level.FINER, message); preconditionFailure .addViolationsBuilder() .setType(VIOLATION_TYPE_INVALID) @@ -572,12 +572,12 @@ private void uploadOutputDirectory( throws IOException, InterruptedException { String outputDir = actionRoot.relativize(outputDirPath).toString(); if (!Files.exists(outputDirPath)) { - log.log(Level.FINE, "ReportResultStage: " + outputDir + " does not exist..."); + log.log(Level.FINER, "ReportResultStage: " + outputDir + " does not exist..."); return; } if (!Files.isDirectory(outputDirPath)) { - log.log(Level.FINE, "ReportResultStage: " + outputDir + " is not a directory..."); + log.log(Level.FINER, "ReportResultStage: " + outputDir + " is not a directory..."); preconditionFailure .addViolationsBuilder() .setType(VIOLATION_TYPE_INVALID) @@ -700,7 +700,7 @@ public boolean putOperation(Operation operation) throws IOException, Interrupted boolean success = createBackplaneRetrier().execute(() -> instance.putOperation(operation)); if (success && operation.getDone()) { completedOperations.inc(); - log.log(Level.FINE, "CompletedOperation: " + operation.getName()); + log.log(Level.FINER, "CompletedOperation: " + operation.getName()); } return success; } From 831572372df54c4a7e8539dfd27c75bd7a4d0dac Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Fri, 4 Aug 2023 13:23:58 -0700 Subject: [PATCH 036/214] Fix io_bytes_read metrics for buildfarm:server --- src/main/java/build/buildfarm/instance/shard/ShardInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index a37e4cb6ad..883931d2d4 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -895,7 +895,7 @@ private void fetchBlobFromWorker( public void onNext(ByteString nextChunk) { blobObserver.onNext(nextChunk); received += nextChunk.size(); - ioMetric.observe(received); + ioMetric.observe(nextChunk.size()); } @Override From 77fee77ba7c6484f045e62080cb8e6d93d52cfc8 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Fri, 28 Jul 2023 12:51:17 -0700 Subject: [PATCH 037/214] chore(deps): bump Guava from 31.1-jre to 32.1.1-jre Remediating https://nvd.nist.gov/vuln/detail/CVE-2023-2976 --- defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index 65087518d5..5f71245c72 100644 --- a/defs.bzl +++ b/defs.bzl @@ -95,7 +95,7 @@ def buildfarm_init(name = "buildfarm"): "com.google.errorprone:error_prone_annotations:2.9.0", "com.google.errorprone:error_prone_core:0.92", "com.google.guava:failureaccess:1.0.1", - "com.google.guava:guava:31.1-jre", + "com.google.guava:guava:32.1.1-jre", "com.google.j2objc:j2objc-annotations:1.1", "com.google.jimfs:jimfs:1.1", "com.google.protobuf:protobuf-java-util:3.10.0", From b5754e4c5b33c50ddf6d5636e9fb00576283d7be Mon Sep 17 00:00:00 2001 From: Tobias Kongsvik Date: Tue, 8 Aug 2023 08:49:21 +0200 Subject: [PATCH 038/214] Upgrade opentelemetry javaagent to 1.28 --- deps.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.bzl b/deps.bzl index 28a66281f4..2b994d33a5 100644 --- a/deps.bzl +++ b/deps.bzl @@ -176,9 +176,9 @@ def buildfarm_dependencies(repository_name = "build_buildfarm"): maybe( http_jar, "opentelemetry", - sha256 = "0523287984978c091be0d22a5c61f0bce8267eeafbbae58c98abaf99c9396832", + sha256 = "eccd069da36031667e5698705a6838d173d527a5affce6cc514a14da9dbf57d7", urls = [ - "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.11.0/opentelemetry-javaagent.jar", + "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.28.0/opentelemetry-javaagent.jar", ], ) From 9e7e633d4e4defd5f0052f9ebe27e4020406afa9 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 10 Aug 2023 11:16:46 -0700 Subject: [PATCH 039/214] Update platforms Fixes https://github.com/bazelbuild/bazel-buildfarm/issues/1421 --- deps.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps.bzl b/deps.bzl index 2b994d33a5..cb22b1641f 100644 --- a/deps.bzl +++ b/deps.bzl @@ -13,10 +13,10 @@ def archive_dependencies(third_party): { "name": "platforms", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.6/platforms-0.0.6.tar.gz", - "https://github.com/bazelbuild/platforms/releases/download/0.0.6/platforms-0.0.6.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", ], - "sha256": "5308fc1d8865406a49427ba24a9ab53087f17f5266a7aabbfc28823f3916e1ca", + "sha256": "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51", }, { "name": "rules_jvm_external", From 18ae72ef484ea453afe60fae368bee4599d7a28d Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:37:50 -0700 Subject: [PATCH 040/214] Add download rate metrics for buildfarm:worker (#1418) * Add download metrics for buildfarm:worker * Run formatter * remove static * change IO_METRIC prometheus counter to static --- .../build/buildfarm/worker/shard/ShardWorkerInstance.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java index 04c11d315b..a891af7faa 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java @@ -56,6 +56,7 @@ import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.stub.ServerCallStreamObserver; +import io.prometheus.client.Counter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -68,6 +69,9 @@ @Log public class ShardWorkerInstance extends AbstractServerInstance { + private static final Counter IO_METRIC = + Counter.build().name("io_bytes_read").help("Read I/O (bytes)").register(); + private final Backplane backplane; public ShardWorkerInstance( @@ -132,6 +136,7 @@ public void getBlob( @Override public void onNext(ByteString data) { blobObserver.onNext(data); + IO_METRIC.inc(data.size()); } void removeBlobLocation() { From 1180a85e231feb99324001e437f1fdaf04634bd5 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Thu, 31 Aug 2023 05:15:44 -0700 Subject: [PATCH 041/214] Add request metadata interceptor to Worker (#1425) --- src/main/java/build/buildfarm/worker/shard/Worker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index da698726de..e1b7acf94c 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -41,6 +41,7 @@ import build.buildfarm.common.config.GrpcMetrics; import build.buildfarm.common.grpc.Retrier; import build.buildfarm.common.grpc.Retrier.Backoff; +import build.buildfarm.common.grpc.TracingMetadataUtils.ServerHeadersInterceptor; import build.buildfarm.common.services.ByteStreamService; import build.buildfarm.common.services.ContentAddressableStorageService; import build.buildfarm.instance.Instance; @@ -233,6 +234,7 @@ private Server createServer( storage, inputFetchStage, executeActionStage, context, completeStage, backplane)); } GrpcMetrics.handleGrpcMetricIntercepts(serverBuilder, configs.getWorker().getGrpcMetrics()); + serverBuilder.intercept(new ServerHeadersInterceptor()); return serverBuilder.build(); } From 8795c6e0ace4b73473bef4d1ec946d9814e75f24 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Thu, 31 Aug 2023 05:31:16 -0700 Subject: [PATCH 042/214] Separate channel for write api (#1424) * Separate channel for write api * shutdown channel on termination --- .../buildfarm/instance/shard/WorkerStubs.java | 1 + .../buildfarm/instance/stub/StubInstance.java | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java b/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java index e0015f6fc4..abaf5f71e1 100644 --- a/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java +++ b/src/main/java/build/buildfarm/instance/shard/WorkerStubs.java @@ -57,6 +57,7 @@ private static Instance newStubInstance(String worker, DigestUtil digestUtil, Du worker, digestUtil, createChannel(worker), + createChannel(worker), // separate write channel timeout, newStubRetrier(), newStubRetryService()); diff --git a/src/main/java/build/buildfarm/instance/stub/StubInstance.java b/src/main/java/build/buildfarm/instance/stub/StubInstance.java index dd647a327d..84ff692ab6 100644 --- a/src/main/java/build/buildfarm/instance/stub/StubInstance.java +++ b/src/main/java/build/buildfarm/instance/stub/StubInstance.java @@ -160,6 +160,7 @@ public class StubInstance implements Instance { private final String identifier; private final DigestUtil digestUtil; private final ManagedChannel channel; + private final ManagedChannel writeChannel; private final @Nullable Duration grpcTimeout; private final Retrier retrier; private final @Nullable ListeningScheduledExecutorService retryService; @@ -186,12 +187,24 @@ public StubInstance( this(name, identifier, digestUtil, channel, grpcTimeout, NO_RETRIES, /* retryService=*/ null); } + public StubInstance( + String name, + String identifier, + DigestUtil digestUtil, + ManagedChannel channel, + Duration grpcTimeout, + Retrier retrier, + @Nullable ListeningScheduledExecutorService retryService) { + this(name, identifier, digestUtil, channel, channel, grpcTimeout, retrier, retryService); + } + @SuppressWarnings("NullableProblems") public StubInstance( String name, String identifier, DigestUtil digestUtil, ManagedChannel channel, + ManagedChannel writeChannel, Duration grpcTimeout, Retrier retrier, @Nullable ListeningScheduledExecutorService retryService) { @@ -199,6 +212,7 @@ public StubInstance( this.identifier = identifier; this.digestUtil = digestUtil; this.channel = channel; + this.writeChannel = writeChannel; this.grpcTimeout = grpcTimeout; this.retrier = retrier; this.retryService = retryService; @@ -358,8 +372,14 @@ public void start(String publicName) {} @Override public void stop() throws InterruptedException { isStopped = true; - channel.shutdownNow(); - channel.awaitTermination(0, TimeUnit.SECONDS); + if (!channel.isShutdown()) { + channel.shutdownNow(); + channel.awaitTermination(0, TimeUnit.SECONDS); + } + if (!writeChannel.isShutdown()) { + writeChannel.shutdownNow(); + writeChannel.awaitTermination(0, TimeUnit.SECONDS); + } if (retryService != null && !shutdownAndAwaitTermination(retryService, 10, TimeUnit.SECONDS)) { log.log(Level.SEVERE, format("Could not shut down retry service for %s", identifier)); } @@ -661,7 +681,7 @@ Write getWrite( deadlined(bsBlockingStub).withInterceptors(attachMetadataInterceptor(requestMetadata)), Suppliers.memoize( () -> - ByteStreamGrpc.newStub(channel) + ByteStreamGrpc.newStub(writeChannel) .withInterceptors(attachMetadataInterceptor(requestMetadata))), resourceName, exceptionTranslator, From 0abb176c8130ac82a3f5ef5bc04f2e7d010e4dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=BChler?= Date: Thu, 7 Sep 2023 13:52:34 +0200 Subject: [PATCH 043/214] fix docu CAS config (#1432) --- .../content_addressable_storage.md | 23 ++++++++++--------- _site/docs/configuration/configuration.md | 21 +++++++++-------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/_site/docs/architecture/content_addressable_storage.md b/_site/docs/architecture/content_addressable_storage.md index a8955b4ce3..41b50d9948 100644 --- a/_site/docs/architecture/content_addressable_storage.md +++ b/_site/docs/architecture/content_addressable_storage.md @@ -38,9 +38,9 @@ This is the example presentation of a CAS in the memory instance available [here ``` worker: - cas: - type: MEMORY - maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 + storages: + - type: MEMORY + maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 ``` ## GRPC @@ -53,9 +53,11 @@ A grpc config example is available in the alternate instance specification in th server: name: shard worker: - cas: - type: GRPC - target: + storages: + - type: FILESYSTEM + path: "cache" + - type: GRPC + target: ``` ## HTTP/1 @@ -89,11 +91,10 @@ The CASFileCache is also available on MemoryInstance servers, where it can repre ``` worker: - cas: - type: FILESYSTEM - path: "cache" - maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 - maxEntrySizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 + storages: + - type: FILESYSTEM + path: "cache" + maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 ``` CASTest is a standalone tool to load the cache and print status information about it. diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index c6df9b58d3..8ee8d5d55b 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -332,20 +332,21 @@ Example: ``` worker: - cas: - type: FILESYSTEM - path: "cache" - maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 - maxEntrySizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 - target: + storages: + - type: FILESYSTEM + path: "cache" + maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 + maxEntrySizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 + target: ``` ``` worker: - cas: - type: GRPC - instanceName: external-cas - target: "cas.external.com:1234" + storages: + - type: FILESYSTEM + path: "cache" + - type: GRPC + target: "cas.external.com:1234" ``` ### Execution Policies From 882e86fb1516cc62b6dbfbd3712376e612b0e712 Mon Sep 17 00:00:00 2001 From: Dmitriy Shirchenko Date: Wed, 20 Sep 2023 11:35:27 -0700 Subject: [PATCH 044/214] Fix deadlock when handling Write request (#1442) * Fix deadlock by setting a timeout and removing the lock. * remove timeout as its not necessary * lint: delete unused import --- .../build/buildfarm/cas/cfc/CASFileCache.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index a112c37bb2..3897c7268f 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -861,8 +861,14 @@ Write newWrite(BlobWriteKey key, ListenableFuture future) { Write write = new Write() { CancellableOutputStream out = null; + + @GuardedBy("this") boolean isReset = false; + + @GuardedBy("this") SettableFuture closedFuture = null; + + @GuardedBy("this") long fileCommittedSize = -1; @Override @@ -943,6 +949,11 @@ public synchronized ListenableFuture getOutputFuture( directExecutor()); } + private synchronized void syncCancelled() { + out = null; + isReset = true; + } + @Override public synchronized FeedbackOutputStream getOutput( long deadlineAfter, TimeUnit deadlineAfterUnits, Runnable onReadyHandler) @@ -951,6 +962,9 @@ public synchronized FeedbackOutputStream getOutput( // will block until it is returned via a close. if (closedFuture != null) { try { + while (!closedFuture.isDone()) { + wait(); + } closedFuture.get(); } catch (ExecutionException e) { throw new IOException(e.getCause()); @@ -967,8 +981,7 @@ public synchronized FeedbackOutputStream getOutput( UUID.fromString(key.getIdentifier()), cancelled -> { if (cancelled) { - out = null; - isReset = true; + syncCancelled(); } outClosedFuture.set(null); }, @@ -978,7 +991,11 @@ public synchronized FeedbackOutputStream getOutput( return uniqueOut; } - private void commitOpenState( + private synchronized void syncNotify() { + notify(); + } + + private synchronized void commitOpenState( CancellableOutputStream out, SettableFuture closedFuture) { // transition the Write to an open state, and modify all internal state required // atomically @@ -986,6 +1003,7 @@ private void commitOpenState( this.out = out; this.closedFuture = closedFuture; + closedFuture.addListener(this::syncNotify, directExecutor()); // they will likely write to this, so we can no longer assume isReset. // might want to subscribe to a write event on the stream isReset = false; From 773341ca188cf2e7acc363c322beb3ad46f7b72f Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 20 Sep 2023 14:38:07 -0400 Subject: [PATCH 045/214] Deliver RemoteCasWriter IOExceptions (#1438) Interactions with RemoteCasWriter which declare IOExceptions should throw them exclusively for failures. --- .../buildfarm/worker/shard/RemoteCasWriter.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java index c7b21bbd0b..8a5bfdb52f 100644 --- a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java +++ b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java @@ -73,7 +73,7 @@ private void insertFileToCasMember(Digest digest, Path file) Throwable cause = e.getCause(); Throwables.throwIfInstanceOf(cause, IOException.class); Throwables.throwIfUnchecked(cause); - throw new RuntimeException(cause); + throw new IOException(cause); } } @@ -90,7 +90,7 @@ private long writeToCasMember(Digest digest, InputStream in) Throwables.throwIfInstanceOf(cause, IOException.class); // prevent a discard of this frame Status status = Status.fromThrowable(cause); - throw status.asRuntimeException(); + throw new IOException(status.asException()); } } @@ -103,25 +103,20 @@ private Write getCasMemberWrite(Digest digest, String workerName) throws IOExcep public void insertBlob(Digest digest, ByteString content) throws IOException, InterruptedException { - insertBlobToCasMember(digest, content); - } - - private void insertBlobToCasMember(Digest digest, ByteString content) - throws IOException, InterruptedException { try (InputStream in = content.newInput()) { retrier.execute(() -> writeToCasMember(digest, in)); } catch (RetryException e) { Throwable cause = e.getCause(); Throwables.throwIfInstanceOf(cause, IOException.class); Throwables.throwIfUnchecked(cause); - throw new RuntimeException(cause); + throw new IOException(cause); } } private String getRandomWorker() throws IOException { synchronized (workerSet) { if (workerSet.isEmpty()) { - throw new RuntimeException("no available workers"); + throw new IOException("no available workers"); } Random rand = new Random(); int index = rand.nextInt(workerSet.size()); From 20d4ae57e5819a529db4a3dae20b06eb3765722c Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Wed, 6 Sep 2023 10:08:47 -0700 Subject: [PATCH 046/214] build: update maven mirrors JCenter is retired. Pick some mirrors from https://repo.maven.apache.org/maven2/.meta/repository-metadata.xml --- defs.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defs.bzl b/defs.bzl index 5f71245c72..5108852adb 100644 --- a/defs.bzl +++ b/defs.bzl @@ -138,8 +138,8 @@ def buildfarm_init(name = "buildfarm"): ], generate_compat_repositories = True, repositories = [ - "https://repo.maven.apache.org/maven2", - "https://jcenter.bintray.com", + "https://repo1.maven.org/maven2", + "https://mirrors.ibiblio.org/pub/mirrors/maven2", ], ) From a7f1ac2290d56a89a5379dfc4343b86765c3f555 Mon Sep 17 00:00:00 2001 From: shaohui Date: Mon, 28 Aug 2023 07:09:19 +0000 Subject: [PATCH 047/214] Add production-ready helm chart for deploying buildfarm on k8s --- kubernetes/helm-charts/buildfarm/.gitignore | 2 + kubernetes/helm-charts/buildfarm/.helmignore | 23 ++ kubernetes/helm-charts/buildfarm/Chart.yaml | 30 +++ .../helm-charts/buildfarm/templates/NOTES.txt | 22 ++ .../buildfarm/templates/_helpers.tpl | 73 +++++++ .../buildfarm/templates/configmap.yaml | 28 +++ .../templates/server/deployment.yaml | 78 +++++++ .../buildfarm/templates/server/service.yaml | 25 +++ .../templates/server/servicemonitor.yaml | 37 ++++ .../buildfarm/templates/serviceaccount.yaml | 12 + .../templates/shard-worker/autoscaler.yaml | 21 ++ .../templates/shard-worker/service.yaml | 25 +++ .../shard-worker/servicemonitor.yaml | 37 ++++ .../templates/shard-worker/statefulsets.yaml | 110 ++++++++++ .../templates/tests/test-connection.yaml | 15 ++ kubernetes/helm-charts/buildfarm/values.yaml | 206 ++++++++++++++++++ 16 files changed, 744 insertions(+) create mode 100644 kubernetes/helm-charts/buildfarm/.gitignore create mode 100644 kubernetes/helm-charts/buildfarm/.helmignore create mode 100644 kubernetes/helm-charts/buildfarm/Chart.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/NOTES.txt create mode 100644 kubernetes/helm-charts/buildfarm/templates/_helpers.tpl create mode 100644 kubernetes/helm-charts/buildfarm/templates/configmap.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/server/deployment.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/server/service.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/server/servicemonitor.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/serviceaccount.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/shard-worker/service.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/shard-worker/servicemonitor.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml create mode 100644 kubernetes/helm-charts/buildfarm/templates/tests/test-connection.yaml create mode 100644 kubernetes/helm-charts/buildfarm/values.yaml diff --git a/kubernetes/helm-charts/buildfarm/.gitignore b/kubernetes/helm-charts/buildfarm/.gitignore new file mode 100644 index 0000000000..8d8946152c --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/.gitignore @@ -0,0 +1,2 @@ +charts +Chart.lock diff --git a/kubernetes/helm-charts/buildfarm/.helmignore b/kubernetes/helm-charts/buildfarm/.helmignore new file mode 100644 index 0000000000..0e8a0eb36f --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/kubernetes/helm-charts/buildfarm/Chart.yaml b/kubernetes/helm-charts/buildfarm/Chart.yaml new file mode 100644 index 0000000000..ce443957dd --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +name: buildfarm +description: A Helm chart for bazel buildfarm + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v2.5.0" + +dependencies: + - condition: redis.enabled + name: redis + repository: https://charts.helm.sh/stable + version: 10.5.7 \ No newline at end of file diff --git a/kubernetes/helm-charts/buildfarm/templates/NOTES.txt b/kubernetes/helm-charts/buildfarm/templates/NOTES.txt new file mode 100644 index 0000000000..92421375fb --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.server.ingress.enabled }} +{{- range $host := .Values.server.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.server.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.server.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "buildfarm.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.server.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "buildfarm.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "buildfarm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.server.service.port }} +{{- else if contains "ClusterIP" .Values.server.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "buildfarm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/_helpers.tpl b/kubernetes/helm-charts/buildfarm/templates/_helpers.tpl new file mode 100644 index 0000000000..dffd8587bd --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/_helpers.tpl @@ -0,0 +1,73 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "buildfarm.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "buildfarm.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "buildfarm.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "buildfarm.labels" -}} +helm.sh/chart: {{ include "buildfarm.chart" . }} +{{ include "buildfarm.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "buildfarm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "buildfarm.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "buildfarm.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "buildfarm.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + + +{{/* Checks for `externalRedis` */}} +{{- if .Values.externalRedis.host }} + {{/* check if they are using externalRedis (the default value for `externalRedis.host` is "localhost") */}} + {{- if not (eq .Values.externalRedis.host "localhost") }} + {{- if .Values.redis.enabled }} + {{ required "If `externalRedis.host` is set, then `redis.enabled` should be `false`!" nil }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/kubernetes/helm-charts/buildfarm/templates/configmap.yaml b/kubernetes/helm-charts/buildfarm/templates/configmap.yaml new file mode 100644 index 0000000000..809d83e049 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/configmap.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "buildfarm.fullname" . }}-config +data: + config.yml: |- + {{- range $key, $value := .Values.config }} + {{- if kindIs "map" $value }} + {{- else }} + {{ $key }}: {{ $value }}{{- end }} + {{- end }} + backplane: + {{- if .Values.redis.enabled }} + redisUri: "{{ .Values.redis.scheme }}://{{ printf "%s-redis-master.%s" (include "redis.fullname" .) (.Release.Namespace) }}:{{ "6379" }}" + {{- else }} + redisUri: "{{ .Values.externalRedis.uri }}" + {{- end }} + {{- with .Values.config.backplane }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.config.server }} + server: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.config.worker }} + worker: + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/server/deployment.yaml b/kubernetes/helm-charts/buildfarm/templates/server/deployment.yaml new file mode 100644 index 0000000000..e56261f1fd --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/server/deployment.yaml @@ -0,0 +1,78 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "buildfarm.fullname" . }}-server + labels: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.server.replicaCount }} + selector: + matchLabels: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/server-config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "buildfarm.serviceAccountName" . }} + containers: + - name: buildfarm-server + image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.server.image.pullPolicy }} + command: + - bash + - /app/build_buildfarm/buildfarm-server.binary + args: + - /config/config.yml + env: + {{- if .Values.server.extraEnv }} + {{- toYaml .Values.server.extraEnv | nindent 12 }} + {{- end }} + ports: + - containerPort: 8980 + name: "server-comm" + - containerPort: 9090 + name: "metrics" + livenessProbe: + httpGet: + path: / + port: metrics + readinessProbe: + httpGet: + path: / + port: metrics + resources: + {{- toYaml .Values.server.resources | nindent 12 }} + volumeMounts: + - mountPath: /config + name: config + readOnly: true + {{- with .Values.server.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.server.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.server.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "buildfarm.fullname" . }}-config + name: config diff --git a/kubernetes/helm-charts/buildfarm/templates/server/service.yaml b/kubernetes/helm-charts/buildfarm/templates/server/service.yaml new file mode 100644 index 0000000000..6079f92dc0 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/server/service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "buildfarm.fullname" . }}-server + labels: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.labels" . | nindent 4 }} + {{- with .Values.server.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.server.service.type }} + ports: + - port: {{ .Values.server.service.port }} + targetPort: server-comm + protocol: TCP + name: gprc + - port: 9090 + targetPort: metrics + protocol: TCP + name: metrics + selector: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.selectorLabels" . | nindent 4 }} diff --git a/kubernetes/helm-charts/buildfarm/templates/server/servicemonitor.yaml b/kubernetes/helm-charts/buildfarm/templates/server/servicemonitor.yaml new file mode 100644 index 0000000000..fe8a12b649 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/server/servicemonitor.yaml @@ -0,0 +1,37 @@ +{{- if .Values.server.serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "buildfarm.fullname" . }}-server + labels: + {{- include "buildfarm.labels" . | nindent 4 }} +spec: + endpoints: + - port: "metrics" + {{- with .Values.server.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.server.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + honorLabels: true + path: {{ .Values.server.serviceMonitor.path }} + scheme: {{ .Values.server.serviceMonitor.scheme }} + {{- with .Values.server.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 6 }} + {{- end }} + jobLabel: "{{ .Release.Name }}" + selector: + matchLabels: + name: {{ include "buildfarm.fullname" . }}-server + {{- include "buildfarm.labels" . | nindent 6 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + {{- with .Values.server.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/serviceaccount.yaml b/kubernetes/helm-charts/buildfarm/templates/serviceaccount.yaml new file mode 100644 index 0000000000..f28779e3e4 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "buildfarm.serviceAccountName" . }} + labels: + {{- include "buildfarm.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml new file mode 100644 index 0000000000..4389c793b6 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml @@ -0,0 +1,21 @@ +{{- if .Values.shardWorker.autoscaling.enabled -}} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "buildfarm.fullname" . }}-shard-worker + labels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.labels" . | nindent 4 }} + {{- with .Values.shardWorker.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + maxReplicas: {{ .Values.shardWorker.autoscaling.maxReplicas }} + minReplicas: {{ .Values.shardWorker.autoscaling.minReplicas }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "buildfarm.fullname" . }}-shard-worker + targetCPUUtilizationPercentage: {{ .Values.shardWorker.autoscaling.targetCPUUtilizationPercentage }} +{{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/service.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/service.yaml new file mode 100644 index 0000000000..135756bd5f --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "buildfarm.fullname" . }}-shard-worker + labels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.labels" . | nindent 4 }} + {{- with .Values.shardWorker.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.shardWorker.service.type }} + ports: + - port: {{ .Values.shardWorker.service.port }} + targetPort: worker-comm + protocol: TCP + name: gprc + - port: 9090 + targetPort: metrics + protocol: TCP + name: metrics + selector: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.selectorLabels" . | nindent 4 }} diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/servicemonitor.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/servicemonitor.yaml new file mode 100644 index 0000000000..8ff1a59a56 --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/servicemonitor.yaml @@ -0,0 +1,37 @@ +{{- if .Values.shardWorker.serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "buildfarm.fullname" . }}-shard-worker + labels: + {{- include "buildfarm.labels" . | nindent 4 }} +spec: + endpoints: + - port: "metrics" + {{- with .Values.shardWorker.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.shardWorker.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + honorLabels: true + path: {{ .Values.shardWorker.serviceMonitor.path }} + scheme: {{ .Values.shardWorker.serviceMonitor.scheme }} + {{- with .Values.shardWorker.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 6 }} + {{- end }} + jobLabel: "{{ .Release.Name }}" + selector: + matchLabels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.labels" . | nindent 6 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + {{- with .Values.shardWorker.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml new file mode 100644 index 0000000000..62706a61ac --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml @@ -0,0 +1,110 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "buildfarm.fullname" . }}-shard-worker + labels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.labels" . | nindent 4 }} +spec: + serviceName: {{ include "buildfarm.fullname" . }}-shard-worker + {{- if .Values.shardWorker.autoscaling.enabled }} + replicas: {{ .Values.shardWorker.autoscaling.minReplicas }} + {{- else }} + replicas: {{ .Values.shardWorker.replicaCount }} + {{- end }} + selector: + matchLabels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/worker-config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + name: {{ include "buildfarm.fullname" . }}-shard-worker + {{- include "buildfarm.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "buildfarm.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: buildfarm-worker + image: "{{ .Values.shardWorker.image.repository }}:{{ .Values.shardWorker.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.shardWorker.image.pullPolicy }} + args: + - /config/config.yml + - --public_name=$(POD_IP):8982 + command: + - bash + - /app/build_buildfarm/buildfarm-shard-worker.binary + env: + - name: POD_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + {{- if .Values.shardWorker.extraEnv }} + {{- toYaml .Values.shardWorker.extraEnv | nindent 12 }} + {{- end }} + ports: + - containerPort: 8981 + name: "worker-comm" + - containerPort: 9090 + name: "metrics" + livenessProbe: + httpGet: + path: / + port: metrics + readinessProbe: + httpGet: + path: / + port: metrics + resources: + {{- toYaml .Values.shardWorker.resources | nindent 12 }} + volumeMounts: + - mountPath: /config + name: config + readOnly: true + - mountPath: /tmp/worker + name: {{ include "buildfarm.fullname" . }}-shard-worker-data + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} + {{- with .Values.shardWorker.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.shardWorker.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.shardWorker.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "buildfarm.fullname" . }}-config + name: config + {{- with .Values.shardWorker.extraVolumes }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} + volumeClaimTemplates: + - metadata: + name: {{ include "buildfarm.fullname" . }}-shard-worker-data + spec: + accessModes: ["ReadWriteOnce"] + {{- with .Values.shardWorker.storage.class }} + storageClassName: "{{ . }}" + {{- end }} + resources: + requests: + storage: "{{ .Values.shardWorker.storage.size }}" diff --git a/kubernetes/helm-charts/buildfarm/templates/tests/test-connection.yaml b/kubernetes/helm-charts/buildfarm/templates/tests/test-connection.yaml new file mode 100644 index 0000000000..7aea6f1cfe --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "buildfarm.fullname" . }}-test-connection" + labels: + {{- include "buildfarm.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: appropriate/curl:latest + command: ['curl'] + args: ['--output', '/dev/null', '{{ include "buildfarm.fullname" . }}-server:{{ .Values.server.service.port }}'] + restartPolicy: Never diff --git a/kubernetes/helm-charts/buildfarm/values.yaml b/kubernetes/helm-charts/buildfarm/values.yaml new file mode 100644 index 0000000000..3bb2994b7a --- /dev/null +++ b/kubernetes/helm-charts/buildfarm/values.yaml @@ -0,0 +1,206 @@ +# Default values for buildfarm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +nameOverride: "" +fullnameOverride: "" + +imagePullSecrets: [] + +config: + # see: https://github.com/bazelbuild/bazel-buildfarm/blob/main/examples/config.yml + digestFunction: SHA256 + defaultActionTimeout: 600 + maximumActionTimeout: 3600 + maxEntrySizeBytes: "2147483648" # 2 * 1024 * 1024 * 1024 + prometheusPort: 9090 + backplane: + queues: + - name: "cpu" + allowUnmatched: true + properties: + - name: "min-cores" + value: "*" + - name: "max-cores" + value: "*" + server: + name: "shard" + recordBesEvents: true + worker: + port: 8982 + publicName: "localhost:8982" + executeStageWidth: 80 + inputFetchStageWidth: 8 + realInputDirectories: + - "external" + root: "/tmp/worker" + storages: + - type: FILESYSTEM + path: "cache" + maxSizeBytes: 536870912000 # 500 * 1024 * 1024 * 1024 + +server: + image: + repository: bazelbuild/buildfarm-server + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + replicaCount: 1 + resources: { } + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + service: + type: ClusterIP + port: 8980 + + ingress: + enabled: false + className: "" + annotations: { } + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [ ] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + + nodeSelector: {} + tolerations: [] + affinity: {} + extraVolumes: [] + # - name: additionalSecret + # secret: + # secretName: my-secret + # defaultMode: 0600 + + extraVolumeMounts: [] + # - name: customConfig + # mountPath: /mnt/config + # readOnly: true + extraEnv: + - name: JAVABIN + value: "/usr/bin/java" + + serviceMonitor: + ## If true, a ServiceMonitor CRD is created for a prometheus operator + ## https://github.com/coreos/prometheus-operator + ## + enabled: false + path: /metrics + # namespace: monitoring (defaults to use the namespace this chart is deployed to) + labels: {} + interval: 1m + scheme: http + tlsConfig: {} + scrapeTimeout: 30s + relabelings: [] + targetLabels: [] + +shardWorker: + image: + repository: bazelbuild/buildfarm-worker + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + replicaCount: 2 + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + targetCPUUtilizationPercentage: 50 + + resources: { } + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + storage: + # the storage class for pv, leave empty will using default + class: "" + size: 50Gi + + service: + type: ClusterIP + port: 8982 + + nodeSelector: {} + tolerations: [] + affinity: {} + extraVolumes: [] + # - name: additionalSecret + # secret: + # secretName: my-secret + # defaultMode: 0600 + + extraVolumeMounts: [] + # - name: customConfig + # mountPath: /mnt/config + # readOnly: true + extraEnv: + - name: JAVABIN + value: "/usr/bin/java" + serviceMonitor: + ## If true, a ServiceMonitor CRD is created for a prometheus operator + ## https://github.com/coreos/prometheus-operator + ## + enabled: false + path: /metrics + # namespace: monitoring (defaults to use the namespace this chart is deployed to) + labels: {} + interval: 1m + scheme: http + tlsConfig: {} + scrapeTimeout: 30s + relabelings: [] + targetLabels: [] + +################################### +## DATABASE | Embedded Redis +################################### +redis: + ## - set to `false` if using `externalRedis.*` + ## + enabled: true + scheme: "redis" + ## See more redis configs: https://github.com/bitnami/charts/blob/main/bitnami/redis/README.md + usePassword: false + ## configs for redis cluster mode + ## + cluster: + ## if redis runs in cluster mode + ## + enabled: false + + ## the number of redis slaves + ## + slaveCount: 1 + +externalRedis: + uri: "redis://localhost:6379" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" From dfe9d3da2981624d94390d279ae4aa7c5d3bad4d Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 21 Sep 2023 10:29:22 -0400 Subject: [PATCH 048/214] Update quick_start.md Fixes #1447 --- _site/docs/quick_start.md | 44 ++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/_site/docs/quick_start.md b/_site/docs/quick_start.md index 5383c31199..79b7595bd0 100644 --- a/_site/docs/quick_start.md +++ b/_site/docs/quick_start.md @@ -10,7 +10,7 @@ Here we describe how to use bazel remote caching or remote execution with buildf ## Setup -You can run this quick start on a single computer running nearly any flavor of linux. This computer is the localhost for the rest of the description. +You can run this quick start on a single computer running any flavor of linux that bazel supports. A C++ compiler is used here to demonstrate action execution. This computer is the localhost for the rest of the description. ### Backplane @@ -44,7 +44,7 @@ cc_binary( And an empty WORKSPACE file. -As a test, verify that `bazel run :main` builds your main program and runs it, and prints `Hello, World!`. This will ensure that you have properly installed bazel and a C++ compiler, and have a working target before moving on to remote execution. +As a test, verify that `bazel run :main` builds your main program and runs it, and prints `Hello, World!`. This will ensure that you have properly installed `bazel` and a C++ compiler, and have a working target before moving on to remote caching or remote execution. Download and extract the buildfarm repository. Each command sequence below will have the intended working directory indicated, between the client (workspace running bazel), and buildfarm. @@ -52,25 +52,33 @@ This tutorial assumes that you have a bazel binary in your path and you are in t ## Remote Caching -A Buildfarm server with an instance can be used strictly as an ActionCache and ContentAddressableStorage to improve build performance. This is an example of running a bazel client that will retrieve results if available, and store them if the cache is missed and the execution needs to run locally. +A Buildfarm cluster can be used strictly as an ActionCache (AC) and ContentAddressableStorage (CAS) to improve build performance. This is an example of running a bazel client that will retrieve results if available, otherwise store them on a cache miss after executing locally. Download the buildfarm repository and change into its directory, then: -run `bazelisk run src/main/java/build/buildfarm:buildfarm-server $PWD/examples/config.minimal.yml` + * run `bazel run src/main/java/build/buildfarm:buildfarm-server $PWD/examples/config.minimal.yml` This will wait while the server runs, indicating that it is ready for requests. -From another prompt (i.e. a separate terminal) in your newly created workspace directory from above: +A server alone does not itself store the content of action results. It acts as an endpoint for any number of workers that present storage, so we must also start a single worker. -run `bazel clean` -run `bazel run --remote_cache=grpc://localhost:8980 :main` +From another prompt (i.e. a separate terminal) in the buildfarm repository directory: + + * run `bazel run src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.minimal.yml` + +This will also wait while the worker runs, indicating it will be available to store cache content. + +From another prompt in your newly created workspace directory from above: + + * run `bazel clean` + * run `bazel run --remote_cache=grpc://localhost:8980 :main` Why do we clean here? Since we're verifying re-execution and caching, this ensures that we will execute any actions in the `run` step and interact with the remote cache. We should be attempting to retrieve cached results, and then when we miss - since we just started this memory resident server - bazel will upload the results of the execution for later use. There will be no change in the output of this bazel run if everything worked, since bazel does not provide output each time it uploads results. To prove that we have placed something in the action cache, we need to do the following: -run `bazel clean` -run `bazel run --remote_cache=localhost:8980 :main` + * run `bazel clean` + * run `bazel run --remote_cache=localhost:8980 :main` This should now print statistics on the `processes` line that indicate that you've retrieved results from the cache for your actions: @@ -80,20 +88,22 @@ INFO: 2 processes: 2 remote cache hit. ## Remote Execution (and caching) -Now we will use buildfarm for remote execution with a minimal configuration - a single memory instance, with a worker on the localhost that can execute a single process at a time - via a bazel invocation on our workspace. +Now we will use buildfarm for remote execution with a minimal configuration with a worker on the localhost that can execute a single process at a time, via a bazel invocation on our workspace. -First, we should restart the buildfarm server to ensure that we get remote execution (this can also be forced from the client by using `--noremote_accept_cached`). From the buildfarm server prompt and directory: +First, we should restart the buildfarm server, and delete the worker's cas storage to ensure that we get remote execution (this can also be forced from the client by using `--noremote_accept_cached`). From the buildfarm server prompt and directory: -interrupt a running `buildfarm-server` -run `bazelisk run src/main/java/build/buildfarm:buildfarm-server $PWD/examples/config.minimal.yml` + * interrupt the running `buildfarm-server` (i.e. Ctrl-C) + * run `bazel run src/main/java/build/buildfarm:buildfarm-server $PWD/examples/config.minimal.yml` From another prompt in the buildfarm repository directory: -run `bazelisk run src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.minimal.yml` + * interrupt the running `buildfarm-shard-worker` (i.e. Ctrl-C) + * recursively remove the worker root directory: from the config.minimal.yml, this will be `rm -fr /tmp/worker` + * run `bazel run src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.minimal.yml` From another prompt, in your client workspace: -run `bazel run --remote_executor=grpc://localhost:8980 :main` + * run `bazel run --remote_executor=grpc://localhost:8980 :main` Your build should now print out the following on its `processes` summary line: @@ -117,6 +127,10 @@ To stop the containers, run: ./examples/bf-run stop ``` +## Next Steps + +We've started our worker on the same host as our server, and also the same host on which we built with bazel, but these services can be spread across many machines, per 'remote'. A large number of workers, with a relatively small number of servers (10:1 and 100:1 ratios have been used in practice), consolidating large disks and beefy multicore cpus/gpus on workers, with specialization of what work they perform for bazel builds (or other client work), and specializing servers to have hefty network connections to funnel content traffic. A buildfarm deployment can service hundreds or thousands of developers or CI processes, enabling them to benefit from each others' shared context in the AC/CAS, and the pooled execution of a fleet of worker hosts eager to consume operations and deliver results. + ## Buildfarm Manager You can now easily launch a new Buildfarm cluster locally or in AWS using an open sourced [Buildfarm Manager](https://github.com/80degreeswest/bfmgr). From ed157797fb41f5838d75b1f7e1d9de31cb791412 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 21 Sep 2023 12:07:55 -0400 Subject: [PATCH 049/214] Permit --prometheus_port to override config Specifying --prometheus_port for either server or worker will: Override the config value if delivered as int > 0, otherwise leave the config value alone. Since prometheusPort as configured <= 0 disables the server, this permits users to specify '0' to override the config with a disable switch. Updated quick_start docs to reflect this extra parameter. --- _site/docs/quick_start.md | 16 +++++----- .../common/config/BuildfarmConfigs.java | 6 ++++ .../common/config/BuildfarmOptions.java | 30 +++++++++++++++++++ .../common/config/ServerOptions.java | 6 +--- .../common/config/ShardWorkerOptions.java | 6 +--- 5 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 src/main/java/build/buildfarm/common/config/BuildfarmOptions.java diff --git a/_site/docs/quick_start.md b/_site/docs/quick_start.md index 79b7595bd0..7af957ee63 100644 --- a/_site/docs/quick_start.md +++ b/_site/docs/quick_start.md @@ -64,8 +64,10 @@ A server alone does not itself store the content of action results. It acts as a From another prompt (i.e. a separate terminal) in the buildfarm repository directory: - * run `bazel run src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.minimal.yml` + * run `bazel run src/main/java/build/buildfarm:buildfarm-shard-worker -- --prometheus_port=9091 $PWD/examples/config.minimal.yml` +The `--` option is bazel convention to treat all subsequent arguments as parameters to the running app, like our `--prometheus_port`, instead of interpreting them with `run` +The `--prometheus_port=9091` option allows this worker to run alongside our server, who will have started and logged that it has started a service on port `9090`. You can also turn this option off (with `--` separator), with `--prometheus_option=0` for either server or worker. This will also wait while the worker runs, indicating it will be available to store cache content. From another prompt in your newly created workspace directory from above: @@ -90,16 +92,16 @@ INFO: 2 processes: 2 remote cache hit. Now we will use buildfarm for remote execution with a minimal configuration with a worker on the localhost that can execute a single process at a time, via a bazel invocation on our workspace. -First, we should restart the buildfarm server, and delete the worker's cas storage to ensure that we get remote execution (this can also be forced from the client by using `--noremote_accept_cached`). From the buildfarm server prompt and directory: +First, to clean out the results from the previous cached actions, flush your local redis database: + + * run `redis-cli flushdb` + +Next, we should restart the buildfarm server, and delete the worker's cas storage to ensure that we get remote execution (this can also be forced from the client by using `--noremote_accept_cached`). From the buildfarm server prompt and directory: * interrupt the running `buildfarm-server` (i.e. Ctrl-C) * run `bazel run src/main/java/build/buildfarm:buildfarm-server $PWD/examples/config.minimal.yml` -From another prompt in the buildfarm repository directory: - - * interrupt the running `buildfarm-shard-worker` (i.e. Ctrl-C) - * recursively remove the worker root directory: from the config.minimal.yml, this will be `rm -fr /tmp/worker` - * run `bazel run src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.minimal.yml` +You can leave the worker running from the Remote Caching step, it will not require a restart From another prompt, in your client workspace: diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 432a11a90a..68106d56c7 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -78,6 +78,9 @@ public static BuildfarmConfigs loadServerConfigs(String[] args) throws Configura if (options.port > 0) { buildfarmConfigs.getServer().setPort(options.port); } + if (options.prometheusPort >= 0) { + buildfarmConfigs.setPrometheusPort(options.prometheusPort); + } adjustServerConfigs(buildfarmConfigs); return buildfarmConfigs; } @@ -94,6 +97,9 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura if (!Strings.isNullOrEmpty(options.publicName)) { buildfarmConfigs.getWorker().setPublicName(options.publicName); } + if (options.prometheusPort >= 0) { + buildfarmConfigs.setPrometheusPort(options.prometheusPort); + } adjustWorkerConfigs(buildfarmConfigs); return buildfarmConfigs; } diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java new file mode 100644 index 0000000000..defeebbf48 --- /dev/null +++ b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java @@ -0,0 +1,30 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.common.config; + +import com.google.devtools.common.options.Option; +import com.google.devtools.common.options.OptionsBase; + +/** Command-line options definition for Worker. */ +public class BuildfarmOptions extends OptionsBase { + @Option(name = "help", abbrev = 'h', help = "Prints usage info.", defaultValue = "true") + public boolean help; + + @Option( + name = "prometheus_port", + help = "Port for the prometheus service. '0' will disable prometheus hosting", + defaultValue = "-1") + public int prometheusPort; +} diff --git a/src/main/java/build/buildfarm/common/config/ServerOptions.java b/src/main/java/build/buildfarm/common/config/ServerOptions.java index 5c1e00a0d5..35f47d6d13 100644 --- a/src/main/java/build/buildfarm/common/config/ServerOptions.java +++ b/src/main/java/build/buildfarm/common/config/ServerOptions.java @@ -15,13 +15,9 @@ package build.buildfarm.common.config; import com.google.devtools.common.options.Option; -import com.google.devtools.common.options.OptionsBase; /** Command-line options definition for example server. */ -public class ServerOptions extends OptionsBase { - @Option(name = "help", abbrev = 'h', help = "Prints usage info.", defaultValue = "true") - public boolean help; - +public class ServerOptions extends BuildfarmOptions { @Option(name = "port", abbrev = 'p', help = "Port to use.", defaultValue = "-1") public int port; diff --git a/src/main/java/build/buildfarm/common/config/ShardWorkerOptions.java b/src/main/java/build/buildfarm/common/config/ShardWorkerOptions.java index 7671ae0a4f..c116d31673 100644 --- a/src/main/java/build/buildfarm/common/config/ShardWorkerOptions.java +++ b/src/main/java/build/buildfarm/common/config/ShardWorkerOptions.java @@ -15,13 +15,9 @@ package build.buildfarm.common.config; import com.google.devtools.common.options.Option; -import com.google.devtools.common.options.OptionsBase; /** Command-line options definition for Worker. */ -public class ShardWorkerOptions extends OptionsBase { - @Option(name = "help", abbrev = 'h', help = "Prints usage info.", defaultValue = "true") - public boolean help; - +public class ShardWorkerOptions extends BuildfarmOptions { @Option( name = "root", help = "Root base directory for all work being performed.", From fb7cbd8cce4679c2a48424be92c3c5c51affec8d Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Fri, 22 Sep 2023 08:41:32 -0400 Subject: [PATCH 050/214] [metrics] Emit operation_exit_code metric to track execution exit codes (#1444) Co-authored-by: Trevor Hickey --- _site/docs/metrics/metrics.md | 4 ++++ .../buildfarm/metrics/AbstractMetricsPublisher.java | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/_site/docs/metrics/metrics.md b/_site/docs/metrics/metrics.md index 5aa96fe56f..6079b7e9b7 100644 --- a/_site/docs/metrics/metrics.md +++ b/_site/docs/metrics/metrics.md @@ -124,6 +124,10 @@ Gauge for the number of operations in each stage (using a stage_name for each in Gauge for the completed operations status (using a status_code label for each individual GRPC code) +**operation_exit_code** + +Gauge for the completed operations exit code (using a exit_code label for each individual execution exit code) + **operation_worker** Gauge for the number of operations executed on each worker (using a worker_name label for each individual worker) diff --git a/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java b/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java index 925f4d95bf..7dd09b6d0f 100644 --- a/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java +++ b/src/main/java/build/buildfarm/metrics/AbstractMetricsPublisher.java @@ -51,6 +51,13 @@ public abstract class AbstractMetricsPublisher implements MetricsPublisher { .labelNames("worker_name") .help("Operations per worker.") .register(); + + private static final Gauge operationExitCode = + Gauge.build() + .name("operation_exit_code") + .labelNames("exit_code") + .help("Operation execution exit code.") + .register(); private static final Histogram queuedTime = Histogram.build().name("queued_time_ms").help("Queued time in ms.").register(); private static final Histogram outputUploadTime = @@ -97,6 +104,11 @@ protected OperationRequestMetadata populateRequestMetadata( Integer.toString( operationRequestMetadata.getExecuteResponse().getStatus().getCode())) .inc(); + operationExitCode + .labels( + Integer.toString( + operationRequestMetadata.getExecuteResponse().getResult().getExitCode())) + .inc(); if (operationRequestMetadata.getExecuteResponse().hasResult() && operationRequestMetadata.getExecuteResponse().getResult().hasExecutionMetadata()) { operationsPerWorker From a6fe20747ca6f217df84f7cd0432bae0a0dc7fe8 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 7 Sep 2023 10:48:49 -0700 Subject: [PATCH 051/214] feat(redis): support rediss:// URIs for Redis-SSL Support "rediss://" (extra 's', like https) to indicate Redis-SSL connections. For Redis client identifier, we use the `identifier` passed to RedisShardBackplane. --- .../instance/shard/JedisClusterFactory.java | 27 ++++++++++++++----- .../instance/shard/RedisShardBackplane.java | 2 +- .../build/buildfarm/tools/WorkerProfile.java | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java index 922558b50b..e3172b01f2 100644 --- a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java +++ b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java @@ -30,6 +30,7 @@ import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.ScanParams; import redis.clients.jedis.ScanResult; +import redis.clients.jedis.util.JedisURIHelper; /** * @class JedisClusterFactory @@ -43,15 +44,17 @@ public class JedisClusterFactory { * @brief Create a jedis cluster instance. * @details Use proto configuration to connect to a redis cluster server and provide a jedis * client. - * @param config Configuration for connecting to a redis cluster server. + * @param identifier Redis Client name. * @return An established jedis client used to operate on the redis cluster. * @note Suggested return identifier: jedis. + * @link Redis Client name */ - public static Supplier create() throws ConfigurationException { + public static Supplier create(String identifier) throws ConfigurationException { // null password is required to elicit no auth in jedis String[] redisNodes = configs.getBackplane().getRedisNodes(); if (redisNodes != null && redisNodes.length > 0) { return createJedisClusterFactory( + identifier, list2Set(redisNodes), configs.getBackplane().getTimeout(), configs.getBackplane().getMaxAttempts(), @@ -63,6 +66,7 @@ public static Supplier create() throws ConfigurationException { // support "" as redis password. return createJedisClusterFactory( + identifier, parseUri(configs.getBackplane().getRedisUri()), configs.getBackplane().getTimeout(), configs.getBackplane().getMaxAttempts(), @@ -80,7 +84,7 @@ public static Supplier create() throws ConfigurationException { * @note Suggested return identifier: jedis. */ public static JedisCluster createTest() throws Exception { - JedisCluster redis = JedisClusterFactory.create().get(); + JedisCluster redis = JedisClusterFactory.create("test").get(); // use the client to create an empty redis cluster // this will prevent any persistent data across test runs @@ -151,7 +155,12 @@ private static void deleteExistingKeys(Jedis node) { * @note Suggested return identifier: jedis. */ private static Supplier createJedisClusterFactory( - URI redisUri, int timeout, int maxAttempts, String password, JedisPoolConfig poolConfig) { + String identifier, + URI redisUri, + int timeout, + int maxAttempts, + String password, + JedisPoolConfig poolConfig) { return () -> new JedisCluster( new HostAndPort(redisUri.getHost(), redisUri.getPort()), @@ -159,7 +168,9 @@ private static Supplier createJedisClusterFactory( /* soTimeout=*/ Integer.max(2000, timeout), Integer.max(5, maxAttempts), password, - poolConfig); + identifier, + poolConfig, + JedisURIHelper.isRedisSSLScheme(redisUri)); } /** @@ -174,6 +185,7 @@ private static Supplier createJedisClusterFactory( * @note Suggested return identifier: jedis. */ private static Supplier createJedisClusterFactory( + String identifier, Set redisUrisNodes, int timeout, int maxAttempts, @@ -186,12 +198,13 @@ private static Supplier createJedisClusterFactory( /* soTimeout=*/ Integer.max(2000, timeout), Integer.max(5, maxAttempts), password, - poolConfig); + identifier, + poolConfig, + false); } /** * @brief Create a jedis pool config. * @details Use configuration to build the appropriate jedis pool configuration. - * @param config Configuration for connecting to a redis cluster server. * @return A created jedis pool config. * @note Suggested return identifier: poolConfig. */ diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index f0a5ff222e..200929ecbb 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -152,7 +152,7 @@ public RedisShardBackplane( Function onPublish, Function onComplete) throws ConfigurationException { - this(source, onPublish, onComplete, JedisClusterFactory.create()); + this(source, onPublish, onComplete, JedisClusterFactory.create(source)); } public RedisShardBackplane( diff --git a/src/main/java/build/buildfarm/tools/WorkerProfile.java b/src/main/java/build/buildfarm/tools/WorkerProfile.java index ee36bf035a..69dbb8cdee 100644 --- a/src/main/java/build/buildfarm/tools/WorkerProfile.java +++ b/src/main/java/build/buildfarm/tools/WorkerProfile.java @@ -109,7 +109,7 @@ private static Set getWorkers(String[] args) throws ConfigurationExcepti } catch (IOException e) { System.out.println("Could not parse yml configuration file." + e); } - RedisClient client = new RedisClient(JedisClusterFactory.create().get()); + RedisClient client = new RedisClient(JedisClusterFactory.create("worker-profile").get()); return client.call(jedis -> fetchWorkers(jedis, System.currentTimeMillis())); } From 79eee498c54fc8b67f9368c1f0d54229fdc44e05 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Wed, 20 Sep 2023 12:04:52 -0700 Subject: [PATCH 052/214] chore: make code more readable --- .../build/buildfarm/instance/shard/JedisClusterFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java index e3172b01f2..5f85da29f6 100644 --- a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java +++ b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java @@ -170,7 +170,7 @@ private static Supplier createJedisClusterFactory( password, identifier, poolConfig, - JedisURIHelper.isRedisSSLScheme(redisUri)); + /* ssl=*/ JedisURIHelper.isRedisSSLScheme(redisUri)); } /** @@ -200,7 +200,7 @@ private static Supplier createJedisClusterFactory( password, identifier, poolConfig, - false); + /* ssl=*/ false); } /** * @brief Create a jedis pool config. From 330566948e437d2c9cf624930a83e24bd54c4992 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 23 Sep 2023 09:44:48 -0400 Subject: [PATCH 053/214] Update rules_docker dependencies via injection Specify and patch more recent rules_go and bazel_gazelle per upstream patch. Docker images work with recent HEAD releases of bazel as a result. Depends on #1453 resolution to actually build //... Fixes #1440 --- deps.bzl | 19 +++++++++++++++++++ third_party/docker_go_toolchain.patch | 11 +++++++++++ 2 files changed, 30 insertions(+) create mode 100644 third_party/docker_go_toolchain.patch diff --git a/deps.bzl b/deps.bzl index cb22b1641f..c31cf04edd 100644 --- a/deps.bzl +++ b/deps.bzl @@ -106,10 +106,29 @@ def archive_dependencies(third_party): "patch_args": ["-p1"], "patches": ["%s:clang_toolchain.patch" % third_party], }, + + # Used to build release container images { "name": "io_bazel_rules_docker", "sha256": "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf", "urls": ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"], + "patch_args": ["-p0"], + "patches": ["%s:docker_go_toolchain.patch" % third_party], + }, + + # Updated versions of io_bazel_rules_docker dependencies for bazel compatibility + { + "name": "io_bazel_rules_go", + "sha256": "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3", + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", + ], + }, + { + "name": "bazel_gazelle", + "sha256": "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", + "urls": ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz"], }, # Bazel is referenced as a dependency so that buildfarm can access the linux-sandbox as a potential execution wrapper. diff --git a/third_party/docker_go_toolchain.patch b/third_party/docker_go_toolchain.patch new file mode 100644 index 0000000000..3b00ff333c --- /dev/null +++ b/third_party/docker_go_toolchain.patch @@ -0,0 +1,11 @@ +--- repositories/go_repositories.bzl.orig 2023-09-23 08:36:00.148468653 -0400 ++++ repositories/go_repositories.bzl 2023-09-23 08:33:22.502127476 -0400 +@@ -37,7 +37,7 @@ + go_repository_default_config (str, optional): A file used to determine the root of the workspace. + """ + go_rules_dependencies() +- go_register_toolchains() ++ go_register_toolchains("1.21.0") + gazelle_dependencies(go_repository_default_config = go_repository_default_config) + excludes = native.existing_rules().keys() + if "com_github_google_go_containerregistry" not in excludes: From 7f86c47922c995de798946a94cc0eb25c141fdb3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 18 Jul 2023 13:58:57 -0400 Subject: [PATCH 054/214] Treat '.' working_directory segment as current Any '.' appearance as a segment should be considered to be the current directory in the search sequence of a working_directory path. --- .../buildfarm/instance/server/AbstractServerInstance.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java index 57d827ffa8..d828b7bd89 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java @@ -1168,6 +1168,9 @@ void validateCommand( } else { Directory directory = directoriesIndex.get(inputRootDigest); for (String segment : workingDirectory.split("/")) { + if (segment.equals(".")) { + continue; + } Directory nextDirectory = directory; // linear for now for (DirectoryNode dirNode : directory.getDirectoriesList()) { From 90439ca36863b9f4971a142733fa9dae895e1500 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 25 Sep 2023 09:51:24 -0400 Subject: [PATCH 055/214] Remove unused setExecuteResponseBuilder Method setExecuteResponseBuilder is not called in OperationContext --- src/main/java/build/buildfarm/worker/OperationContext.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/OperationContext.java b/src/main/java/build/buildfarm/worker/OperationContext.java index e07649d03a..71b1975783 100644 --- a/src/main/java/build/buildfarm/worker/OperationContext.java +++ b/src/main/java/build/buildfarm/worker/OperationContext.java @@ -74,11 +74,6 @@ private Builder( this.queueEntry = queueEntry; } - public Builder setExecuteResponseBuilder(ExecuteResponse.Builder executeResponse) { - this.executeResponse = executeResponse; - return this; - } - public Builder setOperation(Operation operation) { this.operation = operation; return this; From 8cc247f3ccc4b98370eeb0254316090f7bf9b49c Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 17 Jul 2023 15:21:59 -0400 Subject: [PATCH 056/214] Log on write errors --- .../buildfarm/common/services/WriteStreamObserver.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index 483f266e03..36cc0595a6 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -291,6 +291,13 @@ private boolean errorResponse(Throwable t) { requestMetadata.getToolInvocationId(), requestMetadata.getActionId(), name)); + } else { + log.log( + Level.WARNING, + format( + "error %s after %d requests and %d bytes at offset %d", + name, requestCount, requestBytes, earliestOffset), + t); } return true; } From f651cdbf7b2203e8cdb5645a1f869589e42f28c3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 24 Jul 2023 10:23:54 -0400 Subject: [PATCH 057/214] Use integer ids for Sqlite bidirectional index The cost in size for a single table bidirectional index is vast compared to the use of 3nf integer keys. Experimental estimates offer a decrease in file size of 90%. --- .../cas/cfc/SqliteFileDirectoriesIndex.java | 64 +++++++++++++++---- .../cas/cfc/DirectoriesIndexTest.java | 1 + 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java index 030c749037..b18b5bd22c 100644 --- a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java +++ b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java @@ -57,13 +57,19 @@ private void open() { throw new RuntimeException(e); } + String createDirectoriesSql = + "CREATE TABLE directories (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; + String createFilesSql = "CREATE TABLE files (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; String createEntriesSql = "CREATE TABLE entries (\n" - + " path TEXT NOT NULL,\n" - + " directory TEXT NOT NULL\n" + + " file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,\n" + + " directory_id INTEGER NOT NULL REFERENCES directories(id) ON DELETE CASCADE,\n" + + " PRIMARY KEY (file_id, directory_id)\n" + ")"; try (Statement stmt = conn.createStatement()) { + stmt.execute(createDirectoriesSql); + stmt.execute(createFilesSql); stmt.execute(createEntriesSql); } catch (SQLException e) { throw new RuntimeException(e); @@ -77,11 +83,13 @@ private void open() { public synchronized void start() { open(); - String createPathIndexSql = "CREATE INDEX path_idx ON entries (path)"; - String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory)"; + String createPathIndexSql = "CREATE INDEX files_name_idx ON entries (file_id)"; + String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory_id)"; + String enforceForeignKeys = "PRAGMA foreign_keys=ON"; try (Statement stmt = conn.createStatement()) { stmt.execute(createPathIndexSql); stmt.execute(createDirectoryIndexSql); + stmt.execute(enforceForeignKeys); } catch (SQLException e) { throw new RuntimeException(e); } @@ -101,7 +109,8 @@ public void close() { private Set removeEntryDirectories(String entry) { open(); - String selectSql = "SELECT directory FROM entries WHERE path = ?"; + String selectSql = + "SELECT d.name as directory FROM files f INNER JOIN entries e ON f.id = e.file_id INNER JOIN directories d ON d.id = e.directory_id WHERE f.name = ?"; ImmutableSet.Builder directoriesBuilder = ImmutableSet.builder(); try (PreparedStatement selectStatement = conn.prepareStatement(selectSql)) { @@ -116,7 +125,7 @@ private Set removeEntryDirectories(String entry) { } // all directories featuring this entry are now invalid ImmutableSet directories = directoriesBuilder.build(); - String deleteSql = "DELETE FROM entries where directory = ?"; + String deleteSql = "DELETE FROM directories where name = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { conn.setAutoCommit(false); for (Digest directory : directories) { @@ -128,6 +137,14 @@ private Set removeEntryDirectories(String entry) { } catch (SQLException e) { throw new RuntimeException(e); } + // clear out orphaned files + try (Statement orphanStatement = conn.createStatement()) { + String deleteOrphanSql = + "DELETE FROM files WHERE id in (SELECT id FROM files f LEFT JOIN entries e ON f.id = e.file_id WHERE e.file_id IS NULL)"; + orphanStatement.execute(deleteOrphanSql); + } catch (SQLException e) { + throw new RuntimeException(e); + } return directories; } @@ -141,13 +158,37 @@ public synchronized Set removeEntry(String entry) throws IOException { private synchronized void addEntriesDirectory(Set entries, Digest directory) { open(); - String digest = DigestUtil.toString(directory); - String insertSql = "INSERT INTO entries (path, directory) VALUES (?,?)"; - try (PreparedStatement insertStatement = conn.prepareStatement(insertSql)) { + String directoryName = DigestUtil.toString(directory); + String filesInsertSql = "INSERT OR IGNORE INTO files (name) VALUES (?)"; + try (PreparedStatement filesInsertStatement = conn.prepareStatement(filesInsertSql)) { + conn.setAutoCommit(false); + for (String entry : entries) { + filesInsertStatement.setString(1, entry); + filesInsertStatement.addBatch(); + } + filesInsertStatement.executeBatch(); + conn.commit(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + // should be novel directory + String directoriesInsertSql = "INSERT INTO directories (name) VALUES (?)"; + try (PreparedStatement directoriesInsertStatement = + conn.prepareStatement(directoriesInsertSql)) { + conn.setAutoCommit(false); + directoriesInsertStatement.setString(1, directoryName); + directoriesInsertStatement.executeUpdate(); + conn.commit(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + String entriesInsertSql = + "INSERT INTO entries (file_id, directory_id) SELECT f.id, d.id FROM files f, directories d WHERE f.name = ? AND d.name = ?"; + try (PreparedStatement insertStatement = conn.prepareStatement(entriesInsertSql)) { conn.setAutoCommit(false); - insertStatement.setString(2, digest); for (String entry : entries) { insertStatement.setString(1, entry); + insertStatement.setString(2, directoryName); insertStatement.addBatch(); } insertStatement.executeBatch(); @@ -168,8 +209,9 @@ private void removeEntriesDirectory(Digest directory) { open(); String digest = DigestUtil.toString(directory); - String deleteSql = "DELETE FROM entries WHERE directory = ?"; + String deleteSql = "DELETE FROM directories WHERE name = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { + conn.setAutoCommit(true); deleteStatement.setString(1, digest); deleteStatement.executeUpdate(); } catch (SQLException e) { diff --git a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java index 3eec66def7..b4effa2bc8 100644 --- a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java @@ -51,6 +51,7 @@ protected DirectoriesIndexTest(Path root, DirectoriesIndexType type) { } else { throw new IllegalArgumentException("DirectoriesIndex type is not supported."); } + directoriesIndex.start(); } @Before From 9f93972508b907f45c3b06bdbb23186f8b7d5c8f Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Fri, 29 Sep 2023 13:47:57 -0400 Subject: [PATCH 058/214] Update graceful shutdown functionality to better handle worker terminations (#1462) --- _site/docs/configuration/configuration.md | 41 +++++----- examples/config.yml | 2 +- .../build/buildfarm/common/config/Admin.java | 2 + .../build/buildfarm/common/config/Worker.java | 1 + .../shard/ShutDownWorkerGracefully.java | 31 ------- .../build/buildfarm/worker/shard/Worker.java | 80 +++++++++---------- 6 files changed, 64 insertions(+), 93 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 8ee8d5d55b..cbd286587f 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -238,26 +238,27 @@ backplane: ### Worker -| Configuration | Accepted and _Default_ Values | Environment Var | Description | -|----------------------------------|-------------------------------|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| port | Integer, _8981_ | | Listening port of the worker | -| publicName | String, _DERIVED:port_ | INSTANCE_NAME | Host:port of the GRPC server, required to be accessible by all servers | -| root | String, _/tmp/worker_ | | Path for all operation content storage | -| inlineContentLimit | Integer, _1048567_ | | Total size in bytes of inline content for action results, output files, stdout, stderr content | -| operationPollPeriod | Integer, _1_ | | Period between poll operations at any stage | -| executeStageWidth | Integer, _0_ | EXECUTION_STAGE_WIDTH | Number of CPU cores available for execution (0 = system available cores) | -| executeStageWidthOffset | Integer, _0_ | | Offset number of CPU cores available for execution (to allow for use by other processes) | -| inputFetchStageWidth | Integer, _0_ | | Number of concurrently available slots to fetch inputs (0 = system calculated based on CPU cores) | -| inputFetchDeadline | Integer, _60_ | | Limit on time (seconds) for input fetch stage to fetch inputs | -| linkInputDirectories | boolean, _true_ | | Use an input directory creation strategy which creates a single directory tree at the highest level containing no output paths of any kind, and symlinks that directory into an action's execroot, saving large amounts of time spent manufacturing the same read-only input hierirchy over multiple actions' executions | -| execOwner | String, _null_ | | Create exec trees containing directories that are owned by this user | -| hexBucketLevels | Integer, _0_ | | Number of levels to create for directory storage by leading byte of the hash (problematic, not recommended) | -| defaultMaxCores | Integer, _0_ | | Constrain all executions to this logical core count unless otherwise specified via min/max-cores (0 = no limit) | -| limitGlobalExecution | boolean, _false_ | | Constrain all executions to a pool of logical cores specified in executeStageWidth | -| onlyMulticoreTests | boolean, _false_ | | Only permit tests to exceed the default coresvalue for their min/max-cores range specification (only works with non-zero defaultMaxCores) | -| allowBringYourOwnContainer | boolean, _false_ | | Enable execution in a custom Docker container | -| errorOperationRemainingResources | boolean, _false_ | | | -| realInputDirectories | List of Strings, _external_ | | A list of paths that will not be subject to the effects of linkInputDirectories setting, may also be used to provide writable directories as input roots for actions which expect to be able to write to an input location and will fail if they cannot | +| Configuration | Accepted and _Default_ Values | Environment Var | Description | +|----------------------------------|-------------------------------|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| port | Integer, _8981_ | | Listening port of the worker | +| publicName | String, _DERIVED:port_ | INSTANCE_NAME | Host:port of the GRPC server, required to be accessible by all servers | +| root | String, _/tmp/worker_ | | Path for all operation content storage | +| inlineContentLimit | Integer, _1048567_ | | Total size in bytes of inline content for action results, output files, stdout, stderr content | +| operationPollPeriod | Integer, _1_ | | Period between poll operations at any stage | +| executeStageWidth | Integer, _0_ | EXECUTION_STAGE_WIDTH | Number of CPU cores available for execution (0 = system available cores) | +| executeStageWidthOffset | Integer, _0_ | | Offset number of CPU cores available for execution (to allow for use by other processes) | +| inputFetchStageWidth | Integer, _0_ | | Number of concurrently available slots to fetch inputs (0 = system calculated based on CPU cores) | +| inputFetchDeadline | Integer, _60_ | | Limit on time (seconds) for input fetch stage to fetch inputs | +| linkInputDirectories | boolean, _true_ | | Use an input directory creation strategy which creates a single directory tree at the highest level containing no output paths of any kind, and symlinks that directory into an action's execroot, saving large amounts of time spent manufacturing the same read-only input hierirchy over multiple actions' executions | +| execOwner | String, _null_ | | Create exec trees containing directories that are owned by this user | +| hexBucketLevels | Integer, _0_ | | Number of levels to create for directory storage by leading byte of the hash (problematic, not recommended) | +| defaultMaxCores | Integer, _0_ | | Constrain all executions to this logical core count unless otherwise specified via min/max-cores (0 = no limit) | +| limitGlobalExecution | boolean, _false_ | | Constrain all executions to a pool of logical cores specified in executeStageWidth | +| onlyMulticoreTests | boolean, _false_ | | Only permit tests to exceed the default coresvalue for their min/max-cores range specification (only works with non-zero defaultMaxCores) | +| allowBringYourOwnContainer | boolean, _false_ | | Enable execution in a custom Docker container | +| errorOperationRemainingResources | boolean, _false_ | | | +| realInputDirectories | List of Strings, _external_ | | A list of paths that will not be subject to the effects of linkInputDirectories setting, may also be used to provide writable directories as input roots for actions which expect to be able to write to an input location and will fail if they cannot | +| gracefulShutdownSeconds | Integer, 0 | | Time in seconds to allow for operations in flight to finish when shutdown signal is received | ``` worker: diff --git a/examples/config.yml b/examples/config.yml index 3c435fccc7..dd165a4d46 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -38,7 +38,6 @@ server: admin: deploymentEnvironment: AWS clusterEndpoint: "grpc://localhost" - enableGracefulShutdown: false metrics: publisher: LOG logLevel: FINEST @@ -126,6 +125,7 @@ worker: onlyMulticoreTests: false allowBringYourOwnContainer: false errorOperationRemainingResources: false + gracefulShutdownSeconds: 0 sandboxSettings: alwaysUse: false selectForBlockNetwork: false diff --git a/src/main/java/build/buildfarm/common/config/Admin.java b/src/main/java/build/buildfarm/common/config/Admin.java index 07deb4ce70..f4f8168225 100644 --- a/src/main/java/build/buildfarm/common/config/Admin.java +++ b/src/main/java/build/buildfarm/common/config/Admin.java @@ -11,5 +11,7 @@ public enum DEPLOYMENT_ENVIRONMENT { private DEPLOYMENT_ENVIRONMENT deploymentEnvironment; private String clusterEndpoint; + // This configuration is deprecated but is left here for backwards compatibility. Use + // worker:gracefulShutdownSeconds instead. private boolean enableGracefulShutdown; } diff --git a/src/main/java/build/buildfarm/common/config/Worker.java b/src/main/java/build/buildfarm/common/config/Worker.java index 294b70dc2f..4caaff2b02 100644 --- a/src/main/java/build/buildfarm/common/config/Worker.java +++ b/src/main/java/build/buildfarm/common/config/Worker.java @@ -35,6 +35,7 @@ public class Worker { private boolean onlyMulticoreTests = false; private boolean allowBringYourOwnContainer = false; private boolean errorOperationRemainingResources = false; + private int gracefulShutdownSeconds = 0; private ExecutionPolicy[] executionPolicies = {}; private SandboxSettings sandboxSettings = new SandboxSettings(); diff --git a/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java b/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java index 63b1b205cb..711c3cf0d3 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java +++ b/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java @@ -14,9 +14,6 @@ package build.buildfarm.worker.shard; -import static java.util.logging.Level.WARNING; - -import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.v1test.PrepareWorkerForGracefulShutDownRequest; import build.buildfarm.v1test.PrepareWorkerForGracefulShutDownRequestResults; import build.buildfarm.v1test.ShutDownWorkerGrpc; @@ -26,7 +23,6 @@ @Log public class ShutDownWorkerGracefully extends ShutDownWorkerGrpc.ShutDownWorkerImplBase { - private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); private final Worker worker; public ShutDownWorkerGracefully(Worker worker) { @@ -44,33 +40,6 @@ public ShutDownWorkerGracefully(Worker worker) { public void prepareWorkerForGracefulShutdown( PrepareWorkerForGracefulShutDownRequest request, StreamObserver responseObserver) { - String clusterId = configs.getServer().getClusterId(); - String clusterEndpoint = configs.getServer().getAdmin().getClusterEndpoint(); - if (clusterId == null - || clusterId.equals("") - || clusterEndpoint == null - || clusterEndpoint.equals("")) { - String errorMessage = - String.format( - "Current AdminConfig doesn't have cluster_id or cluster_endpoint set, " - + "the worker %s won't be shut down.", - configs.getWorker().getPublicName()); - log.log(WARNING, errorMessage); - responseObserver.onError(new RuntimeException(errorMessage)); - return; - } - - if (!configs.getServer().getAdmin().isEnableGracefulShutdown()) { - String errorMessage = - String.format( - "Current AdminConfig doesn't support shut down worker gracefully, " - + "the worker %s won't be shut down.", - configs.getWorker().getPublicName()); - log.log(WARNING, errorMessage); - responseObserver.onError(new RuntimeException(errorMessage)); - return; - } - try { CompletableFuture.runAsync(worker::prepareWorkerForGracefulShutdown); responseObserver.onNext(PrepareWorkerForGracefulShutDownRequestResults.newBuilder().build()); diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index e1b7acf94c..a33dbaad60 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -27,7 +27,6 @@ import build.bazel.remote.execution.v2.Compressor; import build.bazel.remote.execution.v2.Digest; -import build.buildfarm.admin.aws.AwsAdmin; import build.buildfarm.backplane.Backplane; import build.buildfarm.cas.ContentAddressableStorage; import build.buildfarm.cas.ContentAddressableStorage.Blob; @@ -91,7 +90,6 @@ import javax.annotation.PreDestroy; import javax.naming.ConfigurationException; import lombok.extern.java.Log; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @@ -140,52 +138,51 @@ public class Worker { private Pipeline pipeline; private Backplane backplane; private LoadingCache workerStubs; - @Autowired private AwsAdmin awsAdmin; /** - * The method will prepare the worker for graceful shutdown and send out grpc request to disable - * scale in protection when the worker is ready. If unexpected errors happened, it will cancel the - * graceful shutdown progress make the worker available again. + * The method will prepare the worker for graceful shutdown when the worker is ready. Note on + * using stderr here instead of log. By the time this is called in PreDestroy, the log is no + * longer available and is not logging messages. */ public void prepareWorkerForGracefulShutdown() { - inGracefulShutdown = true; - log.log( - Level.INFO, - "The current worker will not be registered again and should be shutdown gracefully!"); - pipeline.stopMatchingOperations(); - int scanRate = 30; // check every 30 seconds - int timeWaited = 0; - int timeOut = 60 * 15; // 15 minutes - - try { - while (!pipeline.isEmpty() && timeWaited < timeOut) { - SECONDS.sleep(scanRate); - timeWaited += scanRate; - log.log(INFO, String.format("Pipeline is still not empty after %d seconds.", timeWaited)); - } - } catch (InterruptedException e) { - log.log(Level.SEVERE, "The worker gracefully shutdown is interrupted: " + e.getMessage()); - } finally { - // make a grpc call to disable scale protection - String clusterEndpoint = configs.getServer().getAdmin().getClusterEndpoint(); - log.log( - INFO, + if (configs.getWorker().getGracefulShutdownSeconds() == 0) { + System.err.println( String.format( - "It took the worker %d seconds to %s", - timeWaited, - pipeline.isEmpty() ? "finish all actions" : "but still cannot finish all actions")); + "Graceful Shutdown is not enabled. Worker is shutting down without finishing executions in progress.")); + } else { + inGracefulShutdown = true; + System.err.println( + "Graceful Shutdown - The current worker will not be registered again and should be shutdown gracefully!"); + pipeline.stopMatchingOperations(); + int scanRate = 30; // check every 30 seconds + int timeWaited = 0; + int timeOut = configs.getWorker().getGracefulShutdownSeconds(); + try { - awsAdmin.disableHostScaleInProtection(clusterEndpoint, configs.getWorker().getPublicName()); - } catch (Exception e) { - log.log( - SEVERE, + if (pipeline.isEmpty()) { + System.err.println("Graceful Shutdown - no work in the pipeline."); + } else { + System.err.println( + String.format("Graceful Shutdown - waiting for executions to finish.")); + } + while (!pipeline.isEmpty() && timeWaited < timeOut) { + SECONDS.sleep(scanRate); + timeWaited += scanRate; + System.err.println( + String.format( + "Graceful Shutdown - Pipeline is still not empty after %d seconds.", timeWaited)); + } + } catch (InterruptedException e) { + System.err.println( + "Graceful Shutdown - The worker gracefully shutdown is interrupted: " + e.getMessage()); + } finally { + System.err.println( String.format( - "gRPC call to AdminService to disable scale in protection failed with exception: %s and stacktrace %s", - e.getMessage(), Arrays.toString(e.getStackTrace()))); - // Gracefully shutdown cannot be performed successfully because of error in - // AdminService side. Under this scenario, the worker has to be added back to the worker - // pool. - inGracefulShutdown = false; + "Graceful Shutdown - It took the worker %d seconds to %s", + timeWaited, + pipeline.isEmpty() + ? "finish all actions" + : "gracefully shutdown but still cannot finish all actions")); } } } @@ -637,6 +634,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep @PreDestroy public void stop() throws InterruptedException { System.err.println("*** shutting down gRPC server since JVM is shutting down"); + prepareWorkerForGracefulShutdown(); PrometheusPublisher.stopHttpServer(); boolean interrupted = Thread.interrupted(); if (pipeline != null) { From ec4b82cd488e6a01c3b235210a2fd4090d701105 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 26 Sep 2023 13:21:25 -0400 Subject: [PATCH 059/214] Manipulate worker set directly in RSB Avoid dependency on subscriber to update state changes when removing workers. This prevents an NPE which will occur invariably when workers are allowably configured with subscribeToBackplane: false. --- .../build/buildfarm/instance/shard/RedisShardBackplane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 200929ecbb..6676accdf3 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -634,7 +634,7 @@ public boolean removeWorker(String name, String reason) throws IOException { .setRemove(WorkerChange.Remove.newBuilder().setSource(source).setReason(reason).build()) .build(); String workerChangeJson = JsonFormat.printer().print(workerChange); - return subscriber.removeWorker(name) + return storageWorkerSet.remove(name) && client.call( jedis -> removeWorkerAndPublish(jedis, name, workerChangeJson, /* storage=*/ true)); } From c48d600e5a2b69dc42b732bd16f556c9e6b4b49a Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 26 Sep 2023 13:24:53 -0400 Subject: [PATCH 060/214] Remove publishTtlMetric option The individual metric controls for ttl are not necessary either for performance or feature support. Use Files' attributes acquisition mechanism for modified time. --- examples/config.yml | 1 - .../build/buildfarm/cas/cfc/CASFileCache.java | 54 +++++++------------ .../build/buildfarm/common/config/Cas.java | 3 -- .../worker/shard/ShardCASFileCache.java | 2 - .../build/buildfarm/worker/shard/Worker.java | 1 - .../buildfarm/cas/cfc/CASFileCacheTest.java | 3 -- 6 files changed, 20 insertions(+), 44 deletions(-) diff --git a/examples/config.yml b/examples/config.yml index dd165a4d46..6ea0ee1132 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -112,7 +112,6 @@ worker: hexBucketLevels: 0 execRootCopyFallback: false target: - publishTtlMetric: false executeStageWidth: 1 inputFetchStageWidth: 1 inputFetchDeadline: 60 diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 3897c7268f..6b6e63b4ad 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -145,7 +145,19 @@ public abstract class CASFileCache implements ContentAddressableStorage { Gauge.build().name("cas_size").help("CAS size.").register(); private static final Gauge casEntryCountMetric = Gauge.build().name("cas_entry_count").help("Number of entries in the CAS.").register(); - private static Histogram casTtl; + private static Histogram casTtl = + Histogram.build() + .name("cas_ttl_s") + .buckets( + 3600, // 1 hour + 21600, // 6 hours + 86400, // 1 day + 345600, // 4 days + 604800, // 1 week + 1210000 // 2 weeks + ) + .help("The amount of time CAS entries live on L1 storage before expiration (seconds)") + .register(); private static final Gauge casCopyFallbackMetric = Gauge.build() @@ -160,7 +172,6 @@ public abstract class CASFileCache implements ContentAddressableStorage { private final EntryPathStrategy entryPathStrategy; private final long maxSizeInBytes; private final long maxEntrySizeInBytes; - private final boolean publishTtlMetric; private final boolean execRootFallback; private final DigestUtil digestUtil; private final ConcurrentMap storage; @@ -306,7 +317,6 @@ public CASFileCache( maxEntrySizeInBytes, config.getHexBucketLevels(), config.isFileDirectoriesIndexInMemory(), - config.isPublishTtlMetric(), config.isExecRootCopyFallback(), digestUtil, expireService, @@ -325,7 +335,6 @@ public CASFileCache( long maxEntrySizeInBytes, int hexBucketLevels, boolean storeFileDirsIndexInMemory, - boolean publishTtlMetric, boolean execRootFallback, DigestUtil digestUtil, ExecutorService expireService, @@ -339,7 +348,6 @@ public CASFileCache( this.root = root; this.maxSizeInBytes = maxSizeInBytes; this.maxEntrySizeInBytes = maxEntrySizeInBytes; - this.publishTtlMetric = publishTtlMetric; this.execRootFallback = execRootFallback; this.digestUtil = digestUtil; this.expireService = expireService; @@ -351,22 +359,6 @@ public CASFileCache( this.delegateSkipLoad = delegateSkipLoad; this.directoriesIndexDbName = directoriesIndexDbName; - if (publishTtlMetric) { - casTtl = - Histogram.build() - .name("cas_ttl_s") - .buckets( - 3600, // 1 hour - 21600, // 6 hours - 86400, // 1 day - 345600, // 4 days - 604800, // 1 week - 1210000 // 2 weeks - ) - .help("The amount of time CAS entries live on L1 storage before expiration (seconds)") - .register(); - } - entryPathStrategy = new HexBucketEntryPathStrategy(root, hexBucketLevels); String directoriesIndexUrl = "jdbc:sqlite:"; @@ -2710,25 +2702,19 @@ private CancellableOutputStream putOrReference( } private void deleteExpiredKey(String key) throws IOException { - // We don't want publishing the metric to delay the deletion of the file. - // We publish the metric only after the file has been deleted. - long createdTime = 0; Path path = getRemovingPath(key); - if (publishTtlMetric) { - createdTime = path.toFile().lastModified(); - } + long createdTimeMs = Files.getLastModifiedTime(path).to(MILLISECONDS); Files.delete(path); - if (publishTtlMetric) { - publishExpirationMetric(createdTime); - } + publishExpirationMetric(createdTimeMs); } - private void publishExpirationMetric(long createdTime) { - long currentTime = new Date().getTime(); - long ttl = currentTime - createdTime; - casTtl.observe(Time.millisecondsToSeconds(ttl)); + private void publishExpirationMetric(long createdTimeMs) { + // TODO introduce ttl clock + long currentTimeMs = new Date().getTime(); + long ttlMs = currentTimeMs - createdTimeMs; + casTtl.observe(Time.millisecondsToSeconds(ttlMs)); } @SuppressWarnings({"ConstantConditions", "ResultOfMethodCallIgnored"}) diff --git a/src/main/java/build/buildfarm/common/config/Cas.java b/src/main/java/build/buildfarm/common/config/Cas.java index 5b16fb2168..93ecdbfaf2 100644 --- a/src/main/java/build/buildfarm/common/config/Cas.java +++ b/src/main/java/build/buildfarm/common/config/Cas.java @@ -30,9 +30,6 @@ public enum TYPE { private String target; private boolean readonly = false; - // Metrics - private boolean publishTtlMetric = false; - public Path getValidPath(Path root) throws ConfigurationException { if (Strings.isNullOrEmpty(path)) { throw new ConfigurationException("Cas cache directory value in config missing"); diff --git a/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java b/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java index c1a56beb06..b03cbe6f32 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardCASFileCache.java @@ -38,7 +38,6 @@ class ShardCASFileCache extends CASFileCache { long maxEntrySizeInBytes, int maxBucketLevels, boolean storeFileDirsIndexInMemory, - boolean publishTtlMetric, boolean execRootFallback, DigestUtil digestUtil, ExecutorService expireService, @@ -53,7 +52,6 @@ class ShardCASFileCache extends CASFileCache { maxEntrySizeInBytes, maxBucketLevels, storeFileDirsIndexInMemory, - publishTtlMetric, execRootFallback, digestUtil, expireService, diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index a33dbaad60..46f0f083f6 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -354,7 +354,6 @@ private ContentAddressableStorage createStorage( // delegate level cas.getHexBucketLevels(), cas.isFileDirectoriesIndexInMemory(), - cas.isPublishTtlMetric(), cas.isExecRootCopyFallback(), digestUtil, removeDirectoryService, diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index 1bd1791999..72e167b4df 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -147,7 +147,6 @@ public void setUp() throws IOException, InterruptedException { /* maxEntrySizeInBytes=*/ 1024, /* hexBucketLevels=*/ 1, storeFileDirsIndexInMemory, - /* publishTtlMetric=*/ false, /* execRootFallback=*/ false, DIGEST_UTIL, expireService, @@ -1111,7 +1110,6 @@ public void copyExternalInputRetries() throws Exception { /* maxEntrySizeInBytes=*/ 1024, /* hexBucketLevels=*/ 1, storeFileDirsIndexInMemory, - /* publishTtlMetric=*/ false, /* execRootFallback=*/ false, DIGEST_UTIL, expireService, @@ -1175,7 +1173,6 @@ public void newInputThrowsNoSuchFileExceptionWithoutDelegate() throws Exception /* maxEntrySizeInBytes=*/ 1024, /* hexBucketLevels=*/ 1, storeFileDirsIndexInMemory, - /* publishTtlMetric=*/ false, /* execRootFallback=*/ false, DIGEST_UTIL, expireService, From 2abad58270b4f89a23a1dacb809cf6ce85d85d43 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 4 Oct 2023 16:17:38 -0400 Subject: [PATCH 061/214] Config-compatible behavior for publishTtlMetric --- src/main/java/build/buildfarm/common/config/Cas.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/build/buildfarm/common/config/Cas.java b/src/main/java/build/buildfarm/common/config/Cas.java index 93ecdbfaf2..9c671d4958 100644 --- a/src/main/java/build/buildfarm/common/config/Cas.java +++ b/src/main/java/build/buildfarm/common/config/Cas.java @@ -3,7 +3,9 @@ import com.google.common.base.Strings; import java.nio.file.Path; import javax.naming.ConfigurationException; +import lombok.AccessLevel; import lombok.Data; +import lombok.Getter; @Data public class Cas { @@ -30,6 +32,9 @@ public enum TYPE { private String target; private boolean readonly = false; + @Getter(AccessLevel.NONE) + private boolean publishTtlMetric = false; // deprecated + public Path getValidPath(Path root) throws ConfigurationException { if (Strings.isNullOrEmpty(path)) { throw new ConfigurationException("Cas cache directory value in config missing"); From 10189d628c650fea73484a4470038c3a38b64ba6 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 26 Sep 2023 14:21:10 -0400 Subject: [PATCH 062/214] Correct logging advisements for current Java Java logging definitions must now match java.util.logging.config.file, update these specifications in our README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8dc99874b3..675fe94dbd 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Run via ``` bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- -Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Dlogging.config=file:$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` **`logfile`** has to be in the [standard java util logging format](https://docs.oracle.com/cd/E57471_01/bigData.100/data_processing_bdd/src/rdp_logging_config.html) and passed as a --jvm_flag=-Dlogging.config=file: **`configfile`** has to be in [yaml format](https://bazelbuild.github.io/bazel-buildfarm/docs/configuration). @@ -43,7 +43,7 @@ Run via ``` bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- -Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Dlogging.config=file:$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` **`logfile`** has to be in the [standard java util logging format](https://docs.oracle.com/cd/E57471_01/bigData.100/data_processing_bdd/src/rdp_logging_config.html) and passed as a --jvm_flag=-Dlogging.config=file: @@ -68,13 +68,13 @@ You can use typical Java logging configuration to filter these results and obser An example `logging.properties` file has been provided at [examples/logging.properties](examples/logging.properties) for use as follows: ``` -bazel run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Dlogging.config=file:$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +bazel run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` and ``` -bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Dlogging.config=file:$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` To attach a remote debugger, run the executable with the `--debug=` flag. For example: From 0c30cb057e7a9bfb3850c68608c0085fd488ad24 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 14:44:14 -0400 Subject: [PATCH 063/214] Rename GracefulShutdownTest --- src/main/java/build/buildfarm/tools/BUILD | 6 +++--- .../{GracefulShutdownTest.java => GracefulShutdown.java} | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/main/java/build/buildfarm/tools/{GracefulShutdownTest.java => GracefulShutdown.java} (93%) diff --git a/src/main/java/build/buildfarm/tools/BUILD b/src/main/java/build/buildfarm/tools/BUILD index 37c6bdb58a..44a4498ef9 100644 --- a/src/main/java/build/buildfarm/tools/BUILD +++ b/src/main/java/build/buildfarm/tools/BUILD @@ -185,9 +185,9 @@ java_binary( ) java_binary( - name = "GracefulShutdownTest", - srcs = ["GracefulShutdownTest.java"], - main_class = "build.buildfarm.tools.GracefulShutdownTest", + name = "GracefulShutdown", + srcs = ["GracefulShutdown.java"], + main_class = "build.buildfarm.tools.GracefulShutdown", visibility = ["//visibility:public"], deps = [ "//src/main/java/build/buildfarm/common/grpc", diff --git a/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java b/src/main/java/build/buildfarm/tools/GracefulShutdown.java similarity index 93% rename from src/main/java/build/buildfarm/tools/GracefulShutdownTest.java rename to src/main/java/build/buildfarm/tools/GracefulShutdown.java index 85ae5ab78d..689edfeff1 100644 --- a/src/main/java/build/buildfarm/tools/GracefulShutdownTest.java +++ b/src/main/java/build/buildfarm/tools/GracefulShutdown.java @@ -23,9 +23,9 @@ import build.buildfarm.v1test.ShutDownWorkerGrpc; import io.grpc.ManagedChannel; -class GracefulShutdownTest { +class GracefulShutdown { /** - * Example command: GracefulShutdownTest ShutDown workerIp buildfarm-endpoint + * Example command: GracefulShutdown ShutDown workerIp buildfarm-endpoint * * @param args */ @@ -48,7 +48,7 @@ private static void shutDownGracefully(String[] args) { } /** - * Example command: GracefulShutdownTest PrepareWorker WorkerIp:port + * Example command: GracefulShutdown PrepareWorker WorkerIp:port * * @param args */ @@ -65,7 +65,7 @@ private static void prepareWorkerForShutDown(String[] args) { } /** - * Example command: GracefulShutdownTest DisableProtection WorkerIp buildfarm_endpoint + * Example command: GracefulShutdown DisableProtection WorkerIp buildfarm_endpoint * * @param args */ From 5a0d8d606ba62d6a801247d9bc52a84761d95a03 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 14:52:16 -0400 Subject: [PATCH 064/214] Remove WebController --- .../common/config/BuildfarmConfigs.java | 1 - .../build/buildfarm/common/config/WebUI.java | 40 --- src/main/java/build/buildfarm/server/BUILD | 3 - .../buildfarm/server/BuildFarmServer.java | 4 - .../build/buildfarm/server/controllers/BUILD | 46 --- .../server/controllers/WebController.java | 291 ------------------ 6 files changed, 385 deletions(-) delete mode 100644 src/main/java/build/buildfarm/common/config/WebUI.java delete mode 100644 src/main/java/build/buildfarm/server/controllers/BUILD delete mode 100644 src/main/java/build/buildfarm/server/controllers/WebController.java diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 68106d56c7..1a15e40803 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -39,7 +39,6 @@ public final class BuildfarmConfigs { private Server server = new Server(); private Backplane backplane = new Backplane(); private Worker worker = new Worker(); - private WebUI ui = new WebUI(); private ExecutionWrappers executionWrappers = new ExecutionWrappers(); private BuildfarmConfigs() {} diff --git a/src/main/java/build/buildfarm/common/config/WebUI.java b/src/main/java/build/buildfarm/common/config/WebUI.java deleted file mode 100644 index 443d210691..0000000000 --- a/src/main/java/build/buildfarm/common/config/WebUI.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2023 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.common.config; - -import lombok.Data; - -/** - * @class WebUI - * @brief Settings for buildfarm's web UI. - * @details Buildfarm provides a web frontend for developers to introspect builds. - */ -@Data -public class WebUI { - /** - * @field enable - * @brief Whether to enable the web frontend. - * @details When disabled there will be no ports opened or routes available. - */ - public boolean enable = false; - - /** - * @field port - * @brief HTTP port for the web frontend. - * @details 8080 is useful for local testing since port 80 requires sudo. We choose the following - * default since many ports are blocked in upstream CI. - */ - public String port = "8982"; -} diff --git a/src/main/java/build/buildfarm/server/BUILD b/src/main/java/build/buildfarm/server/BUILD index b05d2e5ef7..0d6d396dc8 100644 --- a/src/main/java/build/buildfarm/server/BUILD +++ b/src/main/java/build/buildfarm/server/BUILD @@ -14,7 +14,6 @@ java_library( "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/shard", "//src/main/java/build/buildfarm/metrics/prometheus", - "//src/main/java/build/buildfarm/server/controllers:WebController", "//src/main/java/build/buildfarm/server/services", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@maven//:com_github_pcj_google_options", @@ -29,10 +28,8 @@ java_library( "@maven//:org_springframework_boot_spring_boot", "@maven//:org_springframework_boot_spring_boot_autoconfigure", "@maven//:org_springframework_boot_spring_boot_starter_thymeleaf", - "@maven//:org_springframework_boot_spring_boot_starter_web", "@maven//:org_springframework_spring_beans", "@maven//:org_springframework_spring_context", "@maven//:org_springframework_spring_core", - "@maven//:org_springframework_spring_web", ], ) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index d0d26a6f52..e82928e934 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -29,7 +29,6 @@ import build.buildfarm.instance.Instance; import build.buildfarm.instance.shard.ShardInstance; import build.buildfarm.metrics.prometheus.PrometheusPublisher; -import build.buildfarm.server.controllers.WebController; import build.buildfarm.server.services.ActionCacheService; import build.buildfarm.server.services.AdminService; import build.buildfarm.server.services.CapabilitiesService; @@ -143,7 +142,6 @@ public synchronized void start(ServerBuilder serverBuilder, String publicName checkState(!stopping, "must not call start after stop"); instance.start(publicName); - WebController.setInstance((ShardInstance) instance); server.start(); healthStatusManager.setStatus( @@ -214,8 +212,6 @@ public static void main(String[] args) throws ConfigurationException { // Disable Logback System.setProperty("org.springframework.boot.logging.LoggingSystem", "none"); - springConfig.put("ui.frontend.enable", configs.getUi().isEnable()); - springConfig.put("server.port", configs.getUi().getPort()); app.setDefaultProperties(springConfig); try { diff --git a/src/main/java/build/buildfarm/server/controllers/BUILD b/src/main/java/build/buildfarm/server/controllers/BUILD deleted file mode 100644 index 1e523bcef5..0000000000 --- a/src/main/java/build/buildfarm/server/controllers/BUILD +++ /dev/null @@ -1,46 +0,0 @@ -java_library( - name = "WebController", - srcs = ["WebController.java"], - plugins = ["//src/main/java/build/buildfarm/common:lombok"], - visibility = ["//visibility:public"], - deps = [ - "//src/main/java/build/buildfarm/common", - "//src/main/java/build/buildfarm/common/config", - "//src/main/java/build/buildfarm/common/grpc", - "//src/main/java/build/buildfarm/common/resources", - "//src/main/java/build/buildfarm/common/resources:resource_java_proto", - "//src/main/java/build/buildfarm/common/services", - "//src/main/java/build/buildfarm/instance", - "//src/main/java/build/buildfarm/instance/shard", - "//src/main/java/build/buildfarm/metrics/prometheus", - "//src/main/java/build/buildfarm/operations", - "//src/main/java/build/buildfarm/server/services", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_error_details_proto", - "@maven//:com_github_pcj_google_options", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java", - "@maven//:com_google_protobuf_protobuf_java_util", - "@maven//:com_googlecode_json_simple_json_simple", - "@maven//:com_jayway_jsonpath_json_path", - "@maven//:io_grpc_grpc_api", - "@maven//:io_grpc_grpc_core", - "@maven//:io_grpc_grpc_protobuf", - "@maven//:io_grpc_grpc_services", - "@maven//:io_prometheus_simpleclient", - "@maven//:javax_annotation_javax_annotation_api", - "@maven//:org_bouncycastle_bcprov_jdk15on", - "@maven//:org_projectlombok_lombok", - "@maven//:org_springframework_boot_spring_boot", - "@maven//:org_springframework_boot_spring_boot_autoconfigure", - "@maven//:org_springframework_boot_spring_boot_starter_web", - "@maven//:org_springframework_spring_beans", - "@maven//:org_springframework_spring_context", - "@maven//:org_springframework_spring_core", - "@maven//:org_springframework_spring_web", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/server/controllers/WebController.java b/src/main/java/build/buildfarm/server/controllers/WebController.java deleted file mode 100644 index 5ed5c8250e..0000000000 --- a/src/main/java/build/buildfarm/server/controllers/WebController.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2023 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.server.controllers; - -import build.bazel.remote.execution.v2.ExecuteOperationMetadata; -import build.bazel.remote.execution.v2.ExecuteResponse; -import build.bazel.remote.execution.v2.RequestMetadata; -import build.buildfarm.instance.shard.ShardInstance; -import build.buildfarm.operations.EnrichedOperation; -import build.buildfarm.v1test.CompletedOperationMetadata; -import build.buildfarm.v1test.ExecutingOperationMetadata; -import build.buildfarm.v1test.QueuedOperationMetadata; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.Timestamp; -import com.google.protobuf.util.Durations; -import com.google.protobuf.util.JsonFormat; -import com.google.protobuf.util.Timestamps; -import com.google.rpc.PreconditionFailure; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import lombok.extern.java.Log; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -// An HTTP frontend for providing a web UI in buildfarm. Its primarily used by developers so that -// they can introspect their build inovocations. Standalone tools that communicate over GRPC are -// sometimes less accessible. Nonetheless, the APIs should be similar. -// The web frontend can be deployed as part of the servers. However, the controller may also be -// included in other standalone tools if you'd like the frontend decoupled from the servers. -// This controller can provide web content directly through spring boot via thymeleaf. -// The controller also provides raw REST APIs for those wishing to build out their own frontend. -@Log -@Controller -@ConditionalOnProperty("ui.frontend.enable") -public class WebController { - private static ShardInstance instance; - - // Most of the routes require an instance to have their queries fulfilled. - // I wanted to have the instance set in the controller's constructor, but I was having trouble - // doing that with springboot's bean initialization and auto-wiring. - // Particularly because the controller is constructed before the instance is actually created. - // I settled for having the instance static and allowing the server startup to provide the - // instance once ready. - public static void setInstance(ShardInstance instanceIn) { - instance = instanceIn; - } - - // This is typically the starting for a developer looking to introspect their builds. - // When running a bazel client with `--bes_results_url` they will shown this URL route. - // The page is intented to give them a summary of their build invocation and allow them to drill - // down into more details. - @GetMapping("/invocation/{invocationId}") - public String invocation(Model model, @PathVariable String invocationId) { - // We need to look up the user's operations as fast as possible. Scanning all of the stored - // operations and filtering by invocatio ID (i.e. O(n)) does not scale. Instead, the invocation - // ID must be the primary key to their specific list of build operation IDs. We then lookup - // each - // operation by ID (preferably batched). This is technically two backend calls. It could be - // made faster - // at the expense of duplicate information stored in the backend. - Set operationIDs = instance.findOperationsByInvocationId(invocationId); - Iterable> foundOperations = instance.getOperations(operationIDs); - - // Populate the model for the page. - buildInvocationModel(model, invocationId, foundOperations); - - // Render page. - return "invocation"; - } - - private void buildInvocationModel( - Model model, String invocationId, Iterable> foundOperations) { - // Create an array representing table information about all the oprations involved in the - // invocation. - // This is the core content of the page. - JSONArray operationResults = new JSONArray(); - for (Map.Entry entry : foundOperations) { - Operation operation = jsonToOperation(entry.getValue()); - JSONObject obj = new JSONObject(); - obj.put("target", extractTargetId(operation)); - obj.put("mnemonic", extractActionMnemonic(operation)); - obj.put("stage", extractStatus(operation)); - obj.put("duration", extractDuration(operation)); - obj.put("worker", extractWorker(operation)); - - String operationId = entry.getKey(); - String id = operationId.substring(operationId.lastIndexOf('/')).substring(1); - obj.put("operationId", id); - - operationResults.add(obj); - } - - // Populate data to be provided to the frontend. - model.addAttribute("operation", operationResults.toJSONString()); - model.addAttribute("invocationId", String.format("Invocation: %s", invocationId)); - } - - // An operation represents an executed action. - // The operation has a target ID which corresponds to the bazel label what developers are - // typically thinking of when wishing to evaluate their build. - // This page shows them all of the information that we track related to the operation. - @GetMapping("/operation/{operationId}") - public String operation(Model model, @PathVariable String operationId) { - EnrichedOperation result = - instance.findEnrichedOperation(String.format("shard/operations/%s", operationId)); - model.addAttribute("fullOperation", result.asJsonString()); - return "operation"; - } - - // Information about the current deployment. Useful for verifying what is running. - @GetMapping("/info") - public String info(Model model) { - return "info"; - } - - /** - * @brief Convert string json into operation type. - * @details Parses json and returns null if invalid. - * @param json The json to convert to Operation type. - * @return The created operation. - * @note Suggested return identifier: operation. - */ - private static Operation jsonToOperation(String json) { - // create a json parser - JsonFormat.Parser operationParser = - JsonFormat.parser() - .usingTypeRegistry( - JsonFormat.TypeRegistry.newBuilder() - .add(CompletedOperationMetadata.getDescriptor()) - .add(ExecutingOperationMetadata.getDescriptor()) - .add(ExecuteOperationMetadata.getDescriptor()) - .add(QueuedOperationMetadata.getDescriptor()) - .add(PreconditionFailure.getDescriptor()) - .build()) - .ignoringUnknownFields(); - - if (json == null) { - log.log(Level.WARNING, "Operation Json is empty"); - return null; - } - try { - Operation.Builder operationBuilder = Operation.newBuilder(); - operationParser.merge(json, operationBuilder); - return operationBuilder.build(); - } catch (InvalidProtocolBufferException e) { - log.log(Level.WARNING, "InvalidProtocolBufferException while building an operation.", e); - return null; - } - } - - private String extractTargetId(Operation operation) { - return expectRequestMetadata(operation).getTargetId(); - } - - private String extractActionMnemonic(Operation operation) { - return expectRequestMetadata(operation).getActionMnemonic(); - } - - private String extractStatus(Operation operation) { - return String.valueOf(expectExecuteOperationMetadata(operation).getStage()); - } - - private String extractDuration(Operation operation) { - Any result = operation.getResponse(); - try { - Timestamp start = - result - .unpack(ExecuteResponse.class) - .getResult() - .getExecutionMetadata() - .getWorkerStartTimestamp(); - Timestamp end = - result - .unpack(ExecuteResponse.class) - .getResult() - .getExecutionMetadata() - .getWorkerCompletedTimestamp(); - Duration duration = Timestamps.between(start, end); - return Durations.toSecondsAsDouble(duration) + "s"; - } catch (InvalidProtocolBufferException e) { - System.out.println(e.toString()); - return "Unknown"; - } - } - - private String extractWorker(Operation operation) { - Any result = operation.getResponse(); - try { - return result.unpack(ExecuteResponse.class).getResult().getExecutionMetadata().getWorker(); - } catch (InvalidProtocolBufferException e) { - System.out.println(e.toString()); - return "Unknown"; - } - } - - private static ExecuteOperationMetadata expectExecuteOperationMetadata(Operation operation) { - String name = operation.getName(); - Any metadata = operation.getMetadata(); - QueuedOperationMetadata queuedOperationMetadata = maybeQueuedOperationMetadata(name, metadata); - if (queuedOperationMetadata != null) { - return queuedOperationMetadata.getExecuteOperationMetadata(); - } - ExecutingOperationMetadata executingOperationMetadata = - maybeExecutingOperationMetadata(name, metadata); - if (executingOperationMetadata != null) { - return executingOperationMetadata.getExecuteOperationMetadata(); - } - CompletedOperationMetadata completedOperationMetadata = - maybeCompletedOperationMetadata(name, metadata); - if (completedOperationMetadata != null) { - return completedOperationMetadata.getExecuteOperationMetadata(); - } - return ExecuteOperationMetadata.getDefaultInstance(); - } - - private static RequestMetadata expectRequestMetadata(Operation operation) { - String name = operation.getName(); - Any metadata = operation.getMetadata(); - QueuedOperationMetadata queuedOperationMetadata = maybeQueuedOperationMetadata(name, metadata); - if (queuedOperationMetadata != null) { - return queuedOperationMetadata.getRequestMetadata(); - } - ExecutingOperationMetadata executingOperationMetadata = - maybeExecutingOperationMetadata(name, metadata); - if (executingOperationMetadata != null) { - return executingOperationMetadata.getRequestMetadata(); - } - CompletedOperationMetadata completedOperationMetadata = - maybeCompletedOperationMetadata(name, metadata); - if (completedOperationMetadata != null) { - return completedOperationMetadata.getRequestMetadata(); - } - return RequestMetadata.getDefaultInstance(); - } - - private static QueuedOperationMetadata maybeQueuedOperationMetadata(String name, Any metadata) { - if (metadata.is(QueuedOperationMetadata.class)) { - try { - return metadata.unpack(QueuedOperationMetadata.class); - } catch (InvalidProtocolBufferException e) { - log.log(Level.SEVERE, String.format("invalid executing operation metadata %s", name), e); - } - } - return null; - } - - private static ExecutingOperationMetadata maybeExecutingOperationMetadata( - String name, Any metadata) { - if (metadata.is(ExecutingOperationMetadata.class)) { - try { - return metadata.unpack(ExecutingOperationMetadata.class); - } catch (InvalidProtocolBufferException e) { - log.log(Level.SEVERE, String.format("invalid executing operation metadata %s", name), e); - } - } - return null; - } - - private static CompletedOperationMetadata maybeCompletedOperationMetadata( - String name, Any metadata) { - if (metadata.is(CompletedOperationMetadata.class)) { - try { - return metadata.unpack(CompletedOperationMetadata.class); - } catch (InvalidProtocolBufferException e) { - log.log(Level.SEVERE, String.format("invalid completed operation metadata %s", name), e); - } - } - return null; - } -} From fa8dd6fa1c4d138e08333f07c048446aa15a9b33 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 14:54:06 -0400 Subject: [PATCH 065/214] Interrupt+Join operationQueuer/dispatchMonitor Use interrupt to halt the OperationQueuer. Join on both operationQueuer and dispatchMonitor before instance stop return. --- .../java/build/buildfarm/instance/shard/ShardInstance.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index 883931d2d4..bf0c42a8c5 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -568,10 +568,12 @@ public void stop() throws InterruptedException { stopping = true; log.log(Level.FINER, format("Instance %s is stopping", getName())); if (operationQueuer != null) { - operationQueuer.stop(); + operationQueuer.interrupt(); + operationQueuer.join(); } if (dispatchedMonitor != null) { dispatchedMonitor.interrupt(); + dispatchedMonitor.join(); } if (prometheusMetricsThread != null) { prometheusMetricsThread.interrupt(); From 60093dbe25506302cf3f2c115f98378dc96629b7 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 15:33:45 -0400 Subject: [PATCH 066/214] Present operationNames by stage Include Match and Report Result stages in output Record the active operationName occupying slots in each of the stages and present them with WorkerProfile Avoid several unnecessary casts with interfaces for operation slot stages. --- src/main/java/build/buildfarm/tools/Cat.java | 3 + .../buildfarm/worker/ExecuteActionStage.java | 4 +- .../buildfarm/worker/InputFetchStage.java | 6 +- .../build/buildfarm/worker/MatchStage.java | 6 +- .../build/buildfarm/worker/PipelineStage.java | 35 ++++-- .../worker/SuperscalarPipelineStage.java | 39 ++++++- .../build/buildfarm/worker/shard/Worker.java | 21 ++-- .../worker/shard/WorkerProfileService.java | 100 +++++++++++------- .../build/buildfarm/v1test/buildfarm.proto | 2 + .../worker/SuperscalarPipelineStageTest.java | 5 + 10 files changed, 155 insertions(+), 66 deletions(-) diff --git a/src/main/java/build/buildfarm/tools/Cat.java b/src/main/java/build/buildfarm/tools/Cat.java index 7c8e561454..bca404b3c1 100644 --- a/src/main/java/build/buildfarm/tools/Cat.java +++ b/src/main/java/build/buildfarm/tools/Cat.java @@ -650,6 +650,9 @@ private static void getWorkerProfile(Instance instance) { private static void printStageInformation(StageInformation stage) { System.out.printf("%s slots configured: %d%n", stage.getName(), stage.getSlotsConfigured()); System.out.printf("%s slots used %d%n", stage.getName(), stage.getSlotsUsed()); + for (String operationName : stage.getOperationNamesList()) { + System.out.printf("%s operation %s\n", stage.getName(), operationName); + } } private static void printOperationTime(OperationTimesBetweenStages time) { diff --git a/src/main/java/build/buildfarm/worker/ExecuteActionStage.java b/src/main/java/build/buildfarm/worker/ExecuteActionStage.java index 6c5e247a8f..f1ad546676 100644 --- a/src/main/java/build/buildfarm/worker/ExecuteActionStage.java +++ b/src/main/java/build/buildfarm/worker/ExecuteActionStage.java @@ -107,7 +107,7 @@ public void releaseExecutor( int slotUsage = removeAndRelease(operationName, claims); executionTime.observe(usecs / 1000.0); executionStallTime.observe(stallUSecs / 1000.0); - logComplete( + complete( operationName, usecs, stallUSecs, @@ -141,7 +141,7 @@ protected void iterate() throws InterruptedException { executors.add(executorThread); int slotUsage = executorClaims.addAndGet(limits.cpu.claimed); executionSlotUsage.set(slotUsage); - logStart(operationContext.operation.getName(), getUsage(slotUsage)); + start(operationContext.operation.getName(), getUsage(slotUsage)); executorThread.start(); } } diff --git a/src/main/java/build/buildfarm/worker/InputFetchStage.java b/src/main/java/build/buildfarm/worker/InputFetchStage.java index 6b0f741fd8..3953ef9595 100644 --- a/src/main/java/build/buildfarm/worker/InputFetchStage.java +++ b/src/main/java/build/buildfarm/worker/InputFetchStage.java @@ -72,13 +72,14 @@ public void releaseInputFetcher( int size = removeAndRelease(operationName); inputFetchTime.observe(usecs / 1000.0); inputFetchStallTime.observe(stallUSecs / 1000.0); - logComplete( + complete( operationName, usecs, stallUSecs, String.format("%s, %s", success ? "Success" : "Failure", getUsage(size))); } + @Override public int getSlotUsage() { return fetchers.size(); } @@ -106,8 +107,7 @@ protected void iterate() throws InterruptedException { fetchers.add(fetcher); int slotUsage = fetchers.size(); inputFetchSlotUsage.set(slotUsage); - logStart( - operationContext.queueEntry.getExecuteEntry().getOperationName(), getUsage(slotUsage)); + start(operationContext.queueEntry.getExecuteEntry().getOperationName(), getUsage(slotUsage)); fetcher.start(); } } diff --git a/src/main/java/build/buildfarm/worker/MatchStage.java b/src/main/java/build/buildfarm/worker/MatchStage.java index e245ee68d6..dc81a2ce31 100644 --- a/src/main/java/build/buildfarm/worker/MatchStage.java +++ b/src/main/java/build/buildfarm/worker/MatchStage.java @@ -103,12 +103,12 @@ public void setOnCancelHandler(Runnable onCancelHandler) { @SuppressWarnings("SameReturnValue") private boolean onOperationPolled() throws InterruptedException { String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); - logStart(operationName); + start(operationName); long matchingAtUSecs = stopwatch.elapsed(MICROSECONDS); OperationContext matchedOperationContext = match(operationContext); long matchedInUSecs = stopwatch.elapsed(MICROSECONDS) - matchingAtUSecs; - logComplete(operationName, matchedInUSecs, waitDuration, true); + complete(operationName, matchedInUSecs, waitDuration, true); matchedOperationContext.poller.pause(); try { output.put(matchedOperationContext); @@ -139,7 +139,7 @@ protected void iterate() throws InterruptedException { } MatchOperationListener listener = new MatchOperationListener(operationContext, stopwatch); try { - logStart(); + start(); workerContext.match(listener); } finally { if (!listener.wasMatched()) { diff --git a/src/main/java/build/buildfarm/worker/PipelineStage.java b/src/main/java/build/buildfarm/worker/PipelineStage.java index 7dd1d6d9ee..edad2bb572 100644 --- a/src/main/java/build/buildfarm/worker/PipelineStage.java +++ b/src/main/java/build/buildfarm/worker/PipelineStage.java @@ -19,6 +19,7 @@ import com.google.common.base.Stopwatch; import java.util.logging.Level; import java.util.logging.Logger; +import javax.annotation.Nullable; public abstract class PipelineStage implements Runnable { protected final String name; @@ -30,6 +31,7 @@ public abstract class PipelineStage implements Runnable { private volatile boolean closed = false; private Thread tickThread = null; private boolean tickCancelledFlag = false; + private String operationName = null; PipelineStage( String name, WorkerContext workerContext, PipelineStage output, PipelineStage error) { @@ -39,12 +41,20 @@ public abstract class PipelineStage implements Runnable { this.error = error; } + public String getName() { + return name; + } + private void runInterruptible() throws InterruptedException { while (!output.isClosed() || isClaimed()) { iterate(); } } + public @Nullable String getOperationName() { + return operationName; + } + @Override public void run() { try { @@ -94,7 +104,7 @@ protected void iterate() throws InterruptedException { Stopwatch stopwatch = Stopwatch.createUnstarted(); try { operationContext = take(); - logStart(operationContext.operation.getName()); + start(operationContext.operation.getName()); stopwatch.start(); boolean valid = false; tickThread = Thread.currentThread(); @@ -128,31 +138,34 @@ protected void iterate() throws InterruptedException { } after(operationContext); long usecs = stopwatch.elapsed(MICROSECONDS); - logComplete( - operationContext.operation.getName(), usecs, stallUSecs, nextOperationContext != null); + complete(operationName, usecs, stallUSecs, nextOperationContext != null); + operationName = null; } private String logIterateId(String operationName) { return String.format("%s::iterate(%s)", name, operationName); } - protected void logStart() { - logStart(""); + protected void start() { + start(""); } - protected void logStart(String operationName) { - logStart(operationName, "Starting"); + protected void start(String operationName) { + start(operationName, "Starting"); } - protected void logStart(String operationName, String message) { + protected void start(String operationName, String message) { + // TODO to unary stage + this.operationName = operationName; getLogger().log(Level.FINER, String.format("%s: %s", logIterateId(operationName), message)); } - protected void logComplete(String operationName, long usecs, long stallUSecs, boolean success) { - logComplete(operationName, usecs, stallUSecs, success ? "Success" : "Failed"); + protected void complete(String operationName, long usecs, long stallUSecs, boolean success) { + complete(operationName, usecs, stallUSecs, success ? "Success" : "Failed"); } - protected void logComplete(String operationName, long usecs, long stallUSecs, String status) { + protected void complete(String operationName, long usecs, long stallUSecs, String status) { + this.operationName = operationName; getLogger() .log( Level.FINER, diff --git a/src/main/java/build/buildfarm/worker/SuperscalarPipelineStage.java b/src/main/java/build/buildfarm/worker/SuperscalarPipelineStage.java index 64636d72c2..ed7e610a10 100644 --- a/src/main/java/build/buildfarm/worker/SuperscalarPipelineStage.java +++ b/src/main/java/build/buildfarm/worker/SuperscalarPipelineStage.java @@ -14,17 +14,21 @@ package build.buildfarm.worker; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import java.util.logging.Level; -abstract class SuperscalarPipelineStage extends PipelineStage { +public abstract class SuperscalarPipelineStage extends PipelineStage { protected final int width; @SuppressWarnings("rawtypes") protected final BlockingQueue claims; + protected Set operationNames = new HashSet<>(); + private volatile boolean catastrophic = false; // ensure that only a single claim waits for available slots for core count @@ -46,6 +50,39 @@ public SuperscalarPipelineStage( protected abstract int claimsRequired(OperationContext operationContext); + @Override + public String getOperationName() { + throw new UnsupportedOperationException("use getOperationNames on superscalar stages"); + } + + public int getWidth() { + return width; + } + + public abstract int getSlotUsage(); + + public Iterable getOperationNames() { + synchronized (operationNames) { + return new HashSet(operationNames); + } + } + + @Override + protected void start(String operationName, String message) { + synchronized (operationNames) { + operationNames.add(operationName); + } + super.start(operationName, message); + } + + @Override + protected void complete(String operationName, long usecs, long stallUSecs, String status) { + super.complete(operationName, usecs, stallUSecs, status); + synchronized (operationNames) { + operationNames.remove(operationName); + } + } + synchronized void waitForReleaseOrCatastrophe(BlockingQueue queue) { boolean interrupted = false; while (!catastrophic && isClaimed()) { diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 46f0f083f6..a5affbbaec 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -57,6 +57,7 @@ import build.buildfarm.worker.PipelineStage; import build.buildfarm.worker.PutOperationStage; import build.buildfarm.worker.ReportResultStage; +import build.buildfarm.worker.SuperscalarPipelineStage; import com.google.common.cache.LoadingCache; import com.google.common.collect.Lists; import com.google.devtools.common.options.OptionsParsingException; @@ -197,7 +198,7 @@ private Operation stripQueuedOperation(Operation operation) { private Server createServer( ServerBuilder serverBuilder, - ContentAddressableStorage storage, + @Nullable CASFileCache storage, Instance instance, Pipeline pipeline, ShardWorkerContext context) { @@ -211,13 +212,13 @@ private Server createServer( // It will use various execution phases for it's profile service. // On the other hand, a worker that is only capable of CAS storage does not need a pipeline. if (configs.getWorker().getCapabilities().isExecution()) { - PipelineStage completeStage = - new PutOperationStage((operation) -> context.deactivate(operation.getName())); + PutOperationStage completeStage = + new PutOperationStage(operation -> context.deactivate(operation.getName())); PipelineStage errorStage = completeStage; /* new ErrorStage(); */ PipelineStage reportResultStage = new ReportResultStage(context, completeStage, errorStage); - PipelineStage executeActionStage = + SuperscalarPipelineStage executeActionStage = new ExecuteActionStage(context, reportResultStage, errorStage); - PipelineStage inputFetchStage = + SuperscalarPipelineStage inputFetchStage = new InputFetchStage(context, executeActionStage, new PutOperationStage(context::requeue)); PipelineStage matchStage = new MatchStage(context, inputFetchStage, errorStage); @@ -228,7 +229,13 @@ private Server createServer( serverBuilder.addService( new WorkerProfileService( - storage, inputFetchStage, executeActionStage, context, completeStage, backplane)); + storage, + matchStage, + inputFetchStage, + executeActionStage, + reportResultStage, + completeStage, + backplane)); } GrpcMetrics.handleGrpcMetricIntercepts(serverBuilder, configs.getWorker().getGrpcMetrics()); serverBuilder.intercept(new ServerHeadersInterceptor()); @@ -608,7 +615,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep writer); pipeline = new Pipeline(); - server = createServer(serverBuilder, storage, instance, pipeline, context); + server = createServer(serverBuilder, (CASFileCache) storage, instance, pipeline, context); removeWorker(configs.getWorker().getPublicName()); diff --git a/src/main/java/build/buildfarm/worker/shard/WorkerProfileService.java b/src/main/java/build/buildfarm/worker/shard/WorkerProfileService.java index 6eee990426..f00c57cc3d 100644 --- a/src/main/java/build/buildfarm/worker/shard/WorkerProfileService.java +++ b/src/main/java/build/buildfarm/worker/shard/WorkerProfileService.java @@ -15,7 +15,6 @@ package build.buildfarm.worker.shard; import build.buildfarm.backplane.Backplane; -import build.buildfarm.cas.ContentAddressableStorage; import build.buildfarm.cas.cfc.CASFileCache; import build.buildfarm.v1test.OperationTimesBetweenStages; import build.buildfarm.v1test.StageInformation; @@ -24,67 +23,90 @@ import build.buildfarm.v1test.WorkerProfileGrpc; import build.buildfarm.v1test.WorkerProfileMessage; import build.buildfarm.v1test.WorkerProfileRequest; -import build.buildfarm.worker.ExecuteActionStage; -import build.buildfarm.worker.InputFetchStage; import build.buildfarm.worker.PipelineStage; import build.buildfarm.worker.PutOperationStage; import build.buildfarm.worker.PutOperationStage.OperationStageDurations; -import build.buildfarm.worker.WorkerContext; +import build.buildfarm.worker.SuperscalarPipelineStage; import io.grpc.stub.StreamObserver; import java.io.IOException; +import javax.annotation.Nullable; public class WorkerProfileService extends WorkerProfileGrpc.WorkerProfileImplBase { - private final CASFileCache storage; - private final InputFetchStage inputFetchStage; - private final ExecuteActionStage executeActionStage; - private final WorkerContext context; + private final @Nullable CASFileCache storage; + private final PipelineStage matchStage; + private final SuperscalarPipelineStage inputFetchStage; + private final SuperscalarPipelineStage executeActionStage; + private final PipelineStage reportResultStage; private final PutOperationStage completeStage; private final Backplane backplane; public WorkerProfileService( - ContentAddressableStorage storage, - PipelineStage inputFetchStage, - PipelineStage executeActionStage, - WorkerContext context, - PipelineStage completeStage, + @Nullable CASFileCache storage, + PipelineStage matchStage, + SuperscalarPipelineStage inputFetchStage, + SuperscalarPipelineStage executeActionStage, + PipelineStage reportResultStage, + PutOperationStage completeStage, Backplane backplane) { - this.storage = (CASFileCache) storage; - this.inputFetchStage = (InputFetchStage) inputFetchStage; - this.executeActionStage = (ExecuteActionStage) executeActionStage; - this.context = context; + this.storage = storage; + this.matchStage = matchStage; + this.inputFetchStage = inputFetchStage; + this.executeActionStage = executeActionStage; + this.reportResultStage = reportResultStage; this.completeStage = (PutOperationStage) completeStage; this.backplane = backplane; } + private StageInformation unaryStageInformation(String name, @Nullable String operationName) { + StageInformation.Builder builder = + StageInformation.newBuilder().setName(name).setSlotsConfigured(1); + if (operationName != null) { + builder.setSlotsUsed(1).addOperationNames(operationName); + } + return builder.build(); + } + + private StageInformation superscalarStageInformation(SuperscalarPipelineStage stage) { + return StageInformation.newBuilder() + .setName(stage.getName()) + .setSlotsConfigured(stage.getWidth()) + .setSlotsUsed(stage.getSlotUsage()) + .addAllOperationNames(stage.getOperationNames()) + .build(); + } + @Override public void getWorkerProfile( WorkerProfileRequest request, StreamObserver responseObserver) { // get usage of CASFileCache - WorkerProfileMessage.Builder replyBuilder = - WorkerProfileMessage.newBuilder() - .setCasSize(storage.size()) - .setCasEntryCount(storage.entryCount()) - .setCasMaxSize(storage.maxSize()) - .setCasMaxEntrySize(storage.maxEntrySize()) - .setCasUnreferencedEntryCount(storage.unreferencedEntryCount()) - .setCasDirectoryEntryCount(storage.directoryStorageCount()) - .setCasEvictedEntryCount(storage.getEvictedCount()) - .setCasEvictedEntrySize(storage.getEvictedSize()); + WorkerProfileMessage.Builder replyBuilder = WorkerProfileMessage.newBuilder(); + + // FIXME deliver full local storage chain + if (storage != null) { + replyBuilder + .setCasSize(storage.size()) + .setCasEntryCount(storage.entryCount()) + .setCasMaxSize(storage.maxSize()) + .setCasMaxEntrySize(storage.maxEntrySize()) + .setCasUnreferencedEntryCount(storage.unreferencedEntryCount()) + .setCasDirectoryEntryCount(storage.directoryStorageCount()) + .setCasEvictedEntryCount(storage.getEvictedCount()) + .setCasEvictedEntrySize(storage.getEvictedSize()); + } // get slots configured and used of superscalar stages + // prefer reverse order to avoid double counting if possible + // these stats are not consistent across their sampling and will + // produce: slots that are not consistent with operations, operations + // in multiple stages even in reverse due to claim progress + // in short: this is for monitoring, not for guaranteed consistency checks + String reportResultOperation = reportResultStage.getOperationName(); + String matchOperation = matchStage.getOperationName(); replyBuilder - .addStages( - StageInformation.newBuilder() - .setName("InputFetchStage") - .setSlotsConfigured(context.getInputFetchStageWidth()) - .setSlotsUsed(inputFetchStage.getSlotUsage()) - .build()) - .addStages( - StageInformation.newBuilder() - .setName("ExecuteActionStage") - .setSlotsConfigured(context.getExecuteStageWidth()) - .setSlotsUsed(executeActionStage.getSlotUsage()) - .build()); + .addStages(unaryStageInformation(reportResultStage.getName(), reportResultOperation)) + .addStages(superscalarStageInformation(executeActionStage)) + .addStages(superscalarStageInformation(inputFetchStage)) + .addStages(unaryStageInformation(matchStage.getName(), matchOperation)); // get average time costs on each stage OperationStageDurations[] durations = completeStage.getAverageTimeCostPerStage(); diff --git a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto index b4c78b3c03..9632593f11 100644 --- a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto +++ b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto @@ -602,6 +602,8 @@ message StageInformation { // number of slots used for this stage int32 slots_used = 3; + + repeated string operation_names = 4; } message WorkerProfileMessage { diff --git a/src/test/java/build/buildfarm/worker/SuperscalarPipelineStageTest.java b/src/test/java/build/buildfarm/worker/SuperscalarPipelineStageTest.java index 60cb0d8be9..3716513102 100644 --- a/src/test/java/build/buildfarm/worker/SuperscalarPipelineStageTest.java +++ b/src/test/java/build/buildfarm/worker/SuperscalarPipelineStageTest.java @@ -72,6 +72,11 @@ protected int claimsRequired(OperationContext operationContext) { boolean isFull() { return claims.size() == width; } + + @Override + public int getSlotUsage() { + return 0; + } } @Test From 9ff8e6448f6ec4c67667b4fbb46c484318354bf4 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 26 Sep 2023 14:36:58 -0400 Subject: [PATCH 067/214] Remove subscribeToBackplane, adjust failsafe op A shard server is impractical without operation subscription, partition subscription confirmation between servers and workers. The failsafe execution is configuration that is likely not desired on workers. This change removes the failsafe behavior from workers via backplane config, and relegates the setting of failsafe boolean to server config. If the option is restored for workers, it can be added to worker configs so that configs may continue to be shared between workers and servers and retain independent addressability. --- examples/config.yml | 3 +- .../buildfarm/common/config/Backplane.java | 11 ++- .../build/buildfarm/common/config/Server.java | 1 + .../instance/shard/RedisShardBackplane.java | 20 ++++- .../instance/shard/ShardInstance.java | 6 +- .../build/buildfarm/worker/shard/Worker.java | 7 +- .../shard/RedisShardBackplaneTest.java | 83 +++++++++---------- 7 files changed, 79 insertions(+), 52 deletions(-) diff --git a/examples/config.yml b/examples/config.yml index 6ea0ee1132..f426e98547 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -22,6 +22,7 @@ server: dispatchedMonitorIntervalSeconds: 1 runOperationQueuer: true ensureOutputsPresent: false + runFailsafeOperation: true maxCpu: 0 maxRequeueAttempts: 5 useDenyList: true @@ -70,8 +71,6 @@ backplane: operationChannelPrefix: "OperationChannel" casPrefix: "ContentAddressableStorage" casExpire: 604800 # 1 week - subscribeToBackplane: true - runFailsafeOperation: true maxQueueDepth: 100000 maxPreQueueDepth: 1000000 priorityQueue: false diff --git a/src/main/java/build/buildfarm/common/config/Backplane.java b/src/main/java/build/buildfarm/common/config/Backplane.java index 9dd28c3d22..5c21532ab4 100644 --- a/src/main/java/build/buildfarm/common/config/Backplane.java +++ b/src/main/java/build/buildfarm/common/config/Backplane.java @@ -1,7 +1,9 @@ package build.buildfarm.common.config; import com.google.common.base.Strings; +import lombok.AccessLevel; import lombok.Data; +import lombok.Getter; @Data public class Backplane { @@ -32,8 +34,13 @@ public enum BACKPLANE_TYPE { private String operationChannelPrefix = "OperationChannel"; private String casPrefix = "ContentAddressableStorage"; private int casExpire = 604800; // 1 Week - private boolean subscribeToBackplane = true; - private boolean runFailsafeOperation = true; + + @Getter(AccessLevel.NONE) + private boolean subscribeToBackplane = true; // deprecated + + @Getter(AccessLevel.NONE) + private boolean runFailsafeOperation = true; // deprecated + private int maxQueueDepth = 100000; private int maxPreQueueDepth = 1000000; private boolean priorityQueue = false; diff --git a/src/main/java/build/buildfarm/common/config/Server.java b/src/main/java/build/buildfarm/common/config/Server.java index e169c2575b..9f2899ff60 100644 --- a/src/main/java/build/buildfarm/common/config/Server.java +++ b/src/main/java/build/buildfarm/common/config/Server.java @@ -24,6 +24,7 @@ public enum INSTANCE_TYPE { private String sslPrivateKeyPath = null; private boolean runDispatchedMonitor = true; private int dispatchedMonitorIntervalSeconds = 1; + private boolean runFailsafeOperation = true; private boolean runOperationQueuer = true; private boolean ensureOutputsPresent = false; private int maxRequeueAttempts = 5; diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 6676accdf3..ebb832f5aa 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -129,6 +129,8 @@ public class RedisShardBackplane implements Backplane { .build()); private final String source; // used in operation change publication + private final boolean subscribeToBackplane; + private final boolean runFailsafeOperation; private final Function onPublish; private final Function onComplete; private final Supplier jedisClusterFactory; @@ -149,18 +151,30 @@ public class RedisShardBackplane implements Backplane { public RedisShardBackplane( String source, + boolean subscribeToBackplane, + boolean runFailsafeOperation, Function onPublish, Function onComplete) throws ConfigurationException { - this(source, onPublish, onComplete, JedisClusterFactory.create(source)); + this( + source, + subscribeToBackplane, + runFailsafeOperation, + onPublish, + onComplete, + JedisClusterFactory.create(source)); } public RedisShardBackplane( String source, + boolean subscribeToBackplane, + boolean runFailsafeOperation, Function onPublish, Function onComplete, Supplier jedisClusterFactory) { this.source = source; + this.subscribeToBackplane = subscribeToBackplane; + this.runFailsafeOperation = runFailsafeOperation; this.onPublish = onPublish; this.onComplete = onComplete; this.jedisClusterFactory = jedisClusterFactory; @@ -519,10 +533,10 @@ public void start(String clientPublicName) throws IOException { // Create containers that make up the backplane state = DistributedStateCreator.create(client); - if (configs.getBackplane().isSubscribeToBackplane()) { + if (subscribeToBackplane) { startSubscriptionThread(); } - if (configs.getBackplane().isRunFailsafeOperation()) { + if (runFailsafeOperation) { startFailsafeOperationThread(); } diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index bf0c42a8c5..c1c07b08f0 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -254,7 +254,11 @@ public class ShardInstance extends AbstractServerInstance { private static Backplane createBackplane(String identifier) throws ConfigurationException { if (configs.getBackplane().getType().equals(SHARD)) { return new RedisShardBackplane( - identifier, ShardInstance::stripOperation, ShardInstance::stripQueuedOperation); + identifier, + /* subscribeToBackplane=*/ true, + configs.getServer().isRunFailsafeOperation(), + ShardInstance::stripOperation, + ShardInstance::stripQueuedOperation); } else { throw new IllegalArgumentException("Shard Backplane not set in config"); } diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index a5affbbaec..9a919d9703 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -546,7 +546,12 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep if (SHARD.equals(configs.getBackplane().getType())) { backplane = - new RedisShardBackplane(identifier, this::stripOperation, this::stripQueuedOperation); + new RedisShardBackplane( + identifier, + /* subscribeToBackplane=*/ false, + /* runFailsafeOperation=*/ false, + this::stripOperation, + this::stripQueuedOperation); backplane.start(configs.getWorker().getPublicName()); } else { throw new IllegalArgumentException("Shard Backplane not set in config"); diff --git a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java index 97d8fb5d0f..16e5bb8fbc 100644 --- a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java +++ b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java @@ -58,7 +58,6 @@ @RunWith(JUnit4.class) public class RedisShardBackplaneTest { - private RedisShardBackplane backplane; private BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); @Mock Supplier mockJedisClusterFactory; @@ -66,12 +65,20 @@ public class RedisShardBackplaneTest { @Before public void setUp() throws IOException { configs.getBackplane().setOperationExpire(10); - configs.getBackplane().setSubscribeToBackplane(false); - configs.getBackplane().setRunFailsafeOperation(false); configs.getBackplane().setQueues(new Queue[] {}); MockitoAnnotations.initMocks(this); } + public RedisShardBackplane createBackplane(String name) { + return new RedisShardBackplane( + name, + /* subscribeToBackplane=*/ false, + /* runFailsafeOperation=*/ false, + o -> o, + o -> o, + mockJedisClusterFactory); + } + @Test public void workersWithInvalidProtobufAreRemoved() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); @@ -80,9 +87,7 @@ public void workersWithInvalidProtobufAreRemoved() throws IOException { .thenReturn(ImmutableMap.of("foo", "foo")); when(jedisCluster.hdel(configs.getBackplane().getWorkersHashName() + "_storage", "foo")) .thenReturn(1L); - backplane = - new RedisShardBackplane( - "invalid-protobuf-worker-removed-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("invalid-protobuf-worker-removed-test"); backplane.start("startTime/test:0000"); assertThat(backplane.getStorageWorkers()).isEmpty(); @@ -99,12 +104,10 @@ public void workersWithInvalidProtobufAreRemoved() throws IOException { assertThat(workerChange.getTypeCase()).isEqualTo(WorkerChange.TypeCase.REMOVE); } - void verifyChangePublished(JedisCluster jedis) throws IOException { + OperationChange verifyChangePublished(String channel, JedisCluster jedis) throws IOException { ArgumentCaptor changeCaptor = ArgumentCaptor.forClass(String.class); - verify(jedis, times(1)).publish(eq(backplane.operationChannel("op")), changeCaptor.capture()); - OperationChange opChange = parseOperationChange(changeCaptor.getValue()); - assertThat(opChange.hasReset()).isTrue(); - assertThat(opChange.getReset().getOperation().getName()).isEqualTo("op"); + verify(jedis, times(1)).publish(eq(channel), changeCaptor.capture()); + return parseOperationChange(changeCaptor.getValue()); } String operationName(String name) { @@ -115,9 +118,7 @@ String operationName(String name) { public void prequeueUpdatesOperationPrequeuesAndPublishes() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "prequeue-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("prequeue-operation-test"); backplane.start("startTime/test:0000"); final String opName = "op"; @@ -135,32 +136,34 @@ public void prequeueUpdatesOperationPrequeuesAndPublishes() throws IOException { .lpush( configs.getBackplane().getPreQueuedOperationsListName(), JsonFormat.printer().print(executeEntry)); - verifyChangePublished(jedisCluster); + OperationChange opChange = + verifyChangePublished(backplane.operationChannel(opName), jedisCluster); + assertThat(opChange.hasReset()).isTrue(); + assertThat(opChange.getReset().getOperation().getName()).isEqualTo(opName); } @Test public void queuingPublishes() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "requeue-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("requeue-operation-test"); backplane.start("startTime/test:0000"); final String opName = "op"; backplane.queueing(opName); verify(mockJedisClusterFactory, times(1)).get(); - verifyChangePublished(jedisCluster); + OperationChange opChange = + verifyChangePublished(backplane.operationChannel(opName), jedisCluster); + assertThat(opChange.hasReset()).isTrue(); + assertThat(opChange.getReset().getOperation().getName()).isEqualTo(opName); } @Test public void requeueDispatchedOperationQueuesAndPublishes() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "requeue-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("requeue-operation-test"); backplane.start("startTime/test:0000"); final String opName = "op"; @@ -180,7 +183,10 @@ public void requeueDispatchedOperationQueuesAndPublishes() throws IOException { .lpush( configs.getBackplane().getQueuedOperationsListName(), JsonFormat.printer().print(queueEntry)); - verifyChangePublished(jedisCluster); + OperationChange opChange = + verifyChangePublished(backplane.operationChannel(opName), jedisCluster); + assertThat(opChange.hasReset()).isTrue(); + assertThat(opChange.getReset().getOperation().getName()).isEqualTo(opName); } @Test @@ -194,9 +200,7 @@ public void dispatchedOperationsShowProperRequeueAmount0to1() // create a backplane JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "requeue-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("requeue-operation-test"); backplane.start("startTime/test:0000"); // ARRANGE @@ -250,9 +254,7 @@ public void dispatchedOperationsShowProperRequeueAmount1to2() // create a backplane JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "requeue-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("requeue-operation-test"); backplane.start("startTime/test:0000"); // Assume the operation queue is already populated from a first re-queue. @@ -298,9 +300,7 @@ public void dispatchedOperationsShowProperRequeueAmount1to2() public void completeOperationUndispatches() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "complete-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("complete-operation-test"); backplane.start("startTime/test:0000"); final String opName = "op"; @@ -317,9 +317,7 @@ public void completeOperationUndispatches() throws IOException { public void deleteOperationDeletesAndPublishes() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "delete-operation-test", (o) -> o, (o) -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("delete-operation-test"); backplane.start("startTime/test:0000"); final String opName = "op"; @@ -330,7 +328,10 @@ public void deleteOperationDeletesAndPublishes() throws IOException { verify(jedisCluster, times(1)) .hdel(configs.getBackplane().getDispatchedOperationsHashName(), opName); verify(jedisCluster, times(1)).del(operationName(opName)); - verifyChangePublished(jedisCluster); + OperationChange opChange = + verifyChangePublished(backplane.operationChannel(opName), jedisCluster); + assertThat(opChange.hasReset()).isTrue(); + assertThat(opChange.getReset().getOperation().getName()).isEqualTo(opName); } @Test @@ -341,9 +342,7 @@ public void invocationsCanBeBlacklisted() throws IOException { configs.getBackplane().getInvocationBlacklistPrefix() + ":" + toolInvocationId; when(jedisCluster.exists(invocationBlacklistKey)).thenReturn(true); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane( - "invocation-blacklist-test", o -> o, o -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("invocation-blacklist-test"); backplane.start("startTime/test:0000"); assertThat( @@ -361,8 +360,7 @@ public void invocationsCanBeBlacklisted() throws IOException { public void testGetWorkersStartTime() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane("workers-starttime-test", o -> o, o -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("workers-starttime-test"); backplane.start("startTime/test:0000"); Set workerNames = ImmutableSet.of("worker1", "worker2", "missing_worker"); @@ -386,8 +384,7 @@ public void testGetWorkersStartTime() throws IOException { public void getDigestInsertTime() throws IOException { JedisCluster jedisCluster = mock(JedisCluster.class); when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); - backplane = - new RedisShardBackplane("digest-inserttime-test", o -> o, o -> o, mockJedisClusterFactory); + RedisShardBackplane backplane = createBackplane("digest-inserttime-test"); backplane.start("startTime/test:0000"); long ttl = 3600L; long expirationInSecs = configs.getBackplane().getCasExpire(); From b21ab2e93a56c74c8071133d4d68675c3527c1b3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 28 Sep 2023 16:08:23 -0400 Subject: [PATCH 068/214] Removing AWS/GCP Metrics and Admin controls Internally driven metrics and scaling controls have low, if any, usage rates. Prometheus has largely succeeded independent publication of metrics, and externally driven scaling is the norm. These modules have been incomplete between cloud providers, and for the functional side of AWS, bind us to springboot. Removing them for the sake of reduced dependencies and complexity. --- defs.bzl | 5 - .../java/build/buildfarm/admin/Admin.java | 36 --- src/main/java/build/buildfarm/admin/BUILD | 15 -- .../build/buildfarm/admin/aws/AwsAdmin.java | 243 ----------------- src/main/java/build/buildfarm/admin/aws/BUILD | 29 -- src/main/java/build/buildfarm/admin/gcp/BUILD | 18 -- .../build/buildfarm/admin/gcp/GcpAdmin.java | 57 ---- .../buildfarm/common/config/Metrics.java | 6 +- .../metrics/aws/AwsMetricsPublisher.java | 151 ----------- .../java/build/buildfarm/metrics/aws/BUILD | 22 -- .../java/build/buildfarm/metrics/gcp/BUILD | 16 -- .../metrics/gcp/GcpMetricsPublisher.java | 31 --- .../buildfarm/server/BuildFarmServer.java | 2 - .../server/services/AdminService.java | 254 ------------------ .../build/buildfarm/server/services/BUILD | 5 - .../server/services/ExecutionService.java | 11 +- .../java/build/buildfarm/worker/shard/BUILD | 2 - src/test/java/build/buildfarm/metrics/BUILD | 4 - .../metrics/MetricsPublisherTest.java | 11 +- 19 files changed, 11 insertions(+), 907 deletions(-) delete mode 100644 src/main/java/build/buildfarm/admin/Admin.java delete mode 100644 src/main/java/build/buildfarm/admin/BUILD delete mode 100644 src/main/java/build/buildfarm/admin/aws/AwsAdmin.java delete mode 100644 src/main/java/build/buildfarm/admin/aws/BUILD delete mode 100644 src/main/java/build/buildfarm/admin/gcp/BUILD delete mode 100644 src/main/java/build/buildfarm/admin/gcp/GcpAdmin.java delete mode 100644 src/main/java/build/buildfarm/metrics/aws/AwsMetricsPublisher.java delete mode 100644 src/main/java/build/buildfarm/metrics/aws/BUILD delete mode 100644 src/main/java/build/buildfarm/metrics/gcp/BUILD delete mode 100644 src/main/java/build/buildfarm/metrics/gcp/GcpMetricsPublisher.java delete mode 100644 src/main/java/build/buildfarm/server/services/AdminService.java diff --git a/defs.bzl b/defs.bzl index 5108852adb..993e9d36f4 100644 --- a/defs.bzl +++ b/defs.bzl @@ -43,12 +43,7 @@ IO_GRPC_MODULES = [ ] COM_AWS_MODULES = [ - "autoscaling", - "core", - "ec2", "secretsmanager", - "sns", - "ssm", "s3", ] diff --git a/src/main/java/build/buildfarm/admin/Admin.java b/src/main/java/build/buildfarm/admin/Admin.java deleted file mode 100644 index ca739f2347..0000000000 --- a/src/main/java/build/buildfarm/admin/Admin.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.admin; - -import build.buildfarm.v1test.GetHostsResult; - -public interface Admin { - void terminateHost(String hostId); - - void stopContainer(String hostId, String containerName); - - GetHostsResult getHosts(String filter, int ageInMinutes, String status); - - void scaleCluster( - String scaleGroupName, - Integer minHosts, - Integer maxHosts, - Integer targetHosts, - Integer targetReservedHostsPercent); - - void disableHostScaleInProtection(String instanceName); - - void disableHostScaleInProtection(String clusterEndpoint, String instanceIp); -} diff --git a/src/main/java/build/buildfarm/admin/BUILD b/src/main/java/build/buildfarm/admin/BUILD deleted file mode 100644 index a5e481399e..0000000000 --- a/src/main/java/build/buildfarm/admin/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -java_library( - name = "admin", - srcs = glob(["*.java"]), - visibility = ["//visibility:public"], - deps = [ - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_status_java_proto", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java", - "@maven//:com_google_protobuf_protobuf_java_util", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java b/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java deleted file mode 100644 index f40dd72c95..0000000000 --- a/src/main/java/build/buildfarm/admin/aws/AwsAdmin.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.admin.aws; - -import static build.buildfarm.common.grpc.Channels.createChannel; - -import build.buildfarm.admin.Admin; -import build.buildfarm.common.config.BuildfarmConfigs; -import build.buildfarm.v1test.AdminGrpc; -import build.buildfarm.v1test.DisableScaleInProtectionRequest; -import build.buildfarm.v1test.GetHostsResult; -import build.buildfarm.v1test.Host; -import com.amazonaws.services.autoscaling.AmazonAutoScaling; -import com.amazonaws.services.autoscaling.AmazonAutoScalingClientBuilder; -import com.amazonaws.services.autoscaling.model.InstancesDistribution; -import com.amazonaws.services.autoscaling.model.MixedInstancesPolicy; -import com.amazonaws.services.autoscaling.model.SetInstanceProtectionRequest; -import com.amazonaws.services.autoscaling.model.SetInstanceProtectionResult; -import com.amazonaws.services.autoscaling.model.UpdateAutoScalingGroupRequest; -import com.amazonaws.services.ec2.AmazonEC2; -import com.amazonaws.services.ec2.AmazonEC2ClientBuilder; -import com.amazonaws.services.ec2.model.DescribeInstancesRequest; -import com.amazonaws.services.ec2.model.DescribeInstancesResult; -import com.amazonaws.services.ec2.model.Filter; -import com.amazonaws.services.ec2.model.Instance; -import com.amazonaws.services.ec2.model.Reservation; -import com.amazonaws.services.ec2.model.Tag; -import com.amazonaws.services.ec2.model.TerminateInstancesRequest; -import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement; -import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClientBuilder; -import com.amazonaws.services.simplesystemsmanagement.model.SendCommandRequest; -import com.google.protobuf.util.Timestamps; -import io.grpc.ManagedChannel; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; -import java.util.logging.Level; -import lombok.extern.java.Log; -import org.springframework.stereotype.Component; - -@Log -@Component -public class AwsAdmin implements Admin { - private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - private AmazonAutoScaling scale; - private AmazonEC2 ec2; - private AWSSimpleSystemsManagement ssm; - - public AwsAdmin() { - String region = configs.getServer().getCloudRegion(); - if (region != null) { - scale = AmazonAutoScalingClientBuilder.standard().withRegion(region).build(); - ec2 = AmazonEC2ClientBuilder.standard().withRegion(region).build(); - ssm = AWSSimpleSystemsManagementClientBuilder.standard().withRegion(region).build(); - } else { - log.warning("Missing cloudRegion configuration. AWS Admin will not be enabled."); - } - } - - @Override - public void terminateHost(String hostId) { - ec2.terminateInstances(new TerminateInstancesRequest().withInstanceIds(hostId)); - log.log(Level.INFO, String.format("Terminated host: %s", hostId)); - } - - @Override - public void stopContainer(String hostId, String containerName) { - String stopContainerCmd = - "docker ps | grep " + containerName + " | awk '{print $1 }' | xargs -I {} docker stop {}"; - Map> parameters = new HashMap<>(); - parameters.put("commands", Collections.singletonList(stopContainerCmd)); - ssm.sendCommand( - new SendCommandRequest() - .withDocumentName("AWS-RunShellScript") - .withInstanceIds(hostId) - .withParameters(parameters)); - log.log(Level.INFO, String.format("Stopped container: %s on host: %s", containerName, hostId)); - } - - @Override - public GetHostsResult getHosts(String filter, int ageInMinutes, String status) { - GetHostsResult.Builder resultBuilder = GetHostsResult.newBuilder(); - List hosts = new ArrayList<>(); - DescribeInstancesResult instancesResult = - ec2.describeInstances( - new DescribeInstancesRequest() - .withFilters(new Filter().withName("tag-value").withValues(filter))); - long hostNum = 1L; - for (Reservation r : instancesResult.getReservations()) { - for (Instance e : r.getInstances()) { - long uptime = getHostUptimeInMinutes(e.getLaunchTime()); - if (e.getPrivateIpAddress() != null - && uptime > ageInMinutes - && status.equalsIgnoreCase(e.getState().getName())) { - Host.Builder hostBuilder = Host.newBuilder(); - hostBuilder.setHostNum(hostNum++); - hostBuilder.setDnsName(e.getPrivateDnsName()); - hostBuilder.setHostId(e.getInstanceId()); - hostBuilder.setIpAddress(e.getPrivateIpAddress()); - hostBuilder.setLaunchTime(Timestamps.fromMillis(e.getLaunchTime().getTime())); - hostBuilder.setLifecycle( - e.getInstanceLifecycle() != null ? e.getInstanceLifecycle() : "on demand"); - hostBuilder.setNumCores(e.getCpuOptions().getCoreCount()); - hostBuilder.setState(e.getState().getName()); - hostBuilder.setType(e.getInstanceType()); - hostBuilder.setUptimeMinutes(uptime); - hosts.add(hostBuilder.build()); - } - } - } - resultBuilder.addAllHosts(hosts); - resultBuilder.setNumHosts(hosts.size()); - log.log(Level.FINER, String.format("Got %d hosts for filter: %s", hosts.size(), filter)); - return resultBuilder.build(); - } - - @Override - public void scaleCluster( - String scaleGroupName, - Integer minHosts, - Integer maxHosts, - Integer targetHosts, - Integer targetReservedHostsPercent) { - UpdateAutoScalingGroupRequest request = - new UpdateAutoScalingGroupRequest().withAutoScalingGroupName(scaleGroupName); - if (minHosts != null) { - request.setMinSize(minHosts); - } - if (maxHosts != null) { - request.setMaxSize(maxHosts); - } - if (targetHosts != null) { - request.setMaxSize(targetHosts); - } - if (targetReservedHostsPercent != null) { - request.setMixedInstancesPolicy( - new MixedInstancesPolicy() - .withInstancesDistribution( - new InstancesDistribution() - .withOnDemandPercentageAboveBaseCapacity(targetReservedHostsPercent))); - } - scale.updateAutoScalingGroup(request); - log.log(Level.INFO, String.format("Scaled: %s", scaleGroupName)); - } - - private long getHostUptimeInMinutes(Date launchTime) { - Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - return (cal.getTime().getTime() - launchTime.getTime()) / 60000; - } - - /** - * Disable instance scale in protection so that auto scaler can shutdown the instance. - * - * @param privateDnsName the private Dns name of instance (i.e. ip-xx-xxx-xx-xx.ec2.internal) - */ - @Override - public void disableHostScaleInProtection(String privateDnsName) { - // 1 get AutoScalingGroup and InstanceId - Instance workerInstance = getInstanceId(privateDnsName); - if (workerInstance == null) { - String errorMessage = "Cannot find instance with private DNS name " + privateDnsName; - log.log(Level.SEVERE, errorMessage); - throw new RuntimeException(errorMessage); - } - String instanceId = workerInstance.getInstanceId(); - String autoScalingGroup = getTagValue(workerInstance.getTags()); - if (autoScalingGroup == null || autoScalingGroup.length() == 0) { - String errorMessage = - "Cannot find AutoScalingGroup name of worker with private DNS name " + privateDnsName; - log.log(Level.SEVERE, errorMessage); - throw new RuntimeException(errorMessage); - } - - // 2 disable scale in protection of the worker - SetInstanceProtectionRequest disableProtectionRequest = - new SetInstanceProtectionRequest() - .withInstanceIds(instanceId) - .withAutoScalingGroupName(autoScalingGroup) - .withProtectedFromScaleIn(false); - SetInstanceProtectionResult result = scale.setInstanceProtection(disableProtectionRequest); - log.log( - Level.INFO, - String.format( - "Disable protection of host: %s in AutoScalingGroup: %s and get result: %s", - instanceId, autoScalingGroup, result.toString())); - } - - @Override - public void disableHostScaleInProtection(String clusterEndpoint, String instanceIp) { - ManagedChannel channel = null; - try { - channel = createChannel(clusterEndpoint); - AdminGrpc.AdminBlockingStub adminBlockingStub = AdminGrpc.newBlockingStub(channel); - adminBlockingStub.disableScaleInProtection( - DisableScaleInProtectionRequest.newBuilder().setInstanceName(instanceIp).build()); - } finally { - if (channel != null) { - channel.shutdown(); - } - } - } - - private String getTagValue(List tags) { - for (Tag tag : tags) { - if ("aws:autoscaling:groupName".equalsIgnoreCase(tag.getKey())) { - return tag.getValue(); - } - } - return null; - } - - private Instance getInstanceId(String privateDnsName) { - DescribeInstancesRequest describeInstancesRequest = - new DescribeInstancesRequest() - .withFilters(new Filter().withName("private-dns-name").withValues(privateDnsName)); - DescribeInstancesResult instancesResult = ec2.describeInstances(describeInstancesRequest); - for (Reservation r : instancesResult.getReservations()) { - for (Instance e : r.getInstances()) { - if (e.getPrivateDnsName() != null && e.getPrivateDnsName().equals(privateDnsName)) { - return e; - } - } - } - return null; - } -} diff --git a/src/main/java/build/buildfarm/admin/aws/BUILD b/src/main/java/build/buildfarm/admin/aws/BUILD deleted file mode 100644 index a49e431bfd..0000000000 --- a/src/main/java/build/buildfarm/admin/aws/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -java_library( - name = "aws", - srcs = glob(["*.java"]), - plugins = ["//src/main/java/build/buildfarm/common:lombok"], - visibility = ["//visibility:public"], - deps = [ - "//src/main/java/build/buildfarm/admin", - "//src/main/java/build/buildfarm/common/config", - "//src/main/java/build/buildfarm/common/grpc", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_status_java_proto", - "@maven//:com_amazonaws_aws_java_sdk_autoscaling", - "@maven//:com_amazonaws_aws_java_sdk_core", - "@maven//:com_amazonaws_aws_java_sdk_ec2", - "@maven//:com_amazonaws_aws_java_sdk_secretsmanager", - "@maven//:com_amazonaws_aws_java_sdk_ssm", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java_util", - "@maven//:io_grpc_grpc_api", - "@maven//:org_projectlombok_lombok", - "@maven//:org_springframework_spring_beans", - "@maven//:org_springframework_spring_context", - "@maven//:org_springframework_spring_core", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/admin/gcp/BUILD b/src/main/java/build/buildfarm/admin/gcp/BUILD deleted file mode 100644 index 3d94b91f3f..0000000000 --- a/src/main/java/build/buildfarm/admin/gcp/BUILD +++ /dev/null @@ -1,18 +0,0 @@ -java_library( - name = "gcp", - srcs = glob(["*.java"]), - visibility = ["//visibility:public"], - deps = [ - "//src/main/java/build/buildfarm/admin", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_status_java_proto", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java_util", - "@maven//:org_springframework_spring_beans", - "@maven//:org_springframework_spring_context", - "@maven//:org_springframework_spring_core", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/admin/gcp/GcpAdmin.java b/src/main/java/build/buildfarm/admin/gcp/GcpAdmin.java deleted file mode 100644 index 34ee9a0163..0000000000 --- a/src/main/java/build/buildfarm/admin/gcp/GcpAdmin.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.admin.gcp; - -import build.buildfarm.admin.Admin; -import build.buildfarm.v1test.GetHostsResult; -import org.springframework.stereotype.Component; - -@Component -public class GcpAdmin implements Admin { - @Override - public void terminateHost(String hostId) { - throw new UnsupportedOperationException("Not Implemented."); - } - - @Override - public void stopContainer(String hostId, String containerName) { - throw new UnsupportedOperationException("Not Implemented."); - } - - @Override - public GetHostsResult getHosts(String filter, int ageInMinutes, String status) { - throw new UnsupportedOperationException("Not Implemented."); - } - - @Override - public void scaleCluster( - String scaleGroupName, - Integer minHosts, - Integer maxHosts, - Integer targetHosts, - Integer targetReservedHostsPercent) { - throw new UnsupportedOperationException("Not Implemented."); - } - - @Override - public void disableHostScaleInProtection(String instanceName) { - throw new UnsupportedOperationException("Not Implemented."); - } - - @Override - public void disableHostScaleInProtection(String clusterEndpoint, String instanceIp) { - throw new UnsupportedOperationException("Not Implemented"); - } -} diff --git a/src/main/java/build/buildfarm/common/config/Metrics.java b/src/main/java/build/buildfarm/common/config/Metrics.java index 73a9113d7a..28e065ddbf 100644 --- a/src/main/java/build/buildfarm/common/config/Metrics.java +++ b/src/main/java/build/buildfarm/common/config/Metrics.java @@ -1,6 +1,8 @@ package build.buildfarm.common.config; +import lombok.AccessLevel; import lombok.Data; +import lombok.Getter; @Data public class Metrics { @@ -19,7 +21,9 @@ public enum LOG_LEVEL { FINEST, } - private PUBLISHER publisher = PUBLISHER.LOG; + @Getter(AccessLevel.NONE) + private PUBLISHER publisher = PUBLISHER.LOG; // deprecated + private LOG_LEVEL logLevel = LOG_LEVEL.FINEST; private String topic; private int topicMaxConnections; diff --git a/src/main/java/build/buildfarm/metrics/aws/AwsMetricsPublisher.java b/src/main/java/build/buildfarm/metrics/aws/AwsMetricsPublisher.java deleted file mode 100644 index e0ae2785e0..0000000000 --- a/src/main/java/build/buildfarm/metrics/aws/AwsMetricsPublisher.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.metrics.aws; - -import build.bazel.remote.execution.v2.RequestMetadata; -import build.buildfarm.common.config.BuildfarmConfigs; -import build.buildfarm.metrics.AbstractMetricsPublisher; -import com.amazonaws.ClientConfiguration; -import com.amazonaws.auth.AWSCredentials; -import com.amazonaws.auth.AWSStaticCredentialsProvider; -import com.amazonaws.handlers.AsyncHandler; -import com.amazonaws.services.secretsmanager.AWSSecretsManager; -import com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder; -import com.amazonaws.services.secretsmanager.model.GetSecretValueRequest; -import com.amazonaws.services.secretsmanager.model.GetSecretValueResult; -import com.amazonaws.services.sns.AmazonSNSAsync; -import com.amazonaws.services.sns.AmazonSNSAsyncClientBuilder; -import com.amazonaws.services.sns.model.PublishRequest; -import com.amazonaws.services.sns.model.PublishResult; -import com.amazonaws.util.StringUtils; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.Base64; -import java.util.HashMap; -import java.util.logging.Level; -import lombok.extern.java.Log; - -@Log -public class AwsMetricsPublisher extends AbstractMetricsPublisher { - private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - private static AmazonSNSAsync snsClient; - - private final String snsTopicOperations; - private String accessKeyId = null; - private String secretKey = null; - private final String region; - private final int snsClientMaxConnections; - - public AwsMetricsPublisher() { - super(configs.getServer().getClusterId()); - snsTopicOperations = configs.getServer().getMetrics().getTopic(); - region = configs.getServer().getCloudRegion(); - getAwsSecret(configs.getServer().getMetrics().getSecretName()); - snsClientMaxConnections = configs.getServer().getMetrics().getTopicMaxConnections(); - if (!StringUtils.isNullOrEmpty(snsTopicOperations) - && snsClientMaxConnections > 0 - && !StringUtils.isNullOrEmpty(accessKeyId) - && !StringUtils.isNullOrEmpty(secretKey) - && !StringUtils.isNullOrEmpty(region)) { - snsClient = initSnsClient(); - } - } - - @Override - public void publishRequestMetadata(Operation operation, RequestMetadata requestMetadata) { - try { - if (snsClient != null) { - snsClient.publishAsync( - new PublishRequest( - snsTopicOperations, - formatRequestMetadataToJson(populateRequestMetadata(operation, requestMetadata))), - new AsyncHandler() { - @Override - public void onError(Exception e) { - log.log(Level.WARNING, "Could not publish metrics data to SNS.", e); - } - - @Override - public void onSuccess(PublishRequest request, PublishResult publishResult) {} - }); - } - } catch (Exception e) { - log.log( - Level.WARNING, - String.format("Could not publish request metadata to SNS for %s.", operation.getName()), - e); - } - } - - private AmazonSNSAsync initSnsClient() { - log.log(Level.INFO, "Initializing SNS Client."); - return AmazonSNSAsyncClientBuilder.standard() - .withRegion(region) - .withClientConfiguration( - new ClientConfiguration().withMaxConnections(snsClientMaxConnections)) - .withCredentials( - new AWSStaticCredentialsProvider( - new AWSCredentials() { - @Override - public String getAWSAccessKeyId() { - return accessKeyId; - } - - @Override - public String getAWSSecretKey() { - return secretKey; - } - })) - .build(); - } - - @Override - public void publishMetric(String metricName, Object metricValue) { - throw new UnsupportedOperationException(); - } - - @SuppressWarnings("unchecked") - private void getAwsSecret(String secretName) { - AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard().withRegion(region).build(); - GetSecretValueRequest getSecretValueRequest = - new GetSecretValueRequest().withSecretId(secretName); - GetSecretValueResult getSecretValueResult; - try { - getSecretValueResult = client.getSecretValue(getSecretValueRequest); - } catch (Exception e) { - log.log(Level.SEVERE, String.format("Could not get secret %s from AWS.", secretName)); - return; - } - String secret; - if (getSecretValueResult.getSecretString() != null) { - secret = getSecretValueResult.getSecretString(); - } else { - secret = - new String(Base64.getDecoder().decode(getSecretValueResult.getSecretBinary()).array()); - } - - if (secret != null) { - try { - final ObjectMapper objectMapper = new ObjectMapper(); - final HashMap secretMap = objectMapper.readValue(secret, HashMap.class); - accessKeyId = secretMap.get("access_key"); - secretKey = secretMap.get("secret_key"); - } catch (IOException e) { - log.log(Level.SEVERE, String.format("Could not parse secret %s from AWS", secretName)); - } - } - } -} diff --git a/src/main/java/build/buildfarm/metrics/aws/BUILD b/src/main/java/build/buildfarm/metrics/aws/BUILD deleted file mode 100644 index 51d44ea8c9..0000000000 --- a/src/main/java/build/buildfarm/metrics/aws/BUILD +++ /dev/null @@ -1,22 +0,0 @@ -java_library( - name = "aws", - srcs = glob(["*.java"]), - plugins = ["//src/main/java/build/buildfarm/common:lombok"], - visibility = ["//visibility:public"], - deps = [ - "//src/main/java/build/buildfarm/common/config", - "//src/main/java/build/buildfarm/metrics", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_status_java_proto", - "@maven//:com_amazonaws_aws_java_sdk_core", - "@maven//:com_amazonaws_aws_java_sdk_secretsmanager", - "@maven//:com_amazonaws_aws_java_sdk_sns", - "@maven//:com_fasterxml_jackson_core_jackson_databind", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java_util", - "@maven//:org_projectlombok_lombok", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/metrics/gcp/BUILD b/src/main/java/build/buildfarm/metrics/gcp/BUILD deleted file mode 100644 index 765902b905..0000000000 --- a/src/main/java/build/buildfarm/metrics/gcp/BUILD +++ /dev/null @@ -1,16 +0,0 @@ -java_library( - name = "gcp", - srcs = glob(["*.java"]), - visibility = ["//visibility:public"], - deps = [ - "//src/main/java/build/buildfarm/common/config", - "//src/main/java/build/buildfarm/metrics", - "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@googleapis//:google_rpc_code_java_proto", - "@googleapis//:google_rpc_error_details_java_proto", - "@googleapis//:google_rpc_status_java_proto", - "@maven//:com_google_guava_guava", - "@maven//:com_google_protobuf_protobuf_java_util", - "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", - ], -) diff --git a/src/main/java/build/buildfarm/metrics/gcp/GcpMetricsPublisher.java b/src/main/java/build/buildfarm/metrics/gcp/GcpMetricsPublisher.java deleted file mode 100644 index 40a6ddb1f8..0000000000 --- a/src/main/java/build/buildfarm/metrics/gcp/GcpMetricsPublisher.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.metrics.gcp; - -import build.buildfarm.common.config.BuildfarmConfigs; -import build.buildfarm.metrics.AbstractMetricsPublisher; - -public class GcpMetricsPublisher extends AbstractMetricsPublisher { - private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - - public GcpMetricsPublisher() { - super(configs.getServer().getClusterId()); - } - - @Override - public void publishMetric(String metricName, Object metricValue) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index e82928e934..4ca669d5f1 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -30,7 +30,6 @@ import build.buildfarm.instance.shard.ShardInstance; import build.buildfarm.metrics.prometheus.PrometheusPublisher; import build.buildfarm.server.services.ActionCacheService; -import build.buildfarm.server.services.AdminService; import build.buildfarm.server.services.CapabilitiesService; import build.buildfarm.server.services.ExecutionService; import build.buildfarm.server.services.FetchService; @@ -122,7 +121,6 @@ public synchronized void start(ServerBuilder serverBuilder, String publicName .addService(new ExecutionService(instance, keepaliveScheduler)) .addService(new OperationQueueService(instance)) .addService(new OperationsService(instance)) - .addService(new AdminService(instance)) .addService(new FetchService(instance)) .addService(ProtoReflectionService.newInstance()) .addService(new PublishBuildEventService()) diff --git a/src/main/java/build/buildfarm/server/services/AdminService.java b/src/main/java/build/buildfarm/server/services/AdminService.java deleted file mode 100644 index 94178fbf27..0000000000 --- a/src/main/java/build/buildfarm/server/services/AdminService.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.server.services; - -import static build.buildfarm.common.grpc.Channels.createChannel; - -import build.buildfarm.admin.Admin; -import build.buildfarm.admin.aws.AwsAdmin; -import build.buildfarm.admin.gcp.GcpAdmin; -import build.buildfarm.common.CasIndexResults; -import build.buildfarm.common.config.BuildfarmConfigs; -import build.buildfarm.instance.Instance; -import build.buildfarm.v1test.AdminGrpc; -import build.buildfarm.v1test.DisableScaleInProtectionRequest; -import build.buildfarm.v1test.DisableScaleInProtectionRequestResults; -import build.buildfarm.v1test.GetClientStartTimeRequest; -import build.buildfarm.v1test.GetClientStartTimeResult; -import build.buildfarm.v1test.GetHostsRequest; -import build.buildfarm.v1test.GetHostsResult; -import build.buildfarm.v1test.PrepareWorkerForGracefulShutDownRequest; -import build.buildfarm.v1test.ReindexCasRequest; -import build.buildfarm.v1test.ReindexCasRequestResults; -import build.buildfarm.v1test.ScaleClusterRequest; -import build.buildfarm.v1test.ShutDownWorkerGracefullyRequest; -import build.buildfarm.v1test.ShutDownWorkerGracefullyRequestResults; -import build.buildfarm.v1test.ShutDownWorkerGrpc; -import build.buildfarm.v1test.StopContainerRequest; -import build.buildfarm.v1test.TerminateHostRequest; -import com.google.rpc.Code; -import com.google.rpc.Status; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import java.util.logging.Level; -import lombok.extern.java.Log; - -@Log -public class AdminService extends AdminGrpc.AdminImplBase { - private final Admin adminController; - private final Instance instance; - - private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); - - public AdminService(Instance instance) { - this.adminController = getAdminController(); - this.instance = instance; - } - - @Override - public void terminateHost(TerminateHostRequest request, StreamObserver responseObserver) { - try { - if (adminController != null) { - adminController.terminateHost(request.getHostId()); - } - responseObserver.onNext(Status.newBuilder().setCode(Code.OK_VALUE).build()); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log(Level.SEVERE, "Could not terminate host.", e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - @Override - public void stopContainer(StopContainerRequest request, StreamObserver responseObserver) { - try { - if (adminController != null) { - adminController.stopContainer(request.getHostId(), request.getContainerName()); - } - responseObserver.onNext(Status.newBuilder().setCode(Code.OK_VALUE).build()); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log(Level.SEVERE, "Could not stop container.", e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - @Override - public void getHosts(GetHostsRequest request, StreamObserver responseObserver) { - try { - GetHostsResult result = null; - if (adminController != null) { - result = - adminController.getHosts( - request.getFilter(), request.getAgeInMinutes(), request.getStatus()); - } - responseObserver.onNext(result); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log(Level.SEVERE, "Could not get hosts.", e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - @Override - public void getClientStartTime( - GetClientStartTimeRequest request, - StreamObserver responseObserver) { - try { - GetClientStartTimeResult result = instance.getClientStartTime(request); - responseObserver.onNext(result); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log( - Level.SEVERE, - String.format("Could not get client start time for %s.", request.getInstanceName()), - e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - @Override - public void scaleCluster(ScaleClusterRequest request, StreamObserver responseObserver) { - try { - if (adminController != null) { - adminController.scaleCluster( - request.getScaleGroupName(), - request.getMinHosts(), - request.getMaxHosts(), - request.getTargetHosts(), - request.getTargetReservedHostsPercent()); - } - responseObserver.onNext(Status.newBuilder().setCode(Code.OK_VALUE).build()); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log(Level.SEVERE, "Could not scale cluster.", e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - @Override - public void reindexCas( - ReindexCasRequest request, StreamObserver responseObserver) { - try { - CasIndexResults results = instance.reindexCas(); - log.info(String.format("CAS Indexer Results: %s", results.toMessage())); - responseObserver.onNext( - ReindexCasRequestResults.newBuilder() - .setRemovedHosts(results.removedHosts) - .setRemovedKeys(results.removedKeys) - .setTotalKeys(results.totalKeys) - .build()); - responseObserver.onCompleted(); - } catch (Exception e) { - log.log(Level.SEVERE, "Could not reindex CAS.", e); - responseObserver.onError(io.grpc.Status.fromThrowable(e).asException()); - } - } - - /** - * Server-side implementation of ShutDownWorkerGracefully. This will reroute the request to target - * worker. - * - * @param request ShutDownWorkerGracefullyRequest received through grpc - * @param responseObserver grpc response observer - */ - @Override - public void shutDownWorkerGracefully( - ShutDownWorkerGracefullyRequest request, - StreamObserver responseObserver) { - try { - informWorkerToPrepareForShutdown(request.getWorkerName()); - responseObserver.onNext(ShutDownWorkerGracefullyRequestResults.newBuilder().build()); - responseObserver.onCompleted(); - } catch (Exception e) { - String errorMessage = - String.format( - "Could not inform the worker %s to prepare for graceful shutdown with error %s.", - request.getWorkerName(), e.getMessage()); - log.log(Level.SEVERE, errorMessage); - responseObserver.onError(new Exception(errorMessage)); - } - } - - /** - * Inform a worker to prepare for graceful shutdown. - * - * @param host the host that should be prepared for shutdown. - */ - @SuppressWarnings("ResultOfMethodCallIgnored") - private void informWorkerToPrepareForShutdown(String host) { - ManagedChannel channel = null; - try { - channel = createChannel(host); - ShutDownWorkerGrpc.ShutDownWorkerBlockingStub shutDownWorkerBlockingStub = - ShutDownWorkerGrpc.newBlockingStub(channel); - shutDownWorkerBlockingStub.prepareWorkerForGracefulShutdown( - PrepareWorkerForGracefulShutDownRequest.newBuilder().build()); - } finally { - if (channel != null) { - channel.shutdown(); - } - } - } - - /** - * Server-side implementation of disableScaleInProtection. - * - * @param request grpc request - * @param responseObserver grpc response observer - */ - @Override - public void disableScaleInProtection( - DisableScaleInProtectionRequest request, - StreamObserver responseObserver) { - try { - String hostPrivateIp = trimHostPrivateDns(request.getInstanceName()); - adminController.disableHostScaleInProtection(hostPrivateIp); - responseObserver.onNext(DisableScaleInProtectionRequestResults.newBuilder().build()); - responseObserver.onCompleted(); - } catch (RuntimeException e) { - responseObserver.onError(e); - } - } - - /** - * The private dns get from worker might be suffixed with ":portNumber", which should be trimmed. - * - * @param hostPrivateIp the private dns should be trimmed. - * @return - */ - @SuppressWarnings("JavaDoc") - private String trimHostPrivateDns(String hostPrivateIp) { - String portSeparator = ":"; - if (hostPrivateIp.contains(portSeparator)) { - hostPrivateIp = hostPrivateIp.split(portSeparator)[0]; - } - return hostPrivateIp; - } - - private static Admin getAdminController() { - if (configs.getServer().getAdmin().getDeploymentEnvironment() == null) { - return null; - } - switch (configs.getServer().getAdmin().getDeploymentEnvironment()) { - default: - return null; - case AWS: - return new AwsAdmin(); - case GCP: - return new GcpAdmin(); - } - } -} diff --git a/src/main/java/build/buildfarm/server/services/BUILD b/src/main/java/build/buildfarm/server/services/BUILD index 54b7af993c..6bb44b94f8 100644 --- a/src/main/java/build/buildfarm/server/services/BUILD +++ b/src/main/java/build/buildfarm/server/services/BUILD @@ -4,17 +4,12 @@ java_library( plugins = ["//src/main/java/build/buildfarm/common:lombok"], visibility = ["//visibility:public"], deps = [ - "//src/main/java/build/buildfarm/admin", - "//src/main/java/build/buildfarm/admin/aws", - "//src/main/java/build/buildfarm/admin/gcp", "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/common/resources:resource_java_proto", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/metrics", - "//src/main/java/build/buildfarm/metrics/aws", - "//src/main/java/build/buildfarm/metrics/gcp", "//src/main/java/build/buildfarm/metrics/log", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", diff --git a/src/main/java/build/buildfarm/server/services/ExecutionService.java b/src/main/java/build/buildfarm/server/services/ExecutionService.java index 7f46c0bb3c..69799524fb 100644 --- a/src/main/java/build/buildfarm/server/services/ExecutionService.java +++ b/src/main/java/build/buildfarm/server/services/ExecutionService.java @@ -28,8 +28,6 @@ import build.buildfarm.common.grpc.TracingMetadataUtils; import build.buildfarm.instance.Instance; import build.buildfarm.metrics.MetricsPublisher; -import build.buildfarm.metrics.aws.AwsMetricsPublisher; -import build.buildfarm.metrics.gcp.GcpMetricsPublisher; import build.buildfarm.metrics.log.LogMetricsPublisher; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.ListenableFuture; @@ -205,13 +203,6 @@ public void execute(ExecuteRequest request, StreamObserver responseOb } private static MetricsPublisher getMetricsPublisher() { - switch (configs.getServer().getMetrics().getPublisher()) { - default: - return new LogMetricsPublisher(); - case AWS: - return new AwsMetricsPublisher(); - case GCP: - return new GcpMetricsPublisher(); - } + return new LogMetricsPublisher(); } } diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index beeaaae918..120365882b 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -4,8 +4,6 @@ java_library( plugins = ["//src/main/java/build/buildfarm/common:lombok"], visibility = ["//visibility:public"], deps = [ - "//src/main/java/build/buildfarm/admin", - "//src/main/java/build/buildfarm/admin/aws", "//src/main/java/build/buildfarm/backplane", "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", diff --git a/src/test/java/build/buildfarm/metrics/BUILD b/src/test/java/build/buildfarm/metrics/BUILD index 8e5d3cace9..c32955e20d 100644 --- a/src/test/java/build/buildfarm/metrics/BUILD +++ b/src/test/java/build/buildfarm/metrics/BUILD @@ -8,14 +8,10 @@ java_test( "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/metrics", - "//src/main/java/build/buildfarm/metrics/aws", "//src/main/java/build/buildfarm/metrics/log", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "//src/test/java/build/buildfarm:test_runner", "@googleapis//:google_rpc_error_details_java_proto", - "@maven//:com_amazonaws_aws_java_sdk_core", - "@maven//:com_amazonaws_aws_java_sdk_secretsmanager", - "@maven//:com_amazonaws_aws_java_sdk_sns", "@maven//:com_google_guava_guava", "@maven//:com_google_jimfs_jimfs", "@maven//:com_google_protobuf_protobuf_java", diff --git a/src/test/java/build/buildfarm/metrics/MetricsPublisherTest.java b/src/test/java/build/buildfarm/metrics/MetricsPublisherTest.java index 21c9685efd..f30adb55c6 100644 --- a/src/test/java/build/buildfarm/metrics/MetricsPublisherTest.java +++ b/src/test/java/build/buildfarm/metrics/MetricsPublisherTest.java @@ -22,7 +22,6 @@ import build.bazel.remote.execution.v2.RequestMetadata; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.config.Metrics; -import build.buildfarm.metrics.aws.AwsMetricsPublisher; import build.buildfarm.metrics.log.LogMetricsPublisher; import build.buildfarm.v1test.OperationRequestMetadata; import com.google.longrunning.Operation; @@ -69,7 +68,7 @@ public class MetricsPublisherTest { public void setUp() throws IOException { configs.getServer().setCloudRegion("test"); configs.getServer().setClusterId("buildfarm-test"); - configs.getServer().getMetrics().setPublisher(Metrics.PUBLISHER.AWS); + configs.getServer().getMetrics().setPublisher(Metrics.PUBLISHER.LOG); } @Test @@ -81,7 +80,7 @@ public void publishCompleteMetricsTest() throws InvalidProtocolBufferException { .setMetadata(Any.pack(defaultExecuteOperationMetadata)) .build(); - AwsMetricsPublisher metricsPublisher = new AwsMetricsPublisher(); + LogMetricsPublisher metricsPublisher = new LogMetricsPublisher(); assertThat( AbstractMetricsPublisher.formatRequestMetadataToJson( metricsPublisher.populateRequestMetadata(operation, defaultRequestMetadata))) @@ -110,7 +109,7 @@ public void publishMetricsWithNoExecuteResponseTest() { Operation operation = defaultOperation.toBuilder().setMetadata(Any.pack(defaultExecuteOperationMetadata)).build(); - assertThat(new AwsMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) + assertThat(new LogMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) .isNotNull(); } @@ -119,7 +118,7 @@ public void publishMetricsWithNoExecuteOperationMetadataTest() { Operation operation = defaultOperation.toBuilder().setResponse(Any.pack(defaultExecuteResponse)).build(); - assertThat(new AwsMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) + assertThat(new LogMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) .isNotNull(); } @@ -135,7 +134,7 @@ public void preconditionFailureTest() { .setMetadata(Any.pack(defaultExecuteOperationMetadata)) .build(); - assertThat(new AwsMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) + assertThat(new LogMetricsPublisher().populateRequestMetadata(operation, defaultRequestMetadata)) .isNotNull(); } From f97f04816119775bcd52a9becd75c405450c52f4 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:00:15 -0400 Subject: [PATCH 069/214] Remove unused setOnCancelHandler Remove this unused OperationQueue feature which provides no invocations on any use. --- .../buildfarm/instance/MatchListener.java | 3 --- .../server/services/OperationQueueService.java | 18 ++---------------- .../build/buildfarm/worker/MatchStage.java | 5 ----- .../worker/shard/ShardWorkerContext.java | 5 ----- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/MatchListener.java b/src/main/java/build/buildfarm/instance/MatchListener.java index 46f6dfc000..3da7df90eb 100644 --- a/src/main/java/build/buildfarm/instance/MatchListener.java +++ b/src/main/java/build/buildfarm/instance/MatchListener.java @@ -27,7 +27,4 @@ public interface MatchListener { boolean onEntry(@Nullable QueueEntry queueEntry) throws InterruptedException; void onError(Throwable t); - - // method that should be called when this match is cancelled and no longer valid - void setOnCancelHandler(Runnable onCancelHandler); } diff --git a/src/main/java/build/buildfarm/server/services/OperationQueueService.java b/src/main/java/build/buildfarm/server/services/OperationQueueService.java index 6d3edb8178..11f6501667 100644 --- a/src/main/java/build/buildfarm/server/services/OperationQueueService.java +++ b/src/main/java/build/buildfarm/server/services/OperationQueueService.java @@ -28,9 +28,7 @@ import com.google.rpc.Code; import io.grpc.Status; import io.grpc.StatusRuntimeException; -import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; -import java.util.function.Consumer; public class OperationQueueService extends OperationQueueGrpc.OperationQueueImplBase { private final Instance instance; @@ -43,14 +41,11 @@ private static class OperationQueueMatchListener implements MatchListener { @SuppressWarnings("rawtypes") private final InterruptingPredicate onMatch; - private final Consumer setOnCancelHandler; private static final QueueEntry queueEntry = null; @SuppressWarnings("rawtypes") - OperationQueueMatchListener( - InterruptingPredicate onMatch, Consumer setOnCancelHandler) { + OperationQueueMatchListener(InterruptingPredicate onMatch) { this.onMatch = onMatch; - this.setOnCancelHandler = setOnCancelHandler; } @Override @@ -70,11 +65,6 @@ public void onError(Throwable t) { Throwables.throwIfUnchecked(t); throw new RuntimeException(t); } - - @Override - public void setOnCancelHandler(Runnable onCancelHandler) { - setOnCancelHandler.accept(onCancelHandler); - } } private InterruptingPredicate createOnMatch( @@ -97,14 +87,10 @@ private InterruptingPredicate createOnMatch( @Override public void take(TakeOperationRequest request, StreamObserver responseObserver) { - ServerCallStreamObserver callObserver = - (ServerCallStreamObserver) responseObserver; - try { instance.match( request.getPlatform(), - new OperationQueueMatchListener( - createOnMatch(instance, responseObserver), callObserver::setOnCancelHandler)); + new OperationQueueMatchListener(createOnMatch(instance, responseObserver))); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } diff --git a/src/main/java/build/buildfarm/worker/MatchStage.java b/src/main/java/build/buildfarm/worker/MatchStage.java index dc81a2ce31..663aee3c52 100644 --- a/src/main/java/build/buildfarm/worker/MatchStage.java +++ b/src/main/java/build/buildfarm/worker/MatchStage.java @@ -95,11 +95,6 @@ public void onError(Throwable t) { throw new RuntimeException(t); } - @Override - public void setOnCancelHandler(Runnable onCancelHandler) { - // never called, only blocking stub used - } - @SuppressWarnings("SameReturnValue") private boolean onOperationPolled() throws InterruptedException { String operationName = operationContext.queueEntry.getExecuteEntry().getOperationName(); diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 143fa09966..9f4ee3a29e 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -350,11 +350,6 @@ public void onError(Throwable t) { Throwables.throwIfUnchecked(t); throw new RuntimeException(t); } - - @Override - public void setOnCancelHandler(Runnable onCancelHandler) { - listener.setOnCancelHandler(onCancelHandler); - } }; while (dedupMatchListener.getMatched()) { try { From c2c15449efddefad5e6bdd11107dbcc1e99f8f7b Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 4 Oct 2023 16:46:57 -0400 Subject: [PATCH 070/214] Update BWoB docs for ensureOutputsPresent --- _site/docs/execution/builds-without-the-bytes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_site/docs/execution/builds-without-the-bytes.md b/_site/docs/execution/builds-without-the-bytes.md index abda8c86b5..5c49025877 100644 --- a/_site/docs/execution/builds-without-the-bytes.md +++ b/_site/docs/execution/builds-without-the-bytes.md @@ -7,7 +7,7 @@ nav_order: 4 # Builds Without The Bytes -tl;dr: add `--build_request_id=https://host?ENSURE_OUTPUTS_PRESENT=true#$(uuidgen)` to your BWOB bazel invocations. +tl;dr: add `--build_request_id=https://host?ENSURE_OUTPUTS_PRESENT=true#$(uuidgen)`, to your BWOB bazel invocations, or enable `ensureOutputsPresent` in your config to set it globally. As proposed in this [issue](https://github.com/bazelbuild/bazel/issues/6862) and the accompanying document, bazel endeavors to provide a mechanism to be 'content-light' for remote execution, using only content reference addresses to request action execution and construct successively dependent action definitions. @@ -17,4 +17,4 @@ This puts BuildFarm in the uncomfortable position of never being able to expire To combat this, you can provide some metadata to buildfarm that will help to limit (but will not remove the possibility of) failed builds. -Bazel presents a 'correlated_invocations_id' on every request to BuildFarm, including the GetActionResult request, which it uses to retrieve cached results. Since ActionResults are the long tail survivor of actions, being retained for much longer after one executes and produces its content, this represents the most likely position where content may have been removed, and a stale reference might be provided. BuildFarm recognizes this correlated_invocations_id and if it is a URI, can parse its query parameters for behavior control. One such control is ENSURE_OUTPUTS_PRESENT for the GetActionResult request - if this query value is the string "true", BuildFarm will make a silent FindMissingBlobs check for all of the outputs of an ActionResult before responding with it. If any are missing, BuildFarm will instead return code NOT_FOUND, inspiring the client to see a cache miss, and attempt a [remote] execution. \ No newline at end of file +Bazel presents a 'correlated_invocations_id' on every request to BuildFarm, including the GetActionResult request, which it uses to retrieve cached results. Since ActionResults are the long tail survivor of actions, being retained for much longer after one executes and produces its content, this represents the most likely position where content may have been removed, and a stale reference might be provided. BuildFarm recognizes this correlated_invocations_id and if it is a URI, can parse its query parameters for behavior control. One such control is ENSURE_OUTPUTS_PRESENT for the GetActionResult request - if this query value is the string "true", BuildFarm will make a silent FindMissingBlobs check for all of the outputs of an ActionResult before responding with it. If any are missing, BuildFarm will instead return code NOT_FOUND, inspiring the client to see a cache miss, and attempt a [remote] execution. From 09015c9abfd02015ed3fdf88e6a72ec143a83eff Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Fri, 6 Oct 2023 13:34:21 +0000 Subject: [PATCH 071/214] Disable Bzlmod explicitly in .bazelrc --- .bazelrc | 4 ++++ MODULE.bazel | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 MODULE.bazel diff --git a/.bazelrc b/.bazelrc index cfea58ba6a..adbb3c68fd 100644 --- a/.bazelrc +++ b/.bazelrc @@ -14,3 +14,7 @@ test --test_tag_filters=-redis,-integration # Ensure buildfarm is compatible with future versions of bazel. # https://buildkite.com/bazel/bazelisk-plus-incompatible-flags common --incompatible_disallow_empty_glob + +# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel +# https://github.com/bazelbuild/bazel-buildfarm/issues/1479 +common --noenable_bzlmod diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 0000000000..cabbbe697c --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,2 @@ +# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel +# https://github.com/bazelbuild/bazel-buildfarm/issues/1479 From 1041b57e55cba97d41657b094384a9725c45d5b5 Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Thu, 28 Sep 2023 21:55:15 -0700 Subject: [PATCH 072/214] Log write errors with worker address --- .../buildfarm/common/grpc/StubWriteOutputStream.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java index 26b67f5c6c..4e500398b2 100644 --- a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java +++ b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java @@ -227,6 +227,14 @@ public void onNext(WriteResponse response) { @Override public void onError(Throwable t) { + log.log( + WARNING, + format( + "%s: write(%s) on worker %s after %d bytes of content", + Status.fromThrowable(t).getCode().name(), + resourceName, + bsStub.get().getChannel().authority(), + writtenBytes)); writeFuture.setException(exceptionTranslator.apply(t)); } From 30412adf9bcfa72734bd9fb3ac4b13bda397b9d2 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Sun, 8 Oct 2023 08:25:16 -0400 Subject: [PATCH 073/214] Revert "Use integer ids for Sqlite bidirectional index" This reverts commit f651cdbf7b2203e8cdb5645a1f869589e42f28c3. --- .../cas/cfc/SqliteFileDirectoriesIndex.java | 64 ++++--------------- .../cas/cfc/DirectoriesIndexTest.java | 1 - 2 files changed, 11 insertions(+), 54 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java index b18b5bd22c..030c749037 100644 --- a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java +++ b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java @@ -57,19 +57,13 @@ private void open() { throw new RuntimeException(e); } - String createDirectoriesSql = - "CREATE TABLE directories (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; - String createFilesSql = "CREATE TABLE files (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; String createEntriesSql = "CREATE TABLE entries (\n" - + " file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,\n" - + " directory_id INTEGER NOT NULL REFERENCES directories(id) ON DELETE CASCADE,\n" - + " PRIMARY KEY (file_id, directory_id)\n" + + " path TEXT NOT NULL,\n" + + " directory TEXT NOT NULL\n" + ")"; try (Statement stmt = conn.createStatement()) { - stmt.execute(createDirectoriesSql); - stmt.execute(createFilesSql); stmt.execute(createEntriesSql); } catch (SQLException e) { throw new RuntimeException(e); @@ -83,13 +77,11 @@ private void open() { public synchronized void start() { open(); - String createPathIndexSql = "CREATE INDEX files_name_idx ON entries (file_id)"; - String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory_id)"; - String enforceForeignKeys = "PRAGMA foreign_keys=ON"; + String createPathIndexSql = "CREATE INDEX path_idx ON entries (path)"; + String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory)"; try (Statement stmt = conn.createStatement()) { stmt.execute(createPathIndexSql); stmt.execute(createDirectoryIndexSql); - stmt.execute(enforceForeignKeys); } catch (SQLException e) { throw new RuntimeException(e); } @@ -109,8 +101,7 @@ public void close() { private Set removeEntryDirectories(String entry) { open(); - String selectSql = - "SELECT d.name as directory FROM files f INNER JOIN entries e ON f.id = e.file_id INNER JOIN directories d ON d.id = e.directory_id WHERE f.name = ?"; + String selectSql = "SELECT directory FROM entries WHERE path = ?"; ImmutableSet.Builder directoriesBuilder = ImmutableSet.builder(); try (PreparedStatement selectStatement = conn.prepareStatement(selectSql)) { @@ -125,7 +116,7 @@ private Set removeEntryDirectories(String entry) { } // all directories featuring this entry are now invalid ImmutableSet directories = directoriesBuilder.build(); - String deleteSql = "DELETE FROM directories where name = ?"; + String deleteSql = "DELETE FROM entries where directory = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { conn.setAutoCommit(false); for (Digest directory : directories) { @@ -137,14 +128,6 @@ private Set removeEntryDirectories(String entry) { } catch (SQLException e) { throw new RuntimeException(e); } - // clear out orphaned files - try (Statement orphanStatement = conn.createStatement()) { - String deleteOrphanSql = - "DELETE FROM files WHERE id in (SELECT id FROM files f LEFT JOIN entries e ON f.id = e.file_id WHERE e.file_id IS NULL)"; - orphanStatement.execute(deleteOrphanSql); - } catch (SQLException e) { - throw new RuntimeException(e); - } return directories; } @@ -158,37 +141,13 @@ public synchronized Set removeEntry(String entry) throws IOException { private synchronized void addEntriesDirectory(Set entries, Digest directory) { open(); - String directoryName = DigestUtil.toString(directory); - String filesInsertSql = "INSERT OR IGNORE INTO files (name) VALUES (?)"; - try (PreparedStatement filesInsertStatement = conn.prepareStatement(filesInsertSql)) { - conn.setAutoCommit(false); - for (String entry : entries) { - filesInsertStatement.setString(1, entry); - filesInsertStatement.addBatch(); - } - filesInsertStatement.executeBatch(); - conn.commit(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - // should be novel directory - String directoriesInsertSql = "INSERT INTO directories (name) VALUES (?)"; - try (PreparedStatement directoriesInsertStatement = - conn.prepareStatement(directoriesInsertSql)) { - conn.setAutoCommit(false); - directoriesInsertStatement.setString(1, directoryName); - directoriesInsertStatement.executeUpdate(); - conn.commit(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - String entriesInsertSql = - "INSERT INTO entries (file_id, directory_id) SELECT f.id, d.id FROM files f, directories d WHERE f.name = ? AND d.name = ?"; - try (PreparedStatement insertStatement = conn.prepareStatement(entriesInsertSql)) { + String digest = DigestUtil.toString(directory); + String insertSql = "INSERT INTO entries (path, directory) VALUES (?,?)"; + try (PreparedStatement insertStatement = conn.prepareStatement(insertSql)) { conn.setAutoCommit(false); + insertStatement.setString(2, digest); for (String entry : entries) { insertStatement.setString(1, entry); - insertStatement.setString(2, directoryName); insertStatement.addBatch(); } insertStatement.executeBatch(); @@ -209,9 +168,8 @@ private void removeEntriesDirectory(Digest directory) { open(); String digest = DigestUtil.toString(directory); - String deleteSql = "DELETE FROM directories WHERE name = ?"; + String deleteSql = "DELETE FROM entries WHERE directory = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { - conn.setAutoCommit(true); deleteStatement.setString(1, digest); deleteStatement.executeUpdate(); } catch (SQLException e) { diff --git a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java index b4effa2bc8..3eec66def7 100644 --- a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java @@ -51,7 +51,6 @@ protected DirectoriesIndexTest(Path root, DirectoriesIndexType type) { } else { throw new IllegalArgumentException("DirectoriesIndex type is not supported."); } - directoriesIndex.start(); } @Before From 83790688c9e589ea35b3526c71ed95899f417633 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:08:51 -0400 Subject: [PATCH 074/214] Common String.format for PipelineStage --- .../java/build/buildfarm/worker/PipelineStage.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/PipelineStage.java b/src/main/java/build/buildfarm/worker/PipelineStage.java index edad2bb572..ecc78f8e7e 100644 --- a/src/main/java/build/buildfarm/worker/PipelineStage.java +++ b/src/main/java/build/buildfarm/worker/PipelineStage.java @@ -14,6 +14,7 @@ package build.buildfarm.worker; +import static java.lang.String.format; import static java.util.concurrent.TimeUnit.MICROSECONDS; import com.google.common.base.Stopwatch; @@ -63,8 +64,7 @@ public void run() { // ignore } catch (Exception e) { getLogger() - .log( - Level.SEVERE, String.format("%s::run(): stage terminated due to exception", name), e); + .log(Level.SEVERE, format("%s::run(): stage terminated due to exception", name), e); } finally { boolean wasInterrupted = Thread.interrupted(); try { @@ -143,7 +143,7 @@ protected void iterate() throws InterruptedException { } private String logIterateId(String operationName) { - return String.format("%s::iterate(%s)", name, operationName); + return format("%s::iterate(%s)", name, operationName); } protected void start() { @@ -157,7 +157,7 @@ protected void start(String operationName) { protected void start(String operationName, String message) { // TODO to unary stage this.operationName = operationName; - getLogger().log(Level.FINER, String.format("%s: %s", logIterateId(operationName), message)); + getLogger().log(Level.FINER, format("%s: %s", logIterateId(operationName), message)); } protected void complete(String operationName, long usecs, long stallUSecs, boolean success) { @@ -169,7 +169,7 @@ protected void complete(String operationName, long usecs, long stallUSecs, Strin getLogger() .log( Level.FINER, - String.format( + format( "%s: %g ms (%g ms stalled) %s", logIterateId(operationName), usecs / 1000.0f, stallUSecs / 1000.0f, status)); } From fd20d134497061af3d7bd3e06c209a53a01559ae Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:18:10 -0400 Subject: [PATCH 075/214] Cleanup matched logic in SWC listener Continue the loop while we have *not* matched successfully and avoid a confusing inversion in getMatched() --- .../java/build/buildfarm/worker/shard/ShardWorkerContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 9f4ee3a29e..18ab0d8fe5 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -313,7 +313,7 @@ public void match(MatchListener listener) throws InterruptedException { @Override public boolean getMatched() { - return !matched; + return matched; } @Override @@ -351,7 +351,7 @@ public void onError(Throwable t) { throw new RuntimeException(t); } }; - while (dedupMatchListener.getMatched()) { + while (!dedupMatchListener.getMatched()) { try { matchInterruptible(dedupMatchListener); } catch (IOException e) { From 632fceb1b02a13f519a1a6ff64a403262bd9b05c Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:20:55 -0400 Subject: [PATCH 076/214] Refactor SWC matcher and clarify Nullable Distinguish the valid/unique/propagating methods of entry listening. --- .../buildfarm/worker/shard/ShardWorkerContext.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 18ab0d8fe5..d32731879c 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -92,6 +92,7 @@ import java.util.Map; import java.util.Stack; import java.util.logging.Level; +import javax.annotation.Nullable; import lombok.extern.java.Log; @Log @@ -327,20 +328,28 @@ public void onWaitEnd() { } @Override - public boolean onEntry(QueueEntry queueEntry) throws InterruptedException { + public boolean onEntry(@Nullable QueueEntry queueEntry) throws InterruptedException { if (queueEntry == null) { matched = true; return listener.onEntry(null); } + return onValidEntry(queueEntry); + } + + private boolean onValidEntry(QueueEntry queueEntry) throws InterruptedException { String operationName = queueEntry.getExecuteEntry().getOperationName(); if (activeOperations.putIfAbsent(operationName, queueEntry) != null) { log.log(Level.WARNING, "matched duplicate operation " + operationName); return false; } + return onUniqueEntry(queueEntry); + } + + private boolean onUniqueEntry(QueueEntry queueEntry) throws InterruptedException { matched = true; boolean success = listener.onEntry(queueEntry); if (!success) { - requeue(operationName); + requeue(queueEntry.getExecuteEntry().getOperationName()); } return success; } From 7385c74cf0c711a91d1130fa8f406dcb57a8dc60 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:30:43 -0400 Subject: [PATCH 077/214] Interrupt matchStage to induce prepare shutdown The only signal to a waiting match that will halt its current listen loop for a valid unique operation is an interrupt. --- .../java/build/buildfarm/worker/Pipeline.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/Pipeline.java b/src/main/java/build/buildfarm/worker/Pipeline.java index da4eaacfb6..6b2d4f2a7d 100644 --- a/src/main/java/build/buildfarm/worker/Pipeline.java +++ b/src/main/java/build/buildfarm/worker/Pipeline.java @@ -61,9 +61,12 @@ public void close() throws InterruptedException { /** Inform MatchStage to stop matching or picking up new Operations from queue. */ public void stopMatchingOperations() { - for (PipelineStage stage : stageClosePriorities.keySet()) { + for (Map.Entry entry : stageThreads.entrySet()) { + PipelineStage stage = entry.getKey(); if (stage instanceof MatchStage) { - ((MatchStage) stage).prepareForGracefulShutdown(); + MatchStage matchStage = (MatchStage) stage; + matchStage.prepareForGracefulShutdown(); + entry.getValue().interrupt(); return; } } @@ -134,15 +137,17 @@ private void join(boolean closeStage) throws InterruptedException { } } if (stageToClose != null && !stageToClose.isClosed()) { - log.log(Level.FINER, "Closing stage at priority " + maxPriority); + log.log(Level.FINER, "Closing stage " + stageToClose + " at priority " + maxPriority); stageToClose.close(); } } + boolean longStageWait = !closeStage; for (Map.Entry stageThread : stageThreads.entrySet()) { PipelineStage stage = stageThread.getKey(); Thread thread = stageThread.getValue(); try { - thread.join(closeStage ? 1 : 1000); + // 0 is wait forever, no instant wait + thread.join(longStageWait ? 1000 : 1); } catch (InterruptedException e) { if (!closeStage) { synchronized (this) { @@ -172,8 +177,8 @@ private void join(boolean closeStage) throws InterruptedException { + stageClosePriorities.get(stage)); thread.interrupt(); } + longStageWait = false; } - closeStage = false; for (PipelineStage stage : inactiveStages) { synchronized (this) { stageThreads.remove(stage); From 79cf64898a11c745834d9eabd6707f64e7acab4c Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 14:52:53 -0400 Subject: [PATCH 078/214] Specify example config with grpc target Distinguish target param with GRPC type storage from FILESYSTEM definition --- examples/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/config.yml b/examples/config.yml index f426e98547..901e8ff76d 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -110,7 +110,8 @@ worker: skipLoad: false hexBucketLevels: 0 execRootCopyFallback: false - target: + #- type: GRPC + # target: "grpc://host:port" executeStageWidth: 1 inputFetchStageWidth: 1 inputFetchDeadline: 60 From d73628b6a6dcaea90f93426ad4d9c203851c9120 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 3 Oct 2023 16:24:53 -0400 Subject: [PATCH 079/214] Remove SpringBoot usage Reinstate prior usage of LoggingMain for safe shutdown, with added release mechanism for interrupted processes. All invoked shutdowns are graceful, with vastly improved shutdown speed for empty workers waiting for pipeline stages. --- defs.bzl | 20 +-- .../build/buildfarm/common/LoggingMain.java | 28 ++-- src/main/java/build/buildfarm/server/BUILD | 6 - .../buildfarm/server/BuildFarmServer.java | 126 +++++++++------- .../java/build/buildfarm/worker/shard/BUILD | 5 - .../shard/ShutDownWorkerGracefully.java | 3 +- .../build/buildfarm/worker/shard/Worker.java | 139 ++++++++---------- 7 files changed, 145 insertions(+), 182 deletions(-) diff --git a/defs.bzl b/defs.bzl index 993e9d36f4..ec51856484 100644 --- a/defs.bzl +++ b/defs.bzl @@ -43,22 +43,8 @@ IO_GRPC_MODULES = [ ] COM_AWS_MODULES = [ - "secretsmanager", "s3", -] - -ORG_SPRING_MODULES = [ - "spring-beans", - "spring-core", - "spring-context", - "spring-web", -] - -ORG_SPRING_BOOT_MODULES = [ - "spring-boot-autoconfigure", - "spring-boot", - "spring-boot-starter-web", - "spring-boot-starter-thymeleaf", + "secretsmanager", ] def buildfarm_init(name = "buildfarm"): @@ -99,7 +85,6 @@ def buildfarm_init(name = "buildfarm"): "org.slf4j:slf4j-simple:1.7.35", "com.googlecode.json-simple:json-simple:1.1.1", "com.jayway.jsonpath:json-path:2.4.0", - "io.github.lognet:grpc-spring-boot-starter:4.5.4", "org.bouncycastle:bcprov-jdk15on:1.70", "net.jcip:jcip-annotations:1.0", ] + ["io.netty:netty-%s:4.1.94.Final" % module for module in IO_NETTY_MODULES] + @@ -122,9 +107,6 @@ def buildfarm_init(name = "buildfarm"): "org.openjdk.jmh:jmh-core:1.23", "org.openjdk.jmh:jmh-generator-annprocess:1.23", "org.redisson:redisson:3.13.1", - ] + ["org.springframework.boot:%s:2.7.4" % module for module in ORG_SPRING_BOOT_MODULES] + - ["org.springframework:%s:5.3.23" % module for module in ORG_SPRING_MODULES] + - [ "org.threeten:threetenbp:1.3.3", "org.xerial:sqlite-jdbc:3.34.0", "org.jetbrains:annotations:16.0.2", diff --git a/src/main/java/build/buildfarm/common/LoggingMain.java b/src/main/java/build/buildfarm/common/LoggingMain.java index 9a4d9bd2b0..4e60a6286a 100644 --- a/src/main/java/build/buildfarm/common/LoggingMain.java +++ b/src/main/java/build/buildfarm/common/LoggingMain.java @@ -7,24 +7,22 @@ public abstract class LoggingMain { protected abstract void onShutdown() throws InterruptedException; - class ShutdownThread extends Thread { - ShutdownThread(String applicationName) { - super(null, null, applicationName + "-Shutdown", 0); - } - - @Override - public void run() { - try { - LoggingMain.this.onShutdown(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } finally { - WaitingLogManager.release(); - } + private void shutdown() { + try { + onShutdown(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } finally { + WaitingLogManager.release(); } } protected LoggingMain(String applicationName) { - Runtime.getRuntime().addShutdownHook(new ShutdownThread(applicationName)); + Runtime.getRuntime() + .addShutdownHook( + new Thread( + /* group=*/ null, + /* target=*/ this::shutdown, + /* name=*/ applicationName + "-Shutdown")); } } diff --git a/src/main/java/build/buildfarm/server/BUILD b/src/main/java/build/buildfarm/server/BUILD index 0d6d396dc8..eccbf4fda2 100644 --- a/src/main/java/build/buildfarm/server/BUILD +++ b/src/main/java/build/buildfarm/server/BUILD @@ -25,11 +25,5 @@ java_library( "@maven//:javax_annotation_javax_annotation_api", "@maven//:org_bouncycastle_bcprov_jdk15on", "@maven//:org_projectlombok_lombok", - "@maven//:org_springframework_boot_spring_boot", - "@maven//:org_springframework_boot_spring_boot_autoconfigure", - "@maven//:org_springframework_boot_spring_boot_starter_thymeleaf", - "@maven//:org_springframework_spring_beans", - "@maven//:org_springframework_spring_context", - "@maven//:org_springframework_spring_core", ], ) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index 4ca669d5f1..c8ae55c83e 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -15,12 +15,13 @@ package build.buildfarm.server; import static build.buildfarm.common.io.Utils.formatIOError; -import static com.google.common.base.Preconditions.checkState; import static com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination; import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; import static java.util.logging.Level.SEVERE; +import static java.util.logging.Level.WARNING; import build.buildfarm.common.DigestUtil; +import build.buildfarm.common.LoggingMain; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.config.GrpcMetrics; import build.buildfarm.common.grpc.TracingMetadataUtils.ServerHeadersInterceptor; @@ -36,7 +37,6 @@ import build.buildfarm.server.services.OperationQueueService; import build.buildfarm.server.services.OperationsService; import build.buildfarm.server.services.PublishBuildEventService; -import com.google.devtools.common.options.OptionsParsingException; import io.grpc.ServerBuilder; import io.grpc.ServerInterceptor; import io.grpc.health.v1.HealthCheckResponse.ServingStatus; @@ -47,24 +47,16 @@ import java.io.File; import java.io.IOException; import java.security.Security; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; +import java.util.concurrent.atomic.AtomicBoolean; import javax.naming.ConfigurationException; import lombok.extern.java.Log; import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; @SuppressWarnings("deprecation") @Log -@SpringBootApplication -@ComponentScan("build.buildfarm") -public class BuildFarmServer { +public class BuildFarmServer extends LoggingMain { private static final java.util.logging.Logger nettyLogger = java.util.logging.Logger.getLogger("io.grpc.netty"); private static final Counter healthCheckMetric = @@ -78,8 +70,13 @@ public class BuildFarmServer { private Instance instance; private HealthStatusManager healthStatusManager; private io.grpc.Server server; - private boolean stopping = false; private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); + private AtomicBoolean shutdownInitiated = new AtomicBoolean(true); + private AtomicBoolean released = new AtomicBoolean(true); + + BuildFarmServer() { + super("BuildFarmServer"); + } private ShardInstance createInstance() throws IOException, ConfigurationException, InterruptedException { @@ -87,11 +84,13 @@ private ShardInstance createInstance() configs.getServer().getName(), configs.getServer().getSession() + "-" + configs.getServer().getName(), new DigestUtil(configs.getDigestFunction()), - this::stop); + this::initiateShutdown); } public synchronized void start(ServerBuilder serverBuilder, String publicName) throws IOException, ConfigurationException, InterruptedException { + shutdownInitiated.set(false); + released.set(false); instance = createInstance(); healthStatusManager = new HealthStatusManager(); @@ -138,7 +137,6 @@ public synchronized void start(ServerBuilder serverBuilder, String publicName log.info(String.format("%s initialized", configs.getServer().getSession())); - checkState(!stopping, "must not call start after stop"); instance.start(publicName); server.start(); @@ -148,38 +146,69 @@ public synchronized void start(ServerBuilder serverBuilder, String publicName healthCheckMetric.labels("start").inc(); } - @PreDestroy - public void stop() { - synchronized (this) { - if (stopping) { - return; - } - stopping = true; + private synchronized void awaitRelease() throws InterruptedException { + while (!released.get()) { + wait(); } - System.err.println("*** shutting down gRPC server since JVM is shutting down"); + } + + synchronized void stop() throws InterruptedException { + try { + shutdown(); + } finally { + released.set(true); + notify(); + } + } + + private void shutdown() throws InterruptedException { + log.info("*** shutting down gRPC server since JVM is shutting down"); healthStatusManager.setStatus( HealthStatusManager.SERVICE_NAME_ALL_SERVICES, ServingStatus.NOT_SERVING); PrometheusPublisher.stopHttpServer(); healthCheckMetric.labels("stop").inc(); try { - if (server != null) { - server.shutdown(); - } + initiateShutdown(); instance.stop(); - server.awaitTermination(10, TimeUnit.SECONDS); + if (server != null && server.awaitTermination(10, TimeUnit.SECONDS)) { + server = null; + } } catch (InterruptedException e) { if (server != null) { server.shutdownNow(); + server = null; } + throw e; } if (!shutdownAndAwaitTermination(keepaliveScheduler, 10, TimeUnit.SECONDS)) { log.warning("could not shut down keepalive scheduler"); } - System.err.println("*** server shut down"); + log.info("*** server shut down"); + } + + @Override + protected void onShutdown() throws InterruptedException { + initiateShutdown(); + awaitRelease(); } - @PostConstruct - public void init() throws OptionsParsingException { + private void initiateShutdown() { + shutdownInitiated.set(true); + if (server != null) { + server.shutdown(); + } + } + + private void awaitTermination() throws InterruptedException { + while (!shutdownInitiated.get()) { + if (server != null && server.awaitTermination(1, TimeUnit.SECONDS)) { + server = null; + shutdownInitiated.set(true); + } + } + } + + public static void main(String[] args) throws Exception { // Only log severe log messages from Netty. Otherwise it logs warnings that look like this: // // 170714 08:16:28.552:WT 18 [io.grpc.netty.NettyServerHandler.onStreamError] Stream Error @@ -187,35 +216,24 @@ public void init() throws OptionsParsingException { // unknown stream 11369 nettyLogger.setLevel(SEVERE); - try { - start( - ServerBuilder.forPort(configs.getServer().getPort()), - configs.getServer().getPublicName()); - } catch (IOException e) { - System.err.println("error: " + formatIOError(e)); - } catch (InterruptedException e) { - System.err.println("error: interrupted"); - } catch (ConfigurationException e) { - throw new RuntimeException(e); - } - } - - public static void main(String[] args) throws ConfigurationException { configs = BuildfarmConfigs.loadServerConfigs(args); // Configure Spring - SpringApplication app = new SpringApplication(BuildFarmServer.class); - Map springConfig = new HashMap<>(); - - // Disable Logback - System.setProperty("org.springframework.boot.logging.LoggingSystem", "none"); - - app.setDefaultProperties(springConfig); + BuildFarmServer server = new BuildFarmServer(); try { - app.run(args); - } catch (Throwable t) { - log.log(SEVERE, "Error running application", t); + server.start( + ServerBuilder.forPort(configs.getServer().getPort()), + configs.getServer().getPublicName()); + server.awaitTermination(); + } catch (IOException e) { + log.severe("error: " + formatIOError(e)); + } catch (InterruptedException e) { + log.log(WARNING, "interrupted", e); + } catch (Exception e) { + log.log(SEVERE, "Error running application", e); + } finally { + server.stop(); } } } diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index 120365882b..ec48ec5be0 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -36,10 +36,5 @@ java_library( "@maven//:io_prometheus_simpleclient", "@maven//:javax_annotation_javax_annotation_api", "@maven//:org_projectlombok_lombok", - "@maven//:org_springframework_boot_spring_boot", - "@maven//:org_springframework_boot_spring_boot_autoconfigure", - "@maven//:org_springframework_spring_beans", - "@maven//:org_springframework_spring_context", - "@maven//:org_springframework_spring_core", ], ) diff --git a/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java b/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java index 711c3cf0d3..7d394c9731 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java +++ b/src/main/java/build/buildfarm/worker/shard/ShutDownWorkerGracefully.java @@ -18,7 +18,6 @@ import build.buildfarm.v1test.PrepareWorkerForGracefulShutDownRequestResults; import build.buildfarm.v1test.ShutDownWorkerGrpc; import io.grpc.stub.StreamObserver; -import java.util.concurrent.CompletableFuture; import lombok.extern.java.Log; @Log @@ -41,7 +40,7 @@ public void prepareWorkerForGracefulShutdown( PrepareWorkerForGracefulShutDownRequest request, StreamObserver responseObserver) { try { - CompletableFuture.runAsync(worker::prepareWorkerForGracefulShutdown); + worker.initiateShutdown(); responseObserver.onNext(PrepareWorkerForGracefulShutDownRequestResults.newBuilder().build()); responseObserver.onCompleted(); } catch (Exception e) { diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 9a919d9703..084e5df7bf 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -35,6 +35,7 @@ import build.buildfarm.common.BuildfarmExecutors; import build.buildfarm.common.DigestUtil; import build.buildfarm.common.InputStreamFactory; +import build.buildfarm.common.LoggingMain; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.config.Cas; import build.buildfarm.common.config.GrpcMetrics; @@ -60,7 +61,6 @@ import build.buildfarm.worker.SuperscalarPipelineStage; import com.google.common.cache.LoadingCache; import com.google.common.collect.Lists; -import com.google.devtools.common.options.OptionsParsingException; import com.google.longrunning.Operation; import com.google.protobuf.ByteString; import com.google.protobuf.Duration; @@ -85,20 +85,14 @@ import java.util.UUID; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import javax.annotation.Nullable; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; import javax.naming.ConfigurationException; import lombok.extern.java.Log; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; @Log -@SpringBootApplication -@ComponentScan("build.buildfarm") -public class Worker { +public final class Worker extends LoggingMain { private static final java.util.logging.Logger nettyLogger = java.util.logging.Logger.getLogger("io.grpc.netty"); private static final Counter healthCheckMetric = @@ -139,53 +133,10 @@ public class Worker { private Pipeline pipeline; private Backplane backplane; private LoadingCache workerStubs; + private AtomicBoolean released = new AtomicBoolean(true); - /** - * The method will prepare the worker for graceful shutdown when the worker is ready. Note on - * using stderr here instead of log. By the time this is called in PreDestroy, the log is no - * longer available and is not logging messages. - */ - public void prepareWorkerForGracefulShutdown() { - if (configs.getWorker().getGracefulShutdownSeconds() == 0) { - System.err.println( - String.format( - "Graceful Shutdown is not enabled. Worker is shutting down without finishing executions in progress.")); - } else { - inGracefulShutdown = true; - System.err.println( - "Graceful Shutdown - The current worker will not be registered again and should be shutdown gracefully!"); - pipeline.stopMatchingOperations(); - int scanRate = 30; // check every 30 seconds - int timeWaited = 0; - int timeOut = configs.getWorker().getGracefulShutdownSeconds(); - - try { - if (pipeline.isEmpty()) { - System.err.println("Graceful Shutdown - no work in the pipeline."); - } else { - System.err.println( - String.format("Graceful Shutdown - waiting for executions to finish.")); - } - while (!pipeline.isEmpty() && timeWaited < timeOut) { - SECONDS.sleep(scanRate); - timeWaited += scanRate; - System.err.println( - String.format( - "Graceful Shutdown - Pipeline is still not empty after %d seconds.", timeWaited)); - } - } catch (InterruptedException e) { - System.err.println( - "Graceful Shutdown - The worker gracefully shutdown is interrupted: " + e.getMessage()); - } finally { - System.err.println( - String.format( - "Graceful Shutdown - It took the worker %d seconds to %s", - timeWaited, - pipeline.isEmpty() - ? "finish all actions" - : "gracefully shutdown but still cannot finish all actions")); - } - } + private Worker() { + super("BuildFarmShardWorker"); } private Operation stripOperation(Operation operation) { @@ -508,13 +459,6 @@ public void run() { } } catch (InterruptedException e) { // ignore - } finally { - try { - stop(); - } catch (InterruptedException ie) { - log.log(SEVERE, "interrupted while stopping worker", ie); - // ignore - } } } }, @@ -534,6 +478,7 @@ private long loadWorkerStartTimeInMillis() { } public void start() throws ConfigurationException, InterruptedException, IOException { + released.set(false); String session = UUID.randomUUID().toString(); ServerBuilder serverBuilder = ServerBuilder.forPort(configs.getWorker().getPort()); String identifier = "buildfarm-worker-" + configs.getWorker().getPublicName() + "-" + session; @@ -642,10 +587,41 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep log.log(INFO, String.format("%s initialized", identifier)); } - @PreDestroy - public void stop() throws InterruptedException { - System.err.println("*** shutting down gRPC server since JVM is shutting down"); - prepareWorkerForGracefulShutdown(); + @Override + protected void onShutdown() throws InterruptedException { + initiateShutdown(); + awaitRelease(); + } + + private void awaitTermination() throws InterruptedException { + pipeline.join(); + server.awaitTermination(); + } + + public void initiateShutdown() { + pipeline.stopMatchingOperations(); + if (server != null) { + server.shutdown(); + } + } + + private synchronized void awaitRelease() throws InterruptedException { + while (!released.get()) { + wait(); + } + } + + public synchronized void stop() throws InterruptedException { + try { + shutdown(); + } finally { + released.set(true); + notify(); + } + } + + private void shutdown() throws InterruptedException { + log.info("*** shutting down gRPC server since JVM is shutting down"); PrometheusPublisher.stopHttpServer(); boolean interrupted = Thread.interrupted(); if (pipeline != null) { @@ -663,11 +639,12 @@ public void stop() throws InterruptedException { executionSlotsTotal.set(0); inputFetchSlotsTotal.set(0); if (execFileSystem != null) { - log.log(INFO, "Stopping exec filesystem"); + log.info("Stopping exec filesystem"); execFileSystem.stop(); + execFileSystem = null; } if (server != null) { - log.log(INFO, "Shutting down the server"); + log.info("Shutting down the server"); server.shutdown(); try { @@ -678,26 +655,28 @@ public void stop() throws InterruptedException { } finally { server.shutdownNow(); } + server = null; } if (backplane != null) { try { backplane.stop(); + backplane = null; } catch (InterruptedException e) { interrupted = true; } } if (workerStubs != null) { workerStubs.invalidateAll(); + workerStubs = null; } if (interrupted) { Thread.currentThread().interrupt(); throw new InterruptedException(); } - System.err.println("*** server shut down"); + log.info("*** server shut down"); } - @PostConstruct - public void init() throws OptionsParsingException { + public static void main(String[] args) throws Exception { // Only log severe log messages from Netty. Otherwise it logs warnings that look like this: // // 170714 08:16:28.552:WT 18 [io.grpc.netty.NettyServerHandler.onStreamError] Stream Error @@ -705,19 +684,17 @@ public void init() throws OptionsParsingException { // unknown stream 11369 nettyLogger.setLevel(SEVERE); + configs = BuildfarmConfigs.loadWorkerConfigs(args); + Worker worker = new Worker(); try { - start(); + worker.start(); + worker.awaitTermination(); } catch (IOException e) { - System.err.println("error: " + formatIOError(e)); + log.severe(formatIOError(e)); } catch (InterruptedException e) { - System.out.println("error: interrupted"); - } catch (ConfigurationException e) { - throw new RuntimeException(e); + log.log(Level.WARNING, "interrupted", e); + } finally { + worker.stop(); } } - - public static void main(String[] args) throws ConfigurationException { - configs = BuildfarmConfigs.loadWorkerConfigs(args); - SpringApplication.run(Worker.class, args); - } } From 6f88e3424c3b2bb20e381a7358298698c72da559 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Tue, 10 Oct 2023 11:06:01 -0400 Subject: [PATCH 080/214] Enable graceful shutdown for server (#1490) --- _site/docs/configuration/configuration.md | 48 ++++++++++--------- examples/config.yml | 1 + .../build/buildfarm/common/config/Server.java | 1 + .../buildfarm/server/BuildFarmServer.java | 32 +++++++++++++ 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index cbd286587f..ac74bb3f1e 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -51,29 +51,31 @@ worker: ### Server -| Configuration | Accepted and _Default_ Values | Environment Var | Description | -|----------------------------------|-------------------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------| -| instanceType | _SHARD_ | | Type of implementation (SHARD is the only one supported) | -| name | String, _shard_ | | Implementation name | -| publicName | String, _DERIVED:port_ | INSTANCE_NAME | Host:port of the GRPC server, required to be accessible by all servers | -| actionCacheReadOnly | boolean, _false_ | | Allow/Deny writing to action cache | -| port | Integer, _8980_ | | Listening port of the GRPC server | -| casWriteTimeout | Integer, _3600_ | | CAS write timeout (seconds) | -| bytestreamTimeout | Integer, _3600_ | | Byte Stream write timeout (seconds) | -| sslCertificatePath | String, _null_ | | Absolute path of the SSL certificate (if TLS used) | -| sslPrivateKeyPath | String, _null_ | | Absolute path of the SSL private key (if TLS used) | -| runDispatchedMonitor | boolean, _true_ | | Enable an agent to monitor the operation store to ensure that dispatched operations with expired worker leases are requeued | -| dispatchedMonitorIntervalSeconds | Integer, _1_ | | Dispatched monitor's lease expiration check interval (seconds) | -| runOperationQueuer | boolean, _true_ | | Aquire execute request entries cooperatively from an arrival queue on the backplane | -| ensureOutputsPresent | boolean, _false_ | | Decide if all outputs are also present in the CAS. If any outputs are missing a cache miss is returned | -| maxCpu | Integer, _0_ | | Maximum number of CPU cores that any min/max-cores property may request (0 = unlimited) | -| maxRequeueAttempts | Integer, _5_ | | Maximum number of requeue attempts for an operation | -| useDenyList | boolean, _true_ | | Allow usage of a deny list when looking up actions and invocations (for cache only it is recommended to disable this check) | -| grpcTimeout | Integer, _3600_ | | GRPC request timeout (seconds) | -| executeKeepaliveAfterSeconds | Integer, _60_ | | Execute keep alive (seconds) | -| recordBesEvents | boolean, _false_ | | Allow recording of BES events | -| clusterId | String, _local_ | | Buildfarm cluster ID | -| cloudRegion | String, _us-east_1_ | | Deployment region in the cloud | +| Configuration | Accepted and _Default_ Values | Environment Var | Description | +|----------------------------------|-------------------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------| +| instanceType | _SHARD_ | | Type of implementation (SHARD is the only one supported) | +| name | String, _shard_ | | Implementation name | +| publicName | String, _DERIVED:port_ | INSTANCE_NAME | Host:port of the GRPC server, required to be accessible by all servers | +| actionCacheReadOnly | boolean, _false_ | | Allow/Deny writing to action cache | +| port | Integer, _8980_ | | Listening port of the GRPC server | +| casWriteTimeout | Integer, _3600_ | | CAS write timeout (seconds) | +| bytestreamTimeout | Integer, _3600_ | | Byte Stream write timeout (seconds) | +| sslCertificatePath | String, _null_ | | Absolute path of the SSL certificate (if TLS used) | +| sslPrivateKeyPath | String, _null_ | | Absolute path of the SSL private key (if TLS used) | +| runDispatchedMonitor | boolean, _true_ | | Enable an agent to monitor the operation store to ensure that dispatched operations with expired worker leases are requeued | +| dispatchedMonitorIntervalSeconds | Integer, _1_ | | Dispatched monitor's lease expiration check interval (seconds) | +| runOperationQueuer | boolean, _true_ | | Aquire execute request entries cooperatively from an arrival queue on the backplane | +| ensureOutputsPresent | boolean, _false_ | | Decide if all outputs are also present in the CAS. If any outputs are missing a cache miss is returned | +| maxCpu | Integer, _0_ | | Maximum number of CPU cores that any min/max-cores property may request (0 = unlimited) | +| maxRequeueAttempts | Integer, _5_ | | Maximum number of requeue attempts for an operation | +| useDenyList | boolean, _true_ | | Allow usage of a deny list when looking up actions and invocations (for cache only it is recommended to disable this check) | +| grpcTimeout | Integer, _3600_ | | GRPC request timeout (seconds) | +| executeKeepaliveAfterSeconds | Integer, _60_ | | Execute keep alive (seconds) | +| recordBesEvents | boolean, _false_ | | Allow recording of BES events | +| clusterId | String, _local_ | | Buildfarm cluster ID | +| cloudRegion | String, _us-east_1_ | | Deployment region in the cloud | +| gracefulShutdownSeconds | Integer, 0 | | Time in seconds to allow for connections in flight to finish when shutdown signal is received | + Example: diff --git a/examples/config.yml b/examples/config.yml index 901e8ff76d..cdf72f3de7 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -31,6 +31,7 @@ server: recordBesEvents: false clusterId: local cloudRegion: us-east-1 + gracefulShutdownSeconds: 0 caches: directoryCacheMaxEntries: 10000 commandCacheMaxEntries: 10000 diff --git a/src/main/java/build/buildfarm/common/config/Server.java b/src/main/java/build/buildfarm/common/config/Server.java index 9f2899ff60..0487154c2f 100644 --- a/src/main/java/build/buildfarm/common/config/Server.java +++ b/src/main/java/build/buildfarm/common/config/Server.java @@ -42,6 +42,7 @@ public enum INSTANCE_TYPE { private int maxInboundMetadataSize = 0; private ServerCacheConfigs caches = new ServerCacheConfigs(); private boolean findMissingBlobsViaBackplane = false; + private int gracefulShutdownSeconds = 0; public String getSession() { return String.format("buildfarm-server-%s-%s", getPublicName(), sessionGuid); diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index c8ae55c83e..a20f4a6f77 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -17,6 +17,7 @@ import static build.buildfarm.common.io.Utils.formatIOError; import static com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination; import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; +import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.logging.Level.SEVERE; import static java.util.logging.Level.WARNING; @@ -78,6 +79,36 @@ public class BuildFarmServer extends LoggingMain { super("BuildFarmServer"); } + /** + * The method will prepare the server for graceful shutdown when the server is ready. Current + * implementation waits specified period of time. Future improvements could be to keep track of + * open connections and shutdown when there are not left. Note on using stderr here instead of + * log. By the time this is called in PreDestroy, the log is no longer available and is not + * logging messages. + */ + public void prepareServerForGracefulShutdown() { + if (configs.getServer().getGracefulShutdownSeconds() == 0) { + System.err.println( + String.format("Graceful Shutdown is not enabled. Server is shutting down immediately.")); + } else { + try { + System.err.println( + String.format( + "Graceful Shutdown - Waiting %d to allow connections to drain.", + configs.getServer().getGracefulShutdownSeconds())); + SECONDS.sleep(configs.getServer().getGracefulShutdownSeconds()); + } catch (InterruptedException e) { + System.err.println( + "Graceful Shutdown - The server graceful shutdown is interrupted: " + e.getMessage()); + } finally { + System.err.println( + String.format( + "Graceful Shutdown - It took the server %d seconds to shutdown", + configs.getServer().getGracefulShutdownSeconds())); + } + } + } + private ShardInstance createInstance() throws IOException, ConfigurationException, InterruptedException { return new ShardInstance( @@ -163,6 +194,7 @@ synchronized void stop() throws InterruptedException { private void shutdown() throws InterruptedException { log.info("*** shutting down gRPC server since JVM is shutting down"); + prepareServerForGracefulShutdown(); healthStatusManager.setStatus( HealthStatusManager.SERVICE_NAME_ALL_SERVICES, ServingStatus.NOT_SERVING); PrometheusPublisher.stopHttpServer(); From 81122e7fa455afb1267380cab8658ebedbd8b845 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Fri, 6 Oct 2023 16:00:03 -0700 Subject: [PATCH 081/214] refactor: code cleanup Tiny code cleanup --- .../buildfarm/instance/shard/JedisClusterFactory.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java index 5f85da29f6..2bfb48ac9e 100644 --- a/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java +++ b/src/main/java/build/buildfarm/instance/shard/JedisClusterFactory.java @@ -58,9 +58,7 @@ public static Supplier create(String identifier) throws Configurat list2Set(redisNodes), configs.getBackplane().getTimeout(), configs.getBackplane().getMaxAttempts(), - Strings.isNullOrEmpty(configs.getBackplane().getRedisPassword()) - ? null - : configs.getBackplane().getRedisPassword(), + Strings.emptyToNull(configs.getBackplane().getRedisPassword()), createJedisPoolConfig()); } @@ -70,9 +68,7 @@ public static Supplier create(String identifier) throws Configurat parseUri(configs.getBackplane().getRedisUri()), configs.getBackplane().getTimeout(), configs.getBackplane().getMaxAttempts(), - Strings.isNullOrEmpty(configs.getBackplane().getRedisPassword()) - ? null - : configs.getBackplane().getRedisPassword(), + Strings.emptyToNull(configs.getBackplane().getRedisPassword()), createJedisPoolConfig()); } From ad44854942cab540ebf8c208e16bfe8ecc225c8f Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 22 Jun 2023 09:20:08 -0400 Subject: [PATCH 082/214] Log paths created on putDirectory Will include operation root and inform directory cache effectiveness. --- .../build/buildfarm/cas/cfc/CASFileCache.java | 28 +++++++++++--- .../worker/shard/CFCExecFileSystem.java | 37 ++++++++++--------- .../buildfarm/cas/cfc/CASFileCacheTest.java | 3 +- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 6b6e63b4ad..aac1b28994 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -2173,7 +2173,7 @@ private Directory getDirectoryFromDigest( return directory; } - public ListenableFuture putDirectory( + public ListenableFuture putDirectory( Digest digest, Map directoriesIndex, ExecutorService service) { // Claim lock. // Claim the directory path so no other threads try to create/delete it. @@ -2189,7 +2189,7 @@ public ListenableFuture putDirectory( log.log(Level.FINER, format("locked directory %s", path.getFileName())); // Now that a lock has been claimed, we can proceed to create the directory. - ListenableFuture putFuture; + ListenableFuture putFuture; try { putFuture = putDirectorySynchronized(path, digest, directoriesIndex, service); } catch (IOException e) { @@ -2244,8 +2244,26 @@ private boolean directoryEntryExists( return false; } + public static class PathResult { + private final Path path; + private final boolean missed; + + public PathResult(Path path, boolean missed) { + this.path = path; + this.missed = missed; + } + + public Path getPath() { + return path; + } + + public boolean getMissed() { + return missed; + } + } + @SuppressWarnings("ConstantConditions") - private ListenableFuture putDirectorySynchronized( + private ListenableFuture putDirectorySynchronized( Path path, Digest digest, Map directoriesByDigest, ExecutorService service) throws IOException { log.log(Level.FINER, format("directory %s has been locked", path.getFileName())); @@ -2277,7 +2295,7 @@ private ListenableFuture putDirectorySynchronized( if (e != null) { log.log(Level.FINER, format("found existing entry for %s", path.getFileName())); if (directoryEntryExists(path, e, directoriesByDigest)) { - return immediateFuture(path); + return immediateFuture(new PathResult(path, /* missed=*/ false)); } log.log( Level.SEVERE, @@ -2410,7 +2428,7 @@ private ListenableFuture putDirectorySynchronized( : directoriesByDigest.get(digest), Deadline.after(10, SECONDS)); directoryStorage.put(digest, e); - return path; + return new PathResult(path, /* missed=*/ true); }, service); } diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index e6d9826f45..74b238b2c6 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -265,6 +265,7 @@ private Iterable> fetchInputs( .map(symlinkNode -> putSymlink(path, symlinkNode)) .collect(ImmutableList.toImmutableList())); + ImmutableList.Builder> linkedDirectories = ImmutableList.builder(); for (DirectoryNode directoryNode : directory.getDirectoriesList()) { Digest digest = directoryNode.getDigest(); String name = directoryNode.getName(); @@ -285,26 +286,23 @@ private Iterable> fetchInputs( onKey, inputDirectories)); } else { - downloads = - concat( - downloads, - ImmutableList.of( - transform( - linkDirectory(dirPath, digest, directoriesIndex), - (result) -> { - // we saw null entries in the built immutable list without synchronization - synchronized (inputDirectories) { - inputDirectories.add(digest); - } - return null; - }, - fetchService))); + linkedDirectories.add( + transform( + linkDirectory(dirPath, digest, directoriesIndex), + (result) -> { + // we saw null entries in the built immutable list without synchronization + synchronized (inputDirectories) { + inputDirectories.add(digest); + } + return null; + }, + fetchService)); } if (Thread.currentThread().isInterrupted()) { break; } } - return downloads; + return concat(downloads, linkedDirectories.build()); } @SuppressWarnings("ConstantConditions") @@ -312,8 +310,13 @@ private ListenableFuture linkDirectory( Path execPath, Digest digest, Map directoriesIndex) { return transformAsync( fileCache.putDirectory(digest, directoriesIndex, fetchService), - (cachePath) -> { - Files.createSymbolicLink(execPath, cachePath); + pathResult -> { + Path path = pathResult.getPath(); + if (pathResult.getMissed()) { + log.fine( + String.format("putDirectory(%s, %s) created", path, DigestUtil.toString(digest))); + } + Files.createSymbolicLink(execPath, path); return immediateFuture(null); }, fetchService); diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index 72e167b4df..a3d406e232 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -240,7 +240,8 @@ public void putDirectoryCreatesTree() throws IOException, InterruptedException { subdirDigest, subDirectory); Path dirPath = getInterruptiblyOrIOException( - fileCache.putDirectory(dirDigest, directoriesIndex, putService)); + fileCache.putDirectory(dirDigest, directoriesIndex, putService)) + .getPath(); assertThat(Files.isDirectory(dirPath)).isTrue(); assertThat(Files.exists(dirPath.resolve("file"))).isTrue(); assertThat(Files.isDirectory(dirPath.resolve("subdir"))).isTrue(); From b31ffedb5528c0f0fb2930473f802641f390a3d2 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 7 Jul 2023 01:49:58 -0400 Subject: [PATCH 083/214] Permit regex realInputDirectories Selecting realInputDirectories by regex permits flexible patterns that can yield drastic improvements in directory reuse for specialized deployments. runfiles in particular are hazardous expansions of nearly-execroot in the case of bazel. Care must be taken to match directories exclusively. The entire input tree is traversed for matches against expanded paths under the root, to allow for nested selection. Each match thus costs the number of input directories. Counterintuitively, OutputFiles are augmented to avoid the recursive check for OutputDirectories which only applies to actual reported results, resulting in a path match when creating the exec root. Regex style is java.util.Pattern, and must match the full input directory. --- .../worker/shard/CFCExecFileSystem.java | 81 +++++++++++++------ 1 file changed, 58 insertions(+), 23 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 74b238b2c6..70a4acbb04 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -19,7 +19,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.Iterables.concat; -import static com.google.common.collect.Iterables.filter; import static com.google.common.util.concurrent.Futures.allAsList; import static com.google.common.util.concurrent.Futures.catchingAsync; import static com.google.common.util.concurrent.Futures.immediateFailedFuture; @@ -48,7 +47,7 @@ import build.buildfarm.worker.ExecDirException.ViolationException; import build.buildfarm.worker.OutputDirectory; import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; +import com.google.common.collect.Iterables; import com.google.common.util.concurrent.ListenableFuture; import java.io.IOException; import java.io.InputStream; @@ -56,14 +55,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.UserPrincipal; -import java.util.Collections; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Stack; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.function.Consumer; import java.util.logging.Level; +import java.util.regex.Pattern; import javax.annotation.Nullable; import lombok.extern.java.Log; @@ -77,7 +78,7 @@ class CFCExecFileSystem implements ExecFileSystem { private final boolean linkInputDirectories; // override the symlinking above for a set of matching paths - private final Iterable realInputDirectories; + private final Iterable realInputDirectories; private final Map> rootInputFiles = new ConcurrentHashMap<>(); private final Map> rootInputDirectories = new ConcurrentHashMap<>(); @@ -98,7 +99,9 @@ class CFCExecFileSystem implements ExecFileSystem { this.fileCache = fileCache; this.owner = owner; this.linkInputDirectories = linkInputDirectories; - this.realInputDirectories = realInputDirectories; + this.realInputDirectories = + Iterables.transform( + realInputDirectories, realInputDirectory -> Pattern.compile(realInputDirectory)); this.removeDirectoryService = removeDirectoryService; this.accessRecorder = accessRecorder; } @@ -328,28 +331,61 @@ private static void checkExecErrors(Path path, List errors) throws Ex } } - private static boolean treeContainsPath( - String directoryPath, Map directoriesIndex, Digest rootDigest) { - Directory directory = directoriesIndex.get(rootDigest); - for (String name : directoryPath.split("/")) { - List subdirs = directory.getDirectoriesList(); - int index = Collections.binarySearch(Lists.transform(subdirs, DirectoryNode::getName), name); - if (index < 0) { - return false; + private static Iterator directoriesIterator( + Digest digest, Map directoriesIndex) { + Directory root = directoriesIndex.get(digest); + return new Iterator() { + boolean atEnd = root.getDirectoriesCount() == 0; + Stack path = new Stack<>(); + Stack> route = new Stack<>(); + Iterator current = root.getDirectoriesList().iterator(); + + @Override + public boolean hasNext() { + return !atEnd; } - directory = directoriesIndex.get(subdirs.get(index).getDigest()); - } - return true; + + @Override + public String next() { + String nextPath; + DirectoryNode next = current.next(); + String name = next.getName(); + path.push(name); + nextPath = String.join("/", path); + Digest digest = next.getDigest(); + if (digest.getSizeBytes() != 0) { + route.push(current); + current = directoriesIndex.get(digest).getDirectoriesList().iterator(); + } else { + path.pop(); + } + while (!current.hasNext() && !route.isEmpty()) { + current = route.pop(); + path.pop(); + } + atEnd = !current.hasNext(); + return nextPath; + } + }; } private Iterable realDirectories( Map directoriesIndex, Digest rootDigest) { // skip this search if all the directories are real if (linkInputDirectories) { - // somewhat inefficient, but would need many overrides to be painful - return filter( - realInputDirectories, - realInputDirectory -> treeContainsPath(realInputDirectory, directoriesIndex, rootDigest)); + ImmutableList.Builder builder = ImmutableList.builder(); + + Iterator dirs = directoriesIterator(rootDigest, directoriesIndex); + while (dirs.hasNext()) { + String dir = dirs.next(); + for (Pattern pattern : realInputDirectories) { + if (pattern.matcher(dir).matches()) { + builder.add(dir); + } + } + } + + return builder.build(); } return ImmutableList.of(); } @@ -361,10 +397,9 @@ public Path createExecDir( Digest inputRootDigest = action.getInputRootDigest(); OutputDirectory outputDirectory = OutputDirectory.parse( - command.getOutputFilesList(), concat( - command.getOutputDirectoriesList(), - realDirectories(directoriesIndex, inputRootDigest)), + command.getOutputFilesList(), realDirectories(directoriesIndex, inputRootDigest)), + command.getOutputDirectoriesList(), command.getEnvironmentVariablesList()); Path execDir = root.resolve(operationName); From 1dec6848e4141c714b0f854a94fbee3693da2a37 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 7 Jul 2023 02:08:18 -0400 Subject: [PATCH 084/214] Log execPath rather than the cache dir path This will include the path to the missed directory and the operation which required it. --- .../java/build/buildfarm/worker/shard/CFCExecFileSystem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 70a4acbb04..2944f30d0d 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -317,7 +317,8 @@ private ListenableFuture linkDirectory( Path path = pathResult.getPath(); if (pathResult.getMissed()) { log.fine( - String.format("putDirectory(%s, %s) created", path, DigestUtil.toString(digest))); + String.format( + "putDirectory(%s, %s) created", execPath, DigestUtil.toString(digest))); } Files.createSymbolicLink(execPath, path); return immediateFuture(null); From 6af857ad318180ee9bd574429990e774d780f1c7 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 7 Jul 2023 11:14:30 -0400 Subject: [PATCH 085/214] Shore up OutputDirectory for silence on duplicates Prevent adding duplicate realInputDirectories matches --- src/main/java/build/buildfarm/worker/OutputDirectory.java | 5 +++++ .../java/build/buildfarm/worker/shard/CFCExecFileSystem.java | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/java/build/buildfarm/worker/OutputDirectory.java b/src/main/java/build/buildfarm/worker/OutputDirectory.java index 6245553803..caf77b273e 100644 --- a/src/main/java/build/buildfarm/worker/OutputDirectory.java +++ b/src/main/java/build/buildfarm/worker/OutputDirectory.java @@ -161,10 +161,15 @@ private static OutputDirectory parseDirectories(Iterable o Iterables.addAll(sortedOutputDirs, outputDirs); Collections.sort(sortedOutputDirs); + String currentOutputDir = ""; Builder currentBuilder = builder; String prefix = "/"; for (OutputDirectoryEntry entry : sortedOutputDirs) { String outputDir = entry.outputDirectory; + if (outputDir == currentOutputDir) { + continue; + } + currentOutputDir = outputDir; while (!outputDir.startsWith(prefix)) { currentBuilder = stack.pop(); int upPathSeparatorIndex = prefix.lastIndexOf('/', prefix.length() - 2); diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 2944f30d0d..d73b977916 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -382,6 +382,7 @@ private Iterable realDirectories( for (Pattern pattern : realInputDirectories) { if (pattern.matcher(dir).matches()) { builder.add(dir); + break; // avoid adding the same directory twice } } } From 71a928c73f7ba69f7533d13821de0d9bf72c36d9 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 7 Jul 2023 16:31:06 -0400 Subject: [PATCH 086/214] Trigger realInputDirectories to have empty files Ensure that the last leg of the execution presents a directory, rather than the parent, per OutputDirectory's stamping. --- .../java/build/buildfarm/worker/shard/CFCExecFileSystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index d73b977916..94c232a942 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -381,7 +381,7 @@ private Iterable realDirectories( String dir = dirs.next(); for (Pattern pattern : realInputDirectories) { if (pattern.matcher(dir).matches()) { - builder.add(dir); + builder.add(dir + "/"); break; // avoid adding the same directory twice } } From f8017bd9aaa513dc0f91d52b18d06e2a6379d410 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 8 Jul 2023 10:02:43 -0400 Subject: [PATCH 087/214] Switch to positive check for linkInputDirectories --- examples/config.yml | 4 +- .../build/buildfarm/common/config/Worker.java | 2 +- .../worker/shard/CFCExecFileSystem.java | 39 ++++++++++++------- .../build/buildfarm/worker/shard/Worker.java | 2 +- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/examples/config.yml b/examples/config.yml index cdf72f3de7..bce19a3d60 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -117,8 +117,8 @@ worker: inputFetchStageWidth: 1 inputFetchDeadline: 60 linkInputDirectories: true - realInputDirectories: - - "external" + linkedInputDirectories: + - "(?!external)[^/]+" execOwner: defaultMaxCores: 0 limitGlobalExecution: false diff --git a/src/main/java/build/buildfarm/common/config/Worker.java b/src/main/java/build/buildfarm/common/config/Worker.java index 4caaff2b02..1661df9bfe 100644 --- a/src/main/java/build/buildfarm/common/config/Worker.java +++ b/src/main/java/build/buildfarm/common/config/Worker.java @@ -28,7 +28,7 @@ public class Worker { private int inputFetchStageWidth = 0; private int inputFetchDeadline = 60; private boolean linkInputDirectories = true; - private List realInputDirectories = Arrays.asList("external"); + private List linkedInputDirectories = Arrays.asList("(?!external)[^/]+"); private String execOwner; private int defaultMaxCores = 0; private boolean limitGlobalExecution = false; diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 94c232a942..041868f69c 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -47,6 +47,7 @@ import build.buildfarm.worker.ExecDirException.ViolationException; import build.buildfarm.worker.OutputDirectory; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.util.concurrent.ListenableFuture; import java.io.IOException; @@ -58,6 +59,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.Stack; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; @@ -77,8 +79,8 @@ class CFCExecFileSystem implements ExecFileSystem { // perform first-available non-output symlinking and retain directories in cache private final boolean linkInputDirectories; - // override the symlinking above for a set of matching paths - private final Iterable realInputDirectories; + // indicate symlinking above for a set of matching paths + private final Iterable linkedInputDirectories; private final Map> rootInputFiles = new ConcurrentHashMap<>(); private final Map> rootInputDirectories = new ConcurrentHashMap<>(); @@ -92,16 +94,16 @@ class CFCExecFileSystem implements ExecFileSystem { CASFileCache fileCache, @Nullable UserPrincipal owner, boolean linkInputDirectories, - Iterable realInputDirectories, + Iterable linkedInputDirectories, ExecutorService removeDirectoryService, ExecutorService accessRecorder) { this.root = root; this.fileCache = fileCache; this.owner = owner; this.linkInputDirectories = linkInputDirectories; - this.realInputDirectories = + this.linkedInputDirectories = Iterables.transform( - realInputDirectories, realInputDirectory -> Pattern.compile(realInputDirectory)); + linkedInputDirectories, realInputDirectory -> Pattern.compile(realInputDirectory)); this.removeDirectoryService = removeDirectoryService; this.accessRecorder = accessRecorder; } @@ -239,6 +241,7 @@ private Iterable> fetchInputs( Digest directoryDigest, Map directoriesIndex, OutputDirectory outputDirectory, + Set linkedInputDirectories, Consumer onKey, ImmutableList.Builder inputDirectories) throws IOException { @@ -275,7 +278,9 @@ private Iterable> fetchInputs( OutputDirectory childOutputDirectory = outputDirectory != null ? outputDirectory.getChild(name) : null; Path dirPath = path.resolve(name); - if (childOutputDirectory != null || !linkInputDirectories) { + if (childOutputDirectory != null + || !linkInputDirectories + || !linkedInputDirectories.contains(dirPath)) { Files.createDirectories(dirPath); downloads = concat( @@ -286,6 +291,7 @@ private Iterable> fetchInputs( digest, directoriesIndex, childOutputDirectory, + linkedInputDirectories, onKey, inputDirectories)); } else { @@ -370,26 +376,25 @@ public String next() { }; } - private Iterable realDirectories( + private Set linkedDirectories( Map directoriesIndex, Digest rootDigest) { // skip this search if all the directories are real if (linkInputDirectories) { - ImmutableList.Builder builder = ImmutableList.builder(); + ImmutableSet.Builder builder = ImmutableSet.builder(); Iterator dirs = directoriesIterator(rootDigest, directoriesIndex); while (dirs.hasNext()) { String dir = dirs.next(); - for (Pattern pattern : realInputDirectories) { + for (Pattern pattern : linkedInputDirectories) { if (pattern.matcher(dir).matches()) { - builder.add(dir + "/"); + builder.add(dir); break; // avoid adding the same directory twice } } } - return builder.build(); } - return ImmutableList.of(); + return ImmutableSet.of(); } @Override @@ -399,8 +404,7 @@ public Path createExecDir( Digest inputRootDigest = action.getInputRootDigest(); OutputDirectory outputDirectory = OutputDirectory.parse( - concat( - command.getOutputFilesList(), realDirectories(directoriesIndex, inputRootDigest)), + command.getOutputFilesList(), command.getOutputDirectoriesList(), command.getEnvironmentVariablesList()); @@ -413,6 +417,12 @@ public Path createExecDir( ImmutableList.Builder inputFiles = new ImmutableList.Builder<>(); ImmutableList.Builder inputDirectories = new ImmutableList.Builder<>(); + Set linkedInputDirectories = + ImmutableSet.copyOf( + Iterables.transform( + linkedDirectories(directoriesIndex, inputRootDigest), + path -> execDir.resolve(path))); // does this work on windows with / separators? + log.log( Level.FINER, "ExecFileSystem::createExecDir(" + operationName + ") calling fetchInputs"); Iterable> fetchedFutures = @@ -422,6 +432,7 @@ public Path createExecDir( inputRootDigest, directoriesIndex, outputDirectory, + linkedInputDirectories, key -> { synchronized (inputFiles) { inputFiles.add(key); diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 084e5df7bf..153df1a371 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -333,7 +333,7 @@ private ExecFileSystem createCFCExecFileSystem( fileCache, owner, configs.getWorker().isLinkInputDirectories(), - configs.getWorker().getRealInputDirectories(), + configs.getWorker().getLinkedInputDirectories(), removeDirectoryService, accessRecorder /* deadlineAfter=*/ From 5d88e544e54d028c6b7af485aba5bac5b32b11c4 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 12 Oct 2023 10:48:23 -0700 Subject: [PATCH 088/214] docs(configuration): document --prometheus_port CLI argument --- _site/docs/configuration/configuration.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ac74bb3f1e..21956e7b3d 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -28,13 +28,13 @@ For an example config containing all of the configuration values, see `examples/ ### Common -| Configuration | Accepted and _Default_ Values | Description | -|----------------------|-------------------------------|---------------------------------------------------| -| digestFunction | _SHA256_, SHA1 | Digest function for this implementation | -| defaultActionTimeout | Integer, _600_ | Default timeout value for an action (seconds) | -| maximumActionTimeout | Integer, _3600_ | Maximum allowed action timeout (seconds) | -| maxEntrySizeBytes | Long, _2147483648_ | Maximum size of a single blob accepted (bytes) | -| prometheusPort | Integer, _9090_ | Listening port of the Prometheus metrics endpoint | +| Configuration | Accepted and _Default_ Values | Command Line Argument | Description | +|----------------------|-------------------------------|-----------------------|---------------------------------------------------| +| digestFunction | _SHA256_, SHA1 | | Digest function for this implementation | +| defaultActionTimeout | Integer, _600_ | | Default timeout value for an action (seconds) | +| maximumActionTimeout | Integer, _3600_ | | Maximum allowed action timeout (seconds) | +| maxEntrySizeBytes | Long, _2147483648_ | | Maximum size of a single blob accepted (bytes) | +| prometheusPort | Integer, _9090_ | --prometheus_port | Listening port of the Prometheus metrics endpoint | Example: From 21448c3954ff70268c9a8e21871c0fdd7f44767a Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 12 Oct 2023 10:48:54 -0700 Subject: [PATCH 089/214] docs(configuration): readability and typos --- _site/docs/configuration/configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 21956e7b3d..9a806ef336 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -21,8 +21,8 @@ worker: publicName: "localhost:8981" ``` -The configuration can be provided to the server and worker as a CLI argument or through the env variable `CONFIG_PATH` -For an example config containing all of the configuration values, see `examples/config.yml`. +The configuration can be provided to the server and worker as a CLI argument or through the environment variable `CONFIG_PATH` +For an example configuration containing all of the configuration values, see `examples/config.yml`. ## All Configurations @@ -64,7 +64,7 @@ worker: | sslPrivateKeyPath | String, _null_ | | Absolute path of the SSL private key (if TLS used) | | runDispatchedMonitor | boolean, _true_ | | Enable an agent to monitor the operation store to ensure that dispatched operations with expired worker leases are requeued | | dispatchedMonitorIntervalSeconds | Integer, _1_ | | Dispatched monitor's lease expiration check interval (seconds) | -| runOperationQueuer | boolean, _true_ | | Aquire execute request entries cooperatively from an arrival queue on the backplane | +| runOperationQueuer | boolean, _true_ | | Acquire execute request entries cooperatively from an arrival queue on the backplane | | ensureOutputsPresent | boolean, _false_ | | Decide if all outputs are also present in the CAS. If any outputs are missing a cache miss is returned | | maxCpu | Integer, _0_ | | Maximum number of CPU cores that any min/max-cores property may request (0 = unlimited) | | maxRequeueAttempts | Integer, _5_ | | Maximum number of requeue attempts for an operation | From 461cc5a637d9b5617534dbc39b02e78b9a042312 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 12 Oct 2023 10:49:21 -0700 Subject: [PATCH 090/214] style(configuration.md): table formatting --- _site/docs/configuration/configuration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 9a806ef336..2c08e8598e 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -105,12 +105,12 @@ server: ### Server Caches -| Configuration | Accepted and _Default_ Values | Description | -|--------------------------|-------------------------------|--------------------------------------------------------| -| directoryCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the directory cache will hold. | -| commandCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the command cache will hold. | -| digestToActionCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the digest-to-action cache will hold. | -| recentServedExecutionsCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the executions cache will hold. | +| Configuration | Accepted and _Default_ Values | Description | +|---------------------------------------|-------------------------------|----------------------------------------------------------------------| +| directoryCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the directory cache will hold. | +| commandCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the command cache will hold. | +| digestToActionCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the digest-to-action cache will hold. | +| recentServedExecutionsCacheMaxEntries | Long, _64 * 1024_ | The max number of entries that the executions cache will hold. | Example: From b74531c7c6dd74a83ccb1d07c4b8ce9ba8d66d4d Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Fri, 6 Oct 2023 16:01:26 -0700 Subject: [PATCH 091/214] feat: support --redis_uri command line option Support a `--redis_uri` command line option for start-up. --- .../build/buildfarm/common/config/BuildfarmConfigs.java | 6 ++++++ .../build/buildfarm/common/config/BuildfarmOptions.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 1a15e40803..444d25a13d 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -80,6 +80,9 @@ public static BuildfarmConfigs loadServerConfigs(String[] args) throws Configura if (options.prometheusPort >= 0) { buildfarmConfigs.setPrometheusPort(options.prometheusPort); } + if (!Strings.isNullOrEmpty(options.redisUri)) { + buildfarmConfigs.getBackplane().setRedisUri(options.redisUri); + } adjustServerConfigs(buildfarmConfigs); return buildfarmConfigs; } @@ -99,6 +102,9 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura if (options.prometheusPort >= 0) { buildfarmConfigs.setPrometheusPort(options.prometheusPort); } + if (!Strings.isNullOrEmpty(options.redisUri)) { + buildfarmConfigs.getBackplane().setRedisUri(options.redisUri); + } adjustWorkerConfigs(buildfarmConfigs); return buildfarmConfigs; } diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java index defeebbf48..1dbe0c7f98 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java @@ -27,4 +27,10 @@ public class BuildfarmOptions extends OptionsBase { help = "Port for the prometheus service. '0' will disable prometheus hosting", defaultValue = "-1") public int prometheusPort; + + @Option( + name = "redis_uri", + help = "URI for Redis connection. Use 'redis://' or 'rediss://' for the scheme", + defaultValue = "") + public String redisUri; } From d860b277f891222dd83a0cc746a193863e60d715 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 12 Oct 2023 10:46:17 -0700 Subject: [PATCH 092/214] docs(configuration): document the --redis_uri command line options also fixed some spelling typos. --- _site/docs/configuration/configuration.md | 70 +++++++++++------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 2c08e8598e..ae913adf88 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -169,41 +169,41 @@ server: ### Redis Backplane -| Configuration | Accepted and _Default_ Values | Environment Var | Description | -|------------------------------|------------------------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type | _SHARD_ | | Type of backplane. Currently, the only implemntation is SHARD utilizing Redis | -| redisUri | String, redis://localhost:6379 | REDIS_URI | Redis cluster endpoint. This must be a single URI | -| redisPassword | String, _null_ | | Redis password, if applicable | -| redisNodes | List of Strings, _null_ | | List of individual Redis nodes, if applicable | -| jedisPoolMaxTotal | Integer, _4000_ | | The size of the Redis connection pool | -| workersHashName | String, _Workers_ | | Redis key used to store a hash of registered workers | -| workerChannel | String, _WorkerChannel_ | | Redis pubsub channel key where changes of the cluster membership are announced | -| actionCachePrefix | String, _ActionCache_ | | Redis key prefix for all ActionCache entries | -| actionCacheExpire | Integer, _2419200_ | | The TTL maintained for ActionCache entries, not refreshed on getActionResult hit | -| actionBlacklistPrefix | String, _ActionBlacklist_ | | Redis key prefix for all blacklisted actions, which are rejected | -| actionBlacklistExpire | Integer, _3600_ | | The TTL maintained for action blacklist entries | -| invocationBlacklistPrefix | String, _InvocationBlacklist_ | | Redis key prefix for blacklisted invocations, suffixed with a a tool invocation ID | -| operationPrefix | String, _Operation_ | | Redis key prefix for all operations, suffixed wtih the operation's name | -| operationExpire | Integer, _604800_ | | The TTL maintained for all operations, updated on each modification | -| preQueuedOperationsListName | String, _{Arrival}:PreQueuedOperations_ | | Redis key used to store a list of ExecuteEntry awaiting transformation into QueryEntry | -| processingListName | String, _{Arrival}:ProcessingOperations_ | | Redis key of a list used to ensure reliable processing of arrival queue etries with operation watch monitoring | -| processingPrefix | String, _Processing_ | | Redis key prefix for operations which are being dequeued from the arrival queue | -| processingTimeoutMillis | Integer, _20000_ | | Delay (in ms) used to populate processing operation entries | -| queuedOperationsListName | String, _{Execution}:QueuedOperations_ | | Redis key used to store a list of QueueEntry awaiting execution by workers | -| dispatchingPrefix | String, _Dispatching_ | | Redis key prefix for operations which are being dequeued from the ready to run queue | -| dispatchingTimeoutMillis | Integer, _10000_ | | Delay (in ms) used to populate dispatching operation entries | -| dispatchedOperationsHashName | String, _DispatchedOperations_ | | Redis key of a hash of operation names to the worker lease for its execution, which are monitored by the dispatched monitor | -| operationChannelPrefix | String, _OperationChannel_ | | Redis pubsub channel prefix suffixed by an operation name | -| casPrefix | String, _ContentAddressableStorage_ | | Redis key prefix suffixed with a blob digest that maps to a set of workers with that blob's availability | -| casExpire | Integer, _604800_ | | The TTL maintained for CAS entries, which is not refreshed on any read access of the blob | -| subscribeToBackplane | boolean, _true_ | | Enable an agent of the backplane client which subscribes to worker channel and operation channel events. If disabled, responsiveness of watchers and CAS are reduced | -| runFailsafeOperation | boolean, _true_ | | Enable an agent in the backplane client which monitors watched operations and ensures they are in a known maintained, or expirable state | -| maxQueueDepth | Integer, _100000_ | | Maximum length that the ready to run queue is allowed to reach to control an arrival flow for execution | -| maxPreQueueDepth | Integer, _1000000_ | | Maximum lengh that the arrival queue is allowed to reach to control load on the Redis cluster | -| priorityQueue | boolean, _false_ | | Priority queue type allows prioritizing operations based on Bazel's --remote_execution_priority= flag | -| timeout | Integer, _10000_ | | Default timeout | -| maxAttempts | Integer, _20_ | | Maximum number of execution attempts | -| cacheCas | boolean, _false_ | | | +| Configuration | Accepted and _Default_ Values | Environment Var | Command Line Argument | Description | +|------------------------------|------------------------------------------|-----------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| type | _SHARD_ | | | Type of backplane. Currently, the only implementation is SHARD utilizing Redis | +| redisUri | String, redis://localhost:6379 | REDIS_URI | --redis_uri | Redis cluster endpoint. This must be a single URI | +| redisPassword | String, _null_ | | | Redis password, if applicable | +| redisNodes | List of Strings, _null_ | | | List of individual Redis nodes, if applicable | +| jedisPoolMaxTotal | Integer, _4000_ | | | The size of the Redis connection pool | +| workersHashName | String, _Workers_ | | | Redis key used to store a hash of registered workers | +| workerChannel | String, _WorkerChannel_ | | | Redis pubsub channel key where changes of the cluster membership are announced | +| actionCachePrefix | String, _ActionCache_ | | | Redis key prefix for all ActionCache entries | +| actionCacheExpire | Integer, _2419200_ | | | The TTL maintained for ActionCache entries, not refreshed on getActionResult hit | +| actionBlacklistPrefix | String, _ActionBlacklist_ | | | Redis key prefix for all blacklisted actions, which are rejected | +| actionBlacklistExpire | Integer, _3600_ | | | The TTL maintained for action blacklist entries | +| invocationBlacklistPrefix | String, _InvocationBlacklist_ | | | Redis key prefix for blacklisted invocations, suffixed with a a tool invocation ID | +| operationPrefix | String, _Operation_ | | | Redis key prefix for all operations, suffixed with the operation's name | +| operationExpire | Integer, _604800_ | | | The TTL maintained for all operations, updated on each modification | +| preQueuedOperationsListName | String, _{Arrival}:PreQueuedOperations_ | | | Redis key used to store a list of ExecuteEntry awaiting transformation into QueryEntry | +| processingListName | String, _{Arrival}:ProcessingOperations_ | | | Redis key of a list used to ensure reliable processing of arrival queue entries with operation watch monitoring | +| processingPrefix | String, _Processing_ | | | Redis key prefix for operations which are being dequeued from the arrival queue | +| processingTimeoutMillis | Integer, _20000_ | | | Delay (in ms) used to populate processing operation entries | +| queuedOperationsListName | String, _{Execution}:QueuedOperations_ | | | Redis key used to store a list of QueueEntry awaiting execution by workers | +| dispatchingPrefix | String, _Dispatching_ | | | Redis key prefix for operations which are being dequeued from the ready to run queue | +| dispatchingTimeoutMillis | Integer, _10000_ | | | Delay (in ms) used to populate dispatching operation entries | +| dispatchedOperationsHashName | String, _DispatchedOperations_ | | | Redis key of a hash of operation names to the worker lease for its execution, which are monitored by the dispatched monitor | +| operationChannelPrefix | String, _OperationChannel_ | | | Redis pubsub channel prefix suffixed by an operation name | +| casPrefix | String, _ContentAddressableStorage_ | | | Redis key prefix suffixed with a blob digest that maps to a set of workers with that blob's availability | +| casExpire | Integer, _604800_ | | | The TTL maintained for CAS entries, which is not refreshed on any read access of the blob | +| subscribeToBackplane | boolean, _true_ | | | Enable an agent of the backplane client which subscribes to worker channel and operation channel events. If disabled, responsiveness of watchers and CAS are reduced | +| runFailsafeOperation | boolean, _true_ | | | Enable an agent in the backplane client which monitors watched operations and ensures they are in a known maintained, or expirable state | +| maxQueueDepth | Integer, _100000_ | | | Maximum length that the ready to run queue is allowed to reach to control an arrival flow for execution | +| maxPreQueueDepth | Integer, _1000000_ | | | Maximum lengh that the arrival queue is allowed to reach to control load on the Redis cluster | +| priorityQueue | boolean, _false_ | | | Priority queue type allows prioritizing operations based on Bazel's --remote_execution_priority= flag | +| timeout | Integer, _10000_ | | | Default timeout | +| maxAttempts | Integer, _20_ | | | Maximum number of execution attempts | +| cacheCas | boolean, _false_ | | | | Example: From 10bf1398bfecc13804b865ffde0b0e9613c80c23 Mon Sep 17 00:00:00 2001 From: Jorge Pinto Sousa Date: Wed, 11 Oct 2023 16:28:41 +0200 Subject: [PATCH 093/214] Example should use `container_image` instead of `java_image` --- _site/docs/execution/environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_site/docs/execution/environment.md b/_site/docs/execution/environment.md index 4a17aabe6b..d2cbca0b51 100644 --- a/_site/docs/execution/environment.md +++ b/_site/docs/execution/environment.md @@ -116,7 +116,7 @@ Next we will create a BUILD file to create our target image. We will use the sha ``` load("@io_bazel_rules_docker//container:container.bzl", "container_image") -java_image( +container_image( name = "buildfarm-shard-worker-ubuntu20-java14", base = "@ubuntu20_java14_image_base//image", files = [ From 9d4c86c8021804aeb5f8723b4faf914963a95386 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 21 Sep 2023 22:16:27 -0700 Subject: [PATCH 094/214] chore: bump rules_jvm_external Bumping 4.2 -> 5.3 --- deps.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps.bzl b/deps.bzl index c31cf04edd..833fe1447e 100644 --- a/deps.bzl +++ b/deps.bzl @@ -5,8 +5,8 @@ buildfarm dependencies that can be imported into other WORKSPACE files load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file", "http_jar") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -RULES_JVM_EXTERNAL_TAG = "4.2" -RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" +RULES_JVM_EXTERNAL_TAG = "5.3" +RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac" def archive_dependencies(third_party): return [ @@ -22,7 +22,7 @@ def archive_dependencies(third_party): "name": "rules_jvm_external", "strip_prefix": "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, "sha256": RULES_JVM_EXTERNAL_SHA, - "url": "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, + "url": "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), }, # Kubernetes rules. Useful for local development with tilt. From 5bc4564590eba4585676ef411f093423ee6b1b19 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 21 Sep 2023 22:26:06 -0700 Subject: [PATCH 095/214] chore: bump rules_cc Bump fro 0.0.6 -> 0.0.9 --- deps.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps.bzl b/deps.bzl index 833fe1447e..f802fb27e7 100644 --- a/deps.bzl +++ b/deps.bzl @@ -92,9 +92,9 @@ def archive_dependencies(third_party): }, { "name": "rules_cc", - "sha256": "3d9e271e2876ba42e114c9b9bc51454e379cbf0ec9ef9d40e2ae4cec61a31b40", - "strip_prefix": "rules_cc-0.0.6", - "url": "https://github.com/bazelbuild/rules_cc/releases/download/0.0.6/rules_cc-0.0.6.tar.gz", + "sha256": "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", + "strip_prefix": "rules_cc-0.0.9", + "url": "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz", }, # Used to format proto files From edf2211c086b839aa1bb1957245febc681685e2e Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Mon, 16 Oct 2023 23:54:31 -0400 Subject: [PATCH 096/214] Implement local resources for workers (#1282) --- _site/docs/contribute/design-documents.md | 3 +- .../buildfarm/common/config/Backplane.java | 15 +- .../common/config/LimitedResource.java | 43 ++++ .../build/buildfarm/common/config/Worker.java | 6 + .../common/redis/BalancedRedisQueue.java | 11 + .../instance/shard/OperationQueue.java | 84 +++++++- src/main/java/build/buildfarm/worker/BUILD | 1 + .../worker/DequeueMatchEvaluator.java | 37 ++-- .../java/build/buildfarm/worker/Executor.java | 3 + .../build/buildfarm/worker/WorkerContext.java | 2 + .../build/buildfarm/worker/resources/BUILD | 1 + .../worker/resources/LocalResourceSet.java | 37 ++++ .../resources/LocalResourceSetMetrics.java | 46 +++++ .../resources/LocalResourceSetUtils.java | 120 +++++++++++ .../worker/shard/ShardWorkerContext.java | 22 +- .../build/buildfarm/worker/shard/Worker.java | 2 + .../common/config/GrpcMetricsTest.java | 1 - .../java/build/buildfarm/instance/shard/BUILD | 192 +++++++++++++++++- .../shard/RedisShardBackplaneTest.java | 6 +- .../instance/shard/ShardInstanceTest.java | 1 - .../worker/DequeueMatchEvaluatorTest.java | 168 ++++++++++++++- .../buildfarm/worker/StubWorkerContext.java | 5 + .../java/build/buildfarm/worker/shard/BUILD | 1 + .../worker/shard/ShardWorkerContextTest.java | 2 + 24 files changed, 759 insertions(+), 50 deletions(-) create mode 100644 src/main/java/build/buildfarm/common/config/LimitedResource.java create mode 100644 src/main/java/build/buildfarm/worker/resources/LocalResourceSet.java create mode 100644 src/main/java/build/buildfarm/worker/resources/LocalResourceSetMetrics.java create mode 100644 src/main/java/build/buildfarm/worker/resources/LocalResourceSetUtils.java diff --git a/_site/docs/contribute/design-documents.md b/_site/docs/contribute/design-documents.md index f7b1c0b80d..ea608696f3 100644 --- a/_site/docs/contribute/design-documents.md +++ b/_site/docs/contribute/design-documents.md @@ -5,4 +5,5 @@ parent: Contribute nav_order: 2 --- -[Infinite Cache (Storage Workers)](https://docs.google.com/document/d/1IQQbWPzjSluDL25FZ9ADtNIOT90PLijQGIAC4RbwMjY/edit?usp=sharing) \ No newline at end of file +[Infinite Cache (Storage Workers)](https://docs.google.com/document/d/1IQQbWPzjSluDL25FZ9ADtNIOT90PLijQGIAC4RbwMjY/edit?usp=sharing) +[Local and Global Resources](https://docs.google.com/document/d/1u0TkmVmdMS53PWR1hgh-a_cj3NmQYE0Favv9aGFfQZs/edit?usp=sharing) \ No newline at end of file diff --git a/src/main/java/build/buildfarm/common/config/Backplane.java b/src/main/java/build/buildfarm/common/config/Backplane.java index 5c21532ab4..cc15a6028a 100644 --- a/src/main/java/build/buildfarm/common/config/Backplane.java +++ b/src/main/java/build/buildfarm/common/config/Backplane.java @@ -1,6 +1,7 @@ package build.buildfarm.common.config; -import com.google.common.base.Strings; +import java.util.ArrayList; +import java.util.List; import lombok.AccessLevel; import lombok.Data; import lombok.Getter; @@ -52,13 +53,7 @@ public enum BACKPLANE_TYPE { private boolean cacheCas = false; private long priorityPollIntervalMillis = 100; - public String getRedisUri() { - // use environment override (useful for containerized deployment) - if (!Strings.isNullOrEmpty(System.getenv("REDIS_URI"))) { - return System.getenv("REDIS_URI"); - } - - // use configured value - return redisUri; - } + // These limited resources are shared across all workers. + // An example would be a limited number of seats to a license server. + private List resources = new ArrayList<>(); } diff --git a/src/main/java/build/buildfarm/common/config/LimitedResource.java b/src/main/java/build/buildfarm/common/config/LimitedResource.java new file mode 100644 index 0000000000..f3b09ff621 --- /dev/null +++ b/src/main/java/build/buildfarm/common/config/LimitedResource.java @@ -0,0 +1,43 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.common.config; + +import lombok.Data; + +/** + * @class Limited Resource + * @brief A fixed amount of a specific resource. + * @details We define a limited resource as a counting semaphore whose configuration contains a name + * and a count representing a physical or logical group of units obtained by executors as a + * precondition to fulfill a long running operation. These units are released upon the + * operation's completion. The resource is requested by the action's platform properties. + */ +@Data +public class LimitedResource { + /** + * @field name + * @brief The name of the resource. + * @details This should correspond to the platform property's key name: + * resources:: + */ + public String name; + + /** + * @field amount + * @brief The total amount of the resource that's available for use during execution. + * @details As a counting semaphore, this amount becomes the limit. + */ + public int amount = 1; +} diff --git a/src/main/java/build/buildfarm/common/config/Worker.java b/src/main/java/build/buildfarm/common/config/Worker.java index 1661df9bfe..e987c1e370 100644 --- a/src/main/java/build/buildfarm/common/config/Worker.java +++ b/src/main/java/build/buildfarm/common/config/Worker.java @@ -5,6 +5,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.naming.ConfigurationException; @@ -39,6 +40,11 @@ public class Worker { private ExecutionPolicy[] executionPolicies = {}; private SandboxSettings sandboxSettings = new SandboxSettings(); + // These limited resources are only for the individual worker. + // An example would be hardware resources such as GPUs. + // If you want GPU actions to run exclusively, define a single GPU resource. + private List resources = new ArrayList<>(); + public ExecutionPolicy[] getExecutionPolicies() { if (executionPolicies != null) { return executionPolicies; diff --git a/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java b/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java index 52f937c8ed..9123f5eaf9 100644 --- a/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java +++ b/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java @@ -236,6 +236,17 @@ public String dequeue(JedisCluster jedis) throws InterruptedException { } } + /** + * @brief Pop element into internal dequeue and return value. + * @details Null is returned if the queue is empty. + * @return The value of the transfered element. null if queue is empty or thread was interrupted. + * @note Suggested return identifier: val. + */ + public String nonBlockingDequeue(JedisCluster jedis) throws InterruptedException { + QueueInterface queue = queues.get(roundRobinPopIndex()); + return queue.nonBlockingDequeue(jedis); + } + /** * @brief Get the current pop queue. * @details Get the queue that the balanced queue intends to pop from next. diff --git a/src/main/java/build/buildfarm/instance/shard/OperationQueue.java b/src/main/java/build/buildfarm/instance/shard/OperationQueue.java index 64f1f2befa..78dd77c769 100644 --- a/src/main/java/build/buildfarm/instance/shard/OperationQueue.java +++ b/src/main/java/build/buildfarm/instance/shard/OperationQueue.java @@ -24,6 +24,7 @@ import com.google.common.collect.SetMultimap; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import redis.clients.jedis.JedisCluster; /** @@ -48,6 +49,14 @@ public class OperationQueue { */ private final List queues; + /** + * @field currentDequeueIndex + * @brief The current queue index to dequeue from. + * @details Used in a round-robin fashion to ensure an even distribution of dequeues across + * matched queues. + */ + private int currentDequeueIndex = 0; + /** * @brief Constructor. * @details Construct the operation queue with various provisioned redis queues. @@ -186,8 +195,18 @@ public void push( */ public String dequeue(JedisCluster jedis, List provisions) throws InterruptedException { - BalancedRedisQueue queue = chooseEligibleQueue(provisions); - return queue.dequeue(jedis); + // Select all matched queues, and attempt dequeuing via round-robin. + List queues = chooseEligibleQueues(provisions); + int index = roundRobinPopIndex(queues); + String value = queues.get(index).nonBlockingDequeue(jedis); + + // Keep iterating over matched queues until we find one that is non-empty and provides a + // dequeued value. + while (value == null) { + index = roundRobinPopIndex(queues); + value = queues.get(index).nonBlockingDequeue(jedis); + } + return value; } /** @@ -270,6 +289,39 @@ private BalancedRedisQueue chooseEligibleQueue(List provision } } + throwNoEligibleQueueException(provisions); + return null; + } + + /** + * @brief Choose an eligible queues based on given properties. + * @details We use the platform execution properties of a queue entry to determine the appropriate + * queues. If there no eligible queues, an exception is thrown. + * @param provisions Provisions to check that requirements are met. + * @return The chosen queues. + * @note Suggested return identifier: queues. + */ + private List chooseEligibleQueues(List provisions) { + List eligibleQueues = + queues.stream() + .filter(provisionedQueue -> provisionedQueue.isEligible(toMultimap(provisions))) + .map(provisionedQueue -> provisionedQueue.queue()) + .collect(Collectors.toList()); + + if (eligibleQueues.isEmpty()) { + throwNoEligibleQueueException(provisions); + } + + return eligibleQueues; + } + + /** + * @brief Throw an exception that explains why there are no eligible queues. + * @details This function should only be called, when there were no matched queues. + * @param provisions Provisions to check that requirements are met. + * @return no return. + */ + private void throwNoEligibleQueueException(List provisions) { // At this point, we were unable to match an action to an eligible queue. // We will build an error explaining why the matching failed. This will help user's properly // configure their queue or adjust the execution_properties of their actions. @@ -286,6 +338,34 @@ private BalancedRedisQueue chooseEligibleQueue(List provision + eligibilityResults); } + /** + * @brief Get the current queue index for round-robin dequeues. + * @details Adjusts the round-robin index for next call. + * @param matchedQueues The queues to round robin. + * @return The current round-robin index. + * @note Suggested return identifier: queueIndex. + */ + private int roundRobinPopIndex(List matchedQueues) { + int currentIndex = currentDequeueIndex; + currentDequeueIndex = nextQueueInRoundRobin(currentDequeueIndex, matchedQueues); + return currentIndex; + } + + /** + * @brief Get the next queue in the round robin. + * @details If we are currently on the last queue it becomes the first queue. + * @param index Current queue index. + * @param matchedQueues The queues to round robin. + * @return And adjusted val based on the current queue index. + * @note Suggested return identifier: adjustedCurrentQueue. + */ + private int nextQueueInRoundRobin(int index, List matchedQueues) { + if (index >= matchedQueues.size() - 1) { + return 0; + } + return index + 1; + } + /** * @brief Convert proto provisions into java multimap. * @details This conversion is done to more easily check if a key/value exists in the provisions. diff --git a/src/main/java/build/buildfarm/worker/BUILD b/src/main/java/build/buildfarm/worker/BUILD index c25b9e74d6..e24b50d731 100644 --- a/src/main/java/build/buildfarm/worker/BUILD +++ b/src/main/java/build/buildfarm/worker/BUILD @@ -36,6 +36,7 @@ java_library( "@maven//:io_grpc_grpc_stub", "@maven//:io_prometheus_simpleclient", "@maven//:org_apache_commons_commons_compress", + "@maven//:org_apache_commons_commons_lang3", "@maven//:org_jetbrains_annotations", "@maven//:org_projectlombok_lombok", ], diff --git a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java index c3c4c1dfc9..3536ed6bac 100644 --- a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java +++ b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java @@ -14,11 +14,12 @@ package build.buildfarm.worker; -import build.bazel.remote.execution.v2.Command; import build.bazel.remote.execution.v2.Platform; import build.buildfarm.common.ExecutionProperties; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.v1test.QueueEntry; +import build.buildfarm.worker.resources.LocalResourceSet; +import build.buildfarm.worker.resources.LocalResourceSetUtils; import com.google.common.collect.Iterables; import com.google.common.collect.SetMultimap; import org.jetbrains.annotations.NotNull; @@ -45,6 +46,7 @@ public class DequeueMatchEvaluator { * @brief Decide whether the worker should keep the operation or put it back on the queue. * @details Compares the platform properties of the worker to the operation's platform properties. * @param workerProvisions The provisions of the worker. + * @param resourceSet The limited resources that the worker has available. * @param queueEntry An entry recently removed from the queue. * @return Whether or not the worker should accept or reject the queue entry. * @note Overloaded. @@ -53,24 +55,10 @@ public class DequeueMatchEvaluator { @SuppressWarnings("NullableProblems") @NotNull public static boolean shouldKeepOperation( - SetMultimap workerProvisions, QueueEntry queueEntry) { - return shouldKeepViaPlatform(workerProvisions, queueEntry.getPlatform()); - } - - /** - * @brief Decide whether the worker should keep the operation or put it back on the queue. - * @details Compares the platform properties of the worker to the operation's platform properties. - * @param workerProvisions The provisions of the worker. - * @param command A command to evaluate. - * @return Whether or not the worker should accept or reject the queue entry. - * @note Overloaded. - * @note Suggested return identifier: shouldKeepOperation. - */ - @SuppressWarnings("NullableProblems") - @NotNull - public static boolean shouldKeepOperation( - SetMultimap workerProvisions, Command command) { - return shouldKeepViaPlatform(workerProvisions, command.getPlatform()); + SetMultimap workerProvisions, + LocalResourceSet resourceSet, + QueueEntry queueEntry) { + return shouldKeepViaPlatform(workerProvisions, resourceSet, queueEntry.getPlatform()); } /** @@ -79,6 +67,7 @@ public static boolean shouldKeepOperation( * @details Compares the platform properties of the worker to the platform properties of the * operation. * @param workerProvisions The provisions of the worker. + * @param resourceSet The limited resources that the worker has available. * @param platform The platforms of operation. * @return Whether or not the worker should accept or reject the operation. * @note Suggested return identifier: shouldKeepOperation. @@ -86,9 +75,15 @@ public static boolean shouldKeepOperation( @SuppressWarnings("NullableProblems") @NotNull private static boolean shouldKeepViaPlatform( - SetMultimap workerProvisions, Platform platform) { - // attempt to execute everything the worker gets off the queue. + SetMultimap workerProvisions, + LocalResourceSet resourceSet, + Platform platform) { + // attempt to execute everything the worker gets off the queue, + // provided there is enough resources to do so. // this is a recommended configuration. + if (!LocalResourceSetUtils.claimResources(platform, resourceSet)) { + return false; + } if (configs.getWorker().getDequeueMatchSettings().isAcceptEverything()) { return true; } diff --git a/src/main/java/build/buildfarm/worker/Executor.java b/src/main/java/build/buildfarm/worker/Executor.java index 0416c2354d..f4776a6f00 100644 --- a/src/main/java/build/buildfarm/worker/Executor.java +++ b/src/main/java/build/buildfarm/worker/Executor.java @@ -359,6 +359,9 @@ public void run(ResourceLimits limits) { } finally { boolean wasInterrupted = Thread.interrupted(); try { + // Now that the execution has finished we can return any of the claims against local + // resources. + workerContext.returnLocalResources(operationContext.queueEntry); owner.releaseExecutor( operationName, limits.cpu.claimed, diff --git a/src/main/java/build/buildfarm/worker/WorkerContext.java b/src/main/java/build/buildfarm/worker/WorkerContext.java index 873ad1b938..70060acea1 100644 --- a/src/main/java/build/buildfarm/worker/WorkerContext.java +++ b/src/main/java/build/buildfarm/worker/WorkerContext.java @@ -130,4 +130,6 @@ IOResource limitExecution( int commandExecutionClaims(Command command); ResourceLimits commandExecutionSettings(Command command); + + void returnLocalResources(QueueEntry queueEntry); } diff --git a/src/main/java/build/buildfarm/worker/resources/BUILD b/src/main/java/build/buildfarm/worker/resources/BUILD index ac2d69179b..36a4dc3d34 100644 --- a/src/main/java/build/buildfarm/worker/resources/BUILD +++ b/src/main/java/build/buildfarm/worker/resources/BUILD @@ -8,6 +8,7 @@ java_library( "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@maven//:com_google_guava_guava", "@maven//:com_googlecode_json_simple_json_simple", + "@maven//:io_prometheus_simpleclient", "@maven//:org_apache_commons_commons_lang3", ], ) diff --git a/src/main/java/build/buildfarm/worker/resources/LocalResourceSet.java b/src/main/java/build/buildfarm/worker/resources/LocalResourceSet.java new file mode 100644 index 0000000000..97d64fe9b1 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/resources/LocalResourceSet.java @@ -0,0 +1,37 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.resources; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Semaphore; + +/** + * @class Local Resource Set + * @brief A fixed amount of a specific resource. + * @details We define limited resources as a counting semaphores whose configuration contains a name + * and a count representing a physical or logical group of units obtained by executors as a + * precondition to fulfill a long running operation. These units are released upon the + * operation's completion. The resource is requested by the action's platform properties. These + * resources are specific to the individual worker. + */ +public class LocalResourceSet { + /** + * @field resources + * @brief A set containing resource semaphores organized by name. + * @details Key is name, and value is current usage amount. + */ + public Map resources = new HashMap<>(); +} diff --git a/src/main/java/build/buildfarm/worker/resources/LocalResourceSetMetrics.java b/src/main/java/build/buildfarm/worker/resources/LocalResourceSetMetrics.java new file mode 100644 index 0000000000..787a7840e5 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/resources/LocalResourceSetMetrics.java @@ -0,0 +1,46 @@ +// Copyright 2020 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.resources; + +import io.prometheus.client.Gauge; + +/** + * @class LocalResourceSetMetrics + * @brief Tracks metrics related to a worker's limited local resources. + * @details Answers how many resources exist, how many are claimed, and by how many requesters. + */ +public class LocalResourceSetMetrics { + public static final Gauge resourceUsageMetric = + Gauge.build() + .name("local_resource_usage") + .labelNames("resource_name") + .help("The number of claims for each resource currently being used for execution") + .register(); + + public static final Gauge resourceTotalMetric = + Gauge.build() + .name("local_resource_total") + .labelNames("resource_name") + .help("The total number of claims exist for a particular resource") + .register(); + + public static final Gauge requestersMetric = + Gauge.build() + .name("local_resource_requesters") + .labelNames("resource_name") + .help( + "Tracks how many actions have requested local resources. This can help determine if resources are being hogged by some actions.") + .register(); +} diff --git a/src/main/java/build/buildfarm/worker/resources/LocalResourceSetUtils.java b/src/main/java/build/buildfarm/worker/resources/LocalResourceSetUtils.java new file mode 100644 index 0000000000..e8a1e56131 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/resources/LocalResourceSetUtils.java @@ -0,0 +1,120 @@ +// Copyright 2020 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.resources; + +import build.bazel.remote.execution.v2.Platform; +import build.buildfarm.common.config.LimitedResource; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Semaphore; +import org.apache.commons.lang3.StringUtils; + +/** + * @class LocalResourceSetUtils + * @brief Utilities for working with the worker's set of local limited resources. + * @details The methods help with allocation / de-allocation of claims, as well as metrics printing. + */ +public class LocalResourceSetUtils { + private static final LocalResourceSetMetrics metrics = new LocalResourceSetMetrics(); + + public static LocalResourceSet create(List resources) { + LocalResourceSet resourceSet = new LocalResourceSet(); + for (LimitedResource resource : resources) { + resourceSet.resources.put(resource.getName(), new Semaphore(resource.getAmount())); + metrics.resourceTotalMetric.labels(resource.getName()).set(resource.getAmount()); + } + return resourceSet; + } + + public static boolean claimResources(Platform platform, LocalResourceSet resourceSet) { + List> claimed = new ArrayList<>(); + + boolean allClaimed = true; + for (Platform.Property property : platform.getPropertiesList()) { + // Skip properties that are not requesting a limited resource. + String resourceName = getResourceName(property); + Semaphore resource = resourceSet.resources.get(resourceName); + if (resource == null) { + continue; + } + + // Attempt to claim. If claiming fails, we must return all other claims. + int requestAmount = getResourceRequestAmount(property); + boolean wasAcquired = semaphoreAquire(resource, resourceName, requestAmount); + if (wasAcquired) { + claimed.add(new AbstractMap.SimpleEntry<>(resourceName, requestAmount)); + } else { + allClaimed = false; + break; + } + } + + // cleanup remaining resources if they were not all claimed. + if (!allClaimed) { + for (Map.Entry claim : claimed) { + semaphoreRelease( + resourceSet.resources.get(claim.getKey()), claim.getKey(), claim.getValue()); + } + } + + return allClaimed; + } + + public static void releaseClaims(Platform platform, LocalResourceSet resourceSet) { + for (Platform.Property property : platform.getPropertiesList()) { + String resourceName = getResourceName(property); + Semaphore resource = resourceSet.resources.get(resourceName); + if (resource == null) { + continue; + } + int requestAmount = getResourceRequestAmount(property); + semaphoreRelease(resource, resourceName, requestAmount); + } + } + + private static boolean semaphoreAquire(Semaphore resource, String resourceName, int amount) { + boolean wasAcquired = resource.tryAcquire(amount); + if (wasAcquired) { + metrics.resourceUsageMetric.labels(resourceName).inc(amount); + } + metrics.requestersMetric.labels(resourceName).inc(); + return wasAcquired; + } + + private static void semaphoreRelease(Semaphore resource, String resourceName, int amount) { + resource.release(amount); + metrics.resourceUsageMetric.labels(resourceName).dec(amount); + metrics.requestersMetric.labels(resourceName).dec(); + } + + private static int getResourceRequestAmount(Platform.Property property) { + // We support resource values that are not numbers and interpret them as a request for 1 + // resource. For example "gpu:RTX-4090" is equivalent to resource:gpu:1". + try { + return Integer.parseInt(property.getValue()); + } catch (NumberFormatException e) { + return 1; + } + } + + private static String getResourceName(Platform.Property property) { + // We match to keys whether they are prefixed "resource:" or not. + // "resource:gpu:1" requests the gpu resource in the same way that "gpu:1" does. + // The prefix originates from bazel's syntax for the --extra_resources flag. + return StringUtils.removeStart(property.getName(), "resource:"); + } +} diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index d32731879c..c844f53963 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -60,6 +60,8 @@ import build.buildfarm.worker.cgroup.Cpu; import build.buildfarm.worker.cgroup.Group; import build.buildfarm.worker.cgroup.Mem; +import build.buildfarm.worker.resources.LocalResourceSet; +import build.buildfarm.worker.resources.LocalResourceSetUtils; import build.buildfarm.worker.resources.ResourceDecider; import build.buildfarm.worker.resources.ResourceLimits; import com.google.common.annotations.VisibleForTesting; @@ -129,6 +131,7 @@ class ShardWorkerContext implements WorkerContext { private final Group operationsGroup = executionsGroup.getChild("operations"); private final CasWriter writer; private final boolean errorOperationRemainingResources; + private final LocalResourceSet resourceSet; static SetMultimap getMatchProvisions( Iterable policies, int executeStageWidth) { @@ -162,6 +165,7 @@ static SetMultimap getMatchProvisions( boolean onlyMulticoreTests, boolean allowBringYourOwnContainer, boolean errorOperationRemainingResources, + LocalResourceSet resourceSet, CasWriter writer) { this.name = name; this.matchProvisions = getMatchProvisions(policies, executeStageWidth); @@ -182,6 +186,7 @@ static SetMultimap getMatchProvisions( this.onlyMulticoreTests = onlyMulticoreTests; this.allowBringYourOwnContainer = allowBringYourOwnContainer; this.errorOperationRemainingResources = errorOperationRemainingResources; + this.resourceSet = resourceSet; this.writer = writer; } @@ -273,6 +278,12 @@ public QueuedOperation getQueuedOperation(QueueEntry queueEntry) @SuppressWarnings("ConstantConditions") private void matchInterruptible(MatchListener listener) throws IOException, InterruptedException { + QueueEntry queueEntry = takeEntryOffOperationQueue(listener); + decideWhetherToKeepOperation(queueEntry, listener); + } + + private QueueEntry takeEntryOffOperationQueue(MatchListener listener) + throws IOException, InterruptedException { listener.onWaitStart(); QueueEntry queueEntry = null; try { @@ -294,9 +305,13 @@ private void matchInterruptible(MatchListener listener) throws IOException, Inte // transient backplane errors will propagate a null queueEntry } listener.onWaitEnd(); + return queueEntry; + } + private void decideWhetherToKeepOperation(QueueEntry queueEntry, MatchListener listener) + throws IOException, InterruptedException { if (queueEntry == null - || DequeueMatchEvaluator.shouldKeepOperation(matchProvisions, queueEntry)) { + || DequeueMatchEvaluator.shouldKeepOperation(matchProvisions, resourceSet, queueEntry)) { listener.onEntry(queueEntry); } else { backplane.rejectOperation(queueEntry); @@ -306,6 +321,11 @@ private void matchInterruptible(MatchListener listener) throws IOException, Inte } } + @Override + public void returnLocalResources(QueueEntry queueEntry) { + LocalResourceSetUtils.releaseClaims(queueEntry.getPlatform(), resourceSet); + } + @Override public void match(MatchListener listener) throws InterruptedException { RetryingMatchListener dedupMatchListener = diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 153df1a371..7a0d4a60ed 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -59,6 +59,7 @@ import build.buildfarm.worker.PutOperationStage; import build.buildfarm.worker.ReportResultStage; import build.buildfarm.worker.SuperscalarPipelineStage; +import build.buildfarm.worker.resources.LocalResourceSetUtils; import com.google.common.cache.LoadingCache; import com.google.common.collect.Lists; import com.google.longrunning.Operation; @@ -562,6 +563,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep configs.getWorker().isOnlyMulticoreTests(), configs.getWorker().isAllowBringYourOwnContainer(), configs.getWorker().isErrorOperationRemainingResources(), + LocalResourceSetUtils.create(configs.getWorker().getResources()), writer); pipeline = new Pipeline(); diff --git a/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java b/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java index 5301b82608..547f81b2ca 100644 --- a/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java +++ b/src/test/java/build/buildfarm/common/config/GrpcMetricsTest.java @@ -30,7 +30,6 @@ public void testHandleGrpcMetricIntercepts_withLatencyBucket() { grpcMetrics.setEnabled(true); grpcMetrics.setProvideLatencyHistograms(true); grpcMetrics.setLatencyBuckets(new double[] {1, 2, 3}); - GrpcMetrics.handleGrpcMetricIntercepts(serverBuilder, grpcMetrics); verify(serverBuilder, times(1)).intercept(any(MonitoringServerInterceptor.class)); } diff --git a/src/test/java/build/buildfarm/instance/shard/BUILD b/src/test/java/build/buildfarm/instance/shard/BUILD index 6a501a1b68..cd0ae18d24 100644 --- a/src/test/java/build/buildfarm/instance/shard/BUILD +++ b/src/test/java/build/buildfarm/instance/shard/BUILD @@ -1,7 +1,195 @@ java_test( - name = "tests", + name = "DispatchedMonitorTest", size = "small", - srcs = glob(["*.java"]), + srcs = [ + "DispatchedMonitorTest.java", + "UnobservableWatcher.java", + ], + data = ["//examples:example_configs"], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/actioncache", + "//src/main/java/build/buildfarm/backplane", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/server", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_ben_manes_caffeine_caffeine", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:org_mockito_mockito_core", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "RedisShardBackplaneTest", + size = "small", + srcs = [ + "RedisShardBackplaneTest.java", + "UnobservableWatcher.java", + ], + data = ["//examples:example_configs"], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/actioncache", + "//src/main/java/build/buildfarm/backplane", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/server", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_ben_manes_caffeine_caffeine", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:org_mockito_mockito_core", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "RedisShardSubscriberTest", + size = "small", + srcs = [ + "RedisShardSubscriberTest.java", + "UnobservableWatcher.java", + ], + data = ["//examples:example_configs"], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/actioncache", + "//src/main/java/build/buildfarm/backplane", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/server", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_ben_manes_caffeine_caffeine", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:org_mockito_mockito_core", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "ShardInstanceTest", + size = "small", + srcs = [ + "ShardInstanceTest.java", + "UnobservableWatcher.java", + ], + data = ["//examples:example_configs"], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/actioncache", + "//src/main/java/build/buildfarm/backplane", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/server", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_ben_manes_caffeine_caffeine", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:org_mockito_mockito_core", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "TimedWatcherTest", + size = "small", + srcs = [ + "TimedWatcherTest.java", + "UnobservableWatcher.java", + ], + data = ["//examples:example_configs"], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/actioncache", + "//src/main/java/build/buildfarm/backplane", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/server", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_ben_manes_caffeine_caffeine", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:org_mockito_mockito_core", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "UtilTest", + size = "small", + srcs = [ + "UnobservableWatcher.java", + "UtilTest.java", + ], data = ["//examples:example_configs"], test_class = "build.buildfarm.AllTests", deps = [ diff --git a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java index 16e5bb8fbc..3772459cf7 100644 --- a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java +++ b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java @@ -213,8 +213,7 @@ public void dispatchedOperationsShowProperRequeueAmount0to1() .setRequeueAttempts(STARTING_REQUEUE_AMOUNT) .build(); String queueEntryJson = JsonFormat.printer().print(queueEntry); - when(jedisCluster.brpoplpush(any(String.class), any(String.class), any(Integer.class))) - .thenReturn(queueEntryJson); + when(jedisCluster.rpoplpush(any(String.class), any(String.class))).thenReturn(queueEntryJson); // PRE-ASSERT when(jedisCluster.hsetnx(any(String.class), any(String.class), any(String.class))) @@ -266,8 +265,7 @@ public void dispatchedOperationsShowProperRequeueAmount1to2() .setRequeueAttempts(STARTING_REQUEUE_AMOUNT) .build(); String queueEntryJson = JsonFormat.printer().print(queueEntry); - when(jedisCluster.brpoplpush(any(String.class), any(String.class), any(Integer.class))) - .thenReturn(queueEntryJson); + when(jedisCluster.rpoplpush(any(String.class), any(String.class))).thenReturn(queueEntryJson); // PRE-ASSERT when(jedisCluster.hsetnx(any(String.class), any(String.class), any(String.class))) diff --git a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java b/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java index 1fdb7fc460..aa1adc5d3d 100644 --- a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java @@ -1052,7 +1052,6 @@ public void containsBlobReflectsWorkerWithUnknownSize() throws Exception { @Test public void findMissingBlobsTest_ViaBackPlane() throws Exception { - Set activeWorkers = ImmutableSet.of("worker1", "worker2", "worker3"); Set expiredWorkers = ImmutableSet.of("workerX", "workerY", "workerZ"); Set imposterWorkers = ImmutableSet.of("imposter1", "imposter2", "imposter3"); diff --git a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java index bc7acd00a4..47f25cdf79 100644 --- a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java +++ b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java @@ -19,8 +19,10 @@ import build.bazel.remote.execution.v2.Platform; import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.v1test.QueueEntry; +import build.buildfarm.worker.resources.LocalResourceSet; import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; +import java.util.concurrent.Semaphore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -52,10 +54,12 @@ public class DequeueMatchEvaluatorTest { public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); QueueEntry entry = QueueEntry.newBuilder().setPlatform(Platform.newBuilder()).build(); // ACT - boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -70,6 +74,7 @@ public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); workerProvisions.put("cores", "11"); QueueEntry entry = @@ -81,7 +86,8 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { .build(); // ACT - boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because it has more cores than the min-cores requested @@ -98,6 +104,7 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ARRANGE configs.getWorker().getDequeueMatchSettings().setAcceptEverything(false); SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); workerProvisions.put("cores", "10"); QueueEntry entry = @@ -109,7 +116,8 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { .build(); // ACT - boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because it has less cores than the min-cores requested @@ -123,6 +131,7 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Exception { // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); workerProvisions.put("cores", "10"); QueueEntry entry = @@ -136,7 +145,8 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti .build(); // ACT - boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because it has the same cores as the min-cores requested @@ -153,6 +163,7 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAcceptEverything(false); configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(false); SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); QueueEntry entry = QueueEntry.newBuilder() @@ -163,7 +174,8 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E .build(); // ACT - boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isFalse(); @@ -172,7 +184,7 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -181,9 +193,151 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, entry); + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); } + + // Function under test: shouldKeepOperation + // Reason for testing: the local resource should be claimed + // Failure explanation: semaphore claim did not work as expected. + @Test + public void shouldKeepOperationClaimsResource() throws Exception { + // ARRANGE + configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); + configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); + SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); + resourceSet.resources.put("FOO", new Semaphore(1)); + + QueueEntry entry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties( + Platform.Property.newBuilder().setName("resource:FOO").setValue("1"))) + .build(); + + // PRE-ASSERT + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); + + // ACT + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker accepts because the resource is available. + assertThat(shouldKeep).isTrue(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); + + // ACT + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker rejects because there are no resources left. + assertThat(shouldKeep).isFalse(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); + } + + // Function under test: shouldKeepOperation + // Reason for testing: the local resources should be claimed + // Failure explanation: semaphore claim did not work as expected. + @Test + public void shouldKeepOperationClaimsMultipleResource() throws Exception { + // ARRANGE + configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); + configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); + SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); + resourceSet.resources.put("FOO", new Semaphore(2)); + resourceSet.resources.put("BAR", new Semaphore(4)); + + QueueEntry entry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties( + Platform.Property.newBuilder().setName("resource:FOO").setValue("1")) + .addProperties( + Platform.Property.newBuilder().setName("resource:BAR").setValue("2"))) + .build(); + + // PRE-ASSERT + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(2); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(4); + + // ACT + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker accepts because the resource is available. + assertThat(shouldKeep).isTrue(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(2); + + // ACT + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker accepts because the resource is available. + assertThat(shouldKeep).isTrue(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(0); + + // ACT + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker rejects because there are no resources left. + assertThat(shouldKeep).isFalse(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(0); + } + + // Function under test: shouldKeepOperation + // Reason for testing: the local resources should fail to claim, and the existing amount should be + // the same. + // Failure explanation: semaphore claim did not work as expected. + @Test + public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception { + // ARRANGE + configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); + configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); + SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); + resourceSet.resources.put("FOO", new Semaphore(50)); + resourceSet.resources.put("BAR", new Semaphore(100)); + resourceSet.resources.put("BAZ", new Semaphore(200)); + + QueueEntry entry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties( + Platform.Property.newBuilder().setName("resource:FOO").setValue("20")) + .addProperties( + Platform.Property.newBuilder().setName("resource:BAR").setValue("101")) + .addProperties( + Platform.Property.newBuilder().setName("resource:BAZ").setValue("20"))) + .build(); + + // PRE-ASSERT + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(50); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(100); + assertThat(resourceSet.resources.get("BAZ").availablePermits()).isEqualTo(200); + + // ACT + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker rejects because there are no resources left. + // The same amount are returned. + assertThat(shouldKeep).isFalse(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(50); + assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(100); + assertThat(resourceSet.resources.get("BAZ").availablePermits()).isEqualTo(200); + } } diff --git a/src/test/java/build/buildfarm/worker/StubWorkerContext.java b/src/test/java/build/buildfarm/worker/StubWorkerContext.java index d288d67a6f..7ccf1182d3 100644 --- a/src/test/java/build/buildfarm/worker/StubWorkerContext.java +++ b/src/test/java/build/buildfarm/worker/StubWorkerContext.java @@ -222,4 +222,9 @@ public ResourceLimits commandExecutionSettings(Command command) { public boolean shouldErrorOperationOnRemainingResources() { throw new UnsupportedOperationException(); } + + @Override + public void returnLocalResources(QueueEntry queueEntry) { + throw new UnsupportedOperationException(); + } } diff --git a/src/test/java/build/buildfarm/worker/shard/BUILD b/src/test/java/build/buildfarm/worker/shard/BUILD index b8a7b31ec6..c254e41fa4 100644 --- a/src/test/java/build/buildfarm/worker/shard/BUILD +++ b/src/test/java/build/buildfarm/worker/shard/BUILD @@ -11,6 +11,7 @@ java_test( "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/worker", + "//src/main/java/build/buildfarm/worker/resources", "//src/main/java/build/buildfarm/worker/shard", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "//src/test/java/build/buildfarm:test_runner", diff --git a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java index dd584c49af..c24e681abb 100644 --- a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java +++ b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java @@ -35,6 +35,7 @@ import build.buildfarm.instance.MatchListener; import build.buildfarm.v1test.QueueEntry; import build.buildfarm.worker.WorkerContext; +import build.buildfarm.worker.resources.LocalResourceSet; import com.google.common.collect.ImmutableList; import com.google.protobuf.Duration; import java.util.ArrayList; @@ -105,6 +106,7 @@ WorkerContext createTestContext(Iterable policies) { /* onlyMulticoreTests=*/ false, /* allowBringYourOwnContainer=*/ false, /* errorOperationRemainingResources=*/ false, + /* resourceSet=*/ new LocalResourceSet(), writer); } From 97e3b90c263a27b6e08713d2455a590f7f47405c Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:34:32 -0700 Subject: [PATCH 097/214] build: override grpc dependencies with our dependencies Don't get transitive grpc dependencies, use the ones from our `maven_install(...)` --- defs.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index ec51856484..869fdd2da7 100644 --- a/defs.bzl +++ b/defs.bzl @@ -8,7 +8,7 @@ load( "@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories", ) -load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") +load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories") @@ -114,6 +114,7 @@ def buildfarm_init(name = "buildfarm"): "org.projectlombok:lombok:1.18.24", ], generate_compat_repositories = True, + override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, repositories = [ "https://repo1.maven.org/maven2", "https://mirrors.ibiblio.org/pub/mirrors/maven2", From 96f239d5131b17c32d07a46bb583b487472e5d1c Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:35:25 -0700 Subject: [PATCH 098/214] chore(deps): bump protobuf runtime to 3.19.1 --- defs.bzl | 4 ++-- deps.bzl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/defs.bzl b/defs.bzl index 869fdd2da7..ad8d07ced8 100644 --- a/defs.bzl +++ b/defs.bzl @@ -79,8 +79,8 @@ def buildfarm_init(name = "buildfarm"): "com.google.guava:guava:32.1.1-jre", "com.google.j2objc:j2objc-annotations:1.1", "com.google.jimfs:jimfs:1.1", - "com.google.protobuf:protobuf-java-util:3.10.0", - "com.google.protobuf:protobuf-java:3.10.0", + "com.google.protobuf:protobuf-java-util:3.19.1", + "com.google.protobuf:protobuf-java:3.19.1", "com.google.truth:truth:0.44", "org.slf4j:slf4j-simple:1.7.35", "com.googlecode.json-simple:json-simple:1.1.1", diff --git a/deps.bzl b/deps.bzl index f802fb27e7..e2d2609acf 100644 --- a/deps.bzl +++ b/deps.bzl @@ -36,9 +36,9 @@ def archive_dependencies(third_party): # Needed for "well-known protos" and @com_google_protobuf//:protoc. { "name": "com_google_protobuf", - "sha256": "dd513a79c7d7e45cbaeaf7655289f78fd6b806e52dbbd7018ef4e3cf5cff697a", - "strip_prefix": "protobuf-3.15.8", - "urls": ["https://github.com/protocolbuffers/protobuf/archive/v3.15.8.zip"], + "sha256": "25f1292d4ea6666f460a2a30038eef121e6c3937ae0f61d610611dfb14b0bd32", + "strip_prefix": "protobuf-3.19.1", + "urls": ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.zip"], }, { "name": "com_github_bazelbuild_buildtools", From af3f34e143c263f10139a9eee6262fb190bdddb9 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:36:21 -0700 Subject: [PATCH 099/214] chore(deps) add transitive dependencies --- src/main/java/build/buildfarm/server/BUILD | 2 ++ src/main/java/build/buildfarm/worker/shard/BUILD | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/build/buildfarm/server/BUILD b/src/main/java/build/buildfarm/server/BUILD index eccbf4fda2..7244807f8a 100644 --- a/src/main/java/build/buildfarm/server/BUILD +++ b/src/main/java/build/buildfarm/server/BUILD @@ -16,6 +16,8 @@ java_library( "//src/main/java/build/buildfarm/metrics/prometheus", "//src/main/java/build/buildfarm/server/services", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "@io_grpc_grpc_proto//:health_proto", + "@io_grpc_grpc_proto//:health_java_proto", "@maven//:com_github_pcj_google_options", "@maven//:com_google_guava_guava", "@maven//:io_grpc_grpc_api", diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index ec48ec5be0..4458d61821 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -20,6 +20,8 @@ java_library( "//src/main/java/build/buildfarm/worker/resources", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "@io_grpc_grpc_proto//:health_java_proto", + "@io_grpc_grpc_proto//:health_proto", "@googleapis//:google_rpc_error_details_java_proto", "@maven//:com_github_ben_manes_caffeine_caffeine", "@maven//:com_github_pcj_google_options", From 380f8a1bec163adffc7e0c883abf7f5a160a80ac Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:36:33 -0700 Subject: [PATCH 100/214] feat: add Proto reflection service to shard worker To aid connection troubleshooting --- src/main/java/build/buildfarm/worker/shard/Worker.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 7a0d4a60ed..038097de7f 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -70,6 +70,7 @@ import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.health.v1.HealthCheckResponse.ServingStatus; +import io.grpc.protobuf.services.ProtoReflectionService; import io.grpc.services.HealthStatusManager; import io.prometheus.client.Counter; import io.prometheus.client.Gauge; @@ -158,6 +159,7 @@ private Server createServer( serverBuilder.addService(new ContentAddressableStorageService(instance)); serverBuilder.addService(new ByteStreamService(instance)); serverBuilder.addService(new ShutDownWorkerGracefully(this)); + serverBuilder.addService(ProtoReflectionService.newInstance()); // We will build a worker's server based on it's capabilities. // A worker that is capable of execution will construct an execution pipeline. From 7e7979d037294d1896ed6ae53d8a966e97ffc609 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:55:18 -0700 Subject: [PATCH 101/214] fixup! build: override grpc dependencies with our dependencies --- defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index ad8d07ced8..5b0e4f640c 100644 --- a/defs.bzl +++ b/defs.bzl @@ -8,7 +8,7 @@ load( "@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories", ) -load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") +load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS", "grpc_java_repositories") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories") From 1f9d01fa70f1ecc419c9fca62f5602e5400d66c6 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:55:29 -0700 Subject: [PATCH 102/214] fixup! chore(deps) add transitive dependencies --- src/main/java/build/buildfarm/server/BUILD | 2 +- src/main/java/build/buildfarm/worker/shard/BUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/server/BUILD b/src/main/java/build/buildfarm/server/BUILD index 7244807f8a..2cd750a4ff 100644 --- a/src/main/java/build/buildfarm/server/BUILD +++ b/src/main/java/build/buildfarm/server/BUILD @@ -16,8 +16,8 @@ java_library( "//src/main/java/build/buildfarm/metrics/prometheus", "//src/main/java/build/buildfarm/server/services", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", - "@io_grpc_grpc_proto//:health_proto", "@io_grpc_grpc_proto//:health_java_proto", + "@io_grpc_grpc_proto//:health_proto", "@maven//:com_github_pcj_google_options", "@maven//:com_google_guava_guava", "@maven//:io_grpc_grpc_api", diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index 4458d61821..b62e4369de 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -20,9 +20,9 @@ java_library( "//src/main/java/build/buildfarm/worker/resources", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_grpc", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", "@io_grpc_grpc_proto//:health_java_proto", "@io_grpc_grpc_proto//:health_proto", - "@googleapis//:google_rpc_error_details_java_proto", "@maven//:com_github_ben_manes_caffeine_caffeine", "@maven//:com_github_pcj_google_options", "@maven//:com_google_code_findbugs_jsr305", From 578589fe6dfe075bbb92eb68b4235ed7a335afb0 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:00:14 -0700 Subject: [PATCH 103/214] Bug: Fix Blocked thread in WriteStreamObserver Caused by CASFile Write (#1486) * Add unit test * Signal Write on complete --- .../build/buildfarm/cas/cfc/CASFileCache.java | 3 + .../buildfarm/cas/cfc/CASFileCacheTest.java | 113 ++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index aac1b28994..21c90e5fee 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -878,6 +878,9 @@ public synchronized void reset() { + key.getIdentifier(), e); } finally { + if (closedFuture != null) { + closedFuture.set(null); + } isReset = true; } } diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index a3d406e232..caaab02b35 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -19,8 +19,11 @@ import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static com.google.common.util.concurrent.MoreExecutors.shutdownAndAwaitTermination; +import static java.lang.Thread.State.TERMINATED; +import static java.lang.Thread.State.WAITING; import static java.util.concurrent.Executors.newSingleThreadExecutor; import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static org.junit.Assert.fail; import static org.mockito.Mockito.any; @@ -58,6 +61,7 @@ import com.google.common.collect.Maps; import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; +import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; @@ -77,6 +81,7 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CyclicBarrier; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -1207,6 +1212,114 @@ protected InputStream newExternalInput( assertThat(expected).isNotNull(); } + @Test + public void testConcurrentWrites() throws Exception { + ByteString blob = ByteString.copyFromUtf8("concurrent write"); + Digest digest = DIGEST_UTIL.compute(blob); + UUID uuid = UUID.randomUUID(); + // The same instance of Write will be passed to both the threads, so that the both threads + // try to get same output stream. + Write write = + fileCache.getWrite( + Compressor.Value.IDENTITY, digest, uuid, RequestMetadata.getDefaultInstance()); + + CyclicBarrier barrier = new CyclicBarrier(3); + + Thread write1 = + new Thread( + () -> { + try { + ConcurrentWriteStreamObserver writeStreamObserver = + new ConcurrentWriteStreamObserver(write); + writeStreamObserver.registerCallback(); + barrier.await(); // let both the threads get same write stream. + writeStreamObserver.ownStream(); // let other thread get the ownership of stream + writeStreamObserver.write(blob); + writeStreamObserver.close(); + } catch (Exception e) { + // do nothing + } + }, + "FirstRequest"); + Thread write2 = + new Thread( + () -> { + try { + ConcurrentWriteStreamObserver writeStreamObserver = + new ConcurrentWriteStreamObserver(write); + writeStreamObserver.registerCallback(); + writeStreamObserver.ownStream(); // this thread will get the ownership of stream + barrier.await(); // let both the threads get same write stream. + while (write1.getState() != WAITING) ; // wait for first request to go in wait state + writeStreamObserver.write(blob); + writeStreamObserver.close(); + } catch (Exception e) { + // do nothing + } + }, + "SecondRequest"); + write1.start(); + write2.start(); + barrier.await(); // let both the requests reach the critical section + + // Wait for each write operation to complete, allowing a maximum of 100ms per write. + // Note: A 100ms wait time allowed 1000 * 8 successful test runs. + // In certain scenario, even this wait time may not be enough and test still be called flaky. + // But setting wait time 0 may cause test to wait forever (if there is issue in code) and the + // build might fail with timeout error. + write1.join(100); + write2.join(100); + + assertThat(write1.getState()).isEqualTo(TERMINATED); + assertThat(write2.getState()).isEqualTo(TERMINATED); + } + + static class ConcurrentWriteStreamObserver { + Write write; + FeedbackOutputStream out; + + ConcurrentWriteStreamObserver(Write write) { + this.write = write; + } + + void registerCallback() { + Futures.addCallback( + write.getFuture(), + new FutureCallback() { + @Override + public void onSuccess(Long committedSize) { + commit(); + } + + @Override + public void onFailure(Throwable t) { + // do nothing + } + }, + directExecutor()); + } + + synchronized void ownStream() throws Exception { + this.out = write.getOutput(10, MILLISECONDS, () -> {}); + } + /** + * Request 1 may invoke this method for request 2 or vice-versa via callback on + * write.getFuture(). Synchronization is necessary to prevent conflicts when this method is + * called simultaneously by different threads. + */ + synchronized void commit() { + // critical section + } + + void write(ByteString data) throws IOException { + data.writeTo(out); + } + + void close() throws IOException { + out.close(); + } + } + @RunWith(JUnit4.class) public static class NativeFileDirsIndexInMemoryCASFileCacheTest extends CASFileCacheTest { public NativeFileDirsIndexInMemoryCASFileCacheTest() throws IOException { From dfa5937090d36e7d39fae577c978412367b71c6c Mon Sep 17 00:00:00 2001 From: Stefano Baghino Date: Tue, 24 Oct 2023 21:38:09 +0200 Subject: [PATCH 104/214] Pin the Java toolchain to `remotejdk_17` (#1509) Closes #1508 Cleanups: - remove the unused `ubuntu-bionic` base image - replace `ubuntu-jammy:jammy-java11-gcc` with `ubuntu-mantic:mantic-java17-gcc` - replace `amazoncorretto:19` with `ubuntu-mantic:mantic-java17-gcc` - swap inverted log file names in a file --- .bazelci/run_server_test.sh | 4 ++-- .bazelrc | 6 +++++ BUILD | 6 ++--- images.bzl | 22 +++---------------- jvm_flags.bzl | 10 +++++++-- .../common/processes/JavaProcessWrapper.java | 6 ++++- .../bazel/processes/PersistentWorkerTest.java | 3 ++- src/main/java/build/buildfarm/BUILD | 6 ++--- src/test/java/build/buildfarm/cas/BUILD | 4 ++-- src/test/java/build/buildfarm/common/BUILD | 4 ++-- 10 files changed, 36 insertions(+), 35 deletions(-) diff --git a/.bazelci/run_server_test.sh b/.bazelci/run_server_test.sh index 21b6d70389..54e4658b16 100755 --- a/.bazelci/run_server_test.sh +++ b/.bazelci/run_server_test.sh @@ -8,11 +8,11 @@ bazel build //src/main/java/build/buildfarm:buildfarm-shard-worker bazel build //src/main/java/build/buildfarm:buildfarm-server # Start a single worker -bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker $(pwd)/examples/config.minimal.yml > server.log 2>&1 & +bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker $(pwd)/examples/config.minimal.yml > worker.log 2>&1 & echo "Started buildfarm-shard-worker..." # Start a single server -bazel run //src/main/java/build/buildfarm:buildfarm-server $(pwd)/examples/config.minimal.yml > worker.log 2>&1 & +bazel run //src/main/java/build/buildfarm:buildfarm-server $(pwd)/examples/config.minimal.yml > server.log 2>&1 & echo "Started buildfarm-server..." echo "Wait for startup to finish..." diff --git a/.bazelrc b/.bazelrc index adbb3c68fd..c3caf4d8fb 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,9 @@ +build --java_language_version=17 +build --java_runtime_version=remotejdk_17 + +build --tool_java_language_version=17 +build --tool_java_runtime_version=remotejdk_17 + common --enable_platform_specific_config build:fuse --define=fuse=true diff --git a/BUILD b/BUILD index f552ea9d7b..eb773e1a16 100644 --- a/BUILD +++ b/BUILD @@ -120,7 +120,7 @@ sh_binary( java_image( name = "buildfarm-server", args = ["/app/build_buildfarm/examples/config.minimal.yml"], - base = "@amazon_corretto_java_image_base//image", + base = "@ubuntu-mantic//image", classpath_resources = [ "//src/main/java/build/buildfarm:configs", ], @@ -148,14 +148,14 @@ oss_audit( # Download cgroup-tools so that the worker is able to restrict actions via control groups. download_pkgs( name = "worker_pkgs", - image_tar = "@ubuntu-jammy//image", + image_tar = "@ubuntu-mantic//image", packages = ["cgroup-tools"], tags = ["container"], ) install_pkgs( name = "worker_pkgs_image", - image_tar = "@ubuntu-jammy//image", + image_tar = "@ubuntu-mantic//image", installables_tar = ":worker_pkgs.tar", installation_cleanup_commands = "rm -rf /var/lib/apt/lists/*", output_image_name = "worker_pkgs_image", diff --git a/images.bzl b/images.bzl index 9ab0a8b0b7..939a752ed5 100644 --- a/images.bzl +++ b/images.bzl @@ -27,25 +27,9 @@ def buildfarm_images(): ) container_pull( - name = "ubuntu-bionic", - digest = "sha256:4bc527c7a288da405f2041928c63d0a6479a120ad63461c2f124c944def54be2", + name = "ubuntu-mantic", + digest = "sha256:1419bba15470a95242e917b3abcd8981ae36707b99df5ac705e1eee4d920c51c", registry = "index.docker.io", repository = "bazelbuild/buildfarm-worker-base", - tag = "bionic-java11-gcc", - ) - - container_pull( - name = "ubuntu-jammy", - digest = "sha256:da847ee259ebe7f00631a2f0146d9add60ff0f94b031a2e522ce94c78b1335c2", - registry = "index.docker.io", - repository = "bazelbuild/buildfarm-worker-base", - tag = "jammy-java11-gcc", - ) - - container_pull( - name = "amazon_corretto_java_image_base", - registry = "index.docker.io", - repository = "amazoncorretto", - tag = "19", - digest = "sha256:81d0df4412140416b27211c999e1f3c4565ae89a5cd92889475d20af422ba507", + tag = "mantic-java17-gcc", ) diff --git a/jvm_flags.bzl b/jvm_flags.bzl index 363f161465..440e0718aa 100644 --- a/jvm_flags.bzl +++ b/jvm_flags.bzl @@ -54,6 +54,12 @@ def ensure_accurate_metadata(): "//config:windows": ["-Dsun.nio.fs.ensureAccurateMetadata=true"], }) +def add_opens_sun_nio_fs(): + return select({ + "//conditions:default": [], + "//config:windows": ["--add-opens java.base/sun.nio.fs=ALL-UNNAMED"], + }) + def server_telemetry(): return select({ "//config:open_telemetry": SERVER_TELEMETRY_JVM_FLAGS, @@ -67,7 +73,7 @@ def worker_telemetry(): }) def server_jvm_flags(): - return RECOMMENDED_JVM_FLAGS + DEFAULT_LOGGING_CONFIG + ensure_accurate_metadata() + server_telemetry() + return RECOMMENDED_JVM_FLAGS + DEFAULT_LOGGING_CONFIG + ensure_accurate_metadata() + add_opens_sun_nio_fs() + server_telemetry() def worker_jvm_flags(): - return RECOMMENDED_JVM_FLAGS + DEFAULT_LOGGING_CONFIG + ensure_accurate_metadata() + worker_telemetry() + return RECOMMENDED_JVM_FLAGS + DEFAULT_LOGGING_CONFIG + ensure_accurate_metadata() + add_opens_sun_nio_fs() + worker_telemetry() diff --git a/persistentworkers/src/main/java/persistent/common/processes/JavaProcessWrapper.java b/persistentworkers/src/main/java/persistent/common/processes/JavaProcessWrapper.java index a27b6a9e99..89f2e6a5be 100644 --- a/persistentworkers/src/main/java/persistent/common/processes/JavaProcessWrapper.java +++ b/persistentworkers/src/main/java/persistent/common/processes/JavaProcessWrapper.java @@ -10,12 +10,16 @@ public class JavaProcessWrapper extends ProcessWrapper { + // Get the path of the JVM from the current process to avoid breaking the Bazel sandbox + public static final String CURRENT_JVM_COMMAND = + ProcessHandle.current().info().command().orElseThrow(() -> new RuntimeException("Unable to retrieve the path of the running JVM")); + public JavaProcessWrapper( Path workDir, String classPath, String fullClassName, String[] args ) throws IOException { super(workDir, cmdArgs( new String[]{ - "java", + CURRENT_JVM_COMMAND, "-cp", classPath, fullClassName diff --git a/persistentworkers/src/test/java/persistent/bazel/processes/PersistentWorkerTest.java b/persistentworkers/src/test/java/persistent/bazel/processes/PersistentWorkerTest.java index 0cdc68a7ff..9712394203 100644 --- a/persistentworkers/src/test/java/persistent/bazel/processes/PersistentWorkerTest.java +++ b/persistentworkers/src/test/java/persistent/bazel/processes/PersistentWorkerTest.java @@ -16,6 +16,7 @@ import persistent.bazel.client.PersistentWorker; import persistent.bazel.client.WorkerKey; +import persistent.common.processes.JavaProcessWrapper; import persistent.testutil.ProcessUtils; import persistent.testutil.WorkerUtils; @@ -55,7 +56,7 @@ public void endToEndAdder() throws Exception { ); ImmutableList initCmd = ImmutableList.of( - "java", + JavaProcessWrapper.CURRENT_JVM_COMMAND, "-cp", jarPath.toString(), "adder.Adder", diff --git a/src/main/java/build/buildfarm/BUILD b/src/main/java/build/buildfarm/BUILD index 601aa38eb4..3cbdeb5231 100644 --- a/src/main/java/build/buildfarm/BUILD +++ b/src/main/java/build/buildfarm/BUILD @@ -1,4 +1,4 @@ -load("//:jvm_flags.bzl", "ensure_accurate_metadata") +load("//:jvm_flags.bzl", "add_opens_sun_nio_fs", "ensure_accurate_metadata") package( default_visibility = ["//src:__subpackages__"], @@ -15,7 +15,7 @@ java_binary( classpath_resources = [ ":configs", ], - jvm_flags = ensure_accurate_metadata(), + jvm_flags = ensure_accurate_metadata() + add_opens_sun_nio_fs(), main_class = "build.buildfarm.server.BuildFarmServer", visibility = ["//visibility:public"], runtime_deps = [ @@ -29,7 +29,7 @@ java_binary( classpath_resources = [ ":configs", ], - jvm_flags = ensure_accurate_metadata(), + jvm_flags = ensure_accurate_metadata() + add_opens_sun_nio_fs(), main_class = "build.buildfarm.worker.shard.Worker", visibility = ["//visibility:public"], runtime_deps = [ diff --git a/src/test/java/build/buildfarm/cas/BUILD b/src/test/java/build/buildfarm/cas/BUILD index ff7774e067..fc127b1ea6 100644 --- a/src/test/java/build/buildfarm/cas/BUILD +++ b/src/test/java/build/buildfarm/cas/BUILD @@ -1,10 +1,10 @@ -load("//:jvm_flags.bzl", "ensure_accurate_metadata") +load("//:jvm_flags.bzl", "add_opens_sun_nio_fs", "ensure_accurate_metadata") java_test( name = "tests", size = "small", srcs = glob(["**/*.java"]), - jvm_flags = ensure_accurate_metadata(), + jvm_flags = ensure_accurate_metadata() + add_opens_sun_nio_fs(), test_class = "build.buildfarm.AllTests", deps = [ "//src/main/java/build/buildfarm/cas", diff --git a/src/test/java/build/buildfarm/common/BUILD b/src/test/java/build/buildfarm/common/BUILD index bda4f4243f..70ff4abc94 100644 --- a/src/test/java/build/buildfarm/common/BUILD +++ b/src/test/java/build/buildfarm/common/BUILD @@ -1,10 +1,10 @@ -load("//:jvm_flags.bzl", "ensure_accurate_metadata") +load("//:jvm_flags.bzl", "add_opens_sun_nio_fs", "ensure_accurate_metadata") java_test( name = "tests", size = "small", srcs = glob(["*.java"]), - jvm_flags = ensure_accurate_metadata(), + jvm_flags = ensure_accurate_metadata() + add_opens_sun_nio_fs(), test_class = "build.buildfarm.AllTests", deps = [ "//src/main/java/build/buildfarm/common", From f6459d199d1a40bdd8b31a75d7c19da7a1af69f4 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Wed, 18 Oct 2023 13:32:18 -0700 Subject: [PATCH 105/214] docs: add markdown language specifiers for code blocks --- README.md | 28 ++++++++--------- _site/docs/configuration/configuration.md | 32 ++++++++++---------- _site/docs/execution/execution_policies.md | 26 ++++++++++------ _site/docs/execution/execution_properties.md | 25 +++++++++------ _site/docs/quick_start.md | 25 +++++++++------ 5 files changed, 77 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 675fe94dbd..cd9caf8ee3 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ All commandline options override corresponding config settings. Run via -``` -docker run -d --rm --name buildfarm-redis -p 6379:6379 redis:5.0.9 +```shell +$ docker run -d --rm --name buildfarm-redis -p 6379:6379 redis:5.0.9 redis-cli config set stop-writes-on-bgsave-error no ``` @@ -28,8 +28,8 @@ redis-cli config set stop-writes-on-bgsave-error no Run via -``` -bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- +```shell +$ bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` @@ -40,8 +40,8 @@ Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag= Run via -``` -bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- +```shell +$ bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml @@ -53,9 +53,9 @@ Ex: bazelisk run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm To use the example configured buildfarm with bazel (version 1.0 or higher), you can configure your `.bazelrc` as follows: -``` +```shell $ cat .bazelrc -build --remote_executor=grpc://localhost:8980 +$ build --remote_executor=grpc://localhost:8980 ``` Then run your build as you would normally do. @@ -67,20 +67,20 @@ Buildfarm uses [Java's Logging framework](https://docs.oracle.com/javase/10/core You can use typical Java logging configuration to filter these results and observe the flow of executions through your running services. An example `logging.properties` file has been provided at [examples/logging.properties](examples/logging.properties) for use as follows: -``` -bazel run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +```shell +$ bazel run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` and -``` -bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml +``` shell +$ bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/logging.properties $PWD/examples/config.minimal.yml ``` To attach a remote debugger, run the executable with the `--debug=` flag. For example: -``` -bazel run //src/main/java/build/buildfarm:buildfarm-server -- --debug=5005 $PWD/examples/config.minimal.yml +```shell +$ bazel run //src/main/java/build/buildfarm:buildfarm-server -- --debug=5005 $PWD/examples/config.minimal.yml ``` diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ae913adf88..ab3638f5b1 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -7,7 +7,7 @@ has_children: true Minimal required: -``` +```yaml backplane: redisUri: "redis://localhost:6379" queues: @@ -38,7 +38,7 @@ For an example configuration containing all of the configuration values, see `ex Example: -``` +```yaml digestFunction: SHA1 defaultActionTimeout: 1800 maximumActionTimeout: 1800 @@ -79,7 +79,7 @@ worker: Example: -``` +```yaml server: instanceType: SHARD name: shard @@ -96,7 +96,7 @@ server: Example: -``` +```yaml server: grpcMetrics: enabled: false @@ -114,7 +114,7 @@ server: Example: -``` +```yaml server: caches: directoryCacheMaxEntries: 10000 @@ -132,7 +132,7 @@ server: Example: -``` +```yaml server: admin: deploymentEnvironment: AWS @@ -151,14 +151,14 @@ server: Example: -``` +```yaml server: metrics: publisher: log logLevel: INFO ``` -``` +```yaml server: metrics: publisher: aws @@ -207,7 +207,7 @@ server: Example: -``` +```yaml backplane: type: SHARD redisUri: "redis://localhost:6379" @@ -224,7 +224,7 @@ backplane: Example: -``` +```yaml backplane: type: SHARD redisUri: "redis://localhost:6379" @@ -262,7 +262,7 @@ backplane: | realInputDirectories | List of Strings, _external_ | | A list of paths that will not be subject to the effects of linkInputDirectories setting, may also be used to provide writable directories as input roots for actions which expect to be able to write to an input location and will fail if they cannot | | gracefulShutdownSeconds | Integer, 0 | | Time in seconds to allow for operations in flight to finish when shutdown signal is received | -``` +```yaml worker: port: 8981 publicName: "localhost:8981" @@ -279,7 +279,7 @@ worker: Example: -``` +```yaml worker: capabilities: cas: true @@ -296,7 +296,7 @@ worker: Example: -``` +```yaml worker: sandboxSettings: alwaysUse: true @@ -313,7 +313,7 @@ worker: Example: -``` +```yaml worker: dequeueMatchSettings: acceptEverything: true @@ -333,7 +333,7 @@ worker: Example: -``` +```yaml worker: storages: - type: FILESYSTEM @@ -361,7 +361,7 @@ worker: Example: -``` +```yaml worker: executionPolicies: - name: test diff --git a/_site/docs/execution/execution_policies.md b/_site/docs/execution/execution_policies.md index 19698a9925..f0eaf295d9 100644 --- a/_site/docs/execution/execution_policies.md +++ b/_site/docs/execution/execution_policies.md @@ -17,7 +17,7 @@ This policy type specifies that a worker should prepend a single path, and a num This example will use the buildfarm-provided executable `as-nobody`, which will upon execution demote itself to a `nobody` effective process owner uid, and perform an `execvp(2)` with the remaining provided program arguments, which will subsequently execute as a user that no longer matches the worker process. -``` +```yaml # default wrapper policy application worker: executionPolicies: @@ -50,7 +50,8 @@ These wrappers are used for detecting actions that rely on time. Below is a dem This addresses two problems in regards to an action's dependence on time. The 1st problem is when an action takes longer than it should because it's sleeping unnecessarily. The 2nd problem is when an action relies on time which causes it to eventually be broken on master despite the code not changing. Both problems are expressed below as unit tests. We demonstrate a time-spoofing mechanism (the re-writing of syscalls) which allows us to detect these problems generically over any action. The objective is to analyze builds for performance inefficiency and discover future instabilities before they occur. ### Issue 1 (slow test) -``` + +```bash #!/bin/bash set -euo pipefail @@ -58,16 +59,19 @@ echo -n "testing... " sleep 10; echo "done" ``` + The test takes 10 seconds to run on average. -``` -bazel test --runs_per_test=10 --config=remote //cloud/buildfarm:sleep_test + +```shell +$ bazel test --runs_per_test=10 --config=remote //cloud/buildfarm:sleep_test //cloud/buildfarm:sleep_test PASSED in 10.2s Stats over 10 runs: max = 10.2s, min = 10.1s, avg = 10.2s, dev = 0.0s ``` We can check for performance improvements by using the `skip-sleep` option. -``` -bazel test --runs_per_test=10 --config=remote --remote_default_exec_properties='skip-sleep=true' //cloud/buildfarm:sleep_test + +```shell +$ bazel test --runs_per_test=10 --config=remote --remote_default_exec_properties='skip-sleep=true' //cloud/buildfarm:sleep_test //cloud/buildfarm:sleep_test PASSED in 1.0s Stats over 10 runs: max = 1.0s, min = 0.9s, avg = 1.0s, dev = 0.0s ``` @@ -75,7 +79,8 @@ bazel test --runs_per_test=10 --config=remote --remote_default_exec_properties=' Now the test is 10x faster. If skipping sleep makes an action perform significantly faster without affecting its success rate, that would warrant further investigation into the action's implementation. ### Issue 2 (future failing test) -``` + +```bash #!/bin/bash set -euo pipefail @@ -89,12 +94,15 @@ echo "Times change." date exit -1; ``` + The test passes today, but will it pass tomorrow? Will it pass a year from now? We can find out by using the `time-shift` option. -``` -bazel test --test_output=streamed --remote_default_exec_properties='time-shift=31556952' --config=remote //cloud/buildfarm:future_fail + +```shell +$ bazel test --test_output=streamed --remote_default_exec_properties='time-shift=31556952' --config=remote //cloud/buildfarm:future_fail INFO: Found 1 test target... Times change. Mon Sep 25 18:31:09 UTC 2023 //cloud/buildfarm:future_fail FAILED in 18.0s ``` + Time is shifted to the year 2023 and the test now fails. We can fix the problem before others see it. diff --git a/_site/docs/execution/execution_properties.md b/_site/docs/execution/execution_properties.md index 85579ed099..7966c70dd2 100644 --- a/_site/docs/execution/execution_properties.md +++ b/_site/docs/execution/execution_properties.md @@ -76,37 +76,42 @@ Despite being given 1 core, they see all of the cpus and decide to spawn that ma **Standard Example:** This test will succeed when env var TESTVAR is foobar, and fail otherwise. -``` + +```shell #!/bin/bash [ "$TESTVAR" = "foobar" ] ``` -``` -./bazel test \ + +```shell +$ ./bazel test \ --remote_executor=grpc://127.0.0.1:8980 --noremote_accept_cached --nocache_test_results \ //env_test:main FAIL ``` -``` -./bazel test --remote_default_exec_properties='env-vars={"TESTVAR": "foobar"}' \ +```shell +$ ./bazel test --remote_default_exec_properties='env-vars={"TESTVAR": "foobar"}' \ --remote_executor=grpc://127.0.0.1:8980 --noremote_accept_cached --nocache_test_results \ //env_test:main PASS ``` + **Template Example:** If you give a range of cores, buildfarm has the authority to decide how many your operation actually claims. You can let buildfarm resolve this value for you (via [mustache](https://mustache.github.io/)). -``` +```bash #!/bin/bash [ "$MKL_NUM_THREADS" = "1" ] ``` -``` -./bazel test \ + +```shell +$ ./bazel test \ --remote_executor=grpc://127.0.0.1:8980 --noremote_accept_cached --nocache_test_results \ //env_test:main FAIL ``` -``` -./bazel test \ + +```shell +$ ./bazel test \ --remote_default_exec_properties='env-vars="MKL_NUM_THREADS": "{{limits.cpu.claimed}}"' \ --remote_executor=grpc://127.0.0.1:8980 --noremote_accept_cached --nocache_test_results \ //env_test:main diff --git a/_site/docs/quick_start.md b/_site/docs/quick_start.md index 7af957ee63..8a9a9234db 100644 --- a/_site/docs/quick_start.md +++ b/_site/docs/quick_start.md @@ -25,7 +25,8 @@ Let's start with a bazel workspace with a single file to compile into an executa Create a new directory for our workspace and add the following files: `main.cc`: -``` + +```c #include int main( int argc, char *argv[] ) @@ -35,7 +36,8 @@ int main( int argc, char *argv[] ) ``` `BUILD`: -``` + +```starlark cc_binary( name = "main", srcs = ["main.cc"], @@ -118,15 +120,18 @@ That `2 remote` indicates that your compile and link ran remotely. Congratulatio ## Container Quick Start To bring up a minimal buildfarm cluster, you can run: + +```shell +$ ./examples/bf-run start ``` -./examples/bf-run start -``` + This will start all of the necessary containers at the latest version. Once the containers are up, you can build with `bazel run --remote_executor=grpc://localhost:8980 :main`. To stop the containers, run: -``` -./examples/bf-run stop + +```shell +$ ./examples/bf-run stop ``` ## Next Steps @@ -137,8 +142,8 @@ We've started our worker on the same host as our server, and also the same host You can now easily launch a new Buildfarm cluster locally or in AWS using an open sourced [Buildfarm Manager](https://github.com/80degreeswest/bfmgr). -``` -wget https://github.com/80degreeswest/bfmgr/releases/download/1.0.7/bfmgr-1.0.7.jar -java -jar bfmgr-1.0.7.jar -Navigate to http://localhost +```shell +$ wget https://github.com/80degreeswest/bfmgr/releases/download/1.0.7/bfmgr-1.0.7.jar +$ java -jar bfmgr-1.0.7.jar +$ open http://localhost ``` From 018e177642caebf76f8baeeba2b15c7c3b6f5286 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 25 Oct 2023 16:54:59 -0400 Subject: [PATCH 106/214] Support OutputPaths in OutputDirectory Specifying any number of OutputPaths will ignore OutputFiles (consistent with uploads). Where an OutputPath specifies an output directory, the action must be able to create the directory itself. --- .../worker/shard/CFCExecFileSystem.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index 041868f69c..d042ee0fb9 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -397,16 +397,25 @@ private Set linkedDirectories( return ImmutableSet.of(); } + private OutputDirectory createOutputDirectory(Command command) { + Iterable files; + Iterable dirs; + if (command.getOutputPathsCount() != 0) { + files = command.getOutputPathsList(); + dirs = ImmutableList.of(); // output paths require the action to create their own directory + } else { + files = command.getOutputFilesList(); + dirs = command.getOutputDirectoriesList(); + } + return OutputDirectory.parse(files, dirs, command.getEnvironmentVariablesList()); + } + @Override public Path createExecDir( String operationName, Map directoriesIndex, Action action, Command command) throws IOException, InterruptedException { Digest inputRootDigest = action.getInputRootDigest(); - OutputDirectory outputDirectory = - OutputDirectory.parse( - command.getOutputFilesList(), - command.getOutputDirectoriesList(), - command.getEnvironmentVariablesList()); + OutputDirectory outputDirectory = createOutputDirectory(command); Path execDir = root.resolve(operationName); if (Files.exists(execDir)) { From 8b370138da8f21401e78ed3d931e50194b1f4a06 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 26 Oct 2023 11:50:30 -0400 Subject: [PATCH 107/214] Permit Absolute Symlink Targets with configuration Partial specification of the absolute symlink response per REAPI. Remaining work will be in output identification. --- _site/docs/configuration/configuration.md | 15 +++--- examples/config.yml | 1 + .../common/config/BuildfarmConfigs.java | 1 + .../server/AbstractServerInstance.java | 18 +++++++ .../instance/shard/ShardInstance.java | 14 +++++ .../worker/shard/CFCExecFileSystem.java | 7 ++- .../build/buildfarm/worker/shard/Worker.java | 1 + .../server/AbstractServerInstanceTest.java | 51 +++++++++++++++++++ 8 files changed, 100 insertions(+), 8 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ab3638f5b1..ccfc8e026c 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -28,13 +28,14 @@ For an example configuration containing all of the configuration values, see `ex ### Common -| Configuration | Accepted and _Default_ Values | Command Line Argument | Description | -|----------------------|-------------------------------|-----------------------|---------------------------------------------------| -| digestFunction | _SHA256_, SHA1 | | Digest function for this implementation | -| defaultActionTimeout | Integer, _600_ | | Default timeout value for an action (seconds) | -| maximumActionTimeout | Integer, _3600_ | | Maximum allowed action timeout (seconds) | -| maxEntrySizeBytes | Long, _2147483648_ | | Maximum size of a single blob accepted (bytes) | -| prometheusPort | Integer, _9090_ | --prometheus_port | Listening port of the Prometheus metrics endpoint | +| Configuration | Accepted and _Default_ Values | Command Line Argument | Description | +|------------------------------|-------------------------------|-----------------------|--------------------------------------------------------------| +| digestFunction | _SHA256_, SHA1 | | Digest function for this implementation | +| defaultActionTimeout | Integer, _600_ | | Default timeout value for an action (seconds) | +| maximumActionTimeout | Integer, _3600_ | | Maximum allowed action timeout (seconds) | +| maxEntrySizeBytes | Long, _2147483648_ | | Maximum size of a single blob accepted (bytes) | +| prometheusPort | Integer, _9090_ | --prometheus_port | Listening port of the Prometheus metrics endpoint | +| allowSymlinkTargetAbsolute | boolean, _false_ | | Permit inputs to contain symlinks with absolute path targets | Example: diff --git a/examples/config.yml b/examples/config.yml index bce19a3d60..5229fcd07c 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -3,6 +3,7 @@ defaultActionTimeout: 600 maximumActionTimeout: 3600 maxEntrySizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 prometheusPort: 9090 +allowSymlinkTargetAbsolute: false server: instanceType: SHARD name: shard diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 444d25a13d..d6ebbe9e14 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -36,6 +36,7 @@ public final class BuildfarmConfigs { private long maximumActionTimeout = 3600; private long maxEntrySizeBytes = 2147483648L; // 2 * 1024 * 1024 * 1024 private int prometheusPort = 9090; + private boolean allowSymlinkTargetAbsolute = false; private Server server = new Server(); private Backplane backplane = new Backplane(); private Worker worker = new Worker(); diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java index d828b7bd89..541e13701d 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java @@ -178,6 +178,8 @@ public abstract class AbstractServerInstance implements Instance { public static final String ENVIRONMENT_VARIABLES_NOT_SORTED = "The `Command`'s `environment_variables` are not correctly sorted by `name`."; + public static final String SYMLINK_TARGET_ABSOLUTE = "A symlink target is absolute."; + public static final String MISSING_ACTION = "The action was not found in the CAS."; public static final String MISSING_COMMAND = "The command was not found in the CAS."; @@ -790,6 +792,7 @@ public static void validateActionInputDirectory( Stack pathDigests, Set visited, Map directoriesIndex, + boolean allowSymlinkTargetAbsolute, Consumer onInputFile, Consumer onInputDirectory, Consumer onInputDigest, @@ -838,6 +841,14 @@ public static void validateActionInputDirectory( .setSubject("/" + directoryPath + ": " + lastSymlinkName + " > " + symlinkName) .setDescription(DIRECTORY_NOT_SORTED); } + String symlinkTarget = symlinkNode.getTarget(); + if (!allowSymlinkTargetAbsolute && symlinkTarget.charAt(0) == '/') { + preconditionFailure + .addViolationsBuilder() + .setType(VIOLATION_TYPE_INVALID) + .setSubject("/" + directoryPath + ": " + symlinkName + " -> " + symlinkTarget) + .setDescription(SYMLINK_TARGET_ABSOLUTE); + } /* FIXME serverside validity check? regex? Preconditions.checkState( isValidFilename(symlinkName), @@ -907,6 +918,7 @@ public static void validateActionInputDirectory( pathDigests, visited, directoriesIndex, + allowSymlinkTargetAbsolute, onInputFile, onInputDirectory, onInputDigest, @@ -922,6 +934,7 @@ private static void validateActionInputDirectoryDigest( Stack pathDigests, Set visited, Map directoriesIndex, + boolean allowSymlinkTargetAbsolute, Consumer onInputFile, Consumer onInputDirectory, Consumer onInputDigest, @@ -946,6 +959,7 @@ private static void validateActionInputDirectoryDigest( pathDigests, visited, directoriesIndex, + allowSymlinkTargetAbsolute, onInputFile, onInputDirectory, onInputDigest, @@ -1203,12 +1217,16 @@ protected void validateAction( ImmutableSet.Builder inputFilesBuilder = ImmutableSet.builder(); inputDirectoriesBuilder.add(ACTION_INPUT_ROOT_DIRECTORY_PATH); + boolean allowSymlinkTargetAbsolute = + getCacheCapabilities().getSymlinkAbsolutePathStrategy() + == SymlinkAbsolutePathStrategy.Value.ALLOWED; validateActionInputDirectoryDigest( ACTION_INPUT_ROOT_DIRECTORY_PATH, action.getInputRootDigest(), new Stack<>(), new HashSet<>(), directoriesIndex, + allowSymlinkTargetAbsolute, inputFilesBuilder::add, inputDirectoriesBuilder::add, onInputDigest, diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java index c1c07b08f0..241f1a8fa1 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ShardInstance.java @@ -47,6 +47,7 @@ import build.bazel.remote.execution.v2.Action; import build.bazel.remote.execution.v2.ActionResult; import build.bazel.remote.execution.v2.BatchReadBlobsResponse.Response; +import build.bazel.remote.execution.v2.CacheCapabilities; import build.bazel.remote.execution.v2.Command; import build.bazel.remote.execution.v2.Compressor; import build.bazel.remote.execution.v2.Digest; @@ -60,6 +61,7 @@ import build.bazel.remote.execution.v2.Platform.Property; import build.bazel.remote.execution.v2.RequestMetadata; import build.bazel.remote.execution.v2.ResultsCachePolicy; +import build.bazel.remote.execution.v2.SymlinkAbsolutePathStrategy; import build.buildfarm.actioncache.ActionCache; import build.buildfarm.actioncache.ShardActionCache; import build.buildfarm.backplane.Backplane; @@ -2726,4 +2728,16 @@ private boolean inDenyList(RequestMetadata requestMetadata) throws IOException { } return backplane.isBlacklisted(requestMetadata); } + + @Override + protected CacheCapabilities getCacheCapabilities() { + SymlinkAbsolutePathStrategy.Value symlinkAbsolutePathStrategy = + configs.isAllowSymlinkTargetAbsolute() + ? SymlinkAbsolutePathStrategy.Value.ALLOWED + : SymlinkAbsolutePathStrategy.Value.DISALLOWED; + return super.getCacheCapabilities() + .toBuilder() + .setSymlinkAbsolutePathStrategy(symlinkAbsolutePathStrategy) + .build(); + } } diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index d042ee0fb9..dba809fdcf 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -82,6 +82,9 @@ class CFCExecFileSystem implements ExecFileSystem { // indicate symlinking above for a set of matching paths private final Iterable linkedInputDirectories; + // permit symlinks to point to absolute paths in inputs + private final boolean allowSymlinkTargetAbsolute; + private final Map> rootInputFiles = new ConcurrentHashMap<>(); private final Map> rootInputDirectories = new ConcurrentHashMap<>(); private final ExecutorService fetchService = BuildfarmExecutors.getFetchServicePool(); @@ -95,6 +98,7 @@ class CFCExecFileSystem implements ExecFileSystem { @Nullable UserPrincipal owner, boolean linkInputDirectories, Iterable linkedInputDirectories, + boolean allowSymlinkTargetAbsolute, ExecutorService removeDirectoryService, ExecutorService accessRecorder) { this.root = root; @@ -104,6 +108,7 @@ class CFCExecFileSystem implements ExecFileSystem { this.linkedInputDirectories = Iterables.transform( linkedInputDirectories, realInputDirectory -> Pattern.compile(realInputDirectory)); + this.allowSymlinkTargetAbsolute = allowSymlinkTargetAbsolute; this.removeDirectoryService = removeDirectoryService; this.accessRecorder = accessRecorder; } @@ -179,7 +184,7 @@ public InputStream newInput(Compressor.Value compressor, Digest digest, long off private ListenableFuture putSymlink(Path path, SymlinkNode symlinkNode) { Path symlinkPath = path.resolve(symlinkNode.getName()); Path relativeTargetPath = path.getFileSystem().getPath(symlinkNode.getTarget()); - checkState(!relativeTargetPath.isAbsolute()); + checkState(allowSymlinkTargetAbsolute || !relativeTargetPath.isAbsolute()); return listeningDecorator(fetchService) .submit( () -> { diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 038097de7f..eaf8b6cb1a 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -337,6 +337,7 @@ private ExecFileSystem createCFCExecFileSystem( owner, configs.getWorker().isLinkInputDirectories(), configs.getWorker().getLinkedInputDirectories(), + configs.isAllowSymlinkTargetAbsolute(), removeDirectoryService, accessRecorder /* deadlineAfter=*/ diff --git a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java index add9136633..a23afaf0f7 100644 --- a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java @@ -23,6 +23,7 @@ import static build.buildfarm.instance.server.AbstractServerInstance.INVALID_COMMAND; import static build.buildfarm.instance.server.AbstractServerInstance.OUTPUT_DIRECTORY_IS_OUTPUT_ANCESTOR; import static build.buildfarm.instance.server.AbstractServerInstance.OUTPUT_FILE_IS_OUTPUT_ANCESTOR; +import static build.buildfarm.instance.server.AbstractServerInstance.SYMLINK_TARGET_ABSOLUTE; import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.Futures.immediateFuture; import static org.mockito.Mockito.any; @@ -43,6 +44,7 @@ import build.bazel.remote.execution.v2.OutputDirectory; import build.bazel.remote.execution.v2.Platform; import build.bazel.remote.execution.v2.RequestMetadata; +import build.bazel.remote.execution.v2.SymlinkNode; import build.bazel.remote.execution.v2.Tree; import build.buildfarm.actioncache.ActionCache; import build.buildfarm.cas.ContentAddressableStorage; @@ -270,6 +272,7 @@ public void duplicateFileInputIsInvalid() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ Maps.newHashMap(), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFile=*/ file -> {}, /* onInputDirectorie=*/ directory -> {}, /* onInputDigest=*/ digest -> {}, @@ -304,6 +307,7 @@ public void duplicateEmptyDirectoryCheckPasses() throws StatusException { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ ImmutableMap.of(Digest.getDefaultInstance(), emptyDirectory), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, @@ -327,6 +331,7 @@ public void unsortedFileInputIsInvalid() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ Maps.newHashMap(), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, @@ -361,6 +366,7 @@ public void duplicateDirectoryInputIsInvalid() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ ImmutableMap.of(emptyDirectoryDigest, emptyDirectory), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, @@ -395,6 +401,7 @@ public void unsortedDirectoryInputIsInvalid() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ ImmutableMap.of(emptyDirectoryDigest, emptyDirectory), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, @@ -407,6 +414,48 @@ public void unsortedDirectoryInputIsInvalid() { assertThat(violation.getDescription()).isEqualTo(DIRECTORY_NOT_SORTED); } + @Test + public void shouldValidateIfSymlinkTargetAbsolute() { + // invalid for disallowed + PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); + Directory absoluteSymlinkDirectory = + Directory.newBuilder() + .addSymlinks(SymlinkNode.newBuilder().setName("foo").setTarget("/root/secret").build()) + .build(); + AbstractServerInstance.validateActionInputDirectory( + ACTION_INPUT_ROOT_DIRECTORY_PATH, + absoluteSymlinkDirectory, + /* pathDigests=*/ new Stack<>(), + /* visited=*/ Sets.newHashSet(), + /* directoriesIndex=*/ Maps.newHashMap(), + /* allowSymlinkTargetAbsolute=*/ false, + /* onInputFile=*/ file -> {}, + /* onInputDirectorie=*/ directory -> {}, + /* onInputDigest=*/ digest -> {}, + preconditionFailure); + + assertThat(preconditionFailure.getViolationsCount()).isEqualTo(1); + Violation violation = preconditionFailure.getViolationsList().get(0); + assertThat(violation.getType()).isEqualTo(VIOLATION_TYPE_INVALID); + assertThat(violation.getSubject()).isEqualTo("/: foo -> /root/secret"); + assertThat(violation.getDescription()).isEqualTo(SYMLINK_TARGET_ABSOLUTE); + + // valid for allowed + preconditionFailure = PreconditionFailure.newBuilder(); + AbstractServerInstance.validateActionInputDirectory( + ACTION_INPUT_ROOT_DIRECTORY_PATH, + absoluteSymlinkDirectory, + /* pathDigests=*/ new Stack<>(), + /* visited=*/ Sets.newHashSet(), + /* directoriesIndex=*/ Maps.newHashMap(), + /* allowSymlinkTargetAbsolute=*/ true, + /* onInputFile=*/ file -> {}, + /* onInputDirectorie=*/ directory -> {}, + /* onInputDigest=*/ digest -> {}, + preconditionFailure); + assertThat(preconditionFailure.getViolationsCount()).isEqualTo(0); + } + @Test public void nestedOutputDirectoriesAreInvalid() { PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); @@ -547,6 +596,7 @@ public void multipleIdenticalDirectoryMissingAreAllPreconditionFailures() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ ImmutableMap.of(), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, @@ -608,6 +658,7 @@ public void validationRevisitReplicatesPreconditionFailures() { /* pathDigests=*/ new Stack<>(), /* visited=*/ Sets.newHashSet(), /* directoriesIndex=*/ ImmutableMap.of(fooDigest, foo), + /* allowSymlinkTargetAbsolute=*/ false, /* onInputFiles=*/ file -> {}, /* onInputDirectories=*/ directory -> {}, /* onInputDigests=*/ digest -> {}, From df9ce1ddbd0a51b22eb535152794601125d59b84 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Sun, 29 Oct 2023 14:05:45 -0700 Subject: [PATCH 108/214] chore: update bazel to 6.4.0 (#1513) Trying to get more info on the Lombok stamping issue on Windows CI. See also https://github.com/bazelbuild/bazel/issues/10363 and https://github.com/bazelbuild/bazel/pull/18185 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index 5e3254243a..19b860c187 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.1.2 +6.4.0 From bd740c93510bc9c5abe2ba1860ae10bbbf4eae08 Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Mon, 30 Oct 2023 12:22:15 -0400 Subject: [PATCH 109/214] Rename instance types (#1514) --- .../src/main/resources/proto/buildfarm.proto | 8 +-- .../build/buildfarm/instance/server/BUILD | 2 +- ...tServerInstance.java => NodeInstance.java} | 11 ++-- .../shard/RemoteInputStreamFactory.java | 2 +- ...ShardInstance.java => ServerInstance.java} | 28 +++++----- .../buildfarm/server/BuildFarmServer.java | 6 +-- .../build/buildfarm/worker/shard/Worker.java | 5 +- ...orkerInstance.java => WorkerInstance.java} | 8 +-- ...nstanceTest.java => NodeInstanceTest.java} | 53 +++++++++---------- .../java/build/buildfarm/instance/shard/BUILD | 4 +- ...tanceTest.java => ServerInstanceTest.java} | 12 ++--- ...tanceTest.java => WorkerInstanceTest.java} | 6 +-- 12 files changed, 71 insertions(+), 74 deletions(-) rename src/main/java/build/buildfarm/instance/server/{AbstractServerInstance.java => NodeInstance.java} (99%) rename src/main/java/build/buildfarm/instance/shard/{ShardInstance.java => ServerInstance.java} (99%) rename src/main/java/build/buildfarm/worker/shard/{ShardWorkerInstance.java => WorkerInstance.java} (98%) rename src/test/java/build/buildfarm/instance/server/{AbstractServerInstanceTest.java => NodeInstanceTest.java} (94%) rename src/test/java/build/buildfarm/instance/shard/{ShardInstanceTest.java => ServerInstanceTest.java} (99%) rename src/test/java/build/buildfarm/worker/shard/{ShardWorkerInstanceTest.java => WorkerInstanceTest.java} (97%) diff --git a/admin/main/src/main/resources/proto/buildfarm.proto b/admin/main/src/main/resources/proto/buildfarm.proto index 8a000132a3..d391847cb9 100644 --- a/admin/main/src/main/resources/proto/buildfarm.proto +++ b/admin/main/src/main/resources/proto/buildfarm.proto @@ -520,7 +520,7 @@ message RedisShardBackplaneConfig { int32 max_attempts = 33; } -message ShardInstanceConfig { +message ServerInstanceConfig { bool run_dispatched_monitor = 1; int32 dispatched_monitor_interval_seconds = 2; @@ -544,7 +544,7 @@ message ShardInstanceConfig { google.protobuf.Duration grpc_timeout = 8; } -message ShardWorkerInstanceConfig { +message WorkerInstanceConfig { // whether to stream stdout from processes bool stream_stdout = 6; @@ -568,7 +568,7 @@ message ShardWorkerInstanceConfig { } message ShardWorkerConfig { - ShardWorkerInstanceConfig shard_worker_instance_config = 1; + WorkerInstanceConfig shard_worker_instance_config = 1; int32 port = 2; @@ -836,7 +836,7 @@ message InstanceConfig { oneof type { MemoryInstanceConfig memory_instance_config = 3; - ShardInstanceConfig shard_instance_config = 4; + ServerInstanceConfig shard_instance_config = 4; } } diff --git a/src/main/java/build/buildfarm/instance/server/BUILD b/src/main/java/build/buildfarm/instance/server/BUILD index ecff968e79..1c63e9896c 100644 --- a/src/main/java/build/buildfarm/instance/server/BUILD +++ b/src/main/java/build/buildfarm/instance/server/BUILD @@ -1,8 +1,8 @@ java_library( name = "server", srcs = [ - "AbstractServerInstance.java", "GetDirectoryFunction.java", + "NodeInstance.java", "OperationsMap.java", "WatchFuture.java", ], diff --git a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java b/src/main/java/build/buildfarm/instance/server/NodeInstance.java similarity index 99% rename from src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java rename to src/main/java/build/buildfarm/instance/server/NodeInstance.java index 541e13701d..e44305f32e 100644 --- a/src/main/java/build/buildfarm/instance/server/AbstractServerInstance.java +++ b/src/main/java/build/buildfarm/instance/server/NodeInstance.java @@ -144,7 +144,7 @@ import lombok.extern.java.Log; @Log -public abstract class AbstractServerInstance implements Instance { +public abstract class NodeInstance implements Instance { private final String name; protected final ContentAddressableStorage contentAddressableStorage; protected final ActionCache actionCache; @@ -229,7 +229,7 @@ public abstract class AbstractServerInstance implements Instance { public static final String NO_REQUEUE_COMPLETE_MESSAGE = "Operation %s not requeued. Operation has already completed."; - public AbstractServerInstance( + public NodeInstance( String name, DigestUtil digestUtil, ContentAddressableStorage contentAddressableStorage, @@ -1967,19 +1967,18 @@ public ServerCapabilities getCapabilities() { @Override public WorkerProfileMessage getWorkerProfile() { throw new UnsupportedOperationException( - "AbstractServerInstance doesn't support getWorkerProfile() method."); + "NodeInstance doesn't support getWorkerProfile() method."); } @Override public WorkerListMessage getWorkerList() { - throw new UnsupportedOperationException( - "AbstractServerInstance doesn't support getWorkerList() method."); + throw new UnsupportedOperationException("NodeInstance doesn't support getWorkerList() method."); } @Override public PrepareWorkerForGracefulShutDownRequestResults shutDownWorkerGracefully() { throw new UnsupportedOperationException( - "AbstractServerInstance doesn't support drainWorkerPipeline() method."); + "NodeInstance doesn't support drainWorkerPipeline() method."); } @Override diff --git a/src/main/java/build/buildfarm/instance/shard/RemoteInputStreamFactory.java b/src/main/java/build/buildfarm/instance/shard/RemoteInputStreamFactory.java index 640878707f..8a00e9ae96 100644 --- a/src/main/java/build/buildfarm/instance/shard/RemoteInputStreamFactory.java +++ b/src/main/java/build/buildfarm/instance/shard/RemoteInputStreamFactory.java @@ -30,7 +30,7 @@ import build.buildfarm.common.DigestUtil; import build.buildfarm.common.InputStreamFactory; import build.buildfarm.instance.Instance; -import build.buildfarm.instance.shard.ShardInstance.WorkersCallback; +import build.buildfarm.instance.shard.ServerInstance.WorkersCallback; import com.google.common.base.Throwables; import com.google.common.cache.LoadingCache; import com.google.common.collect.Iterables; diff --git a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java similarity index 99% rename from src/main/java/build/buildfarm/instance/shard/ShardInstance.java rename to src/main/java/build/buildfarm/instance/shard/ServerInstance.java index 241f1a8fa1..ab865b0e0e 100644 --- a/src/main/java/build/buildfarm/instance/shard/ShardInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java @@ -81,7 +81,7 @@ import build.buildfarm.common.grpc.UniformDelegateServerCallStreamObserver; import build.buildfarm.instance.Instance; import build.buildfarm.instance.MatchListener; -import build.buildfarm.instance.server.AbstractServerInstance; +import build.buildfarm.instance.server.NodeInstance; import build.buildfarm.operations.EnrichedOperation; import build.buildfarm.operations.FindOperationsResults; import build.buildfarm.v1test.BackplaneStatus; @@ -167,7 +167,7 @@ import lombok.extern.java.Log; @Log -public class ShardInstance extends AbstractServerInstance { +public class ServerInstance extends NodeInstance { private static final ListenableFuture IMMEDIATE_VOID_FUTURE = Futures.immediateFuture(null); private static final String TIMEOUT_OUT_OF_BOUNDS = @@ -259,14 +259,14 @@ private static Backplane createBackplane(String identifier) throws Configuration identifier, /* subscribeToBackplane=*/ true, configs.getServer().isRunFailsafeOperation(), - ShardInstance::stripOperation, - ShardInstance::stripQueuedOperation); + ServerInstance::stripOperation, + ServerInstance::stripQueuedOperation); } else { throw new IllegalArgumentException("Shard Backplane not set in config"); } } - public ShardInstance(String name, String identifier, DigestUtil digestUtil, Runnable onStop) + public ServerInstance(String name, String identifier, DigestUtil digestUtil, Runnable onStop) throws InterruptedException, ConfigurationException { this( name, @@ -276,7 +276,7 @@ public ShardInstance(String name, String identifier, DigestUtil digestUtil, Runn /* actionCacheFetchService=*/ BuildfarmExecutors.getActionCacheFetchServicePool()); } - private ShardInstance( + private ServerInstance( String name, DigestUtil digestUtil, Backplane backplane, @@ -328,7 +328,7 @@ void initializeCaches() { .build(); } - public ShardInstance( + public ServerInstance( String name, DigestUtil digestUtil, Backplane backplane, @@ -1086,7 +1086,7 @@ public void onError(Throwable t) { backplane, workerSet, locationSet, - ShardInstance.this::workerStub, + ServerInstance.this::workerStub, blobDigest, directExecutor(), RequestMetadata.getDefaultInstance()), @@ -2251,7 +2251,7 @@ public ListenableFuture queue(ExecuteEntry executeEntry, Poller poller, Du log.log( Level.FINER, format( - "ShardInstance(%s): checkCache(%s): %sus elapsed", + "ServerInstance(%s): checkCache(%s): %sus elapsed", getName(), operation.getName(), checkCacheUSecs)); return IMMEDIATE_VOID_FUTURE; } @@ -2278,7 +2278,7 @@ private ListenableFuture transformAndQueue( log.log( Level.FINER, format( - "ShardInstance(%s): queue(%s): fetching action %s", + "ServerInstance(%s): queue(%s): fetching action %s", getName(), operation.getName(), actionDigest.getHash())); RequestMetadata requestMetadata = executeEntry.getRequestMetadata(); ListenableFuture actionFuture = @@ -2321,7 +2321,7 @@ private ListenableFuture transformAndQueue( log.log( Level.FINER, format( - "ShardInstance(%s): queue(%s): fetched action %s transforming queuedOperation", + "ServerInstance(%s): queue(%s): fetched action %s transforming queuedOperation", getName(), operation.getName(), actionDigest.getHash())); Stopwatch transformStopwatch = Stopwatch.createStarted(); return transform( @@ -2351,7 +2351,7 @@ private ListenableFuture transformAndQueue( log.log( Level.FINER, format( - "ShardInstance(%s): queue(%s): queuedOperation %s transformed, validating", + "ServerInstance(%s): queue(%s): queuedOperation %s transformed, validating", getName(), operation.getName(), DigestUtil.toString( @@ -2373,7 +2373,7 @@ private ListenableFuture transformAndQueue( log.log( Level.FINER, format( - "ShardInstance(%s): queue(%s): queuedOperation %s validated, uploading", + "ServerInstance(%s): queue(%s): queuedOperation %s validated, uploading", getName(), operation.getName(), DigestUtil.toString( @@ -2425,7 +2425,7 @@ public void onSuccess(ProfiledQueuedOperationMetadata profiledQueuedMetadata) { log.log( Level.FINER, format( - "ShardInstance(%s): queue(%s): %dus checkCache, %dus transform, %dus validate, %dus upload, %dus queue, %dus elapsed", + "ServerInstance(%s): queue(%s): %dus checkCache, %dus transform, %dus validate, %dus upload, %dus queue, %dus elapsed", getName(), queueOperation.getName(), checkCacheUSecs, diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index a20f4a6f77..8672c0df76 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -29,7 +29,7 @@ import build.buildfarm.common.services.ByteStreamService; import build.buildfarm.common.services.ContentAddressableStorageService; import build.buildfarm.instance.Instance; -import build.buildfarm.instance.shard.ShardInstance; +import build.buildfarm.instance.shard.ServerInstance; import build.buildfarm.metrics.prometheus.PrometheusPublisher; import build.buildfarm.server.services.ActionCacheService; import build.buildfarm.server.services.CapabilitiesService; @@ -109,9 +109,9 @@ public void prepareServerForGracefulShutdown() { } } - private ShardInstance createInstance() + private ServerInstance createInstance() throws IOException, ConfigurationException, InterruptedException { - return new ShardInstance( + return new ServerInstance( configs.getServer().getName(), configs.getServer().getSession() + "-" + configs.getServer().getName(), new DigestUtil(configs.getDigestFunction()), diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index eaf8b6cb1a..fd556fc8e8 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -123,7 +123,7 @@ public final class Worker extends LoggingMain { private boolean inGracefulShutdown = false; private boolean isPaused = false; - private ShardWorkerInstance instance; + private WorkerInstance instance; @SuppressWarnings("deprecation") private final HealthStatusManager healthStatusManager = new HealthStatusManager(); @@ -532,8 +532,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep remoteInputStreamFactory, removeDirectoryService, accessRecorder, storage); instance = - new ShardWorkerInstance( - configs.getWorker().getPublicName(), digestUtil, backplane, storage); + new WorkerInstance(configs.getWorker().getPublicName(), digestUtil, backplane, storage); // Create the appropriate writer for the context CasWriter writer; diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java b/src/main/java/build/buildfarm/worker/shard/WorkerInstance.java similarity index 98% rename from src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java rename to src/main/java/build/buildfarm/worker/shard/WorkerInstance.java index a891af7faa..e100417f53 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerInstance.java +++ b/src/main/java/build/buildfarm/worker/shard/WorkerInstance.java @@ -36,7 +36,7 @@ import build.buildfarm.common.Write; import build.buildfarm.common.grpc.UniformDelegateServerCallStreamObserver; import build.buildfarm.instance.MatchListener; -import build.buildfarm.instance.server.AbstractServerInstance; +import build.buildfarm.instance.server.NodeInstance; import build.buildfarm.operations.EnrichedOperation; import build.buildfarm.operations.FindOperationsResults; import build.buildfarm.v1test.BackplaneStatus; @@ -68,13 +68,13 @@ import lombok.extern.java.Log; @Log -public class ShardWorkerInstance extends AbstractServerInstance { +public class WorkerInstance extends NodeInstance { private static final Counter IO_METRIC = Counter.build().name("io_bytes_read").help("Read I/O (bytes)").register(); private final Backplane backplane; - public ShardWorkerInstance( + public WorkerInstance( String name, DigestUtil digestUtil, Backplane backplane, @@ -346,7 +346,7 @@ protected static ExecuteOperationMetadata expectExecuteOperationMetadata(Operati return null; } } else { - return AbstractServerInstance.expectExecuteOperationMetadata(operation); + return NodeInstance.expectExecuteOperationMetadata(operation); } } diff --git a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java b/src/test/java/build/buildfarm/instance/server/NodeInstanceTest.java similarity index 94% rename from src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java rename to src/test/java/build/buildfarm/instance/server/NodeInstanceTest.java index a23afaf0f7..454440281f 100644 --- a/src/test/java/build/buildfarm/instance/server/AbstractServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/server/NodeInstanceTest.java @@ -17,13 +17,13 @@ import static build.buildfarm.common.Actions.checkPreconditionFailure; import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; -import static build.buildfarm.instance.server.AbstractServerInstance.ACTION_INPUT_ROOT_DIRECTORY_PATH; -import static build.buildfarm.instance.server.AbstractServerInstance.DIRECTORY_NOT_SORTED; -import static build.buildfarm.instance.server.AbstractServerInstance.DUPLICATE_DIRENT; -import static build.buildfarm.instance.server.AbstractServerInstance.INVALID_COMMAND; -import static build.buildfarm.instance.server.AbstractServerInstance.OUTPUT_DIRECTORY_IS_OUTPUT_ANCESTOR; -import static build.buildfarm.instance.server.AbstractServerInstance.OUTPUT_FILE_IS_OUTPUT_ANCESTOR; -import static build.buildfarm.instance.server.AbstractServerInstance.SYMLINK_TARGET_ABSOLUTE; +import static build.buildfarm.instance.server.NodeInstance.ACTION_INPUT_ROOT_DIRECTORY_PATH; +import static build.buildfarm.instance.server.NodeInstance.DIRECTORY_NOT_SORTED; +import static build.buildfarm.instance.server.NodeInstance.DUPLICATE_DIRENT; +import static build.buildfarm.instance.server.NodeInstance.INVALID_COMMAND; +import static build.buildfarm.instance.server.NodeInstance.OUTPUT_DIRECTORY_IS_OUTPUT_ANCESTOR; +import static build.buildfarm.instance.server.NodeInstance.OUTPUT_FILE_IS_OUTPUT_ANCESTOR; +import static build.buildfarm.instance.server.NodeInstance.SYMLINK_TARGET_ABSOLUTE; import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.Futures.immediateFuture; import static org.mockito.Mockito.any; @@ -99,10 +99,10 @@ @RunWith(JUnit4.class) @Log -public class AbstractServerInstanceTest { +public class NodeInstanceTest { private static final DigestUtil DIGEST_UTIL = new DigestUtil(HashFunction.SHA256); - static class DummyServerInstance extends AbstractServerInstance { + static class DummyServerInstance extends NodeInstance { DummyServerInstance( ContentAddressableStorage contentAddressableStorage, ActionCache actionCache) { super( @@ -261,7 +261,7 @@ public PrepareWorkerForGracefulShutDownRequestResults shutDownWorkerGracefully() @Test public void duplicateFileInputIsInvalid() { PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, Directory.newBuilder() .addAllFiles( @@ -290,7 +290,7 @@ public void duplicateEmptyDirectoryCheckPasses() throws StatusException { Directory emptyDirectory = Directory.getDefaultInstance(); Digest emptyDirectoryDigest = DIGEST_UTIL.compute(emptyDirectory); PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, Directory.newBuilder() .addAllDirectories( @@ -320,7 +320,7 @@ public void duplicateEmptyDirectoryCheckPasses() throws StatusException { @Test public void unsortedFileInputIsInvalid() { PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, Directory.newBuilder() .addAllFiles( @@ -349,7 +349,7 @@ public void duplicateDirectoryInputIsInvalid() { Directory emptyDirectory = Directory.getDefaultInstance(); Digest emptyDirectoryDigest = DIGEST_UTIL.compute(emptyDirectory); PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, Directory.newBuilder() .addAllDirectories( @@ -384,7 +384,7 @@ public void unsortedDirectoryInputIsInvalid() { Directory emptyDirectory = Directory.getDefaultInstance(); Digest emptyDirectoryDigest = DIGEST_UTIL.compute(emptyDirectory); PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, Directory.newBuilder() .addAllDirectories( @@ -422,7 +422,7 @@ public void shouldValidateIfSymlinkTargetAbsolute() { Directory.newBuilder() .addSymlinks(SymlinkNode.newBuilder().setName("foo").setTarget("/root/secret").build()) .build(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, absoluteSymlinkDirectory, /* pathDigests=*/ new Stack<>(), @@ -442,7 +442,7 @@ public void shouldValidateIfSymlinkTargetAbsolute() { // valid for allowed preconditionFailure = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, absoluteSymlinkDirectory, /* pathDigests=*/ new Stack<>(), @@ -459,7 +459,7 @@ public void shouldValidateIfSymlinkTargetAbsolute() { @Test public void nestedOutputDirectoriesAreInvalid() { PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateOutputs( + NodeInstance.validateOutputs( ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of(), @@ -476,7 +476,7 @@ public void nestedOutputDirectoriesAreInvalid() { @Test public void outputDirectoriesContainingOutputFilesAreInvalid() { PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateOutputs( + NodeInstance.validateOutputs( ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of("foo/bar"), @@ -493,7 +493,7 @@ public void outputDirectoriesContainingOutputFilesAreInvalid() { @Test public void outputFilesAsOutputDirectoryAncestorsAreInvalid() { PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); - AbstractServerInstance.validateOutputs( + NodeInstance.validateOutputs( ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of("foo"), @@ -509,7 +509,7 @@ public void outputFilesAsOutputDirectoryAncestorsAreInvalid() { @Test public void emptyArgumentListIsInvalid() { - AbstractServerInstance instance = new DummyServerInstance(); + NodeInstance instance = new DummyServerInstance(); PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); instance.validateCommand( @@ -529,7 +529,7 @@ public void emptyArgumentListIsInvalid() { @Test public void absoluteWorkingDirectoryIsInvalid() { - AbstractServerInstance instance = new DummyServerInstance(); + NodeInstance instance = new DummyServerInstance(); PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); instance.validateCommand( @@ -549,7 +549,7 @@ public void absoluteWorkingDirectoryIsInvalid() { @Test public void undeclaredWorkingDirectoryIsInvalid() { - AbstractServerInstance instance = new DummyServerInstance(); + NodeInstance instance = new DummyServerInstance(); Digest inputRootDigest = DIGEST_UTIL.compute(Directory.getDefaultInstance()); PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder(); @@ -590,7 +590,7 @@ public void multipleIdenticalDirectoryMissingAreAllPreconditionFailures() { .setDigest(missingDirectoryDigest) .build())) .build(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, root, /* pathDigests=*/ new Stack<>(), @@ -652,7 +652,7 @@ public void validationRevisitReplicatesPreconditionFailures() { DirectoryNode.newBuilder().setName("bar").setDigest(fooDigest).build(), DirectoryNode.newBuilder().setName("foo").setDigest(fooDigest).build())) .build(); - AbstractServerInstance.validateActionInputDirectory( + NodeInstance.validateActionInputDirectory( ACTION_INPUT_ROOT_DIRECTORY_PATH, root, /* pathDigests=*/ new Stack<>(), @@ -721,8 +721,7 @@ public void outputDirectoriesFilesAreEnsuredPresent() throws Exception { .build(); ContentAddressableStorage contentAddressableStorage = mock(ContentAddressableStorage.class); ActionCache actionCache = mock(ActionCache.class); - AbstractServerInstance instance = - new DummyServerInstance(contentAddressableStorage, actionCache); + NodeInstance instance = new DummyServerInstance(contentAddressableStorage, actionCache); Tree tree = Tree.newBuilder() @@ -782,7 +781,7 @@ public void fetchBlobWriteCompleteIsSuccess() throws Exception { Digest expectedDigest = contentDigest.toBuilder().setSizeBytes(-1).build(); ContentAddressableStorage contentAddressableStorage = mock(ContentAddressableStorage.class); - AbstractServerInstance instance = new DummyServerInstance(contentAddressableStorage, null); + NodeInstance instance = new DummyServerInstance(contentAddressableStorage, null); RequestMetadata requestMetadata = RequestMetadata.getDefaultInstance(); Write write = mock(Write.class); diff --git a/src/test/java/build/buildfarm/instance/shard/BUILD b/src/test/java/build/buildfarm/instance/shard/BUILD index cd0ae18d24..b635c74ba5 100644 --- a/src/test/java/build/buildfarm/instance/shard/BUILD +++ b/src/test/java/build/buildfarm/instance/shard/BUILD @@ -110,10 +110,10 @@ java_test( ) java_test( - name = "ShardInstanceTest", + name = "ServerInstanceTest", size = "small", srcs = [ - "ShardInstanceTest.java", + "ServerInstanceTest.java", "UnobservableWatcher.java", ], data = ["//examples:example_configs"], diff --git a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java similarity index 99% rename from src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java rename to src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java index aa1adc5d3d..cd959950a0 100644 --- a/src/test/java/build/buildfarm/instance/shard/ShardInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java @@ -20,9 +20,9 @@ import static build.buildfarm.common.Actions.invalidActionVerboseMessage; import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; -import static build.buildfarm.instance.server.AbstractServerInstance.INVALID_PLATFORM; -import static build.buildfarm.instance.server.AbstractServerInstance.MISSING_ACTION; -import static build.buildfarm.instance.server.AbstractServerInstance.MISSING_COMMAND; +import static build.buildfarm.instance.server.NodeInstance.INVALID_PLATFORM; +import static build.buildfarm.instance.server.NodeInstance.MISSING_ACTION; +import static build.buildfarm.instance.server.NodeInstance.MISSING_COMMAND; import static com.google.common.base.Predicates.notNull; import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.Futures.immediateFuture; @@ -121,14 +121,14 @@ import org.mockito.stubbing.Answer; @RunWith(JUnit4.class) -public class ShardInstanceTest { +public class ServerInstanceTest { private static final DigestUtil DIGEST_UTIL = new DigestUtil(HashFunction.SHA256); private static final long QUEUE_TEST_TIMEOUT_SECONDS = 3; private static final Duration DEFAULT_TIMEOUT = Durations.fromSeconds(60); private static final Command SIMPLE_COMMAND = Command.newBuilder().addAllArguments(ImmutableList.of("true")).build(); - private ShardInstance instance; + private ServerInstance instance; private Map blobDigests; @Mock private Backplane mockBackplane; @@ -145,7 +145,7 @@ public void setUp() throws InterruptedException { blobDigests = Maps.newHashMap(); ActionCache actionCache = new ShardActionCache(10, mockBackplane, newDirectExecutorService()); instance = - new ShardInstance( + new ServerInstance( "shard", DIGEST_UTIL, mockBackplane, diff --git a/src/test/java/build/buildfarm/worker/shard/ShardWorkerInstanceTest.java b/src/test/java/build/buildfarm/worker/shard/WorkerInstanceTest.java similarity index 97% rename from src/test/java/build/buildfarm/worker/shard/ShardWorkerInstanceTest.java rename to src/test/java/build/buildfarm/worker/shard/WorkerInstanceTest.java index 7a4e40be26..3df73187bb 100644 --- a/src/test/java/build/buildfarm/worker/shard/ShardWorkerInstanceTest.java +++ b/src/test/java/build/buildfarm/worker/shard/WorkerInstanceTest.java @@ -50,19 +50,19 @@ import org.mockito.MockitoAnnotations; @RunWith(JUnit4.class) -public class ShardWorkerInstanceTest { +public class WorkerInstanceTest { private final DigestUtil DIGEST_UTIL = new DigestUtil(HashFunction.SHA256); @Mock private Backplane backplane; @Mock private ContentAddressableStorage storage; - private ShardWorkerInstance instance; + private WorkerInstance instance; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); - instance = new ShardWorkerInstance("test", DIGEST_UTIL, backplane, storage); + instance = new WorkerInstance("test", DIGEST_UTIL, backplane, storage); } @SuppressWarnings("unchecked") From 2a61f77dc1713f276674bdbc9a839ec2732feb07 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 30 Oct 2023 14:48:00 -0400 Subject: [PATCH 110/214] Create SymlinkNode outputs during upload (#1515) Default disabled, available with createSymlinkOutputs option in Worker config. --- _site/docs/configuration/configuration.md | 1 + examples/config.yml | 1 + .../build/buildfarm/common/config/Worker.java | 1 + .../worker/shard/ShardWorkerContext.java | 38 +++++++++++++++++-- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ccfc8e026c..466375373f 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -262,6 +262,7 @@ backplane: | errorOperationRemainingResources | boolean, _false_ | | | | realInputDirectories | List of Strings, _external_ | | A list of paths that will not be subject to the effects of linkInputDirectories setting, may also be used to provide writable directories as input roots for actions which expect to be able to write to an input location and will fail if they cannot | | gracefulShutdownSeconds | Integer, 0 | | Time in seconds to allow for operations in flight to finish when shutdown signal is received | +| createSymlinkOutputs | boolean, _false_ | | Creates SymlinkNodes for symbolic links discovered in output paths for actions. No verification of the symlink target path occurs. Buildstream, for example, requires this. | ```yaml worker: diff --git a/examples/config.yml b/examples/config.yml index 5229fcd07c..008bf2e1ca 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -131,6 +131,7 @@ worker: alwaysUse: false selectForBlockNetwork: false selectForTmpFs: false + createSymlinkOutputs: false executionPolicies: - name: test executionWrapper: diff --git a/src/main/java/build/buildfarm/common/config/Worker.java b/src/main/java/build/buildfarm/common/config/Worker.java index e987c1e370..c446134fe2 100644 --- a/src/main/java/build/buildfarm/common/config/Worker.java +++ b/src/main/java/build/buildfarm/common/config/Worker.java @@ -39,6 +39,7 @@ public class Worker { private int gracefulShutdownSeconds = 0; private ExecutionPolicy[] executionPolicies = {}; private SandboxSettings sandboxSettings = new SandboxSettings(); + private boolean createSymlinkOutputs = false; // These limited resources are only for the individual worker. // An example would be hardware resources such as GPUs. diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index c844f53963..98474b439c 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -31,6 +31,7 @@ import build.bazel.remote.execution.v2.ExecutionStage; import build.bazel.remote.execution.v2.FileNode; import build.bazel.remote.execution.v2.Platform; +import build.bazel.remote.execution.v2.SymlinkNode; import build.bazel.remote.execution.v2.Tree; import build.buildfarm.backplane.Backplane; import build.buildfarm.common.CommandUtils; @@ -572,6 +573,7 @@ private void uploadOutputFile( static class OutputDirectoryContext { private final List files = new ArrayList<>(); private final List directories = new ArrayList<>(); + private final List symlinks = new ArrayList<>(); void addFile(FileNode fileNode) { files.add(fileNode); @@ -581,10 +583,19 @@ void addDirectory(DirectoryNode directoryNode) { directories.add(directoryNode); } + void addSymlink(SymlinkNode symlinkNode) { + symlinks.add(symlinkNode); + } + Directory toDirectory() { files.sort(Comparator.comparing(FileNode::getName)); directories.sort(Comparator.comparing(DirectoryNode::getName)); - return Directory.newBuilder().addAllFiles(files).addAllDirectories(directories).build(); + symlinks.sort(Comparator.comparing(SymlinkNode::getName)); + return Directory.newBuilder() + .addAllFiles(files) + .addAllDirectories(directories) + .addAllSymlinks(symlinks) + .build(); } } @@ -621,8 +632,30 @@ private void uploadOutputDirectory( @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (configs.getWorker().isCreateSymlinkOutputs() && attrs.isSymbolicLink()) { + visitSymbolicLink(file); + } else { + visitRegularFile(file, attrs); + } + return FileVisitResult.CONTINUE; + } + + private void visitSymbolicLink(Path file) throws IOException { + // TODO convert symlinks with absolute targets within execution root to relative ones + currentDirectory.addSymlink( + SymlinkNode.newBuilder() + .setName(file.getFileName().toString()) + .setTarget(Files.readSymbolicLink(file).toString()) + .build()); + } + + private void visitRegularFile(Path file, BasicFileAttributes attrs) throws IOException { Digest digest; try { + // should we create symlink nodes in output? + // is buildstream trying to execute in a specific container?? + // can get to NSFE for nonexistent symlinks + // can fail outright for a symlink to a directory digest = getDigestUtil().compute(file); } catch (NoSuchFileException e) { log.log( @@ -631,7 +664,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) "error visiting file %s under output dir %s", outputDirPath.relativize(file), outputDirPath.toAbsolutePath()), e); - return FileVisitResult.CONTINUE; + return; } // should we cast to PosixFilePermissions and do gymnastics there for executable? @@ -655,7 +688,6 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) .setDescription( "An output could not be uploaded because it exceeded the maximum size of an entry"); } - return FileVisitResult.CONTINUE; } @Override From 76c2657111e5ebe92bdc99195a892195aa992be0 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:26:18 -0700 Subject: [PATCH 111/214] feat: Implement CAS lease extension (#1455) Problem Enabling the findMissingBlobsViaBackplane flag in BuildfarmServer eliminates the need for the BuildfarmWorker's fmb API call. This BuildfarmWorker:fmb call was also responsible for tracking CAS entry access. As result, our CAS cache eviction strategy shifted from LRU to FIFO. When the findMissingBlobsViaBackplane flag is enabled, the buildfarm relies on the backplane as the definitive source for CAS availability. Since we don't update CAS expiry on each access, the backplane will independently expire CAS entries based on the specified cas_expire duration, even if they are actively being read. Solution Updated bfServer:fmb call to perform non-blocking fmb calls to workers, allowing these workers to record access for the relevant CAS entries. Extended expiry duration for available CAS entries in the backplane on each fmb call. With these changes, we can utilize Bazel's experimental_remote_cache_lease_extension and experimental_remote_cache_ttl flags for incremental builds. Closes #1428 --- defs.bzl | 1 + .../build/buildfarm/backplane/Backplane.java | 3 + .../instance/shard/CasWorkerMap.java | 7 +++ .../instance/shard/JedisCasWorkerMap.java | 11 ++++ .../instance/shard/RedisShardBackplane.java | 5 ++ .../instance/shard/RedissonCasWorkerMap.java | 8 +++ .../instance/shard/ServerInstance.java | 57 ++++++++++++++--- .../java/build/buildfarm/instance/shard/BUILD | 19 ++++++ .../instance/shard/JedisCasWorkerMapTest.java | 63 +++++++++++++++++++ .../instance/shard/ServerInstanceTest.java | 14 +++++ 10 files changed, 180 insertions(+), 8 deletions(-) create mode 100644 src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java diff --git a/defs.bzl b/defs.bzl index 5b0e4f640c..4b0a5e49bf 100644 --- a/defs.bzl +++ b/defs.bzl @@ -60,6 +60,7 @@ def buildfarm_init(name = "buildfarm"): "com.fasterxml.jackson.core:jackson-databind:2.15.0", "com.github.ben-manes.caffeine:caffeine:2.9.0", "com.github.docker-java:docker-java:3.2.11", + "com.github.fppt:jedis-mock:1.0.10", "com.github.jnr:jffi:1.2.16", "com.github.jnr:jffi:jar:native:1.2.16", "com.github.jnr:jnr-constants:0.9.9", diff --git a/src/main/java/build/buildfarm/backplane/Backplane.java b/src/main/java/build/buildfarm/backplane/Backplane.java index 557a7dc163..e13616b32e 100644 --- a/src/main/java/build/buildfarm/backplane/Backplane.java +++ b/src/main/java/build/buildfarm/backplane/Backplane.java @@ -278,4 +278,7 @@ boolean pollOperation(QueueEntry queueEntry, ExecutionStage.Value stage, long re Boolean propertiesEligibleForQueue(List provisions); GetClientStartTimeResult getClientStartTime(GetClientStartTimeRequest request) throws IOException; + + /** Set expiry time for digests */ + void updateDigestsExpiry(Iterable digests) throws IOException; } diff --git a/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java index 794b296a1f..55b2933e42 100644 --- a/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/CasWorkerMap.java @@ -121,4 +121,11 @@ Map> getMap(RedisClient client, Iterable blobDigests * @note Suggested return identifier: mapSize. */ int size(RedisClient client) throws IOException; + + /** + * @brief Set the expiry duration for the digests. + * @param client Client used for interacting with redis when not using cacheMap. + * @param blobDigests The blob digests to set new the expiry duration. + */ + void setExpire(RedisClient client, Iterable blobDigests) throws IOException; } diff --git a/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java index d035d10491..65d1f06b87 100644 --- a/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/JedisCasWorkerMap.java @@ -234,6 +234,17 @@ public int size(RedisClient client) throws IOException { return client.call(jedis -> ScanCount.get(jedis, name + ":*", 1000)); } + @Override + public void setExpire(RedisClient client, Iterable blobDigests) throws IOException { + client.run( + jedis -> { + for (Digest blobDigest : blobDigests) { + String key = redisCasKey(blobDigest); + jedis.expire(key, keyExpiration_s); + } + }); + } + /** * @brief Get the redis key name. * @details This is to be used for the direct redis implementation. diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index ebb832f5aa..535473f2a9 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -1501,4 +1501,9 @@ public GetClientStartTimeResult getClientStartTime(GetClientStartTimeRequest req } return GetClientStartTimeResult.newBuilder().addAllClientStartTime(startTimes).build(); } + + @Override + public void updateDigestsExpiry(Iterable digests) throws IOException { + state.casWorkerMap.setExpire(client, digests); + } } diff --git a/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java b/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java index 234e15fb15..52b010c31f 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java +++ b/src/main/java/build/buildfarm/instance/shard/RedissonCasWorkerMap.java @@ -209,6 +209,14 @@ public int size(RedisClient client) { return cacheMap.size(); } + @Override + public void setExpire(RedisClient client, Iterable blobDigests) { + for (Digest blobDigest : blobDigests) { + String key = cacheMapCasKey(blobDigest); + cacheMap.expireKey(key, keyExpiration_s, TimeUnit.SECONDS); + } + } + /** * @brief Get a random element from the set. * @details Assumes the set is not empty. diff --git a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java index ab865b0e0e..b1cbed0e07 100644 --- a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java @@ -135,10 +135,12 @@ import java.io.InputStream; import java.io.OutputStream; import java.time.Instant; +import java.util.AbstractMap; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.Deque; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -660,7 +662,7 @@ public ListenableFuture> findMissingBlobs( } if (configs.getServer().isFindMissingBlobsViaBackplane()) { - return findMissingBlobsViaBackplane(nonEmptyDigests); + return findMissingBlobsViaBackplane(nonEmptyDigests, requestMetadata); } return findMissingBlobsQueryingEachWorker(nonEmptyDigests, requestMetadata); @@ -727,24 +729,40 @@ private ListenableFuture> findMissingBlobsQueryingEachWorker( // out-of-date and the server lies about which blobs are actually present. We provide this // alternative strategy for calculating missing blobs. private ListenableFuture> findMissingBlobsViaBackplane( - Iterable nonEmptyDigests) { + Iterable nonEmptyDigests, RequestMetadata requestMetadata) { try { Set uniqueDigests = new HashSet<>(); nonEmptyDigests.forEach(uniqueDigests::add); Map> foundBlobs = backplane.getBlobDigestsWorkers(uniqueDigests); Set workerSet = backplane.getStorageWorkers(); Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerSet); - return immediateFuture( + Map> digestAndWorkersMap = uniqueDigests.stream() - .filter( // best effort to present digests only missing on active workers + .map( digest -> { Set initialWorkers = foundBlobs.getOrDefault(digest, Collections.emptySet()); - return filterAndAdjustWorkersForDigest( - digest, initialWorkers, workerSet, workersStartTime) - .isEmpty(); + return new AbstractMap.SimpleEntry<>( + digest, + filterAndAdjustWorkersForDigest( + digest, initialWorkers, workerSet, workersStartTime)); }) - .collect(Collectors.toList())); + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + + ListenableFuture> missingDigestFuture = + immediateFuture( + digestAndWorkersMap.entrySet().stream() + .filter(entry -> entry.getValue().isEmpty()) + .map(Map.Entry::getKey) + .collect(Collectors.toList())); + return transformAsync( + missingDigestFuture, + (missingDigest) -> { + extendLeaseForDigests(digestAndWorkersMap, requestMetadata); + return immediateFuture(missingDigest); + }, + // Propagate context values but don't cascade its cancellation for downstream calls. + Context.current().fork().fixedContextExecutor(directExecutor())); } catch (Exception e) { log.log(Level.SEVERE, "find missing blob via backplane failed", e); return immediateFailedFuture(Status.fromThrowable(e).asException()); @@ -789,6 +807,29 @@ private Set filterAndAdjustWorkersForDigest( return workersStartedBeforeDigestInsertion; } + private void extendLeaseForDigests( + Map> digestAndWorkersMap, RequestMetadata requestMetadata) { + Map> workerAndDigestMap = new HashMap<>(); + digestAndWorkersMap.forEach( + (digest, workers) -> + workers.forEach( + worker -> + workerAndDigestMap.computeIfAbsent(worker, w -> new HashSet<>()).add(digest))); + + workerAndDigestMap.forEach( + (worker, digests) -> workerStub(worker).findMissingBlobs(digests, requestMetadata)); + + try { + backplane.updateDigestsExpiry(digestAndWorkersMap.keySet()); + } catch (IOException e) { + log.log( + Level.WARNING, + format( + "Failed to update expiry duration for digests (%s) insertion time", + digestAndWorkersMap.keySet())); + } + } + private void findMissingBlobsOnWorker( String requestId, Iterable blobDigests, diff --git a/src/test/java/build/buildfarm/instance/shard/BUILD b/src/test/java/build/buildfarm/instance/shard/BUILD index b635c74ba5..2f08b1003d 100644 --- a/src/test/java/build/buildfarm/instance/shard/BUILD +++ b/src/test/java/build/buildfarm/instance/shard/BUILD @@ -219,3 +219,22 @@ java_test( "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", ], ) + +java_test( + name = "JedisCasWorkerMapTest", + size = "small", + srcs = [ + "JedisCasWorkerMapTest.java", + ], + test_class = "build.buildfarm.AllTests", + deps = [ + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/redis", + "//src/main/java/build/buildfarm/instance/shard", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//third_party/jedis", + "@maven//:com_github_fppt_jedis_mock", + "@maven//:com_google_truth_truth", + ], +) diff --git a/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java b/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java new file mode 100644 index 0000000000..caa69536c1 --- /dev/null +++ b/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java @@ -0,0 +1,63 @@ +package build.buildfarm.instance.shard; + +import static com.google.common.truth.Truth.assertThat; + +import build.bazel.remote.execution.v2.Digest; +import build.buildfarm.common.DigestUtil; +import build.buildfarm.common.redis.RedisClient; +import com.github.fppt.jedismock.RedisServer; +import com.github.fppt.jedismock.server.ServiceOptions; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import redis.clients.jedis.HostAndPort; +import redis.clients.jedis.JedisCluster; + +@RunWith(JUnit4.class) +public class JedisCasWorkerMapTest { + + private static final String CAS_PREFIX = "ContentAddressableStorage"; + + private RedisServer redisServer; + private RedisClient redisClient; + private JedisCasWorkerMap jedisCasWorkerMap; + + @Before + public void setup() throws IOException { + redisServer = + RedisServer.newRedisServer() + .setOptions(ServiceOptions.defaultOptions().withClusterModeEnabled()) + .start(); + redisClient = + new RedisClient( + new JedisCluster( + Collections.singleton( + new HostAndPort(redisServer.getHost(), redisServer.getBindPort())))); + jedisCasWorkerMap = new JedisCasWorkerMap(CAS_PREFIX, 60); + } + + @Test + public void testSetExpire() throws IOException { + Digest testDigest1 = Digest.newBuilder().setHash("abc").build(); + Digest testDigest2 = Digest.newBuilder().setHash("xyz").build(); + + String casKey1 = CAS_PREFIX + ":" + DigestUtil.toString(testDigest1); + String casKey2 = CAS_PREFIX + ":" + DigestUtil.toString(testDigest2); + + redisClient.run(jedis -> jedis.sadd(casKey1, "worker1")); + jedisCasWorkerMap.setExpire(redisClient, Arrays.asList(testDigest1, testDigest2)); + + assertThat((Long) redisClient.call(jedis -> jedis.ttl(casKey1))).isGreaterThan(0L); + assertThat((Long) redisClient.call(jedis -> jedis.ttl(casKey2))).isEqualTo(-2L); + } + + @After + public void tearDown() throws IOException { + redisServer.stop(); + } +} diff --git a/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java index cd959950a0..d66a600dab 100644 --- a/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java @@ -31,9 +31,13 @@ import static java.util.concurrent.Executors.newSingleThreadExecutor; import static java.util.concurrent.TimeUnit.SECONDS; import static org.mockito.AdditionalAnswers.answer; +import static org.mockito.ArgumentMatchers.anyIterable; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.Mockito.any; +import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.atMost; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; @@ -80,6 +84,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.longrunning.Operation; import com.google.protobuf.Any; @@ -95,6 +100,7 @@ import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -1110,8 +1116,12 @@ public void findMissingBlobsTest_ViaBackPlane() throws Exception { buildfarmConfigs.getServer().setFindMissingBlobsViaBackplane(true); Set activeAndImposterWorkers = Sets.newHashSet(Iterables.concat(activeWorkers, imposterWorkers)); + when(mockBackplane.getStorageWorkers()).thenReturn(activeAndImposterWorkers); when(mockBackplane.getBlobDigestsWorkers(any(Iterable.class))).thenReturn(digestAndWorkersMap); + when(mockInstanceLoader.load(anyString())).thenReturn(mockWorkerInstance); + when(mockWorkerInstance.findMissingBlobs(anyIterable(), any(RequestMetadata.class))) + .thenReturn(Futures.immediateFuture(new ArrayList<>())); long serverStartTime = 1686951033L; // june 15th, 2023 Map workersStartTime = new HashMap<>(); @@ -1134,6 +1144,10 @@ public void findMissingBlobsTest_ViaBackPlane() throws Exception { Iterables.concat(missingDigests, digestAvailableOnImposters); assertThat(actualMissingDigests).containsExactlyElementsIn(expectedMissingDigests); + verify(mockWorkerInstance, atMost(3)) + .findMissingBlobs(anyIterable(), any(RequestMetadata.class)); + verify(mockWorkerInstance, atLeast(1)) + .findMissingBlobs(anyIterable(), any(RequestMetadata.class)); for (Digest digest : actualMissingDigests) { assertThat(digest).isNotIn(availableDigests); From cfa2e18724914034eb19c4c01f293117610fa0b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:48:35 -0400 Subject: [PATCH 112/214] Bump org.json:json from 20230227 to 20231013 in /admin/main (#1516) Bumps [org.json:json](https://github.com/douglascrockford/JSON-java) from 20230227 to 20231013. - [Release notes](https://github.com/douglascrockford/JSON-java/releases) - [Changelog](https://github.com/stleary/JSON-java/blob/master/docs/RELEASES.md) - [Commits](https://github.com/douglascrockford/JSON-java/commits) --- updated-dependencies: - dependency-name: org.json:json dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- admin/main/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/main/pom.xml b/admin/main/pom.xml index 006217ccb4..8e128ee64c 100644 --- a/admin/main/pom.xml +++ b/admin/main/pom.xml @@ -94,7 +94,7 @@ org.json json - 20230227 + 20231013 org.projectlombok From ff00c8f3977aadf3df3febaceb07e575821ea9e2 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Wed, 1 Nov 2023 16:14:45 -0400 Subject: [PATCH 113/214] Re-add missing graceful shutdown functionality (#1520) --- .../buildfarm/server/BuildFarmServer.java | 8 ++-- .../build/buildfarm/worker/shard/Worker.java | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index 8672c0df76..c448963209 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -88,20 +88,20 @@ public class BuildFarmServer extends LoggingMain { */ public void prepareServerForGracefulShutdown() { if (configs.getServer().getGracefulShutdownSeconds() == 0) { - System.err.println( + log.info( String.format("Graceful Shutdown is not enabled. Server is shutting down immediately.")); } else { try { - System.err.println( + log.info( String.format( "Graceful Shutdown - Waiting %d to allow connections to drain.", configs.getServer().getGracefulShutdownSeconds())); SECONDS.sleep(configs.getServer().getGracefulShutdownSeconds()); } catch (InterruptedException e) { - System.err.println( + log.info( "Graceful Shutdown - The server graceful shutdown is interrupted: " + e.getMessage()); } finally { - System.err.println( + log.info( String.format( "Graceful Shutdown - It took the server %d seconds to shutdown", configs.getServer().getGracefulShutdownSeconds())); diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index fd556fc8e8..ce69eb3d13 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -137,6 +137,52 @@ public final class Worker extends LoggingMain { private LoadingCache workerStubs; private AtomicBoolean released = new AtomicBoolean(true); + /** + * The method will prepare the worker for graceful shutdown when the worker is ready. Note on + * using stderr here instead of log. By the time this is called in PreDestroy, the log is no + * longer available and is not logging messages. + */ + public void prepareWorkerForGracefulShutdown() { + if (configs.getWorker().getGracefulShutdownSeconds() == 0) { + log.info( + String.format( + "Graceful Shutdown is not enabled. Worker is shutting down without finishing executions in progress.")); + } else { + inGracefulShutdown = true; + log.info( + "Graceful Shutdown - The current worker will not be registered again and should be shutdown gracefully!"); + pipeline.stopMatchingOperations(); + int scanRate = 30; // check every 30 seconds + int timeWaited = 0; + int timeOut = configs.getWorker().getGracefulShutdownSeconds(); + try { + if (pipeline.isEmpty()) { + log.info("Graceful Shutdown - no work in the pipeline."); + } else { + log.info(String.format("Graceful Shutdown - waiting for executions to finish.")); + } + while (!pipeline.isEmpty() && timeWaited < timeOut) { + SECONDS.sleep(scanRate); + timeWaited += scanRate; + log.info( + String.format( + "Graceful Shutdown - Pipeline is still not empty after %d seconds.", timeWaited)); + } + } catch (InterruptedException e) { + log.info( + "Graceful Shutdown - The worker gracefully shutdown is interrupted: " + e.getMessage()); + } finally { + log.info( + String.format( + "Graceful Shutdown - It took the worker %d seconds to %s", + timeWaited, + pipeline.isEmpty() + ? "finish all actions" + : "gracefully shutdown but still cannot finish all actions")); + } + } + } + private Worker() { super("BuildFarmShardWorker"); } @@ -626,6 +672,7 @@ public synchronized void stop() throws InterruptedException { private void shutdown() throws InterruptedException { log.info("*** shutting down gRPC server since JVM is shutting down"); + prepareWorkerForGracefulShutdown(); PrometheusPublisher.stopHttpServer(); boolean interrupted = Thread.interrupted(); if (pipeline != null) { From afb06039ae368fa610c6d200b050f14ab0cffd02 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 14 Jul 2023 08:40:34 -0400 Subject: [PATCH 114/214] Technically correct to unwrap EE on lock failure --- src/main/java/build/buildfarm/cas/cfc/CASFileCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 21c90e5fee..56e53c3b2c 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -1917,7 +1917,7 @@ private Entry safeStorageInsertion(String key, Entry entry) { lock = keyLocks.get(key); } catch (ExecutionException e) { // impossible without exception instantiating lock - throw new RuntimeException(e); + throw new RuntimeException(e.getCause()); } lock.lock(); From 9b5ec4340134b4a2825a712744b2d8855f7f80b0 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 17 Oct 2023 00:40:19 -0400 Subject: [PATCH 115/214] Bump rules_oss_audit and patch for py3.11 --- deps.bzl | 8 +++++--- third_party/rules_oss_audit_pyyaml.patch | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 third_party/rules_oss_audit_pyyaml.patch diff --git a/deps.bzl b/deps.bzl index e2d2609acf..55b12ab136 100644 --- a/deps.bzl +++ b/deps.bzl @@ -151,9 +151,11 @@ def archive_dependencies(third_party): }, { "name": "rules_oss_audit", - "sha256": "02962810bcf82d0c66f929ccc163423f53773b8b154574ca956345523243e70d", - "strip_prefix": "rules_oss_audit-1b2690cefd5a960c181e0d89bf3c076294a0e6f4", - "url": "https://github.com/vmware/rules_oss_audit/archive/1b2690cefd5a960c181e0d89bf3c076294a0e6f4.zip", + "sha256": "8ee8376b05b5ddd2287b070e9a88ec85ef907d47f44e321ce5d4bc2b192eed4e", + "strip_prefix": "rules_oss_audit-167dab5b16abdb5996438f22364de544ff24693f", + "url": "https://github.com/vmware/rules_oss_audit/archive/167dab5b16abdb5996438f22364de544ff24693f.zip", + "patch_args": ["-p1"], + "patches": ["%s:rules_oss_audit_pyyaml.patch" % third_party], }, ] diff --git a/third_party/rules_oss_audit_pyyaml.patch b/third_party/rules_oss_audit_pyyaml.patch new file mode 100644 index 0000000000..d2297f018c --- /dev/null +++ b/third_party/rules_oss_audit_pyyaml.patch @@ -0,0 +1,7 @@ +diff --git a/oss_audit/tools/requirements.txt b/oss_audit/tools/requirements.txt +index 932bd69..be2b74d 100644 +--- a/oss_audit/tools/requirements.txt ++++ b/oss_audit/tools/requirements.txt +@@ -1 +1 @@ +-PyYAML==5.4.1 ++PyYAML==6.0.1 From f9ef75aa437e39ab5d93c309d21f7229294eb748 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 17 Oct 2023 01:11:25 -0400 Subject: [PATCH 116/214] Prevent healthStatusManager NPE on start failure --- src/main/java/build/buildfarm/server/BuildFarmServer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index c448963209..d963454de0 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -195,8 +195,10 @@ synchronized void stop() throws InterruptedException { private void shutdown() throws InterruptedException { log.info("*** shutting down gRPC server since JVM is shutting down"); prepareServerForGracefulShutdown(); - healthStatusManager.setStatus( - HealthStatusManager.SERVICE_NAME_ALL_SERVICES, ServingStatus.NOT_SERVING); + if (healthStatusManager != null) { + healthStatusManager.setStatus( + HealthStatusManager.SERVICE_NAME_ALL_SERVICES, ServingStatus.NOT_SERVING); + } PrometheusPublisher.stopHttpServer(); healthCheckMetric.labels("stop").inc(); try { From 20512f6980a2bbefbbd87c39209e345e2781934b Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 1 Nov 2023 16:48:04 -0400 Subject: [PATCH 117/214] Consistent check for publicName presence --- .../java/build/buildfarm/common/config/BuildfarmConfigs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index d6ebbe9e14..945695228f 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -72,7 +72,7 @@ public static BuildfarmConfigs loadServerConfigs(String[] args) throws Configura log.severe("Could not parse yml configuration file." + e); throw new RuntimeException(e); } - if (!options.publicName.isEmpty()) { + if (!Strings.isNullOrEmpty(options.publicName)) { buildfarmConfigs.getServer().setPublicName(options.publicName); } if (options.port > 0) { From 654032e17eb50f75c84d451b2a80c2f94f2c903b Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 1 Nov 2023 16:49:19 -0400 Subject: [PATCH 118/214] Read through external with query THROUGH=true Specifying a correlated invocation id with a uri containing a THROUGH=true query param will cause the CFC to read a blob through an external input stream, populating locally along the way. This permits client-based replication of blobs, and can enable N+1 replication and traffic balancing for reads. --- src/main/java/build/buildfarm/cas/BUILD | 1 + .../build/buildfarm/cas/cfc/CASFileCache.java | 38 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/cas/BUILD b/src/main/java/build/buildfarm/cas/BUILD index 146206caee..43e2daccde 100644 --- a/src/main/java/build/buildfarm/cas/BUILD +++ b/src/main/java/build/buildfarm/cas/BUILD @@ -27,6 +27,7 @@ java_library( "@maven//:io_grpc_grpc_core", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", + "@maven//:io_netty_netty_codec_http", "@maven//:io_prometheus_simpleclient", "@maven//:net_jcip_jcip_annotations", "@maven//:org_projectlombok_lombok", diff --git a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java index 56e53c3b2c..d6b47490df 100644 --- a/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java +++ b/src/main/java/build/buildfarm/cas/cfc/CASFileCache.java @@ -92,6 +92,7 @@ import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import io.grpc.stub.ServerCallStreamObserver; +import io.netty.handler.codec.http.QueryStringDecoder; import io.prometheus.client.Counter; import io.prometheus.client.Gauge; import io.prometheus.client.Histogram; @@ -99,6 +100,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.channels.ClosedByInterruptException; import java.nio.channels.ClosedChannelException; import java.nio.file.FileAlreadyExistsException; @@ -606,6 +609,20 @@ public Blob get(Digest digest) { private static final int CHUNK_SIZE = 128 * 1024; + private static boolean shouldReadThrough(RequestMetadata requestMetadata) { + try { + URI uri = new URI(requestMetadata.getCorrelatedInvocationsId()); + QueryStringDecoder decoder = new QueryStringDecoder(uri); + return decoder + .parameters() + .getOrDefault("THROUGH", ImmutableList.of("false")) + .get(0) + .equals("true"); + } catch (URISyntaxException e) { + return false; + } + } + @Override public void get( Compressor.Value compressor, @@ -614,9 +631,28 @@ public void get( long count, ServerCallStreamObserver blobObserver, RequestMetadata requestMetadata) { + boolean readThrough = shouldReadThrough(requestMetadata); InputStream in; try { - in = newInput(compressor, digest, offset); + if (readThrough && !contains(digest, /* result=*/ null)) { + // really need to be able to reuse/restart the same write over + // multiple requests - if we get successive read throughs for a single + // digest, we should pick up from where we were last time + // Also servers should affinitize + // And share data, so that they can pick the same worker to pull from + // if possible. + Write write = getWrite(compressor, digest, UUID.randomUUID(), requestMetadata); + blobObserver.setOnCancelHandler(write::reset); + in = + new ReadThroughInputStream( + newExternalInput(compressor, digest, 0), + localOffset -> newTransparentInput(compressor, digest, localOffset), + digest.getSizeBytes(), + offset, + write); + } else { + in = newInput(compressor, digest, offset); + } } catch (IOException e) { blobObserver.onError(e); return; From b4359c5af432bf7302080767815e4ce77a1af8c3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 1 Nov 2023 16:52:41 -0400 Subject: [PATCH 119/214] Add --port option to worker Option to run the worker with a cmdline specification for its gRPC server port. --- .../java/build/buildfarm/common/config/BuildfarmConfigs.java | 3 +++ .../java/build/buildfarm/common/config/BuildfarmOptions.java | 3 +++ src/main/java/build/buildfarm/common/config/ServerOptions.java | 3 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 945695228f..13b41732d8 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -100,6 +100,9 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura if (!Strings.isNullOrEmpty(options.publicName)) { buildfarmConfigs.getWorker().setPublicName(options.publicName); } + if (options.port >= 0) { + buildfarmConfigs.getWorker().setPort(options.port); + } if (options.prometheusPort >= 0) { buildfarmConfigs.setPrometheusPort(options.prometheusPort); } diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java index 1dbe0c7f98..45d6f4aea3 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java @@ -33,4 +33,7 @@ public class BuildfarmOptions extends OptionsBase { help = "URI for Redis connection. Use 'redis://' or 'rediss://' for the scheme", defaultValue = "") public String redisUri; + + @Option(name = "port", help = "Port for the buildfarm service.", defaultValue = "-1") + public int port; } diff --git a/src/main/java/build/buildfarm/common/config/ServerOptions.java b/src/main/java/build/buildfarm/common/config/ServerOptions.java index 35f47d6d13..b151c24c7b 100644 --- a/src/main/java/build/buildfarm/common/config/ServerOptions.java +++ b/src/main/java/build/buildfarm/common/config/ServerOptions.java @@ -18,9 +18,6 @@ /** Command-line options definition for example server. */ public class ServerOptions extends BuildfarmOptions { - @Option(name = "port", abbrev = 'p', help = "Port to use.", defaultValue = "-1") - public int port; - @Option(name = "public_name", abbrev = 'n', help = "Name of this server.", defaultValue = "") public String publicName; } From 51958098e039fcdac2b4230ddb63915fa749f5e7 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 1 Nov 2023 16:53:31 -0400 Subject: [PATCH 120/214] Restore worker --root cmdline specification Root cmdline specification has been broken since the config change of v2. --- .../java/build/buildfarm/common/config/BuildfarmConfigs.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java index 13b41732d8..05d7915b27 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmConfigs.java @@ -109,6 +109,9 @@ public static BuildfarmConfigs loadWorkerConfigs(String[] args) throws Configura if (!Strings.isNullOrEmpty(options.redisUri)) { buildfarmConfigs.getBackplane().setRedisUri(options.redisUri); } + if (!Strings.isNullOrEmpty(options.root)) { + buildfarmConfigs.getWorker().setRoot(options.root); + } adjustWorkerConfigs(buildfarmConfigs); return buildfarmConfigs; } From 938c789dcdd8603eb6bb1d0525a8d891dbb077c0 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 1 Nov 2023 16:54:59 -0400 Subject: [PATCH 121/214] Make bf-executor small blob names consistent Remove the size identification for small blobs when uploading with bf-executor. --- src/main/java/build/buildfarm/tools/Executor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/tools/Executor.java b/src/main/java/build/buildfarm/tools/Executor.java index 4f2f9f3d6f..901ff33a95 100644 --- a/src/main/java/build/buildfarm/tools/Executor.java +++ b/src/main/java/build/buildfarm/tools/Executor.java @@ -238,7 +238,7 @@ private static void loadFilesIntoCAS(String instanceName, Channel channel, Path ByteStreamStub bsStub = ByteStreamGrpc.newStub(channel); for (Digest missingDigest : missingDigests) { - Path path = blobsDir.resolve(missingDigest.getHash() + "_" + missingDigest.getSizeBytes()); + Path path = blobsDir.resolve(missingDigest.getHash()); if (missingDigest.getSizeBytes() < Size.mbToBytes(1)) { Request request = Request.newBuilder() From 87face12f1544cbd28d9f6e0dc049f7402ed9363 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 2 Nov 2023 12:22:18 -0400 Subject: [PATCH 122/214] Configured output size operation failure Permit installations to control the failure process for operations which produce outputs larger than the maxEntrySizeBytes. A default value of false retains the existing behavior which appears transient and blacklists the executed action key. When enabled, the action will fail under an invalid violation that indicates user error. --- _site/docs/configuration/configuration.md | 1 + examples/config.yml | 1 + .../build/buildfarm/common/config/Worker.java | 2 ++ .../worker/shard/ShardWorkerContext.java | 20 ++++++++++++++----- .../build/buildfarm/worker/shard/Worker.java | 1 + .../worker/shard/ShardWorkerContextTest.java | 1 + 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 466375373f..373968f068 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -260,6 +260,7 @@ backplane: | onlyMulticoreTests | boolean, _false_ | | Only permit tests to exceed the default coresvalue for their min/max-cores range specification (only works with non-zero defaultMaxCores) | | allowBringYourOwnContainer | boolean, _false_ | | Enable execution in a custom Docker container | | errorOperationRemainingResources | boolean, _false_ | | | +| errorOperationOutputSizeExceeded | boolean, _false_ | | Operations which produce single output files which exceed maxEntrySizeBytes will fail with a violation type which implies a user error. When disabled, the violation will indicate a transient error, with the action blacklisted. | | realInputDirectories | List of Strings, _external_ | | A list of paths that will not be subject to the effects of linkInputDirectories setting, may also be used to provide writable directories as input roots for actions which expect to be able to write to an input location and will fail if they cannot | | gracefulShutdownSeconds | Integer, 0 | | Time in seconds to allow for operations in flight to finish when shutdown signal is received | | createSymlinkOutputs | boolean, _false_ | | Creates SymlinkNodes for symbolic links discovered in output paths for actions. No verification of the symlink target path occurs. Buildstream, for example, requires this. | diff --git a/examples/config.yml b/examples/config.yml index 008bf2e1ca..69536c5af8 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -126,6 +126,7 @@ worker: onlyMulticoreTests: false allowBringYourOwnContainer: false errorOperationRemainingResources: false + errorOperationOutputSizeExceeded: false gracefulShutdownSeconds: 0 sandboxSettings: alwaysUse: false diff --git a/src/main/java/build/buildfarm/common/config/Worker.java b/src/main/java/build/buildfarm/common/config/Worker.java index c446134fe2..1a95d94956 100644 --- a/src/main/java/build/buildfarm/common/config/Worker.java +++ b/src/main/java/build/buildfarm/common/config/Worker.java @@ -46,6 +46,8 @@ public class Worker { // If you want GPU actions to run exclusively, define a single GPU resource. private List resources = new ArrayList<>(); + private boolean errorOperationOutputSizeExceeded = false; + public ExecutionPolicy[] getExecutionPolicies() { if (executionPolicies != null) { return executionPolicies; diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 98474b439c..edf7162a36 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -133,6 +133,7 @@ class ShardWorkerContext implements WorkerContext { private final CasWriter writer; private final boolean errorOperationRemainingResources; private final LocalResourceSet resourceSet; + private final boolean errorOperationOutputSizeExceeded; static SetMultimap getMatchProvisions( Iterable policies, int executeStageWidth) { @@ -166,6 +167,7 @@ static SetMultimap getMatchProvisions( boolean onlyMulticoreTests, boolean allowBringYourOwnContainer, boolean errorOperationRemainingResources, + boolean errorOperationOutputSizeExceeded, LocalResourceSet resourceSet, CasWriter writer) { this.name = name; @@ -187,6 +189,7 @@ static SetMultimap getMatchProvisions( this.onlyMulticoreTests = onlyMulticoreTests; this.allowBringYourOwnContainer = allowBringYourOwnContainer; this.errorOperationRemainingResources = errorOperationRemainingResources; + this.errorOperationOutputSizeExceeded = errorOperationOutputSizeExceeded; this.resourceSet = resourceSet; this.writer = writer; } @@ -504,6 +507,7 @@ private void uploadOutputFile( ActionResult.Builder resultBuilder, Path outputPath, Path actionRoot, + String entrySizeViolationType, PreconditionFailure.Builder preconditionFailure) throws IOException, InterruptedException { String outputFile = actionRoot.relativize(outputPath).toString(); @@ -534,7 +538,7 @@ private void uploadOutputFile( outputPath, size, maxEntrySize); preconditionFailure .addViolationsBuilder() - .setType(VIOLATION_TYPE_MISSING) + .setType(entrySizeViolationType) .setSubject(outputFile + ": " + size) .setDescription(message); return; @@ -562,7 +566,7 @@ private void uploadOutputFile( } catch (EntryLimitException e) { preconditionFailure .addViolationsBuilder() - .setType(VIOLATION_TYPE_MISSING) + .setType(entrySizeViolationType) .setSubject("blobs/" + DigestUtil.toString(digest)) .setDescription( "An output could not be uploaded because it exceeded the maximum size of an entry"); @@ -603,6 +607,7 @@ private void uploadOutputDirectory( ActionResult.Builder resultBuilder, Path outputDirPath, Path actionRoot, + String entrySizeViolationType, PreconditionFailure.Builder preconditionFailure) throws IOException, InterruptedException { String outputDir = actionRoot.relativize(outputDirPath).toString(); @@ -683,7 +688,7 @@ private void visitRegularFile(Path file, BasicFileAttributes attrs) throws IOExc } catch (EntryLimitException e) { preconditionFailure .addViolationsBuilder() - .setType(VIOLATION_TYPE_MISSING) + .setType(entrySizeViolationType) .setSubject("blobs/" + DigestUtil.toString(digest)) .setDescription( "An output could not be uploaded because it exceeded the maximum size of an entry"); @@ -730,14 +735,19 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) { public void uploadOutputs( Digest actionDigest, ActionResult.Builder resultBuilder, Path actionRoot, Command command) throws IOException, InterruptedException, StatusException { + String entrySizeViolationType = + errorOperationOutputSizeExceeded ? VIOLATION_TYPE_INVALID : VIOLATION_TYPE_MISSING; + PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); List outputPaths = CommandUtils.getResolvedOutputPaths(command, actionRoot); for (Path outputPath : outputPaths) { if (Files.isDirectory(outputPath)) { - uploadOutputDirectory(resultBuilder, outputPath, actionRoot, preconditionFailure); + uploadOutputDirectory( + resultBuilder, outputPath, actionRoot, entrySizeViolationType, preconditionFailure); } else { - uploadOutputFile(resultBuilder, outputPath, actionRoot, preconditionFailure); + uploadOutputFile( + resultBuilder, outputPath, actionRoot, entrySizeViolationType, preconditionFailure); } } checkPreconditionFailure(actionDigest, preconditionFailure.build()); diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index ce69eb3d13..be0c24a1db 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -611,6 +611,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep configs.getWorker().isOnlyMulticoreTests(), configs.getWorker().isAllowBringYourOwnContainer(), configs.getWorker().isErrorOperationRemainingResources(), + configs.getWorker().isErrorOperationOutputSizeExceeded(), LocalResourceSetUtils.create(configs.getWorker().getResources()), writer); diff --git a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java index c24e681abb..efddbdb866 100644 --- a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java +++ b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java @@ -106,6 +106,7 @@ WorkerContext createTestContext(Iterable policies) { /* onlyMulticoreTests=*/ false, /* allowBringYourOwnContainer=*/ false, /* errorOperationRemainingResources=*/ false, + /* errorOperationOutputSizeExceeded=*/ false, /* resourceSet=*/ new LocalResourceSet(), writer); } From 58faec9eac95a2e610831051aff507bfb3f81110 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 2 Nov 2023 12:03:07 -0400 Subject: [PATCH 123/214] Restore abbrev port as -p --- .../build/buildfarm/common/config/BuildfarmOptions.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java index 45d6f4aea3..9fc3f1ed17 100644 --- a/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java +++ b/src/main/java/build/buildfarm/common/config/BuildfarmOptions.java @@ -34,6 +34,10 @@ public class BuildfarmOptions extends OptionsBase { defaultValue = "") public String redisUri; - @Option(name = "port", help = "Port for the buildfarm service.", defaultValue = "-1") + @Option( + name = "port", + abbrev = 'p', + help = "Port for the buildfarm service.", + defaultValue = "-1") public int port; } From cf6fc58d851f529da103129e2a4b36eb6af748d0 Mon Sep 17 00:00:00 2001 From: Jerry Marino Date: Tue, 31 Oct 2023 13:04:16 -0700 Subject: [PATCH 124/214] Update zstd-jni for latest version There's been a few releases of it by now and this pulls the latest. For buildfarm, notable changes included performance enhancments during decompression. See: https://github.com/facebook/zstd/releases/tag/v1.5.5 --- defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index 4b0a5e49bf..147177835c 100644 --- a/defs.bzl +++ b/defs.bzl @@ -68,7 +68,7 @@ def buildfarm_init(name = "buildfarm"): "com.github.jnr:jnr-posix:3.0.53", "com.github.pcj:google-options:1.0.0", "com.github.serceman:jnr-fuse:0.5.5", - "com.github.luben:zstd-jni:1.5.2-1", + "com.github.luben:zstd-jni:1.5.5-7", "com.github.oshi:oshi-core:6.4.0", "com.google.auth:google-auth-library-credentials:0.9.1", "com.google.auth:google-auth-library-oauth2-http:0.9.1", From 6bc70e1b3961c74b93886408b57f77bf1689e0f8 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 3 Nov 2023 11:28:43 -0400 Subject: [PATCH 125/214] Attempt to resolve windows stamping --- .bazelci/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 98b121e215..728e68d02d 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -70,6 +70,7 @@ tasks: build_targets: - "..." test_flags: + - "--@rules_jvm_external//settings:stamp_manifest=False" - "--test_tag_filters=-integration,-redis" test_targets: - "..." From b2267253bbf16ab30fe5b9d1b2dfaa8c87c295ae Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Wed, 1 Nov 2023 19:53:01 -0700 Subject: [PATCH 126/214] Bug: Fix workerSet update logic for RemoteCasWriter --- .../worker/shard/RemoteCasWriter.java | 32 +++++++++---------- .../build/buildfarm/worker/shard/Worker.java | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java index 8a5bfdb52f..b03c2794e7 100644 --- a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java +++ b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java @@ -21,6 +21,7 @@ import build.bazel.remote.execution.v2.Compressor; import build.bazel.remote.execution.v2.Digest; import build.bazel.remote.execution.v2.RequestMetadata; +import build.buildfarm.backplane.Backplane; import build.buildfarm.common.Size; import build.buildfarm.common.Write; import build.buildfarm.common.grpc.Retrier; @@ -48,13 +49,13 @@ @Log public class RemoteCasWriter implements CasWriter { - private final Set workerSet; + private final Backplane backplane; private final LoadingCache workerStubs; private final Retrier retrier; public RemoteCasWriter( - Set workerSet, LoadingCache workerStubs, Retrier retrier) { - this.workerSet = workerSet; + Backplane backplane, LoadingCache workerStubs, Retrier retrier) { + this.backplane = backplane; this.workerStubs = workerStubs; this.retrier = retrier; } @@ -114,20 +115,19 @@ public void insertBlob(Digest digest, ByteString content) } private String getRandomWorker() throws IOException { - synchronized (workerSet) { - if (workerSet.isEmpty()) { - throw new IOException("no available workers"); - } - Random rand = new Random(); - int index = rand.nextInt(workerSet.size()); - // best case no allocation average n / 2 selection - Iterator iter = workerSet.iterator(); - String worker = null; - while (iter.hasNext() && index-- >= 0) { - worker = iter.next(); - } - return worker; + Set workerSet = backplane.getStorageWorkers(); + if (workerSet.isEmpty()) { + throw new IOException("no available workers"); } + Random rand = new Random(); + int index = rand.nextInt(workerSet.size()); + // best case no allocation average n / 2 selection + Iterator iter = workerSet.iterator(); + String worker = null; + while (iter.hasNext() && index-- >= 0) { + worker = iter.next(); + } + return worker; } private Instance workerStub(String worker) { diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index be0c24a1db..ce7a3e7385 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -584,7 +584,7 @@ public void start() throws ConfigurationException, InterruptedException, IOExcep CasWriter writer; if (!configs.getWorker().getCapabilities().isCas()) { Retrier retrier = new Retrier(Backoff.sequential(5), Retrier.DEFAULT_IS_RETRIABLE); - writer = new RemoteCasWriter(backplane.getStorageWorkers(), workerStubs, retrier); + writer = new RemoteCasWriter(backplane, workerStubs, retrier); } else { writer = new LocalCasWriter(execFileSystem); } From 751ac90e9d18c8a25c3e8d8c26c3f4b4457310bc Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 3 Nov 2023 20:15:43 -0400 Subject: [PATCH 127/214] Detail storage requirements Update for further docs related to storage+type functionality Remove outdated Operation Queue worker definitions --- _site/docs/architecture/workers.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/_site/docs/architecture/workers.md b/_site/docs/architecture/workers.md index 28765b6a7f..ee3e67f8ad 100644 --- a/_site/docs/architecture/workers.md +++ b/_site/docs/architecture/workers.md @@ -7,20 +7,21 @@ nav_order: 2 # Workers -Workers of all types throughout buildfarm are responsible for presenting execution roots to operations that they are matched with, fetching content from a CAS, executing those processes, and reporting the outputs and results of executions. Additionally, buildfarm supports some common behaviors across worker types: +Workers have two major roles in Buildfarm: Execution and CAS Shard. Either of these options can be disabled, though a worker with both disabled provides no value. -* ExecutionPolicies, which allow for explicit and implicit behaviors to control execution. -* A CAS FileCache, which is capable of reading through content for Digests of files or directories, and efficiently presenting those contents based on usage and reference counting, as well as support for cascading into delegate CASs. -* Concurrent pipelined execution of operations, with support for superscalar stages at input fetch and execution. -* Operation exclusivity, preventing the same operation from running through the worker pipeline concurrently. +Regardless of role, a worker must have a local FILESYSTEM type [storage](https://bazelbuild.github.io/bazel-buildfarm/docs/configuration/configuration/#worker-cas) to retain content. This storage serves both as a resident LRU cache for Execution I/O, and the local storage for a CAS Shard. Workers can delegate to successive storage declarations (FILESYSTEM or GRPC), with read-through or expiration waterfall if configured, but only the first storage entry will be used for Executions. -# Worker Types +## Execution -## Operation Queue +Execution Workers are responsible for matching their environments against operations, presenting execution roots to those operations, fetching content from a CAS, executing processes required to complete the operations, and reporting the outputs and results of executions. Control and delivery of these behaviors is accomplished with several mechanisms: -Operation Queue workers are responsible for taking operations from the Memory OperationQueue service and reporting their contents via external CAS and AC services. Executions are the only driving force for their CAS FileCache. For more details on configuring the operation queue, [see here](https://github.com/bazelbuild/bazel-buildfarm/wiki/Operation-Queue). +* A CAS FileCache, which is capable of reading through content for Digests of files or directories, and efficiently presenting those contents based on usage and reference counting, as well as support for cascading into delegate CASs. +* ExecutionPolicies, which allow for explicit and implicit behaviors to control execution. +* Execution Resources to limit concurrent execution in installation-defined resource traunches. +* Concurrent pipelined execution of operations, with support for superscalar stages at input fetch and execution. +* Operation exclusivity, preventing the same operation from running through the worker pipeline concurrently. -## Shard +## CAS Shard Sharded workers interact with the shard backplane for both execution and CAS presentation. Their CAS FileCache serves a CAS gRPC interface as well as the execution root factory. @@ -56,18 +57,20 @@ The Report Result stage injects any outputs from the operation into the CAS, and # Exec Filesystem -Workers must present Exec Filesystems for actions, and manage their existence for the lifetime of an operation's presence within the pipeline. The realization of an operation's execution root with the execution filesystem constitutes a transaction that the operating directory for an action will appear, be writable for outputs, and released and be made unavailable as it proceeds and exits the pipeline. +Workers use ExecFileSystems to present content to actions, and manage their existence for the lifetime of an operation's presence within the pipeline. The realization of an operation's execution root with the execution filesystem constitutes a transaction that the operating directory for an action will appear, be writable for outputs, and released and be made unavailable as it proceeds and exits the pipeline. This means that an action's entire input directory must be available on a filesystem from a unique location per operation - the _Operation Action Input Root_, or just _Root_. Each input file within the Root must contain the content of the inputs, its requested executability via FileNode, and each directory must contain at the outset, child input files and directories. The filesystem is free to handle unspecified outputs as it sees fit, but the directory hierarchy of output files from the Root must be created before execution, and writable during it. When execution and observation of the outputs is completed, the exec filesystem will be asked to destroy the Root and release any associated resources from its retention. -There are two implementations of Execution Filesystem in Buildfarm. Choosing either a `filesystem` or `fuse` `cas` type in the worker config as the first `cas` entry will choose the _CASFileCache_ or _FuseCAS_ implementations, respectively. +Choosing a `filesystem` `storage` type in the worker config as the first `storage` entry will select the _CASFileCache_ _CFCExecFileSystem_. Choosing any other `storage` type will create a _FuseCAS_ _FuseExecFilesystem_. + +***We strongly recommend the use of `filesystem` `storage` as the ExecFileSystem-selecting `storage` entry, the _FuseCAS_ is experimental and may not function reliably over long hauls/with substantial load*** ## CASFileCache/CFCExecFilesystem The CASFileCache provides an Exec Filesystem via CFCExecFilesystem. The (CASFileCache)'s retention of paths is used to reflect individual files, with these paths hard-linked in CFCExecFilesystem under representative directories of the input root to signify usage. The CASFileCache directory retention system is also used to provide a configurable utilization of entire directory trees as a symlink, which was a heuristic optimization applied when substantial cost was observed setting up static trees of input links for operations compared to their execution time. `link_input_directories` in the common Worker configuration will enable this heuristic. Outputs of actions are physically streamed into CAS writes when they are observed after an action execution. -The CASFileCache's persistence in the filesystem and the availability of common POSIX features like symlinks and inode-based reference counts on almost any filesystem implementation have made it a solid choice for extremely large CAS installations - it scales to multi-TB host attached storages with millions of entries with relative ease. +The CASFileCache's persistence in the filesystem and the availability of common POSIX features like symlinks and inode-based reference counts on almost any filesystem implementation have made it a solid choice for extremely large CAS installations - it scales to multi-TB host attached storages containing millions of entries with relative ease. There are plans to improve CASFileCache that will be reflected in improved performance and memory footprint for the features used by CFCExecFilesystem. @@ -75,4 +78,4 @@ There are plans to improve CASFileCache that will be reflected in improved perfo A fuse implementation to provide Roots exists and is specifiable as well. This was an experiment to discover the capacity of a fuse to represent Roots transparently with a ContentAddressableStorage backing, and has not been fully vetted to provide the same reliability as the CFCExecFilesystem. This system is capable of blinking entire trees into existence with ease, as well as supporting write-throughs for outputs suitable for general purpose execution. Some problems with this type were initially observed and never completely resolved, including guaranteed resource release on Root destruction. This implementation is also only built to be backed by its own Memory CAS, with no general purpose CAS support added due to the difficulty of supporting a transaction model for an input tree to enforce the contract of availability. It remains unoptimized yet functional, but difficulties with integrating libfuse 3 into the bazel build, as well as time constraints, have kept it from being scaled and expanded as the rest of Buildfarm has grown. -There are plans to revisit this implementation and bring it back into viability with a CASFileCache-like backing. \ No newline at end of file +There are plans to revisit this implementation and bring it back into viability with a CASFileCache-like backing. From 2bf3eae0b80c55567352ad4b675ea01db32687f7 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 3 Nov 2023 20:16:22 -0400 Subject: [PATCH 128/214] Fix worker execution env title --- _site/docs/architecture/worker-execution-environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_site/docs/architecture/worker-execution-environment.md b/_site/docs/architecture/worker-execution-environment.md index 89bee694fa..a49343fda3 100644 --- a/_site/docs/architecture/worker-execution-environment.md +++ b/_site/docs/architecture/worker-execution-environment.md @@ -1,6 +1,6 @@ --- layout: default -title: Workers +title: Worker Execution Environment parent: Architecture nav_order: 3 --- @@ -124,4 +124,4 @@ java_image( And now that this is in place, we can use the following to build the container and make it available to our local docker daemon: -`bazel run :buildfarm-shard-worker-ubuntu20-java14` \ No newline at end of file +`bazel run :buildfarm-shard-worker-ubuntu20-java14` From b6bddffdeabf108e93e4224829ae9f7c21ba4345 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Fri, 3 Nov 2023 21:32:47 -0400 Subject: [PATCH 129/214] Add storage example descriptions --- _site/docs/configuration/configuration.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 373968f068..83d56a5900 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -325,6 +325,8 @@ worker: ### Worker CAS +Unless specified, options are only relevant for FILESYSTEM type + | Configuration | Accepted and _Default_ Values | Description | |------------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------| | type | _FILESYSTEM_, GRPC | Type of CAS used | @@ -336,6 +338,8 @@ worker: Example: +This definition will create a filesystem-based CAS file cache at the path "/cache" on the worker that will reject entries over 2GiB in size, and will expire LRU blobs when the aggregate size of all blobs exceeds 2GiB in order to insert additional entries. + ```yaml worker: storages: @@ -343,14 +347,15 @@ worker: path: "cache" maxSizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 maxEntrySizeBytes: 2147483648 # 2 * 1024 * 1024 * 1024 - target: ``` +This definition elides FILESYSTEM configuration with '...', will read-through an external GRPC CAS supporting the REAPI CAS Services into its storage, and will attempt to write expiring entries into the GRPC CAS (i.e. pushing new entries into the head of a worker LRU list will drop the entries from the tail into the GRPC CAS). + ``` worker: storages: - type: FILESYSTEM - path: "cache" + ... - type: GRPC target: "cas.external.com:1234" ``` From c49092568934d67dd5d80952e428b52757582992 Mon Sep 17 00:00:00 2001 From: Justin Won Date: Mon, 6 Nov 2023 08:10:36 -0800 Subject: [PATCH 130/214] Check for context cancelled before responding to error (#1526) When a write fails because the write was already cancelled before due to something like deadline exceeded, we get an unknown error. The exception comes from here and when it gets to errorResponse(), it only checks if status code is cancelled. In this case the status code is unknown, so we need to check if context is cancelled to prevent responseObserver from being invoked The code change adds checking if context is cancelled and a unit test testing when the exception has context cancelled. --- .../common/services/WriteStreamObserver.java | 3 +- .../services/WriteStreamObserverTest.java | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index 36cc0595a6..dd52f7769e 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -271,7 +271,8 @@ private void logWriteRequest(WriteRequest request, Exception e) { private boolean errorResponse(Throwable t) { if (exception.compareAndSet(null, t)) { - if (Status.fromThrowable(t).getCode() == Status.Code.CANCELLED) { + if (Status.fromThrowable(t).getCode() == Status.Code.CANCELLED + || Context.current().isCancelled()) { return false; } boolean isEntryLimitException = t instanceof EntryLimitException; diff --git a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java index 4249223990..b6d144a66b 100644 --- a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java +++ b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java @@ -28,6 +28,7 @@ import io.grpc.Context; import io.grpc.Context.CancellableContext; import io.grpc.stub.StreamObserver; +import java.io.IOException; import java.util.UUID; import java.util.concurrent.TimeUnit; import org.junit.Test; @@ -90,4 +91,51 @@ public void cancelledBeforeGetOutputIsSilent() throws Exception { verify(out, times(1)).close(); verifyZeroInteractions(responseObserver); } + + @Test + public void noErrorWhenContextCancelled() throws Exception { + CancellableContext context = Context.current().withCancellation(); + Instance instance = mock(Instance.class); + StreamObserver responseObserver = mock(StreamObserver.class); + ByteString cancelled = ByteString.copyFromUtf8("cancelled data"); + Digest cancelledDigest = DIGEST_UTIL.compute(cancelled); + UUID uuid = UUID.randomUUID(); + UploadBlobRequest uploadBlobRequest = + UploadBlobRequest.newBuilder() + .setBlob(BlobInformation.newBuilder().setDigest(cancelledDigest)) + .setUuid(uuid.toString()) + .build(); + SettableFuture future = SettableFuture.create(); + Write write = mock(Write.class); + when(write.getFuture()).thenReturn(future); + when(write.isComplete()).thenReturn(Boolean.TRUE); + when(instance.getBlobWrite( + eq(Compressor.Value.IDENTITY), + eq(cancelledDigest), + eq(uuid), + any(RequestMetadata.class))) + .thenReturn(write); + + WriteStreamObserver observer = + context.call( + () -> new WriteStreamObserver(instance, 1, SECONDS, () -> {}, responseObserver)); + context.run( + () -> + observer.onNext( + WriteRequest.newBuilder() + .setResourceName(uploadResourceName(uploadBlobRequest)) + .setData(cancelled) + .build())); + context.cancel(new RuntimeException("Cancelled by test")); + future.setException(new IOException("test cancel")); + + verify(write, times(1)).isComplete(); + verify(instance, times(1)) + .getBlobWrite( + eq(Compressor.Value.IDENTITY), + eq(cancelledDigest), + eq(uuid), + any(RequestMetadata.class)); + verifyZeroInteractions(responseObserver); + } } From 2a51c3183c72147c4e1d73ad184941ef04a2ea6e Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Mon, 16 Oct 2023 11:41:41 -0700 Subject: [PATCH 131/214] chore(deps): bump com.google.errorprone:error-prone Release notes: https://github.com/google/error-prone/releases/tag/v2.22.0 --- defs.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defs.bzl b/defs.bzl index 147177835c..a40dccaefe 100644 --- a/defs.bzl +++ b/defs.bzl @@ -74,8 +74,8 @@ def buildfarm_init(name = "buildfarm"): "com.google.auth:google-auth-library-oauth2-http:0.9.1", "com.google.code.findbugs:jsr305:3.0.1", "com.google.code.gson:gson:2.9.0", - "com.google.errorprone:error_prone_annotations:2.9.0", - "com.google.errorprone:error_prone_core:0.92", + "com.google.errorprone:error_prone_annotations:2.22.0", + "com.google.errorprone:error_prone_core:2.22.0", "com.google.guava:failureaccess:1.0.1", "com.google.guava:guava:32.1.1-jre", "com.google.j2objc:j2objc-annotations:1.1", From 7ea1a9fb1ce46705ee774c98e92fe097f16898f9 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 8 Nov 2023 15:49:27 -0500 Subject: [PATCH 132/214] Worker name execution properties matching --- .../buildfarm/common/ExecutionProperties.java | 7 +++ .../worker/DequeueMatchEvaluator.java | 23 +++++++++- .../worker/shard/ShardWorkerContext.java | 3 +- .../worker/DequeueMatchEvaluatorTest.java | 44 +++++++++++++------ 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/src/main/java/build/buildfarm/common/ExecutionProperties.java b/src/main/java/build/buildfarm/common/ExecutionProperties.java index 8126bd607a..ee3975d6dd 100644 --- a/src/main/java/build/buildfarm/common/ExecutionProperties.java +++ b/src/main/java/build/buildfarm/common/ExecutionProperties.java @@ -293,4 +293,11 @@ public class ExecutionProperties { * operation queue). */ public static final String POOL = "Pool"; + + /** + * @field WORKER + * @brief The exec_property to ensure that the action only runs on the worker name given. + * @details Useful for diagnosing woker issues by targeting builds to a specific worker. + */ + public static final String WORKER = "Worker"; } diff --git a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java index 3536ed6bac..59ccd00e37 100644 --- a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java +++ b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java @@ -46,6 +46,7 @@ public class DequeueMatchEvaluator { * @brief Decide whether the worker should keep the operation or put it back on the queue. * @details Compares the platform properties of the worker to the operation's platform properties. * @param workerProvisions The provisions of the worker. + * @param name Worker name. * @param resourceSet The limited resources that the worker has available. * @param queueEntry An entry recently removed from the queue. * @return Whether or not the worker should accept or reject the queue entry. @@ -56,9 +57,10 @@ public class DequeueMatchEvaluator { @NotNull public static boolean shouldKeepOperation( SetMultimap workerProvisions, + String name, LocalResourceSet resourceSet, QueueEntry queueEntry) { - return shouldKeepViaPlatform(workerProvisions, resourceSet, queueEntry.getPlatform()); + return shouldKeepViaPlatform(workerProvisions, name, resourceSet, queueEntry.getPlatform()); } /** @@ -67,6 +69,7 @@ public static boolean shouldKeepOperation( * @details Compares the platform properties of the worker to the platform properties of the * operation. * @param workerProvisions The provisions of the worker. + * @param name Worker name. * @param resourceSet The limited resources that the worker has available. * @param platform The platforms of operation. * @return Whether or not the worker should accept or reject the operation. @@ -76,6 +79,7 @@ public static boolean shouldKeepOperation( @NotNull private static boolean shouldKeepViaPlatform( SetMultimap workerProvisions, + String name, LocalResourceSet resourceSet, Platform platform) { // attempt to execute everything the worker gets off the queue, @@ -84,6 +88,12 @@ private static boolean shouldKeepViaPlatform( if (!LocalResourceSetUtils.claimResources(platform, resourceSet)) { return false; } + + // The action might be requesting to run on a particular action + if (!keepForThisWorker(platform, name)) { + return false; + } + if (configs.getWorker().getDequeueMatchSettings().isAcceptEverything()) { return true; } @@ -91,6 +101,17 @@ private static boolean shouldKeepViaPlatform( return satisfiesProperties(workerProvisions, platform); } + private static boolean keepForThisWorker(Platform platform, String name) { + for (Platform.Property property : platform.getPropertiesList()) { + if (property.getName().equals(ExecutionProperties.WORKER) + && !property.getValue().equals(name)) { + // requested worker does not match this worker, reject + return false; + } + } + return true; + } + /** * @brief Decide whether the worker should keep the operation by comparing its platform properties * with the queue entry. diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index edf7162a36..5194444910 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -315,7 +315,8 @@ private QueueEntry takeEntryOffOperationQueue(MatchListener listener) private void decideWhetherToKeepOperation(QueueEntry queueEntry, MatchListener listener) throws IOException, InterruptedException { if (queueEntry == null - || DequeueMatchEvaluator.shouldKeepOperation(matchProvisions, resourceSet, queueEntry)) { + || DequeueMatchEvaluator.shouldKeepOperation( + matchProvisions, name, resourceSet, queueEntry)) { listener.onEntry(queueEntry); } else { backplane.rejectOperation(queueEntry); diff --git a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java index 47f25cdf79..290470b845 100644 --- a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java +++ b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java @@ -59,7 +59,8 @@ public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -87,7 +88,8 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker accepts because it has more cores than the min-cores requested @@ -117,7 +119,8 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker rejects because it has less cores than the min-cores requested @@ -146,7 +149,8 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker accepts because it has the same cores as the min-cores requested @@ -175,7 +179,8 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT assertThat(shouldKeep).isFalse(); @@ -184,7 +189,9 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -193,7 +200,9 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -224,7 +233,8 @@ public void shouldKeepOperationClaimsResource() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -232,7 +242,9 @@ public void shouldKeepOperationClaimsResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -269,7 +281,8 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -278,7 +291,9 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(2); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -287,7 +302,9 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(0); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -330,7 +347,8 @@ public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + DequeueMatchEvaluator.shouldKeepOperation( + workerProvisions, "worker-name", resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. From a4822c125ae45b775e95d5eacbfa137aa38145ae Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Fri, 21 Apr 2023 15:31:25 -0400 Subject: [PATCH 133/214] updates --- _site/docs/configuration/configuration.md | 12 +++++++----- examples/config.yml | 1 + .../buildfarm/common/config/SandboxSettings.java | 7 +++++++ .../buildfarm/worker/resources/ResourceDecider.java | 8 +++++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 83d56a5900..4be39b9127 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -291,11 +291,12 @@ worker: ### Sandbox Settings -| Configuration | Accepted and _Default_ Values | Description | -|---------------|-------------------------------|---------------------------------------------------| -| alwaysUse | boolean, _false_ | Enforce that the sandbox be used on every acion. | -| selectForBlockNetwork | boolean, _false_ | `block-network` enables sandbox action execution. | -| selectForTmpFs | boolean, _false_ | `tmpfs` enables sandbox action execution. | +| Configuration | Accepted and _Default_ Values | Description | +|---------------|-------------------------------|------------------------------------------------------| +| alwaysUse | boolean, _false_ | Enforce that the sandbox be used on every acion. | +| alwaysUseTmpFs | boolean, _false_ | Enforce that the sandbox uses tmpfs on every acion. | +| selectForBlockNetwork | boolean, _false_ | `block-network` enables sandbox action execution. | +| selectForTmpFs | boolean, _false_ | `tmpfs` enables sandbox action execution. | Example: @@ -303,6 +304,7 @@ Example: worker: sandboxSettings: alwaysUse: true + alwaysUseTmpFs: true selectForBlockNetwork: false selectForTmpFs: false ``` diff --git a/examples/config.yml b/examples/config.yml index 69536c5af8..b0626f467e 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -130,6 +130,7 @@ worker: gracefulShutdownSeconds: 0 sandboxSettings: alwaysUse: false + alwaysUseTmpFs: false selectForBlockNetwork: false selectForTmpFs: false createSymlinkOutputs: false diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index 030377bf0c..b7e238a07e 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -32,6 +32,13 @@ public class SandboxSettings { */ public boolean alwaysUse = false; + /** + * @field alwaysUseTmpFs + * @brief Whether or not to always use tmpfs when using the sandbox. + * @details It may be preferred to enforce sandbox usage than rely on client selection. + */ + public boolean alwaysUseTmpFs = false; + /** * @field selectForBlockNetwork * @brief If the action requires "block network" use the sandbox to fulfill this request. diff --git a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java index a5229a3377..bd352a00a3 100644 --- a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java +++ b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java @@ -203,10 +203,16 @@ private static void decideSandboxUsage(ResourceLimits limits, SandboxSettings sa // configured on if (sandbox.isAlwaysUse()) { limits.useLinuxSandbox = true; - limits.description.add("enabled"); + limits.description.add("enabled sandbox by default"); return; } + // configured on + if (sandbox.isAlwaysUseTmpFs()) { + limits.tmpFs = true; + limits.description.add("enabled tmpfs by default"); + } + // selected based on other features if (limits.network.blockNetwork && sandbox.isSelectForBlockNetwork()) { limits.useLinuxSandbox = true; From f1ea9b51280557b3b6b68c8a36fc53ecb35c9bc8 Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Fri, 21 Apr 2023 16:45:31 -0400 Subject: [PATCH 134/214] updates --- .../common/config/SandboxSettings.java | 7 ++++ .../worker/resources/ResourceDecider.java | 11 ++++-- .../worker/resources/ResourceLimits.java | 7 ++++ .../worker/shard/ShardWorkerContext.java | 39 ++++++++++--------- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index b7e238a07e..d9988c845b 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -32,6 +32,13 @@ public class SandboxSettings { */ public boolean alwaysUse = false; + /** + * @field alwaysUseCgroups + * @brief Whether or not to use cgroups when sandboxing actions. + * @details It may be preferred to enforce cgroup usage. + */ + public boolean alwaysUseCgroups = false; + /** * @field alwaysUseTmpFs * @brief Whether or not to always use tmpfs when using the sandbox. diff --git a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java index bd352a00a3..78021f1ed5 100644 --- a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java +++ b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java @@ -200,14 +200,17 @@ private static void adjustLimits( } private static void decideSandboxUsage(ResourceLimits limits, SandboxSettings sandbox) { - // configured on + + // Decide which sandbox limitations are enabled by default acording to the deployment's + // configuration. if (sandbox.isAlwaysUse()) { limits.useLinuxSandbox = true; limits.description.add("enabled sandbox by default"); - return; } - - // configured on + if (sandbox.isAlwaysUseCgroups()) { + limits.cgroups = true; + limits.description.add("enabled cgroups by default"); + } if (sandbox.isAlwaysUseTmpFs()) { limits.tmpFs = true; limits.description.add("enabled tmpfs by default"); diff --git a/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java b/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java index 4e5601625c..e3ddc4485b 100644 --- a/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java +++ b/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java @@ -75,6 +75,13 @@ public class ResourceLimits { */ public ContainerSettings containerSettings = new ContainerSettings(); + /** + * @field cgroups + * @brief Whether to use cgroups for resource limitation. + * @details Decides whether to use cgroups for restricting cores, mem, etc. + */ + public boolean cgroups = true; + /** * @field cpu * @brief Resource limitations on CPUs. diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 5194444910..590d492dee 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -922,28 +922,31 @@ IOResource limitSpecifiedExecution( // ResourceLimits object. We apply the cgroup settings to file resources // and collect group names to use on the CLI. String operationId = getOperationId(operationName); - final Group group = operationsGroup.getChild(operationId); ArrayList resources = new ArrayList<>(); - ArrayList usedGroups = new ArrayList<>(); - // Possibly set core restrictions. - if (limits.cpu.limit) { - applyCpuLimits(group, limits, resources); - usedGroups.add(group.getCpu().getName()); - } + if (limits.cgroups) { + final Group group = operationsGroup.getChild(operationId); + ArrayList usedGroups = new ArrayList<>(); - // Possibly set memory restrictions. - if (limits.mem.limit) { - applyMemLimits(group, limits, resources); - usedGroups.add(group.getMem().getName()); - } + // Possibly set core restrictions. + if (limits.cpu.limit) { + applyCpuLimits(group, limits, resources); + usedGroups.add(group.getCpu().getName()); + } - // Decide the CLI for running under cgroups - if (!usedGroups.isEmpty()) { - arguments.add( - configs.getExecutionWrappers().getCgroups(), - "-g", - String.join(",", usedGroups) + ":" + group.getHierarchy()); + // Possibly set memory restrictions. + if (limits.mem.limit) { + applyMemLimits(group, limits, resources); + usedGroups.add(group.getMem().getName()); + } + + // Decide the CLI for running under cgroups + if (!usedGroups.isEmpty()) { + arguments.add( + configs.getExecutionWrappers().getCgroups(), + "-g", + String.join(",", usedGroups) + ":" + group.getHierarchy()); + } } // Possibly set network restrictions. From ccf763da22b173967b9ee8bad1dcc4f3b8f80a1e Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Fri, 21 Apr 2023 16:49:24 -0400 Subject: [PATCH 135/214] updates --- .../java/build/buildfarm/common/config/SandboxSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index d9988c845b..fc56aa889f 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -37,7 +37,7 @@ public class SandboxSettings { * @brief Whether or not to use cgroups when sandboxing actions. * @details It may be preferred to enforce cgroup usage. */ - public boolean alwaysUseCgroups = false; + public boolean alwaysUseCgroups = true; /** * @field alwaysUseTmpFs From b7f56613d1aa5a963beb254028c1ea8e86acb17c Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Fri, 21 Apr 2023 16:56:00 -0400 Subject: [PATCH 136/214] updates --- _site/docs/configuration/configuration.md | 8 ++++++-- examples/config.yml | 3 ++- .../build/buildfarm/common/config/SandboxSettings.java | 4 ++-- .../build/buildfarm/worker/resources/ResourceDecider.java | 3 +-- .../buildfarm/worker/resources/ResourceDeciderTest.java | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 4be39b9127..83d4dcc8d0 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -293,7 +293,8 @@ worker: | Configuration | Accepted and _Default_ Values | Description | |---------------|-------------------------------|------------------------------------------------------| -| alwaysUse | boolean, _false_ | Enforce that the sandbox be used on every acion. | +| alwaysUseSandbox | boolean, _false_ | Enforce that the sandbox be used on every acion. | +| alwaysUseCgroups | boolean, _true_ | Enforce that actions run under cgroups. | | alwaysUseTmpFs | boolean, _false_ | Enforce that the sandbox uses tmpfs on every acion. | | selectForBlockNetwork | boolean, _false_ | `block-network` enables sandbox action execution. | | selectForTmpFs | boolean, _false_ | `tmpfs` enables sandbox action execution. | @@ -303,12 +304,15 @@ Example: ```yaml worker: sandboxSettings: - alwaysUse: true + alwaysUseSandbox: true + alwaysUseCgroups: true alwaysUseTmpFs: true selectForBlockNetwork: false selectForTmpFs: false ``` +Note: In order for these settings to take effect, you must also configure `limitGlobalExecution: true`. + ### Dequeue Match | Configuration | Accepted and _Default_ Values | Description | diff --git a/examples/config.yml b/examples/config.yml index b0626f467e..d69688b5b4 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -129,7 +129,8 @@ worker: errorOperationOutputSizeExceeded: false gracefulShutdownSeconds: 0 sandboxSettings: - alwaysUse: false + alwaysUseSandbox: false + alwaysUseCgroups: false alwaysUseTmpFs: false selectForBlockNetwork: false selectForTmpFs: false diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index fc56aa889f..f432989015 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -26,11 +26,11 @@ @Data public class SandboxSettings { /** - * @field alwaysUse + * @field alwaysUseSandbox * @brief Whether or not to always use the sandbox when running actions. * @details It may be preferred to enforce sandbox usage than rely on client selection. */ - public boolean alwaysUse = false; + public boolean alwaysUseSandbox = false; /** * @field alwaysUseCgroups diff --git a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java index 78021f1ed5..5523f1aa79 100644 --- a/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java +++ b/src/main/java/build/buildfarm/worker/resources/ResourceDecider.java @@ -200,10 +200,9 @@ private static void adjustLimits( } private static void decideSandboxUsage(ResourceLimits limits, SandboxSettings sandbox) { - // Decide which sandbox limitations are enabled by default acording to the deployment's // configuration. - if (sandbox.isAlwaysUse()) { + if (sandbox.isAlwaysUseSandbox()) { limits.useLinuxSandbox = true; limits.description.add("enabled sandbox by default"); } diff --git a/src/test/java/build/buildfarm/worker/resources/ResourceDeciderTest.java b/src/test/java/build/buildfarm/worker/resources/ResourceDeciderTest.java index 8fa711ab5a..9c531c7e78 100644 --- a/src/test/java/build/buildfarm/worker/resources/ResourceDeciderTest.java +++ b/src/test/java/build/buildfarm/worker/resources/ResourceDeciderTest.java @@ -726,7 +726,7 @@ public void decideResourceLimitationsAlwaysUseSandbox() throws Exception { // ARRANGE Command command = Command.newBuilder().build(); SandboxSettings sandboxSettings = new SandboxSettings(); - sandboxSettings.alwaysUse = true; + sandboxSettings.alwaysUseSandbox = true; // ACT ResourceLimits limits = From 72b40ae5c3bf757e9129bbea272fc9a2f5b94bab Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Sun, 23 Apr 2023 13:41:39 -0400 Subject: [PATCH 137/214] updates --- .../worker/shard/ShardWorkerContext.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 590d492dee..ad46a7cae9 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -829,7 +829,9 @@ boolean shouldLimitCoreUsage() { @Override public void createExecutionLimits() { if (shouldLimitCoreUsage()) { - createOperationExecutionLimits(); + if (configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { + createOperationExecutionLimits(); + } } } @@ -860,11 +862,13 @@ void createOperationExecutionLimits() { @Override public void destroyExecutionLimits() { - try { - operationsGroup.getCpu().close(); - executionsGroup.getCpu().close(); - } catch (IOException e) { - throw new RuntimeException(e); + if (configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { + try { + operationsGroup.getCpu().close(); + executionsGroup.getCpu().close(); + } catch (IOException e) { + throw new RuntimeException(e); + } } } From 14c759b4be181bb3bffa8adc18c0deb87a70c3fb Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Thu, 9 Nov 2023 05:15:56 +0800 Subject: [PATCH 138/214] Update ShardWorkerContext.java --- .../java/build/buildfarm/worker/shard/ShardWorkerContext.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index ad46a7cae9..a8058f6f5e 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -828,10 +828,8 @@ boolean shouldLimitCoreUsage() { @Override public void createExecutionLimits() { - if (shouldLimitCoreUsage()) { - if (configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { + if (shouldLimitCoreUsage() && configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { createOperationExecutionLimits(); - } } } From ca9bb92b9f72f463d7d653298e2ca2619c451e2e Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Thu, 9 Nov 2023 05:17:08 +0800 Subject: [PATCH 139/214] Update ShardWorkerContext.java --- .../java/build/buildfarm/worker/shard/ShardWorkerContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index a8058f6f5e..11f5e49b35 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -828,8 +828,8 @@ boolean shouldLimitCoreUsage() { @Override public void createExecutionLimits() { - if (shouldLimitCoreUsage() && configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { - createOperationExecutionLimits(); + if (shouldLimitCoreUsage() && configs.getWorker().getSandboxSettings().isAlwaysUseCgroups()) { + createOperationExecutionLimits(); } } From 35883a4d064c33f2c507e51c11661ca761543e44 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 9 Nov 2023 13:25:39 -0500 Subject: [PATCH 140/214] Release resources when not keeping an operation (#1535) --- .../worker/DequeueMatchEvaluator.java | 18 +++++---- .../buildfarm/worker/DequeueResults.java | 38 ++++++++++++++++++ .../worker/shard/ShardWorkerContext.java | 18 ++++++--- .../worker/DequeueMatchEvaluatorTest.java | 39 ++++++++++++------- 4 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 src/main/java/build/buildfarm/worker/DequeueResults.java diff --git a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java index 59ccd00e37..997fc6862c 100644 --- a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java +++ b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java @@ -55,7 +55,7 @@ public class DequeueMatchEvaluator { */ @SuppressWarnings("NullableProblems") @NotNull - public static boolean shouldKeepOperation( + public static DequeueResults shouldKeepOperation( SetMultimap workerProvisions, String name, LocalResourceSet resourceSet, @@ -77,28 +77,32 @@ public static boolean shouldKeepOperation( */ @SuppressWarnings("NullableProblems") @NotNull - private static boolean shouldKeepViaPlatform( + private static DequeueResults shouldKeepViaPlatform( SetMultimap workerProvisions, String name, LocalResourceSet resourceSet, Platform platform) { // attempt to execute everything the worker gets off the queue, // provided there is enough resources to do so. - // this is a recommended configuration. + DequeueResults results = new DequeueResults(); + if (!LocalResourceSetUtils.claimResources(platform, resourceSet)) { - return false; + return results; } + results.resourcesClaimed = true; // The action might be requesting to run on a particular action if (!keepForThisWorker(platform, name)) { - return false; + return results; } if (configs.getWorker().getDequeueMatchSettings().isAcceptEverything()) { - return true; + results.keep = true; + return results; } - return satisfiesProperties(workerProvisions, platform); + results.keep = satisfiesProperties(workerProvisions, platform); + return results; } private static boolean keepForThisWorker(Platform platform, String name) { diff --git a/src/main/java/build/buildfarm/worker/DequeueResults.java b/src/main/java/build/buildfarm/worker/DequeueResults.java new file mode 100644 index 0000000000..f449907db0 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/DequeueResults.java @@ -0,0 +1,38 @@ +// Copyright 2021 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker; + +/** + * @class DequeueResults + * @brief The results of evaluating a dequeued operation. + * @details Contains information about whether the operation should be kept and if resources were + * claimed. + */ +public class DequeueResults { + /** + * @field keep + * @brief Whether the operation should be kept. + * @details Operations not kept should be put back on the queue. + */ + public boolean keep = false; + + /** + * @field resourcesClaimed + * @brief Whether resources have been claimed while deciding to keep operation. + * @details If resources are claimed but the operation is not kept, the resources should be + * released. + */ + public boolean resourcesClaimed = false; +} diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 11f5e49b35..af380750c6 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -55,6 +55,7 @@ import build.buildfarm.v1test.QueueEntry; import build.buildfarm.v1test.QueuedOperation; import build.buildfarm.worker.DequeueMatchEvaluator; +import build.buildfarm.worker.DequeueResults; import build.buildfarm.worker.ExecutionPolicies; import build.buildfarm.worker.RetryingMatchListener; import build.buildfarm.worker.WorkerContext; @@ -283,10 +284,14 @@ public QueuedOperation getQueuedOperation(QueueEntry queueEntry) @SuppressWarnings("ConstantConditions") private void matchInterruptible(MatchListener listener) throws IOException, InterruptedException { QueueEntry queueEntry = takeEntryOffOperationQueue(listener); - decideWhetherToKeepOperation(queueEntry, listener); + if (queueEntry == null) { + listener.onEntry(null); + } else { + decideWhetherToKeepOperation(queueEntry, listener); + } } - private QueueEntry takeEntryOffOperationQueue(MatchListener listener) + private @Nullable QueueEntry takeEntryOffOperationQueue(MatchListener listener) throws IOException, InterruptedException { listener.onWaitStart(); QueueEntry queueEntry = null; @@ -314,11 +319,14 @@ private QueueEntry takeEntryOffOperationQueue(MatchListener listener) private void decideWhetherToKeepOperation(QueueEntry queueEntry, MatchListener listener) throws IOException, InterruptedException { - if (queueEntry == null - || DequeueMatchEvaluator.shouldKeepOperation( - matchProvisions, name, resourceSet, queueEntry)) { + DequeueResults results = + DequeueMatchEvaluator.shouldKeepOperation(matchProvisions, name, resourceSet, queueEntry); + if (results.keep) { listener.onEntry(queueEntry); } else { + if (results.resourcesClaimed) { + returnLocalResources(queueEntry); + } backplane.rejectOperation(queueEntry); } if (Thread.interrupted()) { diff --git a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java index 290470b845..112d7a63eb 100644 --- a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java +++ b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java @@ -60,7 +60,8 @@ public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT assertThat(shouldKeep).isTrue(); @@ -89,7 +90,8 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker accepts because it has more cores than the min-cores requested @@ -120,7 +122,8 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker rejects because it has less cores than the min-cores requested @@ -150,7 +153,8 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker accepts because it has the same cores as the min-cores requested @@ -180,7 +184,8 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT assertThat(shouldKeep).isFalse(); @@ -191,7 +196,8 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E // ACT shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT assertThat(shouldKeep).isTrue(); @@ -202,7 +208,8 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E // ACT shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT assertThat(shouldKeep).isTrue(); @@ -234,7 +241,8 @@ public void shouldKeepOperationClaimsResource() throws Exception { // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker accepts because the resource is available. @@ -244,7 +252,8 @@ public void shouldKeepOperationClaimsResource() throws Exception { // ACT shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker rejects because there are no resources left. @@ -282,7 +291,8 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker accepts because the resource is available. @@ -293,7 +303,8 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ACT shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker accepts because the resource is available. @@ -304,7 +315,8 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ACT shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker rejects because there are no resources left. @@ -348,7 +360,8 @@ public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception // ACT boolean shouldKeep = DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry); + workerProvisions, "worker-name", resourceSet, entry) + .keep; // ASSERT // the worker rejects because there are no resources left. From 9d80f4ee8726dbdc7578ac7307038f503aace901 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 9 Nov 2023 15:35:41 -0500 Subject: [PATCH 141/214] Update queues.md Refer to new camelized DMS fields. Expand predefined dynamic execution property name matches. --- _site/docs/architecture/queues.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/_site/docs/architecture/queues.md b/_site/docs/architecture/queues.md index 872b689735..2dc706bf4a 100644 --- a/_site/docs/architecture/queues.md +++ b/_site/docs/architecture/queues.md @@ -25,33 +25,38 @@ If your configuration file does not specify any provisioned queues, buildfarm wi This will ensure the expected behavior for the paradigm in which all work is put on the same queue. ### Matching Algorithm -The matching algorithm is performed by the operation queue when the caller is requesting to push or pop elements. +The matching algorithm is performed by the operation queue when the server or worker is requesting to push or pop elements, respectively. The matching algorithm is designed to find the appropriate queue to perform these actions on. On the scheduler side, the action's platform properties are used for matching. On the worker side, the `dequeue_match_settings` are used. ![Operation Queue Matching]({{site.url}}{{site.baseurl}}/assets/images/Operation-Queue-Matching1.png) -This is how the matching algorithm works: +The matching algorithm works as follows: Each provision queue is checked in the order that it is configured. The first provision queue that is deemed eligible is chosen and used. When deciding if an action is eligible for the provision queue, each platform property is checked individually. By default, there must be a perfect match on each key/value. Wildcards ("*") can be used to avoid the need of a perfect match. Additionally, if the action contains any platform properties is not mentioned by the provision queue, it will be deemed ineligible. -setting `allow_unmatched: true` can be used to allow a superset of action properties as long as a subset matches the provision queue. +setting `allowUnmatched: true` can be used to allow a superset of action properties as long as a subset matches the provision queue. If no provision queues can be matched, the operation queue will provide an analysis on why none of the queues were eligible. -When taking elements off of the operation queue, the matching algorithm behaves a similar way. -The worker's `DequeueMatchSettings` also have an `allow_unmatched` property. +When taking elements off of the operation queue, the worker's matching algorithm behaves in a similar manner: +The worker's `DequeueMatchSettings` also have an `allowUnmatched` property. Workers also have the ability to reject an operation after matching with a provision queue and dequeuing a value. -To avoid any of these rejections by the worker, you can use `accept_everything: true`. +To avoid any of these rejections by the worker, you can use `acceptEverything: true`. When configuring your worker, consider the following decisions: -First, if the accept_everything setting is true, the job is accepted. +First, if the `allowEverything` setting is `true`, the job is accepted. Otherwise, if any execution property for the queue has a wildcard key, the job is accepted. -Otherwise, if the allow_unmatched setting is true, each key present in the queue's properties must be a wildcard or exist in the execution request's properties with an equal value. +Otherwise, if the `allowUnmatched` setting is `true`, each key present in the queue's properties must be a wildcard or exist in the execution request's properties with an equal value. Otherwise, the execution request's properties must have exactly the same set of keys as the queue's execution properties, and the request's value for each property must equal the queue's if the queue's value for this property is not a wildcard. +There are special predefined execution property names which resolve to dynamic configuration for the worker to match against: +`Worker`: The worker's `publicName` with no wildcard resolution +`min-cores`: Less than or equal to the `executeStageWidth` +`process-wrapper`: The set of named `process-wrappers` present in configuration + ### Server Example In this example the scheduler declares a GPU queue and CPU queue. All queues must be declared for the server deployment: From aac33b60ee36e71a9f4facafa5f704edbd02fc25 Mon Sep 17 00:00:00 2001 From: Matas Rastenis Date: Thu, 9 Nov 2023 16:52:21 -0800 Subject: [PATCH 142/214] Implement custom label header support for Grpc metrics interceptor (#1530) Add an option to provide a list of custom label headers to add to metrics. --- _site/docs/configuration/configuration.md | 2 ++ examples/config.yml | 1 + .../java/build/buildfarm/common/config/GrpcMetrics.java | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 83d4dcc8d0..d51a1f2292 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -94,6 +94,7 @@ server: |--------------------------|-------------------------------|--------------------------------------------------------| | enabled | boolean, _false_ | Publish basic GRPC metrics to a Prometheus endpoint | | provideLatencyHistograms | boolean, _false_ | Publish detailed, more expensive to calculate, metrics | +| labelsToReport | List of Strings, _[]_ | Include custom metrics labels in Prometheus metrics | Example: @@ -102,6 +103,7 @@ server: grpcMetrics: enabled: false provideLatencyHistograms: false + labelsToReport: [] ``` ### Server Caches diff --git a/examples/config.yml b/examples/config.yml index d69688b5b4..825121ea44 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -13,6 +13,7 @@ server: enabled: true provideLatencyHistograms: true latencyBuckets: [0.001, 0.01, 0.1, 1, 5, 10, 20, 40, 60, +Infinity] + labelsToReport: [] maxInboundMessageSizeBytes: 0 maxInboundMetadataSize: 0 casWriteTimeout: 3600 diff --git a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java index 8855ae5fdb..a6e8653500 100644 --- a/src/main/java/build/buildfarm/common/config/GrpcMetrics.java +++ b/src/main/java/build/buildfarm/common/config/GrpcMetrics.java @@ -1,6 +1,7 @@ package build.buildfarm.common.config; import io.grpc.ServerBuilder; +import java.util.List; import lombok.Data; import me.dinowernli.grpc.prometheus.Configuration; import me.dinowernli.grpc.prometheus.MonitoringServerInterceptor; @@ -10,6 +11,7 @@ public class GrpcMetrics { private boolean enabled = false; private boolean provideLatencyHistograms = false; private double[] latencyBuckets; + private List labelsToReport; public static void handleGrpcMetricIntercepts( ServerBuilder serverBuilder, GrpcMetrics grpcMetrics) { @@ -30,6 +32,11 @@ public static void handleGrpcMetricIntercepts( grpcConfig = grpcConfig.withLatencyBuckets(grpcMetrics.getLatencyBuckets()); } + // report custom metric labels + if (grpcMetrics.getLabelsToReport() != null) { + grpcConfig = grpcConfig.withLabelHeaders(grpcMetrics.getLabelsToReport()); + } + // Apply config to create an interceptor and apply it to the GRPC server. MonitoringServerInterceptor monitoringInterceptor = MonitoringServerInterceptor.create(grpcConfig); From f9882f7454c39c17fb957c2eaa7538695a41b255 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 11 Nov 2023 00:36:03 -0500 Subject: [PATCH 143/214] Specify direct guava dependency usage (#1538) Testing with bazel HEAD using jdk21 compilation has revealed new direct dependencies on guava. --- persistentworkers/src/test/java/persistent/bazel/BUILD | 1 + src/test/java/build/buildfarm/common/grpc/BUILD | 1 + src/test/java/build/buildfarm/common/io/BUILD | 1 + src/test/java/build/buildfarm/common/redis/BUILD | 1 + src/test/java/build/buildfarm/common/services/BUILD | 1 + src/test/java/build/buildfarm/server/services/BUILD | 1 + 6 files changed, 6 insertions(+) diff --git a/persistentworkers/src/test/java/persistent/bazel/BUILD b/persistentworkers/src/test/java/persistent/bazel/BUILD index 0cf829a111..b85db78006 100644 --- a/persistentworkers/src/test/java/persistent/bazel/BUILD +++ b/persistentworkers/src/test/java/persistent/bazel/BUILD @@ -3,6 +3,7 @@ COMMON_DEPS = [ "//persistentworkers/src/main/java/persistent/bazel:bazel-persistent-workers", "//persistentworkers/src/test/java/persistent/testutil:testutil", "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_truth_truth", "@maven//:commons_io_commons_io", diff --git a/src/test/java/build/buildfarm/common/grpc/BUILD b/src/test/java/build/buildfarm/common/grpc/BUILD index d470ee243a..35be7f36da 100644 --- a/src/test/java/build/buildfarm/common/grpc/BUILD +++ b/src/test/java/build/buildfarm/common/grpc/BUILD @@ -23,6 +23,7 @@ java_test( "//src/test/java/build/buildfarm:test_runner", "@googleapis//:google_bytestream_bytestream_java_grpc", "@googleapis//:google_bytestream_bytestream_java_proto", + "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_truth_truth", "@maven//:io_grpc_grpc_api", diff --git a/src/test/java/build/buildfarm/common/io/BUILD b/src/test/java/build/buildfarm/common/io/BUILD index 551b96ea58..1f5d1ca179 100644 --- a/src/test/java/build/buildfarm/common/io/BUILD +++ b/src/test/java/build/buildfarm/common/io/BUILD @@ -8,6 +8,7 @@ java_test( "//src/test/java/build/buildfarm:test_runner", "@googleapis//:google_bytestream_bytestream_java_grpc", "@googleapis//:google_bytestream_bytestream_java_proto", + "@maven//:com_google_guava_guava", "@maven//:com_google_jimfs_jimfs", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_truth_truth", diff --git a/src/test/java/build/buildfarm/common/redis/BUILD b/src/test/java/build/buildfarm/common/redis/BUILD index 7b3978fb53..f388e339e0 100644 --- a/src/test/java/build/buildfarm/common/redis/BUILD +++ b/src/test/java/build/buildfarm/common/redis/BUILD @@ -6,6 +6,7 @@ COMMON_DEPS = [ "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "//src/test/java/build/buildfarm:test_runner", "//third_party/jedis", + "@maven//:com_google_guava_guava", "@maven//:com_google_truth_truth", "@maven//:io_grpc_grpc_api", "@maven//:org_mockito_mockito_core", diff --git a/src/test/java/build/buildfarm/common/services/BUILD b/src/test/java/build/buildfarm/common/services/BUILD index 2ba54ab58a..6fe1f35c55 100644 --- a/src/test/java/build/buildfarm/common/services/BUILD +++ b/src/test/java/build/buildfarm/common/services/BUILD @@ -16,6 +16,7 @@ java_test( "//src/test/java/build/buildfarm:test_runner", "@googleapis//:google_bytestream_bytestream_java_grpc", "@googleapis//:google_bytestream_bytestream_java_proto", + "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_truth_truth", "@maven//:io_grpc_grpc_api", diff --git a/src/test/java/build/buildfarm/server/services/BUILD b/src/test/java/build/buildfarm/server/services/BUILD index 09916ed7f0..a83385da04 100644 --- a/src/test/java/build/buildfarm/server/services/BUILD +++ b/src/test/java/build/buildfarm/server/services/BUILD @@ -11,6 +11,7 @@ java_test( "//src/main/java/build/buildfarm/server/services", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "//src/test/java/build/buildfarm:test_runner", + "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_truth_truth", "@maven//:io_grpc_grpc_stub", From 69e0248b64256de2f519866cc6dd33769a18ff24 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 11 Nov 2023 00:38:29 -0500 Subject: [PATCH 144/214] Update lombok dependency for jdk21 (#1540) Annotations under lombok were fixed for jdk21 in 1.18.28, update to current. --- defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defs.bzl b/defs.bzl index a40dccaefe..ea145d1b9f 100644 --- a/defs.bzl +++ b/defs.bzl @@ -112,7 +112,7 @@ def buildfarm_init(name = "buildfarm"): "org.xerial:sqlite-jdbc:3.34.0", "org.jetbrains:annotations:16.0.2", "org.yaml:snakeyaml:2.0", - "org.projectlombok:lombok:1.18.24", + "org.projectlombok:lombok:1.18.30", ], generate_compat_repositories = True, override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, From 339aa131a971c1e541ede590ea8096cfbde97824 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 11 Nov 2023 00:47:00 -0500 Subject: [PATCH 145/214] Reorganize DequeueMatchEvaluator (#1537) Remove acceptEverything DequeueMatchSetting Place worker name in workerProvisions Only enable allowUnmatched effects on key mismatch Only acquire resources after asserting compatibility Update documentation to match changes --- _site/docs/architecture/queues.md | 20 ++-- _site/docs/configuration/configuration.md | 2 - examples/config.yml | 1 - .../common/config/DequeueMatchSettings.java | 7 +- .../worker/DequeueMatchEvaluator.java | 54 ++-------- .../worker/shard/ShardWorkerContext.java | 32 ++---- .../worker/DequeueMatchEvaluatorTest.java | 102 ++++++++---------- 7 files changed, 79 insertions(+), 139 deletions(-) diff --git a/_site/docs/architecture/queues.md b/_site/docs/architecture/queues.md index 2dc706bf4a..4ee44764bf 100644 --- a/_site/docs/architecture/queues.md +++ b/_site/docs/architecture/queues.md @@ -41,19 +41,17 @@ Additionally, if the action contains any platform properties is not mentioned by setting `allowUnmatched: true` can be used to allow a superset of action properties as long as a subset matches the provision queue. If no provision queues can be matched, the operation queue will provide an analysis on why none of the queues were eligible. -When taking elements off of the operation queue, the worker's matching algorithm behaves in a similar manner: -The worker's `DequeueMatchSettings` also have an `allowUnmatched` property. -Workers also have the ability to reject an operation after matching with a provision queue and dequeuing a value. -To avoid any of these rejections by the worker, you can use `acceptEverything: true`. - -When configuring your worker, consider the following decisions: -First, if the `allowEverything` setting is `true`, the job is accepted. -Otherwise, if any execution property for the queue has a wildcard key, the job is accepted. -Otherwise, if the `allowUnmatched` setting is `true`, each key present in the queue's properties must be a wildcard or exist in the execution request's properties with an equal value. -Otherwise, the execution request's properties must have exactly the same set of keys as the queue's execution properties, and the request's value for each property must equal the queue's if the queue's value for this property is not a wildcard. +A worker will dequeue operations from matching queues and determine whether to keep and execute it according to the following procedure: +For each property key-value in the operation's platform, an operation is REJECTED if: + The key is `min-cores` and the integer value is greater than the number of cores on the worker. + Or The key is `min-mem` and the integer value is greater than the number of bytes of RAM on the worker. + Or if the key exists in the `DequeueMatchSettings` platform with neither the value nor a `*` in the corresponding DMS platform key's values, + Or if the `allowUnmatched` setting is `false`. +For each resource requested in the operation's platform with the resource: prefix, the action is rejected if: + The resource amount cannot currently be satisfied with the associated resource capacity count There are special predefined execution property names which resolve to dynamic configuration for the worker to match against: -`Worker`: The worker's `publicName` with no wildcard resolution +`Worker`: The worker's `publicName` `min-cores`: Less than or equal to the `executeStageWidth` `process-wrapper`: The set of named `process-wrappers` present in configuration diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index d51a1f2292..ebbb8ca0e4 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -319,7 +319,6 @@ Note: In order for these settings to take effect, you must also configure `limit | Configuration | Accepted and _Default_ Values | Description | |------------------|-------------------------------|-------------| -| acceptEverything | boolean, _true_ | | | allowUnmatched | boolean, _false_ | | Example: @@ -327,7 +326,6 @@ Example: ```yaml worker: dequeueMatchSettings: - acceptEverything: true allowUnmatched: false ``` diff --git a/examples/config.yml b/examples/config.yml index 825121ea44..c02ff4cfcb 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -103,7 +103,6 @@ worker: inlineContentLimit: 1048567 # 1024 * 1024 operationPollPeriod: 1 dequeueMatchSettings: - acceptEverything: true allowUnmatched: false storages: - type: FILESYSTEM diff --git a/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java b/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java index 20ccbf85b4..57aad77832 100644 --- a/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java +++ b/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java @@ -3,11 +3,16 @@ import build.bazel.remote.execution.v2.Platform; import java.util.ArrayList; import java.util.List; +import lombok.AccessLevel; import lombok.Data; +import lombok.Getter; @Data public class DequeueMatchSettings { - private boolean acceptEverything = true; + + @Getter(AccessLevel.NONE) + private boolean acceptEverything; // deprecated + private boolean allowUnmatched = false; private List properties = new ArrayList(); diff --git a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java index 997fc6862c..3f5815fd10 100644 --- a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java +++ b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java @@ -55,12 +55,11 @@ public class DequeueMatchEvaluator { */ @SuppressWarnings("NullableProblems") @NotNull - public static DequeueResults shouldKeepOperation( + public static boolean shouldKeepOperation( SetMultimap workerProvisions, - String name, LocalResourceSet resourceSet, QueueEntry queueEntry) { - return shouldKeepViaPlatform(workerProvisions, name, resourceSet, queueEntry.getPlatform()); + return shouldKeepViaPlatform(workerProvisions, resourceSet, queueEntry.getPlatform()); } /** @@ -77,43 +76,12 @@ public static DequeueResults shouldKeepOperation( */ @SuppressWarnings("NullableProblems") @NotNull - private static DequeueResults shouldKeepViaPlatform( + private static boolean shouldKeepViaPlatform( SetMultimap workerProvisions, - String name, LocalResourceSet resourceSet, Platform platform) { - // attempt to execute everything the worker gets off the queue, - // provided there is enough resources to do so. - DequeueResults results = new DequeueResults(); - - if (!LocalResourceSetUtils.claimResources(platform, resourceSet)) { - return results; - } - results.resourcesClaimed = true; - - // The action might be requesting to run on a particular action - if (!keepForThisWorker(platform, name)) { - return results; - } - - if (configs.getWorker().getDequeueMatchSettings().isAcceptEverything()) { - results.keep = true; - return results; - } - - results.keep = satisfiesProperties(workerProvisions, platform); - return results; - } - - private static boolean keepForThisWorker(Platform platform, String name) { - for (Platform.Property property : platform.getPropertiesList()) { - if (property.getName().equals(ExecutionProperties.WORKER) - && !property.getValue().equals(name)) { - // requested worker does not match this worker, reject - return false; - } - } - return true; + return satisfiesProperties(workerProvisions, platform) + && LocalResourceSetUtils.claimResources(platform, resourceSet); } /** @@ -183,13 +151,13 @@ private static boolean satisfiesProperty( return possibleMemories >= memBytesRequested; } - // accept other properties not specified on the worker - if (configs.getWorker().getDequeueMatchSettings().isAllowUnmatched()) { - return true; + // ensure exact matches + if (workerProvisions.containsKey(property.getName())) { + return workerProvisions.containsEntry(property.getName(), property.getValue()) + || workerProvisions.containsEntry(property.getName(), "*"); } - // ensure exact matches - return workerProvisions.containsEntry(property.getName(), property.getValue()) - || workerProvisions.containsEntry(property.getName(), "*"); + // accept other properties not specified on the worker + return configs.getWorker().getDequeueMatchSettings().isAllowUnmatched(); } } diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index af380750c6..ac020f5046 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -18,6 +18,7 @@ import static build.buildfarm.common.Actions.checkPreconditionFailure; import static build.buildfarm.common.Errors.VIOLATION_TYPE_INVALID; import static build.buildfarm.common.Errors.VIOLATION_TYPE_MISSING; +import static build.buildfarm.worker.DequeueMatchEvaluator.shouldKeepOperation; import static java.lang.String.format; import static java.util.concurrent.TimeUnit.DAYS; @@ -38,6 +39,7 @@ import build.buildfarm.common.DigestUtil; import build.buildfarm.common.DigestUtil.ActionKey; import build.buildfarm.common.EntryLimitException; +import build.buildfarm.common.ExecutionProperties; import build.buildfarm.common.InputStreamFactory; import build.buildfarm.common.LinuxSandboxOptions; import build.buildfarm.common.Poller; @@ -54,8 +56,6 @@ import build.buildfarm.v1test.CASInsertionPolicy; import build.buildfarm.v1test.QueueEntry; import build.buildfarm.v1test.QueuedOperation; -import build.buildfarm.worker.DequeueMatchEvaluator; -import build.buildfarm.worker.DequeueResults; import build.buildfarm.worker.ExecutionPolicies; import build.buildfarm.worker.RetryingMatchListener; import build.buildfarm.worker.WorkerContext; @@ -137,7 +137,7 @@ class ShardWorkerContext implements WorkerContext { private final boolean errorOperationOutputSizeExceeded; static SetMultimap getMatchProvisions( - Iterable policies, int executeStageWidth) { + Iterable policies, String name, int executeStageWidth) { ImmutableSetMultimap.Builder provisions = ImmutableSetMultimap.builder(); Platform matchPlatform = ExecutionPolicies.getMatchPlatform( @@ -146,6 +146,7 @@ static SetMultimap getMatchProvisions( provisions.put(property.getName(), property.getValue()); } provisions.put(PROVISION_CORES_NAME, String.format("%d", executeStageWidth)); + provisions.put(ExecutionProperties.WORKER, name); return provisions.build(); } @@ -172,7 +173,7 @@ static SetMultimap getMatchProvisions( LocalResourceSet resourceSet, CasWriter writer) { this.name = name; - this.matchProvisions = getMatchProvisions(policies, executeStageWidth); + this.matchProvisions = getMatchProvisions(policies, name, executeStageWidth); this.operationPollPeriod = operationPollPeriod; this.operationPoller = operationPoller; this.inputFetchStageWidth = inputFetchStageWidth; @@ -284,10 +285,10 @@ public QueuedOperation getQueuedOperation(QueueEntry queueEntry) @SuppressWarnings("ConstantConditions") private void matchInterruptible(MatchListener listener) throws IOException, InterruptedException { QueueEntry queueEntry = takeEntryOffOperationQueue(listener); - if (queueEntry == null) { - listener.onEntry(null); + if (queueEntry == null || shouldKeepOperation(matchProvisions, resourceSet, queueEntry)) { + listener.onEntry(queueEntry); } else { - decideWhetherToKeepOperation(queueEntry, listener); + backplane.rejectOperation(queueEntry); } } @@ -317,23 +318,6 @@ private void matchInterruptible(MatchListener listener) throws IOException, Inte return queueEntry; } - private void decideWhetherToKeepOperation(QueueEntry queueEntry, MatchListener listener) - throws IOException, InterruptedException { - DequeueResults results = - DequeueMatchEvaluator.shouldKeepOperation(matchProvisions, name, resourceSet, queueEntry); - if (results.keep) { - listener.onEntry(queueEntry); - } else { - if (results.resourcesClaimed) { - returnLocalResources(queueEntry); - } - backplane.rejectOperation(queueEntry); - } - if (Thread.interrupted()) { - throw new InterruptedException(); - } - } - @Override public void returnLocalResources(QueueEntry queueEntry) { LocalResourceSetUtils.releaseClaims(queueEntry.getPlatform(), resourceSet); diff --git a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java index 112d7a63eb..4d484b8c45 100644 --- a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java +++ b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java @@ -59,9 +59,7 @@ public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -89,9 +87,7 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because it has more cores than the min-cores requested @@ -106,7 +102,6 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { @Test public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(false); SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); workerProvisions.put("cores", "10"); @@ -121,9 +116,7 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because it has less cores than the min-cores requested @@ -152,9 +145,7 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because it has the same cores as the min-cores requested @@ -168,7 +159,6 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti @Test public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws Exception { // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(false); configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(false); SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); @@ -183,33 +173,16 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isFalse(); - // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); - - // ACT - shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; - - // ASSERT - assertThat(shouldKeep).isTrue(); - // ARRANGE configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); // ACT - shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -221,7 +194,6 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E @Test public void shouldKeepOperationClaimsResource() throws Exception { // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); @@ -240,9 +212,7 @@ public void shouldKeepOperationClaimsResource() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -250,10 +220,7 @@ public void shouldKeepOperationClaimsResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); // ACT - shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -261,13 +228,45 @@ public void shouldKeepOperationClaimsResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); } + // Function under test: shouldKeepOperation + // Reason for testing: the local resource should be claimed + // Failure explanation: semaphore claim did not work as expected. + @Test + public void rejectOperationIgnoresResource() throws Exception { + // ARRANGE + configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(false); + SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); + resourceSet.resources.put("FOO", new Semaphore(1)); + + QueueEntry entry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties( + Platform.Property.newBuilder().setName("resource:FOO").setValue("1")) + .addProperties(Platform.Property.newBuilder().setName("os").setValue("randos"))) + .build(); + + // PRE-ASSERT + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); + + // ACT + boolean shouldKeep = + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + + // ASSERT + // the worker rejects because the os is not satisfied + assertThat(shouldKeep).isFalse(); + assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); + } + // Function under test: shouldKeepOperation // Reason for testing: the local resources should be claimed // Failure explanation: semaphore claim did not work as expected. @Test public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); @@ -290,9 +289,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -301,10 +298,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(2); // ACT - shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -313,10 +307,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(0); // ACT - shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -332,7 +323,6 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { @Test public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception { // ARRANGE - configs.getWorker().getDequeueMatchSettings().setAcceptEverything(true); configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); @@ -359,9 +349,7 @@ public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception // ACT boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation( - workerProvisions, "worker-name", resourceSet, entry) - .keep; + DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. From 025305ad9dd06c4f04e702dadb150e314d15c826 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 11 Nov 2023 08:54:51 -0500 Subject: [PATCH 146/214] Upgrade com_google_protobuf for jvm compatibility (#1539) Correct deprecated AccessController usage warning Requires a newer bazel than 6.4.0 for macos to choose unix toolchain with C++ std=c++14 specification for protobuf->absl dependency. --- .bazelci/presubmit.yml | 3 +++ deps.bzl | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 728e68d02d..e08f2f07b6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -55,7 +55,10 @@ tasks: - "..." macos: name: "Unit Tests" + environment: + USE_BAZEL_VERSION: 17be878292730359c9c90efdceabed26126df7ae build_flags: + - "--cxxopt=-std=c++14" - "--build_tag_filters=-container" build_targets: - "..." diff --git a/deps.bzl b/deps.bzl index 55b12ab136..51dfbb953b 100644 --- a/deps.bzl +++ b/deps.bzl @@ -36,9 +36,9 @@ def archive_dependencies(third_party): # Needed for "well-known protos" and @com_google_protobuf//:protoc. { "name": "com_google_protobuf", - "sha256": "25f1292d4ea6666f460a2a30038eef121e6c3937ae0f61d610611dfb14b0bd32", - "strip_prefix": "protobuf-3.19.1", - "urls": ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.zip"], + "sha256": "79082dc68d8bab2283568ce0be3982b73e19ddd647c2411d1977ca5282d2d6b3", + "strip_prefix": "protobuf-25.0", + "urls": ["https://github.com/protocolbuffers/protobuf/archive/v25.0.zip"], }, { "name": "com_github_bazelbuild_buildtools", From f7209098f5d1b4fc671d3008af22aafaa8689902 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Sat, 11 Nov 2023 09:12:37 -0500 Subject: [PATCH 147/214] Create buildfarm-worker-base-build-and-deploy.yml (#1534) Create a github workflow to build base buildfarm worker image. --- ...buildfarm-worker-base-build-and-deploy.yml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/buildfarm-worker-base-build-and-deploy.yml diff --git a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml new file mode 100644 index 0000000000..7550639dd3 --- /dev/null +++ b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml @@ -0,0 +1,28 @@ +name: Build and push base Buildfarm worker image + +on: + push: + branches: + - main + paths: + - ci/base-worker-image/jammy/Dockerfile +jobs: + build: + name: Build Base Buildfarm Worker Image + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build Docker Image + id: buildAndPushImage + uses: MaximilianoBz/dockerhub-buildpush@v1.0 + with: + registry_url: 'docker.io' + repository_name: 'bazelbuild' + user_name: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} + password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} + image_version: 'buildfarm-worker-base:jammy' + docker_file: './ci/base-worker-image/jammy' + - name: Get pre step result output image_pull_url + run: echo "The time was ${{ steps.buildAndPushImage.outputs.image_pull_url }}" From b7daba3e2ee9efe77cd13e91aae1bfd63e89e85b Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Sat, 11 Nov 2023 16:27:24 -0500 Subject: [PATCH 148/214] Add base image generation scripts (#1532) --- ci/base-worker-image/jammy/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ci/base-worker-image/jammy/Dockerfile diff --git a/ci/base-worker-image/jammy/Dockerfile b/ci/base-worker-image/jammy/Dockerfile new file mode 100644 index 0000000000..2e54a2804e --- /dev/null +++ b/ci/base-worker-image/jammy/Dockerfile @@ -0,0 +1,6 @@ +# A minimal container for building a base worker image. +# Buildfarm public releases are build using this image as a starting point. +FROM ubuntu:22.04 + +RUN apt-get update +RUN apt-get -y install default-jre default-jdk build-essential libfuse2 From dcff4f006805ff4c9664f70da9a08675b0883ffb Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Sat, 11 Nov 2023 18:55:16 -0500 Subject: [PATCH 149/214] Fix buildfarm-worker-base-build-and-deploy.yml (#1541) --- .../workflows/buildfarm-worker-base-build-and-deploy.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml index 7550639dd3..a91f6c8593 100644 --- a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml +++ b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml @@ -19,10 +19,8 @@ jobs: uses: MaximilianoBz/dockerhub-buildpush@v1.0 with: registry_url: 'docker.io' - repository_name: 'bazelbuild' + repository_name: 'bazelbuild/buildfarm-worker-base' user_name: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} - image_version: 'buildfarm-worker-base:jammy' + image_version: 'jammy' docker_file: './ci/base-worker-image/jammy' - - name: Get pre step result output image_pull_url - run: echo "The time was ${{ steps.buildAndPushImage.outputs.image_pull_url }}" From 52318f87c29eae3967da88ab06ec8e7b92953e2f Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Tue, 14 Nov 2023 15:32:54 -0500 Subject: [PATCH 150/214] Add public buildfarm image generation actions (#1542) --- .../buildfarm-images-build-and-deploy.yml | 30 +++++++++++++++++++ ...buildfarm-worker-base-build-and-deploy.yml | 16 ++++++++-- BUILD | 26 ++++++++++++++-- ci/base-worker-image/mantic/Dockerfile | 6 ++++ images.bzl | 20 +++++++++++-- 5 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/buildfarm-images-build-and-deploy.yml create mode 100644 ci/base-worker-image/mantic/Dockerfile diff --git a/.github/workflows/buildfarm-images-build-and-deploy.yml b/.github/workflows/buildfarm-images-build-and-deploy.yml new file mode 100644 index 0000000000..789086aafd --- /dev/null +++ b/.github/workflows/buildfarm-images-build-and-deploy.yml @@ -0,0 +1,30 @@ +name: Build and push Buildfarm images + +on: + push: + branches: + - main + +jobs: + build: + name: Build Buildfarm Images + runs-on: ubuntu-latest + steps: + - uses: bazelbuild/setup-bazelisk@v2 + + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Bazelbuild Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} + password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} + + - name: Build Server Image + id: buildAndPushServerImage + run: bazel run public_push_buildfarm-server + + - name: Build Worker Image + id: buildAndPushWorkerImage + run: bazel run public_push_buildfarm-worker diff --git a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml index a91f6c8593..ac620042ba 100644 --- a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml +++ b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml @@ -6,6 +6,7 @@ on: - main paths: - ci/base-worker-image/jammy/Dockerfile + - ci/base-worker-image/mantic/Dockerfile jobs: build: name: Build Base Buildfarm Worker Image @@ -14,8 +15,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Build Docker Image - id: buildAndPushImage + - name: Build Jammy Docker Image + id: buildAndPushJammyImage uses: MaximilianoBz/dockerhub-buildpush@v1.0 with: registry_url: 'docker.io' @@ -24,3 +25,14 @@ jobs: password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} image_version: 'jammy' docker_file: './ci/base-worker-image/jammy' + + - name: Build Mantic Docker Image + id: buildAndPushManticImage + uses: MaximilianoBz/dockerhub-buildpush@v1.0 + with: + registry_url: 'docker.io' + repository_name: 'bazelbuild/buildfarm-worker-base' + user_name: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} + password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} + image_version: 'mantic' + docker_file: './ci/base-worker-image/mantic' diff --git a/BUILD b/BUILD index eb773e1a16..b81921d3c0 100644 --- a/BUILD +++ b/BUILD @@ -2,7 +2,7 @@ load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") load("@io_bazel_rules_docker//java:image.bzl", "java_image") load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs") load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs") -load("@io_bazel_rules_docker//container:container.bzl", "container_image") +load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push") load("@rules_oss_audit//oss_audit:java/oss_audit.bzl", "oss_audit") load("//:jvm_flags.bzl", "server_jvm_flags", "worker_jvm_flags") @@ -120,7 +120,7 @@ sh_binary( java_image( name = "buildfarm-server", args = ["/app/build_buildfarm/examples/config.minimal.yml"], - base = "@ubuntu-mantic//image", + base = "@amazon_corretto_java_image_base//image", classpath_resources = [ "//src/main/java/build/buildfarm:configs", ], @@ -195,3 +195,25 @@ oss_audit( src = "//src/main/java/build/buildfarm:buildfarm-shard-worker", tags = ["audit"], ) + +# Below targets push public docker images to bazelbuild dockerhub. + +container_push( + name = "public_push_buildfarm-server", + format = "Docker", + image = ":buildfarm-server", + registry = "index.docker.io", + repository = "bazelbuild/buildfarm-server", + tag = "latest", + tags = ["container"], +) + +container_push( + name = "public_push_buildfarm-worker", + format = "Docker", + image = ":buildfarm-shard-worker", + registry = "index.docker.io", + repository = "bazelbuild/buildfarm-worker", + tag = "latest", + tags = ["container"], +) diff --git a/ci/base-worker-image/mantic/Dockerfile b/ci/base-worker-image/mantic/Dockerfile new file mode 100644 index 0000000000..3dc2802331 --- /dev/null +++ b/ci/base-worker-image/mantic/Dockerfile @@ -0,0 +1,6 @@ +# A minimal container for building a base worker image. +# Buildfarm public releases are build using this image as a starting point. +FROM ubuntu:23.04 + +RUN apt-get update +RUN apt-get -y install default-jre default-jdk build-essential libfuse2 diff --git a/images.bzl b/images.bzl index 939a752ed5..faa70c3ff1 100644 --- a/images.bzl +++ b/images.bzl @@ -26,10 +26,26 @@ def buildfarm_images(): repository = "distroless/java", ) + # Base mantic worker image for public releases (built via github action from ci/base-worker-image/mantic/Dockerfile) container_pull( name = "ubuntu-mantic", - digest = "sha256:1419bba15470a95242e917b3abcd8981ae36707b99df5ac705e1eee4d920c51c", registry = "index.docker.io", repository = "bazelbuild/buildfarm-worker-base", - tag = "mantic-java17-gcc", + tag = "mantic", + ) + + # Base worker image for public releases (built via github action from ci/base-worker-image/jammy/Dockerfile) + container_pull( + name = "ubuntu-jammy", + registry = "index.docker.io", + repository = "bazelbuild/buildfarm-worker-base", + tag = "jammy", + ) + + # Server base image + container_pull( + name = "amazon_corretto_java_image_base", + registry = "public.ecr.aws/amazoncorretto", + repository = "amazoncorretto", + tag = "21", ) From e3433937236b8c796fcab3c9fe9874a3b34e95d8 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Wed, 15 Nov 2023 20:27:53 -0500 Subject: [PATCH 151/214] Update base image building action (#1544) --- .../buildfarm-images-build-and-deploy.yml | 2 +- ...buildfarm-worker-base-build-and-deploy.yml | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/buildfarm-images-build-and-deploy.yml b/.github/workflows/buildfarm-images-build-and-deploy.yml index 789086aafd..2560eadb3c 100644 --- a/.github/workflows/buildfarm-images-build-and-deploy.yml +++ b/.github/workflows/buildfarm-images-build-and-deploy.yml @@ -1,4 +1,4 @@ -name: Build and push Buildfarm images +name: Build and Push Latest Buildfarm Images on: push: diff --git a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml index ac620042ba..49f1cf40e8 100644 --- a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml +++ b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml @@ -1,4 +1,4 @@ -name: Build and push base Buildfarm worker image +name: Build and Push Base Buildfarm Worker Images on: push: @@ -15,24 +15,24 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Build Jammy Docker Image - id: buildAndPushJammyImage - uses: MaximilianoBz/dockerhub-buildpush@v1.0 + - name: Login to Bazelbuild Docker Hub + uses: docker/login-action@v3 with: - registry_url: 'docker.io' - repository_name: 'bazelbuild/buildfarm-worker-base' - user_name: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} + username: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} - image_version: 'jammy' - docker_file: './ci/base-worker-image/jammy' - - name: Build Mantic Docker Image - id: buildAndPushManticImage - uses: MaximilianoBz/dockerhub-buildpush@v1.0 + - name: Build Jammy Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: - registry_url: 'docker.io' - repository_name: 'bazelbuild/buildfarm-worker-base' - user_name: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} - password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} - image_version: 'mantic' - docker_file: './ci/base-worker-image/mantic' + context: . + file: ./ci/base-worker-image/jammy/Dockerfile + push: true + tags: bazelbuild/buildfarm-worker-base:jammy + + - name: Build Mantic Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./ci/base-worker-image/mantic/Dockerfile + push: true + tags: bazelbuild/buildfarm-worker-base:mantic From dae7f78eda808b745d1e0bc59cfdfb4a3ba67681 Mon Sep 17 00:00:00 2001 From: Yuriy Belenitsky Date: Wed, 15 Nov 2023 21:53:23 -0500 Subject: [PATCH 152/214] Add release image generation action (#1545) --- .bazelci/presubmit.yml | 4 +++ .../buildfarm-images-build-and-deploy.yml | 4 +-- .../buildfarm-release-build-and-deploy.yml | 29 +++++++++++++++++++ BUILD | 4 +-- 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/buildfarm-release-build-and-deploy.yml diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e08f2f07b6..dfdf37f892 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -41,6 +41,8 @@ tasks: name: "Unit Tests" build_targets: - "..." + build_flags: + - "--build_tag_filters=-container" test_flags: - "--test_tag_filters=-integration,-redis" test_targets: @@ -49,6 +51,8 @@ tasks: name: "Unit Tests" build_targets: - "..." + build_flags: + - "--build_tag_filters=-container" test_flags: - "--test_tag_filters=-integration,-redis" test_targets: diff --git a/.github/workflows/buildfarm-images-build-and-deploy.yml b/.github/workflows/buildfarm-images-build-and-deploy.yml index 2560eadb3c..a7f4812c94 100644 --- a/.github/workflows/buildfarm-images-build-and-deploy.yml +++ b/.github/workflows/buildfarm-images-build-and-deploy.yml @@ -23,8 +23,8 @@ jobs: - name: Build Server Image id: buildAndPushServerImage - run: bazel run public_push_buildfarm-server + run: bazel run public_push_buildfarm-server --define release_version=latest - name: Build Worker Image id: buildAndPushWorkerImage - run: bazel run public_push_buildfarm-worker + run: bazel run public_push_buildfarm-worker --define release_version=latest diff --git a/.github/workflows/buildfarm-release-build-and-deploy.yml b/.github/workflows/buildfarm-release-build-and-deploy.yml new file mode 100644 index 0000000000..31200e3ebf --- /dev/null +++ b/.github/workflows/buildfarm-release-build-and-deploy.yml @@ -0,0 +1,29 @@ +name: Build and Push Buildfarm Releases + +on: + release: + types: [published] + +jobs: + build: + name: Build Buildfarm Images + runs-on: ubuntu-latest + steps: + - uses: bazelbuild/setup-bazelisk@v2 + + - name: Checkout + uses: actions/checkout@v3 + + - name: Login to Bazelbuild Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.BAZELBUILD_DOCKERHUB_USERNAME }} + password: ${{ secrets.BAZELBUILD_DOCKERHUB_TOKEN }} + + - name: Build Server Image + id: buildAndPushServerImage + run: bazel run public_push_buildfarm-server --define release_version=${{ github.event.release.tag_name }} + + - name: Build Worker Image + id: buildAndPushWorkerImage + run: bazel run public_push_buildfarm-worker --define release_version=${{ github.event.release.tag_name }} diff --git a/BUILD b/BUILD index b81921d3c0..c0400a6061 100644 --- a/BUILD +++ b/BUILD @@ -204,7 +204,7 @@ container_push( image = ":buildfarm-server", registry = "index.docker.io", repository = "bazelbuild/buildfarm-server", - tag = "latest", + tag = "$(release_version)", tags = ["container"], ) @@ -214,6 +214,6 @@ container_push( image = ":buildfarm-shard-worker", registry = "index.docker.io", repository = "bazelbuild/buildfarm-worker", - tag = "latest", + tag = "$(release_version)", tags = ["container"], ) From b01889d86e05ce088cad6899ded21038858ccdc3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 16 Nov 2023 16:47:18 -0500 Subject: [PATCH 153/214] Limit workflow to canonical repository (#1547) --- .github/workflows/buildfarm-images-build-and-deploy.yml | 1 + .github/workflows/buildfarm-release-build-and-deploy.yml | 1 + .github/workflows/buildfarm-worker-base-build-and-deploy.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/buildfarm-images-build-and-deploy.yml b/.github/workflows/buildfarm-images-build-and-deploy.yml index a7f4812c94..97936b3fe9 100644 --- a/.github/workflows/buildfarm-images-build-and-deploy.yml +++ b/.github/workflows/buildfarm-images-build-and-deploy.yml @@ -7,6 +7,7 @@ on: jobs: build: + if: github.repository == 'bazelbuild/bazel-buildfarm' name: Build Buildfarm Images runs-on: ubuntu-latest steps: diff --git a/.github/workflows/buildfarm-release-build-and-deploy.yml b/.github/workflows/buildfarm-release-build-and-deploy.yml index 31200e3ebf..537919bbbc 100644 --- a/.github/workflows/buildfarm-release-build-and-deploy.yml +++ b/.github/workflows/buildfarm-release-build-and-deploy.yml @@ -6,6 +6,7 @@ on: jobs: build: + if: github.repository == 'bazelbuild/bazel-buildfarm' name: Build Buildfarm Images runs-on: ubuntu-latest steps: diff --git a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml index 49f1cf40e8..a212e5e61a 100644 --- a/.github/workflows/buildfarm-worker-base-build-and-deploy.yml +++ b/.github/workflows/buildfarm-worker-base-build-and-deploy.yml @@ -9,6 +9,7 @@ on: - ci/base-worker-image/mantic/Dockerfile jobs: build: + if: github.repository == 'bazelbuild/bazel-buildfarm' name: Build Base Buildfarm Worker Image runs-on: ubuntu-latest steps: From dcee798579773981812c90ad0280dad234194ee5 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 16 Nov 2023 16:47:43 -0500 Subject: [PATCH 154/214] Check for "cores" exec property as min-cores match (#1548) The execution platform property "cores" is detailed in documentation as specifying "min-cores" and "max-cores". Match this definition and prevent "cores" from being evaluated as a strict match with the worker provision properties (with likely rejection). --- .../worker/DequeueMatchEvaluator.java | 3 +- .../worker/DequeueMatchEvaluatorTest.java | 122 +++++++++++++----- 2 files changed, 91 insertions(+), 34 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java index 3f5815fd10..8f9d712481 100644 --- a/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java +++ b/src/main/java/build/buildfarm/worker/DequeueMatchEvaluator.java @@ -119,7 +119,8 @@ private static boolean satisfiesProperties( private static boolean satisfiesProperty( SetMultimap workerProvisions, Platform.Property property) { // validate min cores - if (property.getName().equals(ExecutionProperties.MIN_CORES)) { + if (property.getName().equals(ExecutionProperties.CORES) + || property.getName().equals(ExecutionProperties.MIN_CORES)) { if (!workerProvisions.containsKey(ExecutionProperties.CORES)) { return false; } diff --git a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java index 4d484b8c45..91f83872ca 100644 --- a/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java +++ b/src/test/java/build/buildfarm/worker/DequeueMatchEvaluatorTest.java @@ -14,6 +14,10 @@ package build.buildfarm.worker; +import static build.buildfarm.common.ExecutionProperties.CORES; +import static build.buildfarm.common.ExecutionProperties.MAX_CORES; +import static build.buildfarm.common.ExecutionProperties.MIN_CORES; +import static build.buildfarm.worker.DequeueMatchEvaluator.shouldKeepOperation; import static com.google.common.truth.Truth.assertThat; import build.bazel.remote.execution.v2.Platform; @@ -58,8 +62,7 @@ public void shouldKeepOperationKeepEmptyQueueEntry() throws Exception { QueueEntry entry = QueueEntry.newBuilder().setPlatform(Platform.newBuilder()).build(); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -75,19 +78,32 @@ public void shouldKeepOperationValidMinCoresQueueEntry() throws Exception { // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); - workerProvisions.put("cores", "11"); + workerProvisions.put(CORES, "11"); - QueueEntry entry = + QueueEntry minCoresEntry = QueueEntry.newBuilder() .setPlatform( Platform.newBuilder() .addProperties( - Platform.Property.newBuilder().setName("min-cores").setValue("10"))) + Platform.Property.newBuilder().setName(MIN_CORES).setValue("10"))) .build(); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, minCoresEntry); + + // ASSERT + // the worker accepts because it has more cores than the min-cores requested + assertThat(shouldKeep).isTrue(); + + QueueEntry coresEntry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties(Platform.Property.newBuilder().setName(CORES).setValue("10"))) + .build(); + + // ACT + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, coresEntry); // ASSERT // the worker accepts because it has more cores than the min-cores requested @@ -104,19 +120,32 @@ public void shouldKeepOperationInvalidMinCoresQueueEntry() throws Exception { // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); - workerProvisions.put("cores", "10"); + workerProvisions.put(CORES, "10"); - QueueEntry entry = + QueueEntry minCoresEntry = QueueEntry.newBuilder() .setPlatform( Platform.newBuilder() .addProperties( - Platform.Property.newBuilder().setName("min-cores").setValue("11"))) + Platform.Property.newBuilder().setName(MIN_CORES).setValue("11"))) .build(); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, minCoresEntry); + + // ASSERT + // the worker rejects because it has less cores than the min-cores requested + assertThat(shouldKeep).isFalse(); + + QueueEntry coresEntry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties(Platform.Property.newBuilder().setName(CORES).setValue("11"))) + .build(); + + // ACT + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, coresEntry); // ASSERT // the worker rejects because it has less cores than the min-cores requested @@ -131,25 +160,39 @@ public void shouldKeepOperationMaxCoresDoNotInfluenceAcceptance() throws Excepti // ARRANGE SetMultimap workerProvisions = HashMultimap.create(); LocalResourceSet resourceSet = new LocalResourceSet(); - workerProvisions.put("cores", "10"); + workerProvisions.put(CORES, "10"); - QueueEntry entry = + QueueEntry minCoresEntry = QueueEntry.newBuilder() .setPlatform( Platform.newBuilder() + .addProperties(Platform.Property.newBuilder().setName(MIN_CORES).setValue("10")) .addProperties( - Platform.Property.newBuilder().setName("min-cores").setValue("10")) - .addProperties( - Platform.Property.newBuilder().setName("max-cores").setValue("20"))) + Platform.Property.newBuilder().setName(MAX_CORES).setValue("20"))) .build(); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, minCoresEntry); // ASSERT // the worker accepts because it has the same cores as the min-cores requested assertThat(shouldKeep).isTrue(); + + QueueEntry coresEntry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties(Platform.Property.newBuilder().setName(CORES).setValue("10")) + .addProperties( + Platform.Property.newBuilder().setName(MAX_CORES).setValue("20"))) + .build(); + + // ACT + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, coresEntry); + + // ASSERT + // the worker accepts because it has the same cores as the cores requested + assertThat(shouldKeep).isTrue(); } // Function under test: shouldKeepOperation @@ -172,8 +215,7 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E .build(); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isFalse(); @@ -182,7 +224,7 @@ public void shouldKeepOperationUnmatchedPropertiesRejectionAcceptance() throws E configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(true); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT assertThat(shouldKeep).isTrue(); @@ -211,8 +253,7 @@ public void shouldKeepOperationClaimsResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -220,7 +261,7 @@ public void shouldKeepOperationClaimsResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(0); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -252,8 +293,7 @@ public void rejectOperationIgnoresResource() throws Exception { assertThat(resourceSet.resources.get("FOO").availablePermits()).isEqualTo(1); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because the os is not satisfied @@ -288,8 +328,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(4); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -298,7 +337,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(2); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker accepts because the resource is available. @@ -307,7 +346,7 @@ public void shouldKeepOperationClaimsMultipleResource() throws Exception { assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(0); // ACT - shouldKeep = DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -348,8 +387,7 @@ public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception assertThat(resourceSet.resources.get("BAZ").availablePermits()).isEqualTo(200); // ACT - boolean shouldKeep = - DequeueMatchEvaluator.shouldKeepOperation(workerProvisions, resourceSet, entry); + boolean shouldKeep = shouldKeepOperation(workerProvisions, resourceSet, entry); // ASSERT // the worker rejects because there are no resources left. @@ -359,4 +397,22 @@ public void shouldKeepOperationFailsToClaimSameAmountRemains() throws Exception assertThat(resourceSet.resources.get("BAR").availablePermits()).isEqualTo(100); assertThat(resourceSet.resources.get("BAZ").availablePermits()).isEqualTo(200); } + + @Test + public void shouldMatchCoresAsMinAndMax() throws Exception { + SetMultimap workerProvisions = HashMultimap.create(); + LocalResourceSet resourceSet = new LocalResourceSet(); + configs.getWorker().getDequeueMatchSettings().setAllowUnmatched(false); + + QueueEntry multicoreEntry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties(Platform.Property.newBuilder().setName(CORES).setValue("2")) + .build()) + .build(); + + // cores must be present from worker provisions to keep cores specified in platform + assertThat(shouldKeepOperation(workerProvisions, resourceSet, multicoreEntry)).isFalse(); + } } From 221eae91e2545f22d78311b45d90734b0caa4c84 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 18 Nov 2023 22:12:43 -0500 Subject: [PATCH 155/214] Consider output_* as relative to WD (#1550) Per the REAPI spec: `The paths are relative to the working directory of the action execution.` Prefix the WorkingDirectory to paths used as OutputDirectory parameters, and verify that these are present in the layout of the directory for use. --- .../worker/shard/CFCExecFileSystem.java | 8 +++- .../worker/shard/CFCExecFileSystemTest.java | 43 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/test/java/build/buildfarm/worker/shard/CFCExecFileSystemTest.java diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index dba809fdcf..15aaa10781 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -46,6 +46,7 @@ import build.buildfarm.worker.ExecDirException; import build.buildfarm.worker.ExecDirException.ViolationException; import build.buildfarm.worker.OutputDirectory; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; @@ -402,7 +403,8 @@ private Set linkedDirectories( return ImmutableSet.of(); } - private OutputDirectory createOutputDirectory(Command command) { + @VisibleForTesting + static OutputDirectory createOutputDirectory(Command command) { Iterable files; Iterable dirs; if (command.getOutputPathsCount() != 0) { @@ -412,6 +414,10 @@ private OutputDirectory createOutputDirectory(Command command) { files = command.getOutputFilesList(); dirs = command.getOutputDirectoriesList(); } + if (!command.getWorkingDirectory().isEmpty()) { + files = Iterables.transform(files, file -> command.getWorkingDirectory() + "/" + file); + dirs = Iterables.transform(dirs, dir -> command.getWorkingDirectory() + "/" + dir); + } return OutputDirectory.parse(files, dirs, command.getEnvironmentVariablesList()); } diff --git a/src/test/java/build/buildfarm/worker/shard/CFCExecFileSystemTest.java b/src/test/java/build/buildfarm/worker/shard/CFCExecFileSystemTest.java new file mode 100644 index 0000000000..8d7c0c9f64 --- /dev/null +++ b/src/test/java/build/buildfarm/worker/shard/CFCExecFileSystemTest.java @@ -0,0 +1,43 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.shard; + +import static com.google.common.truth.Truth.assertThat; + +import build.bazel.remote.execution.v2.Command; +import build.buildfarm.worker.OutputDirectory; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class CFCExecFileSystemTest { + @Test + public void outputDirectoryWorkingDirectoryRelative() { + Command command = + Command.newBuilder() + .setWorkingDirectory("foo/bar") + .addOutputFiles("baz/quux") + .addOutputDirectories("nope") + .build(); + + // verification is actually here with checked contents below + // throws unless the directory is relative to the WorkingDirectory + OutputDirectory workingOutputDirectory = + CFCExecFileSystem.createOutputDirectory(command).getChild("foo").getChild("bar"); + assertThat(workingOutputDirectory.getChild("baz").isLeaf()).isTrue(); + assertThat(workingOutputDirectory.getChild("nope").isLeaf()).isFalse(); + } +} From 91587e73d42fe6d689dd2d1be2b9ca5029e9fc12 Mon Sep 17 00:00:00 2001 From: Win Wang <1862202+wiwa@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:53:56 -0500 Subject: [PATCH 156/214] Implement Persistent Workers as an execution path (#1260) Followup to #1195 Add a new execution pathway in worker/Executor.java to use persistent workers via PersistentExecutor, like DockerExecutor. Mostly unchanged from the form we used to experiment back at Twitter, but now with tests. Co-authored-by: Shane Delmore shane@delmore.io --- .../buildfarm/common/ExecutionProperties.java | 16 +- .../common/config/DequeueMatchSettings.java | 1 - src/main/java/build/buildfarm/worker/BUILD | 4 + .../java/build/buildfarm/worker/Executor.java | 34 ++- .../buildfarm/worker/OperationContext.java | 2 +- .../build/buildfarm/worker/persistent/BUILD | 31 ++ .../worker/persistent/FileAccessUtils.java | 171 +++++++++++ .../buildfarm/worker/persistent/Keymaker.java | 112 +++++++ .../worker/persistent/PersistentExecutor.java | 268 +++++++++++++++++ .../worker/persistent/ProtoCoordinator.java | 284 ++++++++++++++++++ .../worker/persistent/RequestCtx.java | 42 +++ .../worker/persistent/ResponseCtx.java | 34 +++ .../worker/persistent/WorkFilesContext.java | 85 ++++++ .../worker/persistent/WorkerInputs.java | 117 ++++++++ .../resources/ExecutionPropertiesParser.java | 32 ++ .../worker/resources/ResourceLimits.java | 13 + .../java/build/buildfarm/worker/util/BUILD | 24 ++ .../buildfarm/worker/util/InputsIndexer.java | 141 +++++++++ .../instance/shard/JedisCasWorkerMapTest.java | 1 - .../build/buildfarm/worker/persistent/BUILD | 36 +++ .../persistent/ProtoCoordinatorTest.java | 132 ++++++++ .../java/build/buildfarm/worker/util/BUILD | 61 ++++ .../worker/util/InputsIndexerTest.java | 184 ++++++++++++ .../worker/util/WorkerTestUtils.java | 226 ++++++++++++++ 24 files changed, 2043 insertions(+), 8 deletions(-) create mode 100644 src/main/java/build/buildfarm/worker/persistent/BUILD create mode 100644 src/main/java/build/buildfarm/worker/persistent/FileAccessUtils.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/Keymaker.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/PersistentExecutor.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/ProtoCoordinator.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/RequestCtx.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/ResponseCtx.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/WorkFilesContext.java create mode 100644 src/main/java/build/buildfarm/worker/persistent/WorkerInputs.java create mode 100644 src/main/java/build/buildfarm/worker/util/BUILD create mode 100644 src/main/java/build/buildfarm/worker/util/InputsIndexer.java create mode 100644 src/test/java/build/buildfarm/worker/persistent/BUILD create mode 100644 src/test/java/build/buildfarm/worker/persistent/ProtoCoordinatorTest.java create mode 100644 src/test/java/build/buildfarm/worker/util/BUILD create mode 100644 src/test/java/build/buildfarm/worker/util/InputsIndexerTest.java create mode 100644 src/test/java/build/buildfarm/worker/util/WorkerTestUtils.java diff --git a/src/main/java/build/buildfarm/common/ExecutionProperties.java b/src/main/java/build/buildfarm/common/ExecutionProperties.java index ee3975d6dd..198783d21b 100644 --- a/src/main/java/build/buildfarm/common/ExecutionProperties.java +++ b/src/main/java/build/buildfarm/common/ExecutionProperties.java @@ -297,7 +297,21 @@ public class ExecutionProperties { /** * @field WORKER * @brief The exec_property to ensure that the action only runs on the worker name given. - * @details Useful for diagnosing woker issues by targeting builds to a specific worker. + * @details Useful for diagnosing worker issues by targeting builds to a specific worker. */ public static final String WORKER = "Worker"; + + /** + * @field PERSISTENT_WORKER_KEY + * @brief Hash of tool inputs from --experiemental_remote_mark_tool_inputs + * @details See https://github.com/bazelbuild/bazel/issues/10091 + */ + public static final String PERSISTENT_WORKER_KEY = "persistentWorkerKey"; + + /** + * @field PERSISTENT_WORKER_COMMAND + * @brief Command string to start the persistent worker + * @details See https://github.com/bazelbuild/bazel/issues/10091 + */ + public static final String PERSISTENT_WORKER_COMMAND = "persistentWorkerCommand"; } diff --git a/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java b/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java index 57aad77832..29655e20de 100644 --- a/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java +++ b/src/main/java/build/buildfarm/common/config/DequeueMatchSettings.java @@ -9,7 +9,6 @@ @Data public class DequeueMatchSettings { - @Getter(AccessLevel.NONE) private boolean acceptEverything; // deprecated diff --git a/src/main/java/build/buildfarm/worker/BUILD b/src/main/java/build/buildfarm/worker/BUILD index e24b50d731..7352a3900e 100644 --- a/src/main/java/build/buildfarm/worker/BUILD +++ b/src/main/java/build/buildfarm/worker/BUILD @@ -4,12 +4,16 @@ java_library( plugins = ["//src/main/java/build/buildfarm/common:lombok"], visibility = ["//visibility:public"], deps = [ + "//persistentworkers/src/main/java/persistent/bazel:bazel-persistent-workers", + "//persistentworkers/src/main/java/persistent/common:persistent-common", "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/instance", "//src/main/java/build/buildfarm/instance/stub", + "//src/main/java/build/buildfarm/worker/persistent", "//src/main/java/build/buildfarm/worker/resources", + "//src/main/java/build/buildfarm/worker/util", "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@bazel//src/main/protobuf:execution_statistics_java_proto", "@googleapis//:google_rpc_code_java_proto", diff --git a/src/main/java/build/buildfarm/worker/Executor.java b/src/main/java/build/buildfarm/worker/Executor.java index f4776a6f00..ee0de0b1ba 100644 --- a/src/main/java/build/buildfarm/worker/Executor.java +++ b/src/main/java/build/buildfarm/worker/Executor.java @@ -36,12 +36,16 @@ import build.buildfarm.common.config.ExecutionPolicy; import build.buildfarm.common.config.ExecutionWrapper; import build.buildfarm.v1test.ExecutingOperationMetadata; +import build.buildfarm.v1test.Tree; import build.buildfarm.worker.WorkerContext.IOResource; +import build.buildfarm.worker.persistent.PersistentExecutor; +import build.buildfarm.worker.persistent.WorkFilesContext; import build.buildfarm.worker.resources.ResourceLimits; import com.github.dockerjava.api.DockerClient; import com.github.dockerjava.core.DockerClientBuilder; import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.shell.Protos.ExecutionStatistics; import com.google.longrunning.Operation; import com.google.protobuf.Any; @@ -427,16 +431,38 @@ private Code executeCommand( for (EnvironmentVariable environmentVariable : environmentVariables) { environment.put(environmentVariable.getName(), environmentVariable.getValue()); } - for (Map.Entry environmentVariable : - limits.extraEnvironmentVariables.entrySet()) { - environment.put(environmentVariable.getKey(), environmentVariable.getValue()); - } + environment.putAll(limits.extraEnvironmentVariables); // allow debugging before an execution if (limits.debugBeforeExecution) { return ExecutionDebugger.performBeforeExecutionDebug(processBuilder, limits, resultBuilder); } + boolean usePersistentWorker = + !limits.persistentWorkerKey.isEmpty() && !limits.persistentWorkerCommand.isEmpty(); + + if (usePersistentWorker) { + log.fine( + "usePersistentWorker; got persistentWorkerCommand of : " + + limits.persistentWorkerCommand); + + Tree execTree = workerContext.getQueuedOperation(operationContext.queueEntry).getTree(); + + WorkFilesContext filesContext = + WorkFilesContext.fromContext(execDir, execTree, operationContext.command); + + return PersistentExecutor.runOnPersistentWorker( + limits.persistentWorkerCommand, + filesContext, + operationName, + ImmutableList.copyOf(arguments), + ImmutableMap.copyOf(environment), + limits, + timeout, + PersistentExecutor.defaultWorkRootsDir, + resultBuilder); + } + // run the action under docker if (limits.containerSettings.enabled) { DockerClient dockerClient = DockerClientBuilder.getInstance().build(); diff --git a/src/main/java/build/buildfarm/worker/OperationContext.java b/src/main/java/build/buildfarm/worker/OperationContext.java index 71b1975783..ef73e1bbf9 100644 --- a/src/main/java/build/buildfarm/worker/OperationContext.java +++ b/src/main/java/build/buildfarm/worker/OperationContext.java @@ -22,7 +22,7 @@ import com.google.longrunning.Operation; import java.nio.file.Path; -final class OperationContext { +public final class OperationContext { final ExecuteResponse.Builder executeResponse; final Operation operation; final Poller poller; diff --git a/src/main/java/build/buildfarm/worker/persistent/BUILD b/src/main/java/build/buildfarm/worker/persistent/BUILD new file mode 100644 index 0000000000..b476e0ebb2 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/BUILD @@ -0,0 +1,31 @@ +java_library( + name = "persistent", + srcs = glob(["*.java"]), + plugins = ["//src/main/java/build/buildfarm/common:lombok"], + visibility = ["//visibility:public"], + deps = [ + "//persistentworkers/src/main/java/persistent/bazel:bazel-persistent-workers", + "//persistentworkers/src/main/java/persistent/common:persistent-common", + "//persistentworkers/src/main/java/persistent/common/util", + "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/worker/resources", + "//src/main/java/build/buildfarm/worker/util", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "@maven//:com_google_api_grpc_proto_google_common_protos", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:commons_io_commons_io", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_netty", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + "@maven//:io_prometheus_simpleclient", + "@maven//:org_apache_commons_commons_compress", + "@maven//:org_jetbrains_annotations", + "@maven//:org_projectlombok_lombok", + ], +) diff --git a/src/main/java/build/buildfarm/worker/persistent/FileAccessUtils.java b/src/main/java/build/buildfarm/worker/persistent/FileAccessUtils.java new file mode 100644 index 0000000000..ca81384e16 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/FileAccessUtils.java @@ -0,0 +1,171 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +import com.google.common.collect.ImmutableSet; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Supplier; +import lombok.extern.java.Log; + +/** + * Utility for concurrent move/copy of files Can be extended in the future to (sym)linking if we + * need performance + */ +@Log +public final class FileAccessUtils { + // singleton class with only static methods + private FileAccessUtils() {} + + public static Path addPosixOwnerWrite(Path absPath) throws IOException { + Set perms = Files.getPosixFilePermissions(absPath); + + ImmutableSet permsWithWrite = + ImmutableSet.builder() + .addAll(perms) + .add(PosixFilePermission.OWNER_WRITE) + .build(); + + return Files.setAttribute(absPath, "posix:permissions", permsWithWrite); + } + + private static final ConcurrentHashMap fileLocks = new ConcurrentHashMap<>(); + + // Used here as a simple lock for locking "files" (paths) + private static class PathLock { + // Not used elsewhere + private PathLock() {} + } + + /** + * Copies a file, creating necessary directories, replacing existing files. The resulting file is + * set to be writeable, and we throw if we cannot set that. Thread-safe (within a process) against + * writes to the same path. + * + * @param from + * @param to + * @throws IOException + */ + public static void copyFile(Path from, Path to) throws IOException { + Path absTo = to.toAbsolutePath(); + log.finer("copyFile: " + from + " to " + absTo); + if (!Files.exists(from)) { + throw new IOException("copyFile: source file doesn't exist: " + from); + } + IOException ioException = + writeFileSafe( + to, + () -> { + try { + Files.copy(from, absTo, REPLACE_EXISTING, COPY_ATTRIBUTES); + addPosixOwnerWrite(absTo); + return null; + } catch (IOException e) { + return new IOException("copyFile() could not set writeable: " + absTo, e); + } + }); + if (ioException != null) { + throw ioException; + } + } + + /** + * Moves a file, creating necessary directories, replacing existing files. The resulting file is + * set to be writeable, and we throw if we cannot set that. Thread-safe against writes to the same + * path. + * + * @param from + * @param to + * @throws IOException + */ + public static void moveFile(Path from, Path to) throws IOException { + Path absTo = to.toAbsolutePath(); + log.finer("moveFile: " + from + " to " + absTo); + if (!Files.exists(from)) { + throw new IOException("moveFile: source file doesn't exist: " + from); + } + IOException ioException = + writeFileSafe( + absTo, + () -> { + try { + Files.move(from, absTo, REPLACE_EXISTING); + addPosixOwnerWrite(absTo); + return null; + } catch (IOException e) { + return new IOException("copyFile() could not set writeable: " + absTo, e); + } + }); + if (ioException != null) { + throw ioException; + } + } + + /** + * Deletes a file; Thread-safe against writes to the same path. + * + * @param toDelete + * @throws IOException + */ + public static void deleteFileIfExists(Path toDelete) throws IOException { + Path absTo = toDelete.toAbsolutePath(); + PathLock toLock = fileLock(absTo); + synchronized (toLock) { + try { + Files.deleteIfExists(absTo); + } finally { + fileLocks.remove(absTo); + } + } + } + + /** + * Thread-safe (not multi-process-safe) wrapper for locking paths before a write operation. + * + *

This method will create necessary parent directories. + * + *

It is up to the write operation to specify whether or not to overwrite existing files. + */ + @SuppressWarnings("PMD.UnnecessaryLocalBeforeReturn") + private static IOException writeFileSafe(Path absTo, Supplier writeOp) { + PathLock toLock = fileLock(absTo); + synchronized (toLock) { + try { + // If 'absTo' is a symlink, checks if its target file exists + Files.createDirectories(absTo.getParent()); + return writeOp.get(); + } catch (IOException e) { + // PMD will complain about UnnecessaryLocalBeforeReturn + // In this case, it is necessary to catch the exception + return e; + } finally { + // Clean up to prevent too many locks. + fileLocks.remove(absTo); + } + } + } + + // "Logical" file lock + private static PathLock fileLock(Path writeTo) { + return fileLocks.computeIfAbsent(writeTo, k -> new PathLock()); + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/Keymaker.java b/src/main/java/build/buildfarm/worker/persistent/Keymaker.java new file mode 100644 index 0000000000..edfaaf23c3 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/Keymaker.java @@ -0,0 +1,112 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSortedMap; +import com.google.common.hash.HashCode; +import com.google.common.hash.Hasher; +import com.google.common.hash.Hashing; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.Objects; +import java.util.SortedMap; +import persistent.bazel.client.PersistentWorker; +import persistent.bazel.client.WorkerKey; + +/** Much of the logic (hashing) is from Bazel itself (private library/methods, i.e. WorkerKey). */ +public class Keymaker { + // Constructs a key with its worker tool input files being relative paths + public static WorkerKey make( + Path opRoot, + Path workRootsDir, + ImmutableList workerInitCmd, + ImmutableList workerInitArgs, + ImmutableMap workerEnv, + String executionName, + WorkerInputs workerFiles) { + // Cancellation not yet supported; can change in the future, + // Presumably, following how Bazel's own persistent workers work + boolean sandboxed = true; + boolean cancellable = false; + + Path workRoot = + calculateWorkRoot( + workRootsDir, + workerInitCmd, + workerInitArgs, + workerEnv, + executionName, + sandboxed, + cancellable); + Path toolsRoot = workRoot.resolve(PersistentWorker.TOOL_INPUT_SUBDIR); + + SortedMap hashedTools = workerFilesWithHashes(workerFiles); + HashCode combinedToolsHash = workerFilesCombinedHash(toolsRoot, hashedTools); + + return new WorkerKey( + workerInitCmd, + workerInitArgs, + workerEnv, + workRoot, + executionName, + combinedToolsHash, + hashedTools, + sandboxed, + cancellable); + } + + // Hash of a subset of the WorkerKey + private static Path calculateWorkRoot( + Path workRootsDir, + ImmutableList workerInitCmd, + ImmutableList workerInitArgs, + ImmutableMap workerEnv, + String executionName, + boolean sandboxed, + boolean cancellable) { + int workRootId = Objects.hash(workerInitCmd, workerInitArgs, workerEnv, sandboxed, cancellable); + String workRootDirName = "work-root_" + executionName + "_" + workRootId; + return workRootsDir.resolve(workRootDirName); + } + + private static ImmutableSortedMap workerFilesWithHashes( + WorkerInputs workerFiles) { + ImmutableSortedMap.Builder workerFileHashBuilder = + ImmutableSortedMap.naturalOrder(); + + for (Path opPath : workerFiles.opToolInputs) { + Path relPath = workerFiles.opRoot.relativize(opPath); + + HashCode toolInputHash = HashCode.fromBytes(workerFiles.digestFor(opPath).toByteArray()); + workerFileHashBuilder.put(relPath, toolInputHash); + } + + return workerFileHashBuilder.build(); + } + + // Even though we hash the toolsRoot-resolved path, it doesn't exist yet. + private static HashCode workerFilesCombinedHash( + Path toolsRoot, SortedMap hashedTools) { + Hasher hasher = Hashing.sha256().newHasher(); + hashedTools.forEach( + (relPath, toolHash) -> { + hasher.putString(toolsRoot.resolve(relPath).toString(), StandardCharsets.UTF_8); + hasher.putBytes(toolHash.asBytes()); + }); + return hasher.hash(); + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/PersistentExecutor.java b/src/main/java/build/buildfarm/worker/persistent/PersistentExecutor.java new file mode 100644 index 0000000000..a96d678a03 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/PersistentExecutor.java @@ -0,0 +1,268 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import build.bazel.remote.execution.v2.ActionResult; +import build.buildfarm.worker.resources.ResourceLimits; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkRequest; +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkResponse; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.rpc.Code; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Map; +import java.util.logging.Level; +import java.util.stream.Collectors; +import lombok.extern.java.Log; +import persistent.bazel.client.WorkerKey; + +/** + * Executes an Action like Executor/DockerExecutor, writing to ActionResult. + * + *

Currently has special code for discriminating between Javac/Scalac, and other persistent + * workers, likely for debugging purposes, but need to revisit. (Can't remember fully since it was + * so long ago!) + */ +@Log +public class PersistentExecutor { + private static final ProtoCoordinator coordinator = + ProtoCoordinator.ofCommonsPool(getMaxWorkersPerKey()); + + // TODO load from config (i.e. {worker_root}/persistent) + public static final Path defaultWorkRootsDir = Paths.get("/tmp/worker/persistent/"); + + public static final String PERSISTENT_WORKER_FLAG = "--persistent_worker"; + + // TODO Revisit hardcoded actions + static final String JAVABUILDER_JAR = + "external/remote_java_tools/java_tools/JavaBuilder_deploy.jar"; + + private static final String SCALAC_EXEC_NAME = "Scalac"; + private static final String JAVAC_EXEC_NAME = "JavaBuilder"; + + // How many workers can exist at once for a given WorkerKey + // There may be multiple WorkerKeys per mnemonic, + // e.g. if builds are run with different tool fingerprints + private static final int defaultMaxWorkersPerKey = 6; + + private static int getMaxWorkersPerKey() { + try { + return Integer.parseInt(System.getenv("BUILDFARM_MAX_WORKERS_PER_KEY")); + } catch (Exception ignored) { + log.info( + "Could not get env var BUILDFARM_MAX_WORKERS_PER_KEY; defaulting to " + + defaultMaxWorkersPerKey); + } + return defaultMaxWorkersPerKey; + } + + /** + * 1) Parses action inputs into tool inputs and request inputs 2) Makes the WorkerKey 3) Loads the + * tool inputs, if needed, into the WorkerKey tool inputs dir 4) Runs the work request on its + * Coordinator, passing it the required context 5) Passes output to the resultBuilder + */ + public static Code runOnPersistentWorker( + String persistentWorkerInitCmd, + WorkFilesContext context, + String operationName, + ImmutableList argsList, + ImmutableMap envVars, + ResourceLimits limits, + Duration timeout, + Path workRootsDir, + ActionResult.Builder resultBuilder) + throws IOException { + //// Pull out persistent worker start command from the overall action request + + log.log(Level.FINE, "executeCommandOnPersistentWorker[" + operationName + "]"); + + ImmutableList initCmd = parseInitCmd(persistentWorkerInitCmd, argsList); + + String executionName = getExecutionName(argsList); + if (executionName.isEmpty()) { + log.log(Level.SEVERE, "Invalid Argument: " + argsList); + return Code.INVALID_ARGUMENT; + } + + // TODO revisit why this was necessary in the first place + // (@wiwa) I believe the reason has to do with JavaBuilder workers not relying on env vars, + // as compared to rules_scala, only reading info from the argslist of each command. + // That would mean the Java worker keys should be invariant to the env vars we see. + ImmutableMap env; + if (executionName.equals(JAVAC_EXEC_NAME)) { + env = ImmutableMap.of(); + } else { + env = envVars; + } + + int requestArgsIdx = initCmd.size(); + ImmutableList workerExecCmd = initCmd; + ImmutableList workerInitArgs = + ImmutableList.builder().add(PERSISTENT_WORKER_FLAG).build(); + ImmutableList requestArgs = argsList.subList(requestArgsIdx, argsList.size()); + + //// Make Key + + WorkerInputs workerFiles = WorkerInputs.from(context, requestArgs); + + Path binary = Paths.get(workerExecCmd.get(0)); + if (!workerFiles.containsTool(binary) && !binary.isAbsolute()) { + throw new IllegalArgumentException( + "Binary wasn't a tool input nor an absolute path: " + binary); + } + + WorkerKey key = + Keymaker.make( + context.opRoot, + workRootsDir, + workerExecCmd, + workerInitArgs, + env, + executionName, + workerFiles); + + coordinator.copyToolInputsIntoWorkerToolRoot(key, workerFiles); + + //// Make request + + // Inputs should be relative paths (if they are from operation root) + ImmutableList.Builder reqInputsBuilder = ImmutableList.builder(); + + for (Map.Entry opInput : workerFiles.allInputs.entrySet()) { + Input relInput = opInput.getValue(); + Path opPath = opInput.getKey(); + if (opPath.startsWith(workerFiles.opRoot)) { + relInput = + relInput.toBuilder().setPath(workerFiles.opRoot.relativize(opPath).toString()).build(); + } + reqInputsBuilder.add(relInput); + } + ImmutableList reqInputs = reqInputsBuilder.build(); + + WorkRequest request = + WorkRequest.newBuilder() + .addAllArguments(requestArgs) + .addAllInputs(reqInputs) + .setRequestId(0) + .build(); + + RequestCtx requestCtx = new RequestCtx(request, context, workerFiles, timeout); + + //// Run request + //// Required file operations (in/out) are the responsibility of the coordinator + + log.log(Level.FINE, "Request with key: " + key); + WorkResponse response; + String stdErr = ""; + try { + ResponseCtx fullResponse = coordinator.runRequest(key, requestCtx); + + response = fullResponse.response; + stdErr = fullResponse.errorString; + } catch (Exception e) { + String debug = + "\n\tRequest.initCmd: " + + workerExecCmd + + "\n\tRequest.initArgs: " + + workerInitArgs + + "\n\tRequest.requestArgs: " + + request.getArgumentsList(); + String msg = "Exception while running request: " + e + debug + "\n\n"; + + log.log(Level.SEVERE, msg, e); + + response = + WorkResponse.newBuilder() + .setOutput(msg) + .setExitCode(-1) // incomplete + .build(); + } + + //// Set results + + String responseOut = response.getOutput(); + log.log(Level.FINE, "WorkResponse.output: " + responseOut); + + int exitCode = response.getExitCode(); + resultBuilder + .setExitCode(exitCode) + .setStdoutRaw(response.getOutputBytes()) + .setStderrRaw(ByteString.copyFrom(stdErr, StandardCharsets.UTF_8)); + + if (exitCode == 0) { + return Code.OK; + } + + log.severe( + "PersistentExecutor.runOnPersistentWorker Failed with code: " + + exitCode + + "\n" + + responseOut + + "\n" + + executionName + + " inputs:\n" + + ImmutableList.copyOf( + reqInputs.stream().map(Input::getPath).collect(Collectors.toList()))); + return Code.FAILED_PRECONDITION; + } + + private static ImmutableList parseInitCmd(String cmdStr, ImmutableList argsList) { + if (!cmdStr.endsWith(PERSISTENT_WORKER_FLAG)) { + throw new IllegalArgumentException( + "Persistent Worker request must contain " + + PERSISTENT_WORKER_FLAG + + "\nGot: parseInitCmd[" + + cmdStr + + "]" + + "\n" + + argsList); + } + + String cmd = + cmdStr.trim().substring(0, (cmdStr.length() - PERSISTENT_WORKER_FLAG.length()) - 1); + + // Parse init command into list of space-separated words, without the persistent worker flag + ImmutableList.Builder initCmdBuilder = ImmutableList.builder(); + for (String s : argsList) { + if (cmd.isEmpty()) { + break; + } + cmd = cmd.substring(s.length()).trim(); + initCmdBuilder.add(s); + } + ImmutableList initCmd = initCmdBuilder.build(); + // Check that the persistent worker init command matches the action command + if (!initCmd.equals(argsList.subList(0, initCmd.size()))) { + throw new IllegalArgumentException("parseInitCmd?![" + initCmd + "]" + "\n" + argsList); + } + return initCmd; + } + + private static String getExecutionName(ImmutableList argsList) { + boolean isScalac = argsList.size() > 1 && argsList.get(0).endsWith("scalac/scalac"); + if (isScalac) { + return SCALAC_EXEC_NAME; + } else if (argsList.contains(JAVABUILDER_JAR)) { + return JAVAC_EXEC_NAME; + } + return "SomeOtherExec"; + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/ProtoCoordinator.java b/src/main/java/build/buildfarm/worker/persistent/ProtoCoordinator.java new file mode 100644 index 0000000000..e3c890225f --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/ProtoCoordinator.java @@ -0,0 +1,284 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import static persistent.bazel.client.PersistentWorker.TOOL_INPUT_SUBDIR; + +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkRequest; +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkResponse; +import com.google.protobuf.Duration; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Level; +import lombok.extern.java.Log; +import persistent.bazel.client.CommonsWorkerPool; +import persistent.bazel.client.PersistentWorker; +import persistent.bazel.client.WorkCoordinator; +import persistent.bazel.client.WorkerKey; +import persistent.bazel.client.WorkerSupervisor; + +/** + * Responsible for: 1) Initializing a new Worker's file environment correctly 2) pre-request + * requirements, e.g. ensuring tool input files 3) post-response requirements, i.e. putting output + * files in the right place + */ +@Log +public class ProtoCoordinator extends WorkCoordinator { + private static final String WORKER_INIT_LOG_SUFFIX = ".initargs.log"; + + private static final ConcurrentHashMap pendingReqs = + new ConcurrentHashMap<>(); + + private static final Timer timeoutScheduler = new Timer("persistent-worker-timeout", true); + + // Synchronize writes to the tool input directory per WorkerKey + // TODO: We only need a Set of WorkerKeys to synchronize on, but no ConcurrentHashSet + private static final ConcurrentHashMap toolInputSyncs = + new ConcurrentHashMap<>(); + + // Enforces locking on the same object given the same WorkerKey + private static WorkerKey keyLock(WorkerKey key) { + return toolInputSyncs.computeIfAbsent(key, k -> k); + } + + public ProtoCoordinator(CommonsWorkerPool workerPool) { + super(workerPool); + } + + public ProtoCoordinator(WorkerSupervisor supervisor, int maxWorkersPerKey) { + super(new CommonsWorkerPool(supervisor, maxWorkersPerKey)); + } + + // We copy tool inputs from the shared WorkerKey tools directory into our worker exec root, + // since there are multiple workers per key, + // and presumably there might be writes to tool inputs? + // Tool inputs which are absolute-paths (e.g. /usr/bin/...) are not affected + public static ProtoCoordinator ofCommonsPool(int maxWorkersPerKey) { + WorkerSupervisor loadToolsOnCreate = + new WorkerSupervisor() { + @Override + public PersistentWorker create(WorkerKey workerKey) throws Exception { + Path keyExecRoot = workerKey.getExecRoot(); + String workerExecDir = getUniqueSubdir(keyExecRoot); + Path workerExecRoot = keyExecRoot.resolve(workerExecDir); + copyToolsIntoWorkerExecRoot(workerKey, workerExecRoot); + + Path initArgsLogFile = workerExecRoot.resolve(workerExecDir + WORKER_INIT_LOG_SUFFIX); + if (!Files.exists(initArgsLogFile)) { + StringBuilder initArgs = new StringBuilder(); + for (String s : workerKey.getCmd()) { + initArgs.append(s); + initArgs.append('\n'); + } + for (String s : workerKey.getArgs()) { + initArgs.append(s); + initArgs.append('\n'); + } + + Files.write(initArgsLogFile, initArgs.toString().getBytes()); + } + + return new PersistentWorker(workerKey, workerExecDir); + } + }; + return new ProtoCoordinator(loadToolsOnCreate, maxWorkersPerKey); + } + + public void copyToolInputsIntoWorkerToolRoot(WorkerKey key, WorkerInputs workerFiles) + throws IOException { + WorkerKey lock = keyLock(key); + synchronized (lock) { + try { + // Move tool inputs as needed + Path workToolRoot = key.getExecRoot().resolve(PersistentWorker.TOOL_INPUT_SUBDIR); + for (Path opToolPath : workerFiles.opToolInputs) { + Path workToolPath = workerFiles.relativizeInput(workToolRoot, opToolPath); + if (!Files.exists(workToolPath)) { + workerFiles.copyInputFile(opToolPath, workToolPath); + } + } + } finally { + toolInputSyncs.remove(key); + } + } + } + + private static String getUniqueSubdir(Path workRoot) { + String uuid = UUID.randomUUID().toString(); + while (Files.exists(workRoot.resolve(uuid))) { + uuid = UUID.randomUUID().toString(); + } + return uuid; + } + + // copyToolInputsIntoWorkerToolRoot() should have been called before this. + private static void copyToolsIntoWorkerExecRoot(WorkerKey key, Path workerExecRoot) + throws IOException { + log.log(Level.FINE, "loadToolsIntoWorkerRoot() into: " + workerExecRoot); + + Path toolInputRoot = key.getExecRoot().resolve(TOOL_INPUT_SUBDIR); + for (Path relPath : key.getWorkerFilesWithHashes().keySet()) { + Path toolInputPath = toolInputRoot.resolve(relPath); + Path execRootPath = workerExecRoot.resolve(relPath); + + FileAccessUtils.copyFile(toolInputPath, execRootPath); + } + } + + @Override + public WorkRequest preWorkInit(WorkerKey key, RequestCtx request, PersistentWorker worker) + throws IOException { + PersistentWorker pendingWorker = pendingReqs.putIfAbsent(request, worker); + // null means that this request was not in pendingReqs (the expected case) + if (pendingWorker != null) { + if (pendingWorker != worker) { + throw new IllegalArgumentException( + "Already have a persistent worker on the job: " + request.request); + } else { + throw new IllegalArgumentException( + "Got the same request for the same worker while it's running: " + request.request); + } + } + startTimeoutTimer(request); + + // Symlinking should hypothetically be faster+leaner than copying inputs, but it's buggy. + copyNontoolInputs(request.workerInputs, worker.getExecRoot()); + + return request.request; + } + + // After the worker has finished, output files need to be visible in the operation directory + @Override + public ResponseCtx postWorkCleanup( + WorkResponse response, PersistentWorker worker, RequestCtx request) throws IOException { + pendingReqs.remove(request); + + if (response == null) { + throw new RuntimeException("postWorkCleanup: WorkResponse was null!"); + } + + if (response.getExitCode() == 0) { + try { + Path workerExecRoot = worker.getExecRoot(); + moveOutputsToOperationRoot(request.filesContext, workerExecRoot); + cleanUpNontoolInputs(request.workerInputs, workerExecRoot); + } catch (IOException e) { + throw logBadCleanup(request, e); + } + } + + return new ResponseCtx(response, worker.flushStdErr()); + } + + private IOException logBadCleanup(RequestCtx request, IOException e) { + WorkFilesContext context = request.filesContext; + + StringBuilder sb = new StringBuilder(122); + sb.append("Output files failure debug for request with args<") + .append(request.request.getArgumentsList()) + .append(">:\ngetOutputPathsList:\n") + .append(context.outputPaths) + .append("getOutputFilesList:\n") + .append(context.outputFiles) + .append("getOutputDirectoriesList:\n") + .append(context.outputDirectories); + + log.log(Level.SEVERE, sb.toString(), e); + + return new IOException("Response was OK but failed on postWorkCleanup", e); + } + + private void copyNontoolInputs(WorkerInputs workerInputs, Path workerExecRoot) + throws IOException { + for (Path opPath : workerInputs.allInputs.keySet()) { + if (!workerInputs.allToolInputs.contains(opPath)) { + Path execPath = workerInputs.relativizeInput(workerExecRoot, opPath); + workerInputs.copyInputFile(opPath, execPath); + } + } + } + + // Make outputs visible to the rest of Worker machinery + // see DockerExecutor::copyOutputsOutOfContainer + void moveOutputsToOperationRoot(WorkFilesContext context, Path workerExecRoot) + throws IOException { + Path opRoot = context.opRoot; + + for (String outputDir : context.outputDirectories) { + Path outputDirPath = Paths.get(outputDir); + Files.createDirectories(outputDirPath); + } + + for (String relOutput : context.outputFiles) { + Path execOutputPath = workerExecRoot.resolve(relOutput); + Path opOutputPath = opRoot.resolve(relOutput); + + FileAccessUtils.moveFile(execOutputPath, opOutputPath); + } + } + + private void cleanUpNontoolInputs(WorkerInputs workerInputs, Path workerExecRoot) + throws IOException { + for (Path opPath : workerInputs.allInputs.keySet()) { + if (!workerInputs.allToolInputs.contains(opPath)) { + workerInputs.deleteInputFileIfExists(workerExecRoot, opPath); + } + } + } + + private void startTimeoutTimer(RequestCtx request) { + Duration timeout = request.timeout; + if (timeout != null) { + long timeoutNanos = timeout.getSeconds() * 1000000000L + timeout.getNanos(); + timeoutScheduler.schedule(new RequestTimeoutHandler(request), timeoutNanos); + } + } + + private class RequestTimeoutHandler extends TimerTask { + private final RequestCtx request; + + private RequestTimeoutHandler(RequestCtx request) { + this.request = request; + } + + @Override + public void run() { + onTimeout(this.request, pendingReqs.get(this.request)); + } + } + + private void onTimeout(RequestCtx request, PersistentWorker worker) { + if (worker != null) { + log.severe("Persistent Worker timed out on request: " + request.request); + try { + this.workerPool.invalidateObject(worker.getKey(), worker); + } catch (Exception e) { + log.severe( + "Tried to invalidate worker for request:\n" + + request + + "\n\tbut got: " + + e + + "\n\nCalling worker.destroy() and moving on."); + worker.destroy(); + } + } + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/RequestCtx.java b/src/main/java/build/buildfarm/worker/persistent/RequestCtx.java new file mode 100644 index 0000000000..36f42b2f12 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/RequestCtx.java @@ -0,0 +1,42 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkRequest; +import com.google.protobuf.Duration; +import persistent.common.CtxAround; + +public class RequestCtx implements CtxAround { + public final WorkRequest request; + + public final WorkFilesContext filesContext; + + public final WorkerInputs workerInputs; + + public final Duration timeout; + + public RequestCtx( + WorkRequest request, WorkFilesContext ctx, WorkerInputs workFiles, Duration timeout) { + this.request = request; + this.filesContext = ctx; + this.workerInputs = workFiles; + this.timeout = timeout; + } + + @Override + public WorkRequest get() { + return request; + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/ResponseCtx.java b/src/main/java/build/buildfarm/worker/persistent/ResponseCtx.java new file mode 100644 index 0000000000..0ff6edcdae --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/ResponseCtx.java @@ -0,0 +1,34 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import com.google.devtools.build.lib.worker.WorkerProtocol.WorkResponse; +import persistent.common.CtxAround; + +public class ResponseCtx implements CtxAround { + public final WorkResponse response; + + public final String errorString; + + public ResponseCtx(WorkResponse response, String errorString) { + this.response = response; + this.errorString = errorString; + } + + @Override + public WorkResponse get() { + return response; + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/WorkFilesContext.java b/src/main/java/build/buildfarm/worker/persistent/WorkFilesContext.java new file mode 100644 index 0000000000..4aefc7f290 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/WorkFilesContext.java @@ -0,0 +1,85 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import build.bazel.remote.execution.v2.Command; +import build.buildfarm.v1test.Tree; +import build.buildfarm.worker.util.InputsIndexer; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import java.nio.file.Path; + +/** POJO/data class grouping all the input/output file requirements for persistent workers */ +public class WorkFilesContext { + public final Path opRoot; + + public final Tree execTree; + + public final ImmutableList outputPaths; + + public final ImmutableList outputFiles; + + public final ImmutableList outputDirectories; + + private final InputsIndexer inputsIndexer; + + private ImmutableMap pathInputs = null; + + private ImmutableMap toolInputs = null; + + public WorkFilesContext( + Path opRoot, + Tree execTree, + ImmutableList outputPaths, + ImmutableList outputFiles, + ImmutableList outputDirectories) { + this.opRoot = opRoot.toAbsolutePath(); + this.execTree = execTree; + this.outputPaths = outputPaths; + this.outputFiles = outputFiles; + this.outputDirectories = outputDirectories; + + this.inputsIndexer = new InputsIndexer(execTree, this.opRoot); + } + + public static WorkFilesContext fromContext(Path opRoot, Tree inputsTree, Command opCommand) { + return new WorkFilesContext( + opRoot, + inputsTree, + ImmutableList.copyOf(opCommand.getOutputPathsList()), + ImmutableList.copyOf(opCommand.getOutputFilesList()), + ImmutableList.copyOf(opCommand.getOutputDirectoriesList())); + } + + // Paths are absolute paths from the opRoot; same as the Input.getPath(); + public ImmutableMap getPathInputs() { + synchronized (this) { + if (pathInputs == null) { + pathInputs = inputsIndexer.getAllInputs(); + } + } + return pathInputs; + } + + public ImmutableMap getToolInputs() { + synchronized (this) { + if (toolInputs == null) { + toolInputs = inputsIndexer.getToolInputs(); + } + } + return toolInputs; + } +} diff --git a/src/main/java/build/buildfarm/worker/persistent/WorkerInputs.java b/src/main/java/build/buildfarm/worker/persistent/WorkerInputs.java new file mode 100644 index 0000000000..de731b9d83 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/persistent/WorkerInputs.java @@ -0,0 +1,117 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; +import lombok.extern.java.Log; + +@Log +public class WorkerInputs { + public final Path opRoot; + // Some tool inputs are not under opRoot + public final ImmutableSet absToolInputs; + // The Paths in these collections should all be absolute and under opRoot + public final ImmutableSet opToolInputs; + public final ImmutableMap allInputs; + + public final ImmutableSet allToolInputs; + + public WorkerInputs( + Path opRoot, + ImmutableSet absToolInputs, + ImmutableSet opToolInputs, + ImmutableMap allInputs) { + this.opRoot = opRoot; + this.absToolInputs = absToolInputs; + this.opToolInputs = opToolInputs; + this.allInputs = allInputs; + + this.allToolInputs = + ImmutableSet.builder().addAll(absToolInputs).addAll(opToolInputs).build(); + + // Currently not a concern but could be in the future + for (Path tool : opToolInputs) { + if (!allInputs.containsKey(tool)) { + String msg = "Tool not found in inputs: " + tool; + log.severe(msg); + throw new IllegalArgumentException(msg); + } + } + } + + public boolean containsTool(Path tool) { + return allToolInputs.contains(opRoot.resolve(tool)); + } + + public Path relativizeInput(Path newRoot, Path input) { + return newRoot.resolve(opRoot.relativize(input)); + } + + public void copyInputFile(Path from, Path to) throws IOException { + checkFileIsInput("copyInputFile()", from); + FileAccessUtils.copyFile(from, to); + } + + public void deleteInputFileIfExists(Path workerExecRoot, Path opPathInput) throws IOException { + checkFileIsInput("deleteInputFile()", opPathInput); + Path execPathInput = relativizeInput(workerExecRoot, opPathInput); + FileAccessUtils.deleteFileIfExists(execPathInput); + } + + private void checkFileIsInput(String operation, Path file) { + if (!allInputs.containsKey(file)) { + throw new IllegalArgumentException(operation + " called on non-input file: " + file); + } + } + + public ByteString digestFor(Path inputPath) { + Input input = allInputs.get(inputPath); + if (input == null) { + throw new IllegalArgumentException("digestFor() called on non-input file: " + inputPath); + } + return input.getDigest(); + } + + public static WorkerInputs from(WorkFilesContext workFilesContext, List reqArgs) { + ImmutableMap pathInputs = workFilesContext.getPathInputs(); + + ImmutableSet toolsAbsPaths = workFilesContext.getToolInputs().keySet(); + + ImmutableSet toolInputs = + ImmutableSet.copyOf( + toolsAbsPaths.stream().filter(p -> p.startsWith(workFilesContext.opRoot)).iterator()); + ImmutableSet absToolInputs = + ImmutableSet.copyOf(toolsAbsPaths.stream().filter(p -> !toolInputs.contains(p)).iterator()); + + String inputsDebugMsg = + "ParsedWorkFiles:" + + "\nallInputs: " + + pathInputs.keySet() + + "\ntoolInputs: " + + toolInputs + + "\nabsToolInputs: " + + absToolInputs; + + log.fine(inputsDebugMsg); + + return new WorkerInputs(workFilesContext.opRoot, absToolInputs, toolInputs, pathInputs); + } +} diff --git a/src/main/java/build/buildfarm/worker/resources/ExecutionPropertiesParser.java b/src/main/java/build/buildfarm/worker/resources/ExecutionPropertiesParser.java index 183c48da18..2c219589fb 100644 --- a/src/main/java/build/buildfarm/worker/resources/ExecutionPropertiesParser.java +++ b/src/main/java/build/buildfarm/worker/resources/ExecutionPropertiesParser.java @@ -67,6 +67,12 @@ public static ResourceLimits Parse(Command command) { parser.put( ExecutionProperties.DEBUG_TESTS_ONLY, ExecutionPropertiesParser::storeDebugTestsOnly); parser.put(ExecutionProperties.DEBUG_TARGET, ExecutionPropertiesParser::storeDebugTarget); + parser.put( + ExecutionProperties.PERSISTENT_WORKER_KEY, + ExecutionPropertiesParser::storePersistentWorkerKey); + parser.put( + ExecutionProperties.PERSISTENT_WORKER_COMMAND, + ExecutionPropertiesParser::storePersistentWorkerCommand); ResourceLimits limits = new ResourceLimits(); command @@ -327,6 +333,32 @@ private static void storeDebugTarget(ResourceLimits limits, Property property) { describeChange(limits.description, "debug target", property.getValue(), property); } + /** + * @brief Stores persistentWorkerKey + * @details Parses and stores a String. + * @param limits Current limits to apply changes to. + * @param property The property to store. + */ + private static void storePersistentWorkerKey(ResourceLimits limits, Property property) { + limits.persistentWorkerKey = property.getValue(); + ArrayList xs = new ArrayList<>(); + xs.add("Hash of tool inputs for remote persistent workers"); + describeChange(xs, "persistentWorkerKey(hash of tool inputs)", property.getValue(), property); + } + + /** + * @brief Stores persistentWorkerCommand + * @details Parses and stores a String. + * @param limits Current limits to apply changes to. + * @param property The property to store. + */ + private static void storePersistentWorkerCommand(ResourceLimits limits, Property property) { + limits.persistentWorkerCommand = property.getValue(); + ArrayList xs = new ArrayList<>(); + xs.add("persistentWorkerCommand"); + describeChange(xs, "persistentWorkerCommand", property.getValue(), property); + } + /** * @brief Store the description of the change made. * @details Adds a debug message on the resource change. diff --git a/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java b/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java index e3ddc4485b..e20f2c9c27 100644 --- a/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java +++ b/src/main/java/build/buildfarm/worker/resources/ResourceLimits.java @@ -163,4 +163,17 @@ public class ResourceLimits { * @details This can be used to debug execution behavior. */ public final ArrayList description = new ArrayList<>(); + /** + * @field persistentWorkerKey + * @brief Hash of tool inputs for remote persistent workers + * @details See https://github.com/bazelbuild/bazel/issues/10091 + */ + public String persistentWorkerKey = ""; + + /** + * @field persistentWorkerCommand + * @brief Command string to start the persistent worker + * @details See https://github.com/bazelbuild/bazel/issues/10091 + */ + public String persistentWorkerCommand = ""; } diff --git a/src/main/java/build/buildfarm/worker/util/BUILD b/src/main/java/build/buildfarm/worker/util/BUILD new file mode 100644 index 0000000000..a92360d732 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/util/BUILD @@ -0,0 +1,24 @@ +java_library( + name = "util", + srcs = glob(["*.java"]), + visibility = ["//visibility:public"], + deps = [ + "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/instance/stub", + "//src/main/java/build/buildfarm/worker/resources", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "@maven//:com_google_code_gson_gson", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:commons_io_commons_io", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_netty", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_grpc_grpc_stub", + ], +) diff --git a/src/main/java/build/buildfarm/worker/util/InputsIndexer.java b/src/main/java/build/buildfarm/worker/util/InputsIndexer.java new file mode 100644 index 0000000000..84497b04a0 --- /dev/null +++ b/src/main/java/build/buildfarm/worker/util/InputsIndexer.java @@ -0,0 +1,141 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.util; + +import build.bazel.remote.execution.v2.Digest; +import build.bazel.remote.execution.v2.Directory; +import build.bazel.remote.execution.v2.FileNode; +import build.bazel.remote.execution.v2.NodeProperty; +import build.buildfarm.common.ProxyDirectoriesIndex; +import build.buildfarm.v1test.Tree; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import java.nio.file.FileSystem; +import java.nio.file.Path; +import java.util.Map; + +/** + * Organizes action Inputs into files, extracting their paths, and differentiates tool inputs (e.g. + * JavaBuilder, Scalac, etc.) + * + *

Indexes (and partitions) Inputs from an action's Merkle Tree. + */ +public class InputsIndexer { + // See: https://github.com/bazelbuild/bazel/issues/10091 + public static final String BAZEL_TOOL_INPUT_MARKER = "bazel_tool_input"; + + final Tree tree; + final Map proxyDirs; + + final FileSystem fs; + + final Path opRoot; + + ImmutableMap files = null; + ImmutableMap absPathInputs = null; + ImmutableMap toolInputs = null; + + public InputsIndexer(Tree tree, Path opRoot) { + this.tree = tree; + this.proxyDirs = new ProxyDirectoriesIndex(tree.getDirectoriesMap()); + this.opRoot = opRoot; + this.fs = opRoot.getFileSystem(); + } + + // https://stackoverflow.com/questions/22611919/why-do-i-get-providermismatchexception-when-i-try-to-relativize-a-path-agains + public Path pathTransform(final Path path) { + Path ret = fs.getPath(path.isAbsolute() ? fs.getSeparator() : ""); + for (final Path component : path) ret = ret.resolve(component.getFileName().toString()); + return ret; + } + + public ImmutableMap getAllInputs() { + if (absPathInputs == null) { + ImmutableMap relFiles = getAllFiles(); + ImmutableMap.Builder inputs = ImmutableMap.builder(); + + for (Map.Entry pf : relFiles.entrySet()) { + Path absPath = this.opRoot.resolve(pf.getKey()).normalize(); + inputs.put(absPath, inputFromFile(absPath, pf.getValue())); + } + absPathInputs = inputs.build(); + } + return absPathInputs; + } + + public ImmutableMap getToolInputs() { + if (toolInputs == null) { + ImmutableMap relFiles = getAllFiles(); + ImmutableMap.Builder inputs = ImmutableMap.builder(); + + for (Map.Entry pf : relFiles.entrySet()) { + FileNode fn = pf.getValue(); + if (isToolInput(fn)) { + Path absPath = this.opRoot.resolve(pf.getKey()); + inputs.put(absPath, inputFromFile(absPath, fn)); + } + } + toolInputs = inputs.build(); + } + return toolInputs; + } + + private ImmutableMap getAllFiles() { + if (files == null) { + ImmutableMap.Builder accumulator = ImmutableMap.builder(); + Directory rootDir = proxyDirs.get(tree.getRootDigest()); + + Path fsRelative = fs.getPath("."); + files = getFilesFromDir(fsRelative, rootDir, accumulator).build(); + } + return files; + } + + private Input inputFromFile(Path absPath, FileNode fileNode) { + return Input.newBuilder() + .setPath(absPath.toString()) + .setDigest(fileNode.getDigest().getHashBytes()) + .build(); + } + + private ImmutableMap.Builder getFilesFromDir( + Path dirPath, Directory dir, ImmutableMap.Builder acc) { + dir.getFilesList() + .forEach( + fileNode -> { + Path path = dirPath.resolve(fileNode.getName()).normalize(); + acc.put(path, fileNode); + }); + + // Recurse into subdirectories + dir.getDirectoriesList() + .forEach( + dirNode -> + getFilesFromDir( + dirPath.resolve(dirNode.getName()), + this.proxyDirs.get(dirNode.getDigest()), + acc)); + return acc; + } + + private static boolean isToolInput(FileNode fileNode) { + for (NodeProperty prop : fileNode.getNodeProperties().getPropertiesList()) { + if (prop.getName().equals(BAZEL_TOOL_INPUT_MARKER)) { + return true; + } + } + return false; + } +} diff --git a/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java b/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java index caa69536c1..0b6f3d2020 100644 --- a/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java +++ b/src/test/java/build/buildfarm/instance/shard/JedisCasWorkerMapTest.java @@ -20,7 +20,6 @@ @RunWith(JUnit4.class) public class JedisCasWorkerMapTest { - private static final String CAS_PREFIX = "ContentAddressableStorage"; private RedisServer redisServer; diff --git a/src/test/java/build/buildfarm/worker/persistent/BUILD b/src/test/java/build/buildfarm/worker/persistent/BUILD new file mode 100644 index 0000000000..0520097ff6 --- /dev/null +++ b/src/test/java/build/buildfarm/worker/persistent/BUILD @@ -0,0 +1,36 @@ +java_test( + name = "tests", + size = "small", + srcs = glob(["*.java"]), + test_class = "build.buildfarm.AllTests", + deps = [ + "//persistentworkers/src/main/java/persistent/bazel:bazel-persistent-workers", + "//persistentworkers/src/main/java/persistent/common:persistent-common", + "//persistentworkers/src/main/java/persistent/common/util", + "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/instance", + "//src/main/java/build/buildfarm/worker", + "//src/main/java/build/buildfarm/worker/persistent", + "//src/main/java/build/buildfarm/worker/resources", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "//src/test/java/build/buildfarm/worker/util:worker_test_utils", + "@googleapis//:google_rpc_code_java_proto", + "@maven//:com_github_jnr_jnr_constants", + "@maven//:com_github_jnr_jnr_ffi", + "@maven//:com_github_serceman_jnr_fuse", + "@maven//:com_google_guava_guava", + "@maven//:com_google_jimfs_jimfs", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:org_mockito_mockito_core", + "@maven//:org_projectlombok_lombok", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) diff --git a/src/test/java/build/buildfarm/worker/persistent/ProtoCoordinatorTest.java b/src/test/java/build/buildfarm/worker/persistent/ProtoCoordinatorTest.java new file mode 100644 index 0000000000..908a1746e4 --- /dev/null +++ b/src/test/java/build/buildfarm/worker/persistent/ProtoCoordinatorTest.java @@ -0,0 +1,132 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.persistent; + +import build.bazel.remote.execution.v2.Command; +import build.buildfarm.v1test.Tree; +import build.buildfarm.worker.util.WorkerTestUtils; +import build.buildfarm.worker.util.WorkerTestUtils.TreeFile; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.google.common.jimfs.Configuration; +import com.google.common.jimfs.Jimfs; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import persistent.bazel.client.PersistentWorker; +import persistent.bazel.client.WorkerKey; + +@RunWith(JUnit4.class) +public class ProtoCoordinatorTest { + private WorkerKey makeWorkerKey( + WorkFilesContext ctx, WorkerInputs workerFiles, Path workRootsDir) { + return Keymaker.make( + ctx.opRoot, + workRootsDir, + ImmutableList.of("workerExecCmd"), + ImmutableList.of("workerInitArgs"), + ImmutableMap.of(), + "executionName", + workerFiles); + } + + private Path rootDir = null; + + public Path jimFsRoot() { + if (rootDir == null) { + rootDir = + Iterables.getFirst( + Jimfs.newFileSystem( + Configuration.unix() + .toBuilder() + .setAttributeViews("basic", "owner", "posix", "unix") + .build()) + .getRootDirectories(), + null); + } + return rootDir; + } + + @Test + public void testProtoCoordinator() throws Exception { + ProtoCoordinator pc = ProtoCoordinator.ofCommonsPool(4); + + Path fsRoot = jimFsRoot(); + Path opRoot = fsRoot.resolve("opRoot"); + assert (Files.notExists(opRoot)); + Files.createDirectory(opRoot); + + assert (Files.exists(opRoot)); + + String treeRootDir = opRoot.toString(); + List fileInputs = + ImmutableList.of( + new TreeFile("file_1", "file contents 1"), + new TreeFile("subdir/subdir_file_2", "file contents 2"), + new TreeFile("tools_dir/tool_file", "tool file contents", true), + new TreeFile("tools_dir/tool_file_2", "tool file contents 2", true)); + + Tree tree = WorkerTestUtils.makeTree(treeRootDir, fileInputs); + + Command command = WorkerTestUtils.makeCommand(); + WorkFilesContext ctx = WorkFilesContext.fromContext(opRoot, tree, command); + ImmutableList requestArgs = ImmutableList.of("reqArg1"); + + WorkerInputs workerFiles = WorkerInputs.from(ctx, requestArgs); + + for (Map.Entry entry : workerFiles.allInputs.entrySet()) { + Path file = entry.getKey(); + Files.createDirectories(file.getParent()); + Files.createFile(file); + } + + WorkerKey key = makeWorkerKey(ctx, workerFiles, fsRoot.resolve("workRootsDir")); + + Path workRoot = key.getExecRoot(); + Path toolsRoot = workRoot.resolve(PersistentWorker.TOOL_INPUT_SUBDIR); + + pc.copyToolInputsIntoWorkerToolRoot(key, workerFiles); + + assert Files.exists(workRoot); + List expectedToolInputs = new ArrayList<>(); + for (TreeFile file : fileInputs) { + if (file.isTool) { + expectedToolInputs.add(toolsRoot.resolve(file.path)); + } + } + WorkerTestUtils.assertFilesExistExactly(workRoot, expectedToolInputs); + + List expectedOpRootFiles = new ArrayList<>(); + + // Check that we move specified output files (assuming they exist) + for (String pathStr : ctx.outputFiles) { + Path file = workRoot.resolve(pathStr); + Files.createDirectories(file.getParent()); + Files.createFile(file); + expectedOpRootFiles.add(opRoot.resolve(pathStr)); + } + + pc.moveOutputsToOperationRoot(ctx, workRoot); + + WorkerTestUtils.assertFilesExistExactly(opRoot, expectedOpRootFiles); + } +} diff --git a/src/test/java/build/buildfarm/worker/util/BUILD b/src/test/java/build/buildfarm/worker/util/BUILD new file mode 100644 index 0000000000..c0d0bbe46f --- /dev/null +++ b/src/test/java/build/buildfarm/worker/util/BUILD @@ -0,0 +1,61 @@ +java_library( + name = "worker_test_utils", + srcs = ["WorkerTestUtils.java"], + visibility = ["//src/test/java:__subpackages__"], + deps = [ + "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "//src/main/java/build/buildfarm/cas", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/worker/util", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "@googleapis//:google_rpc_code_java_proto", + "@maven//:com_github_jnr_jnr_constants", + "@maven//:com_github_jnr_jnr_ffi", + "@maven//:com_github_serceman_jnr_fuse", + "@maven//:com_google_guava_guava", + "@maven//:com_google_jimfs_jimfs", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:org_mockito_mockito_core", + "@maven//:org_projectlombok_lombok", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + +java_test( + name = "tests", + size = "small", + srcs = glob(["*Test.java"]), + test_class = "build.buildfarm.AllTests", + deps = [ + ":worker_test_utils", + "//persistentworkers/src/main/protobuf:worker_protocol_java_proto", + "//src/main/java/build/buildfarm/cas", + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/worker/util", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//src/test/java/build/buildfarm:test_runner", + "@googleapis//:google_rpc_code_java_proto", + "@maven//:com_github_jnr_jnr_constants", + "@maven//:com_github_jnr_jnr_ffi", + "@maven//:com_github_serceman_jnr_fuse", + "@maven//:com_google_guava_guava", + "@maven//:com_google_jimfs_jimfs", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_truth_truth", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_core", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:org_mockito_mockito_core", + "@maven//:org_projectlombok_lombok", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) diff --git a/src/test/java/build/buildfarm/worker/util/InputsIndexerTest.java b/src/test/java/build/buildfarm/worker/util/InputsIndexerTest.java new file mode 100644 index 0000000000..954eb61e4e --- /dev/null +++ b/src/test/java/build/buildfarm/worker/util/InputsIndexerTest.java @@ -0,0 +1,184 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.util; + +import static build.buildfarm.worker.util.InputsIndexer.BAZEL_TOOL_INPUT_MARKER; +import static com.google.common.truth.Truth.assertThat; + +import build.bazel.remote.execution.v2.Digest; +import build.bazel.remote.execution.v2.Directory; +import build.bazel.remote.execution.v2.DirectoryNode; +import build.bazel.remote.execution.v2.FileNode; +import build.bazel.remote.execution.v2.NodeProperties; +import build.bazel.remote.execution.v2.NodeProperty; +import build.buildfarm.common.DigestUtil; +import build.buildfarm.v1test.Tree; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import com.google.protobuf.ByteString; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Collectors; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +// TODO: use WorkerTestUtils.makeTree +@RunWith(JUnit4.class) +public class InputsIndexerTest { + private final DigestUtil DIGEST_UTIL = new DigestUtil(DigestUtil.HashFunction.SHA256); + + @Test + public void basicEmptyTree() { + Tree emptyTree = Tree.newBuilder().build(); + InputsIndexer indexer = new InputsIndexer(emptyTree, Paths.get(".")); + assertThat(indexer.tree).isEqualTo(emptyTree); + } + + @Test + public void canGetRootDir() { + Tree.Builder treeBuilder = Tree.newBuilder(); + + Directory rootDir = Directory.getDefaultInstance(); + Digest rootDirDigest = addDirToTree(treeBuilder, "my_root_dir", rootDir); + treeBuilder.setRootDigest(rootDirDigest); + + Path arbitraryOpRoot = Paths.get("."); + + InputsIndexer indexer = new InputsIndexer(treeBuilder.build(), arbitraryOpRoot); + assertThat(indexer.proxyDirs.get(rootDirDigest)).isEqualTo(rootDir); + assertThat(indexer.getAllInputs().size()).isEqualTo(0); + } + + @Test + public void rootDirWithFiles() { + Tree.Builder treeBuilder = Tree.newBuilder(); + + FileNode myfile = + makeFileNode("my_file", "my file contents", NodeProperties.getDefaultInstance()); + Directory rootDir = Directory.newBuilder().addFiles(myfile).build(); + Digest rootDirDigest = addDirToTree(treeBuilder, "my_root_dir", rootDir); + treeBuilder.setRootDigest(rootDirDigest); + + Path arbitraryOpRoot = Paths.get("asdf"); + InputsIndexer indexer = new InputsIndexer(treeBuilder.build(), arbitraryOpRoot); + assertThat(indexer.proxyDirs.get(rootDirDigest)).isEqualTo(rootDir); + + Input myfileInput = makeInput(arbitraryOpRoot, myfile); + + ImmutableMap expectedInputs = + ImmutableMap.of(Paths.get(myfileInput.getPath()), myfileInput); + + assertThat(indexer.getAllInputs()).isEqualTo(expectedInputs); + } + + @Test + public void canRecurseAndDistinguishToolInputs() { + Tree.Builder treeBuilder = Tree.newBuilder(); + + FileNode myfile = + makeFileNode("my_file", "my file contents", NodeProperties.getDefaultInstance()); + FileNode subdirfile = + makeFileNode("subdir_file", "my subdir file contents", NodeProperties.getDefaultInstance()); + FileNode toolfile = + makeFileNode( + "tool_file", + "my tool file contents", + makeNodeProperties(ImmutableMap.of(BAZEL_TOOL_INPUT_MARKER, "value doesn't matter"))); + + Directory subDir = Directory.newBuilder().addFiles(subdirfile).build(); + String subDirName = "my_sub_dir"; + Digest subDirDigest = addDirToTree(treeBuilder, subDirName, subDir); + + Directory rootDir = + Directory.newBuilder() + .addFiles(myfile) + .addFiles(toolfile) + .addDirectories(makeDirNode(subDirName, subDirDigest)) + .build(); + + Digest rootDirDigest = addDirToTree(treeBuilder, "my_root_dir", rootDir); + treeBuilder.setRootDigest(rootDirDigest); + + Path arbitraryOpRoot = Paths.get("asdf"); + + InputsIndexer indexer = new InputsIndexer(treeBuilder.build(), arbitraryOpRoot); + assertThat(indexer.proxyDirs.get(rootDirDigest)).isEqualTo(rootDir); + assertThat(indexer.proxyDirs.size()).isEqualTo(2); + + Input myfileInput = makeInput(arbitraryOpRoot, myfile); + Input subdirfileInput = makeInput(arbitraryOpRoot.resolve(subDirName), subdirfile); + Input toolfileInput = makeInput(arbitraryOpRoot, toolfile); + + ImmutableMap nonToolInputs = + ImmutableMap.of( + Paths.get(myfileInput.getPath()), + myfileInput, + Paths.get(subdirfileInput.getPath()), + subdirfileInput); + ImmutableMap toolInputs = + ImmutableMap.of(Paths.get(toolfileInput.getPath()), toolfileInput); + ImmutableMap allInputs = + ImmutableMap.builder().putAll(nonToolInputs).putAll(toolInputs).build(); + + assertThat(indexer.getAllInputs()).isEqualTo(allInputs); + assertThat(indexer.getAllInputs().size()).isEqualTo(3); + assertThat(indexer.getToolInputs()).isEqualTo(toolInputs); + } + + Digest addDirToTree(Tree.Builder treeBuilder, String dirname, Directory dir) { + ByteString dirnameBytes = ByteString.copyFromUtf8(dirname); + Digest digest = DIGEST_UTIL.compute(dirnameBytes); + String hash = digest.getHash(); + treeBuilder.putDirectories(hash, dir); + return digest; + } + + FileNode makeFileNode(String filename, String content, NodeProperties nodeProperties) { + return FileNode.newBuilder() + .setName(filename) + .setDigest(DIGEST_UTIL.compute(ByteString.copyFromUtf8(content))) + .setIsExecutable(false) + .setNodeProperties(nodeProperties) + .build(); + } + + DirectoryNode makeDirNode(String dirname, Digest dirDigest) { + // Pretty sure we don't need the actual hash for our testing purposes + return DirectoryNode.newBuilder().setName(dirname).setDigest(dirDigest).build(); + } + + NodeProperties makeNodeProperties(ImmutableMap props) { + return NodeProperties.newBuilder() + .addAllProperties( + props.entrySet().stream() + .map( + kv -> + NodeProperty.newBuilder() + .setName(kv.getKey()) + .setValue(kv.getValue()) + .build()) + .collect(Collectors.toList())) + .build(); + } + + Input makeInput(Path fileDir, FileNode file) { + Path fileNodePath = fileDir.resolve(file.getName()); + return Input.newBuilder() + .setPath(fileNodePath.toString()) + .setDigest(file.getDigest().getHashBytes()) + .build(); + } +} diff --git a/src/test/java/build/buildfarm/worker/util/WorkerTestUtils.java b/src/test/java/build/buildfarm/worker/util/WorkerTestUtils.java new file mode 100644 index 0000000000..dbaeca5c9f --- /dev/null +++ b/src/test/java/build/buildfarm/worker/util/WorkerTestUtils.java @@ -0,0 +1,226 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.util; + +import static build.buildfarm.worker.util.InputsIndexer.BAZEL_TOOL_INPUT_MARKER; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; + +import build.bazel.remote.execution.v2.Command; +import build.bazel.remote.execution.v2.Digest; +import build.bazel.remote.execution.v2.Directory; +import build.bazel.remote.execution.v2.DirectoryNode; +import build.bazel.remote.execution.v2.FileNode; +import build.bazel.remote.execution.v2.NodeProperties; +import build.bazel.remote.execution.v2.NodeProperty; +import build.buildfarm.common.DigestUtil; +import build.buildfarm.v1test.Tree; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.worker.WorkerProtocol.Input; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.FileVisitor; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class WorkerTestUtils { + public static final DigestUtil DIGEST_UTIL = new DigestUtil(DigestUtil.HashFunction.SHA256); + + public static FileNode makeFileNode( + String filename, String content, NodeProperties nodeProperties) { + return FileNode.newBuilder() + .setName(filename) + .setDigest(DIGEST_UTIL.compute(ByteString.copyFromUtf8(content))) + .setIsExecutable(false) + .setNodeProperties(nodeProperties) + .build(); + } + + public static DirectoryNode makeDirNode(String dirname, Digest dirDigest) { + // Pretty sure we don't need the actual hash for our testing purposes + return DirectoryNode.newBuilder().setName(dirname).setDigest(dirDigest).build(); + } + + public static Digest addDirToTree(Tree.Builder treeBuilder, String dirname, Directory dir) { + ByteString dirnameBytes = ByteString.copyFromUtf8(dirname); + Digest digest = DIGEST_UTIL.compute(dirnameBytes); + String hash = digest.getHash(); + treeBuilder.putDirectories(hash, dir); + return digest; + } + + public static NodeProperties makeNodeProperties(ImmutableMap props) { + return NodeProperties.newBuilder() + .addAllProperties( + props.entrySet().stream() + .map( + kv -> + NodeProperty.newBuilder() + .setName(kv.getKey()) + .setValue(kv.getValue()) + .build()) + .collect(Collectors.toList())) + .build(); + } + + public static Input makeInput(Path fileDir, FileNode file) { + Path fileNodePath = fileDir.resolve(file.getName()); + return Input.newBuilder() + .setPath(fileNodePath.toString()) + .setDigest(file.getDigest().getHashBytes()) + .build(); + } + + public static Command makeCommand() { + ImmutableList outputFiles = ImmutableList.of("output_file", "out_subdir/out_subfile"); + ImmutableList outputDirs = ImmutableList.of("out_subdir"); + ImmutableList outputPaths = + ImmutableList.builder().addAll(outputFiles).addAll(outputDirs).build(); + + return Command.newBuilder() + .addAllOutputFiles(outputFiles) + .addAllOutputDirectories(outputDirs) + .addAllOutputPaths(outputPaths) + .build(); + } + + public static class TreeFile { + public final String path; + public final boolean isTool; + + // null means directory + public final String content; + + public TreeFile(String path) { + this(path, "", false); + } + + public TreeFile(String path, String content) { + this(path, content, false); + } + + public TreeFile(String path, String content, boolean isTool) { + this.path = path; + this.isTool = isTool; + this.content = content; + } + + public boolean isDir() { + return this.content == null; + } + + public String name() { + return Paths.get(this.path).getFileName().toString(); + } + } + + public static Tree makeTree(String rootDirPath, List files) { + Tree.Builder treeBuilder = Tree.newBuilder(); + if (files.isEmpty()) { + return treeBuilder.build(); + } + Directory.Builder rootDirBuilder = Directory.newBuilder(); + + Map dirBuilders = new HashMap<>(); + + for (TreeFile file : files) { + if (file.isDir()) { + dirBuilders.computeIfAbsent(file.path, (filePath) -> Directory.newBuilder()); + } else { + NodeProperties props = NodeProperties.getDefaultInstance(); + if (file.isTool) { + props = makeNodeProperties(ImmutableMap.of(BAZEL_TOOL_INPUT_MARKER, "")); + } + FileNode fileNode = makeFileNode(file.name(), file.content, props); + Path parentDirPath = Paths.get(file.path).getParent(); + if (parentDirPath != null) { + String parentDirPathStr = parentDirPath.normalize().toString(); + Directory.Builder parentDirBuilder = + dirBuilders.computeIfAbsent(parentDirPathStr, (filePath) -> Directory.newBuilder()); + parentDirBuilder.addFiles(fileNode); + } else { + rootDirBuilder.addFiles(fileNode); + } + } + } + + for (Map.Entry entry : dirBuilders.entrySet()) { + String subDirName = entry.getKey(); + Directory subDir = entry.getValue().build(); + Digest subDirDigest = addDirToTree(treeBuilder, subDirName, subDir); + rootDirBuilder.addDirectories(makeDirNode(subDirName, subDirDigest)); + } + + Digest rootDirDigest = addDirToTree(treeBuilder, rootDirPath, rootDirBuilder.build()); + treeBuilder.setRootDigest(rootDirDigest); + + return treeBuilder.build(); + } + + public static List listFilesRec(Path root) throws IOException { + List filesFound = new ArrayList<>(); + + Files.walkFileTree( + root, + new FileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + filesFound.add(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { + throw new IOException("visitFileFailed"); + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + filesFound.add(dir); + return FileVisitResult.CONTINUE; + } + }); + + return filesFound; + } + + // Check all expected files exist and that only they exist + public static void assertFilesExistExactly(Path root, List expectedFiles) + throws IOException { + List listedPaths = listFilesRec(root); + for (Path filePath : listedPaths) { + assertWithMessage("Path not match prefix of any expected file: " + filePath) + .that(expectedFiles.stream().anyMatch(p -> p.startsWith(p))) + .isTrue(); + } + assertThat(listedPaths).containsAtLeastElementsIn(expectedFiles); + } +} From a56b1616681462b2237c6cc8581edad8576c3de6 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 22 Nov 2023 00:38:36 -0500 Subject: [PATCH 157/214] Locate Output Paths relative to WorkingDirectory (#1553) * Locate Output Paths relative to WorkingDirectory Required as a corollary to OutputDirectory changes to consider outputs as relative to working directory. * Windows builds emit relativize paths with native separators --- .../build/buildfarm/common/CommandUtils.java | 8 ++--- .../buildfarm/worker/ReportResultStage.java | 2 +- .../worker/shard/ShardWorkerContext.java | 35 +++++++++++++++---- .../worker/shard/ShardWorkerContextTest.java | 28 +++++++++++++++ 4 files changed, 61 insertions(+), 12 deletions(-) diff --git a/src/main/java/build/buildfarm/common/CommandUtils.java b/src/main/java/build/buildfarm/common/CommandUtils.java index c6eeb150d2..1604743629 100644 --- a/src/main/java/build/buildfarm/common/CommandUtils.java +++ b/src/main/java/build/buildfarm/common/CommandUtils.java @@ -46,7 +46,7 @@ public static boolean isTest(Command command) { * @return The list of output paths. * @note Suggested return identifier: output_paths. */ - public static List getResolvedOutputPaths(Command command, Path actionRoot) { + public static List getResolvedOutputPaths(Command command, Path workingDirectory) { // REAPI clients previously needed to specify whether the output path was a directory or file. // This turned out to be too restrictive-- some build tools don't know what an action produces // until it is done. @@ -65,7 +65,7 @@ public static List getResolvedOutputPaths(Command command, Path actionRoot // `output_directories` will be ignored!" if (command.getOutputPathsCount() != 0) { for (String outputPath : command.getOutputPathsList()) { - resolvedPaths.add(actionRoot.resolve(outputPath)); + resolvedPaths.add(workingDirectory.resolve(outputPath)); } return resolvedPaths; } @@ -73,10 +73,10 @@ public static List getResolvedOutputPaths(Command command, Path actionRoot // Assuming `output_paths` was not used, // fetch deprecated `output_files` and `output_directories` for backwards compatibility. for (String outputPath : command.getOutputFilesList()) { - resolvedPaths.add(actionRoot.resolve(outputPath)); + resolvedPaths.add(workingDirectory.resolve(outputPath)); } for (String outputPath : command.getOutputDirectoriesList()) { - resolvedPaths.add(actionRoot.resolve(outputPath)); + resolvedPaths.add(workingDirectory.resolve(outputPath)); } return resolvedPaths; diff --git a/src/main/java/build/buildfarm/worker/ReportResultStage.java b/src/main/java/build/buildfarm/worker/ReportResultStage.java index d7bf8eeba2..f5709eec28 100644 --- a/src/main/java/build/buildfarm/worker/ReportResultStage.java +++ b/src/main/java/build/buildfarm/worker/ReportResultStage.java @@ -98,7 +98,7 @@ private OperationContext reportPolled(OperationContext operationContext) workerContext.uploadOutputs( operationContext.queueEntry.getExecuteEntry().getActionDigest(), resultBuilder, - operationContext.execDir, + operationContext.execDir.resolve(operationContext.command.getWorkingDirectory()), operationContext.command); } catch (StatusException | StatusRuntimeException e) { ExecuteResponse executeResponse = operationContext.executeResponse.build(); diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index ac020f5046..37e46a5892 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -82,6 +82,7 @@ import io.grpc.Status; import io.grpc.StatusException; import io.prometheus.client.Counter; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.FileVisitResult; @@ -496,14 +497,24 @@ private void updateActionResultStdOutputs(ActionResult.Builder resultBuilder) } } + private static String toREOutputPath(String nativePath) { + // RE API OutputFile/Directory path + // The path separator is a forward slash `/`. + if (File.separatorChar != '/') { + return nativePath.replace(File.separatorChar, '/'); + } + return nativePath; + } + private void uploadOutputFile( ActionResult.Builder resultBuilder, Path outputPath, - Path actionRoot, + Path workingDirectory, String entrySizeViolationType, PreconditionFailure.Builder preconditionFailure) throws IOException, InterruptedException { - String outputFile = actionRoot.relativize(outputPath).toString(); + String outputFile = toREOutputPath(workingDirectory.relativize(outputPath).toString()); + if (!Files.exists(outputPath)) { log.log(Level.FINER, "ReportResultStage: " + outputFile + " does not exist..."); return; @@ -599,11 +610,12 @@ Directory toDirectory() { private void uploadOutputDirectory( ActionResult.Builder resultBuilder, Path outputDirPath, - Path actionRoot, + Path workingDirectory, String entrySizeViolationType, PreconditionFailure.Builder preconditionFailure) throws IOException, InterruptedException { - String outputDir = actionRoot.relativize(outputDirPath).toString(); + String outputDir = toREOutputPath(workingDirectory.relativize(outputDirPath).toString()); + if (!Files.exists(outputDirPath)) { log.log(Level.FINER, "ReportResultStage: " + outputDir + " does not exist..."); return; @@ -733,14 +745,23 @@ public void uploadOutputs( PreconditionFailure.Builder preconditionFailure = PreconditionFailure.newBuilder(); - List outputPaths = CommandUtils.getResolvedOutputPaths(command, actionRoot); + Path workingDirectory = actionRoot.resolve(command.getWorkingDirectory()); + List outputPaths = CommandUtils.getResolvedOutputPaths(command, workingDirectory); for (Path outputPath : outputPaths) { if (Files.isDirectory(outputPath)) { uploadOutputDirectory( - resultBuilder, outputPath, actionRoot, entrySizeViolationType, preconditionFailure); + resultBuilder, + outputPath, + workingDirectory, + entrySizeViolationType, + preconditionFailure); } else { uploadOutputFile( - resultBuilder, outputPath, actionRoot, entrySizeViolationType, preconditionFailure); + resultBuilder, + outputPath, + workingDirectory, + entrySizeViolationType, + preconditionFailure); } } checkPreconditionFailure(actionDigest, preconditionFailure.build()); diff --git a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java index efddbdb866..cf93a1cd4f 100644 --- a/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java +++ b/src/test/java/build/buildfarm/worker/shard/ShardWorkerContextTest.java @@ -15,6 +15,7 @@ package build.buildfarm.worker.shard; import static build.buildfarm.common.config.Server.INSTANCE_TYPE.SHARD; +import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -22,9 +23,14 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import build.bazel.remote.execution.v2.ActionResult; +import build.bazel.remote.execution.v2.Command; +import build.bazel.remote.execution.v2.Digest; +import build.bazel.remote.execution.v2.OutputFile; import build.bazel.remote.execution.v2.Platform; import build.bazel.remote.execution.v2.Platform.Property; import build.buildfarm.backplane.Backplane; +import build.buildfarm.cas.ContentAddressableStorage; import build.buildfarm.common.DigestUtil; import build.buildfarm.common.DigestUtil.HashFunction; import build.buildfarm.common.InputStreamFactory; @@ -37,7 +43,11 @@ import build.buildfarm.worker.WorkerContext; import build.buildfarm.worker.resources.LocalResourceSet; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.jimfs.Jimfs; import com.google.protobuf.Duration; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import org.junit.Before; @@ -165,4 +175,22 @@ public void dequeueMatchSettingsPlatformAcceptsValidQueueEntry() throws Exceptio context.match(listener); verify(listener, times(1)).onEntry(queueEntry); } + + @Test + public void uploadOutputsWorkingDirectoryRelative() throws Exception { + WorkerContext context = createTestContext(); + Command command = + Command.newBuilder().setWorkingDirectory("foo/bar").addOutputFiles("baz/quux").build(); + ContentAddressableStorage storage = mock(ContentAddressableStorage.class); + when(execFileSystem.getStorage()).thenReturn(storage); + Path actionRoot = Iterables.getFirst(Jimfs.newFileSystem().getRootDirectories(), null); + Files.createDirectories(actionRoot.resolve("foo/bar/baz")); + Files.createFile(actionRoot.resolve("foo/bar/baz/quux")); + ActionResult.Builder resultBuilder = ActionResult.newBuilder(); + context.uploadOutputs(Digest.getDefaultInstance(), resultBuilder, actionRoot, command); + + ActionResult result = resultBuilder.build(); + OutputFile outputFile = Iterables.getOnlyElement(result.getOutputFilesList()); + assertThat(outputFile.getPath()).isEqualTo("baz/quux"); + } } From 53e1fbae9362fed3de96a3a5c64dc77daacaa655 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 22 Nov 2023 09:48:11 -0500 Subject: [PATCH 158/214] Remove incorrect external resolve of WD on upload (#1554) Previous patch included a change in actionRoot parameter, expecting it to prefer the working directory rooted path to discover outputs. Might want to reapply this later, but for now leave the resolution in uploadOutputs. --- src/main/java/build/buildfarm/worker/ReportResultStage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/worker/ReportResultStage.java b/src/main/java/build/buildfarm/worker/ReportResultStage.java index f5709eec28..d7bf8eeba2 100644 --- a/src/main/java/build/buildfarm/worker/ReportResultStage.java +++ b/src/main/java/build/buildfarm/worker/ReportResultStage.java @@ -98,7 +98,7 @@ private OperationContext reportPolled(OperationContext operationContext) workerContext.uploadOutputs( operationContext.queueEntry.getExecuteEntry().getActionDigest(), resultBuilder, - operationContext.execDir.resolve(operationContext.command.getWorkingDirectory()), + operationContext.execDir, operationContext.command); } catch (StatusException | StatusRuntimeException e) { ExecuteResponse executeResponse = operationContext.executeResponse.build(); From dd5c87bdc8b5b18bd039e21cd87b8a40aa289d49 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 29 Nov 2023 23:53:47 -0500 Subject: [PATCH 159/214] Instance cleanups (#1555) * Prevent multiple fetches of QueuedOperation Propagate the Tree in OperationContext for use during the persistent workers clause in Executor * Correct WSO and StubWriteOutputStream completion onCompleted should always be called on open requests when StubWriteOutputStreams are closed, even when completed early by the server. onCompleted must be delivered to responseObserver when onCompleted is invoked, lest a no-request write stream be left hanging to DEADLINE_EXCEEDED. * Explicit reset on WriteOffset 0 and blob write Avoid unnecessary queryWriteStatus requests when a WriteRequest appears with write offset 0 in WSO, and reset the stream initially for internal ServerInstance blob uploads. --- .../common/grpc/StubWriteOutputStream.java | 28 +++++++++---------- .../common/services/WriteStreamObserver.java | 26 +++++++++++++---- .../instance/shard/ServerInstance.java | 1 + .../java/build/buildfarm/worker/Executor.java | 2 +- .../build/buildfarm/worker/InputFetcher.java | 6 ++-- .../buildfarm/worker/OperationContext.java | 18 ++++++++++-- .../services/ByteStreamServiceTest.java | 7 +++-- 7 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java index 4e500398b2..855b650ff9 100644 --- a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java +++ b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java @@ -131,21 +131,25 @@ public StubWriteOutputStream( @Override public void close() throws IOException { + StreamObserver finishedWriteObserver; + boolean cancelled = false; if (!checkComplete()) { boolean finishWrite = expectedSize == UNLIMITED_EXPECTED_SIZE; if (finishWrite || offset != 0) { initiateWrite(); flushSome(finishWrite); } - synchronized (this) { - if (writeObserver != null) { - if (finishWrite || getCommittedSize() + offset == expectedSize) { - writeObserver.onCompleted(); - } else { - writeObserver.onError(Status.CANCELLED.asException()); - } - writeObserver = null; - } + cancelled = !finishWrite && getCommittedSize() + offset != expectedSize; + } + synchronized (this) { + finishedWriteObserver = writeObserver; + writeObserver = null; + } + if (finishedWriteObserver != null) { + if (cancelled) { + finishedWriteObserver.onError(Status.CANCELLED.asException()); + } else { + finishedWriteObserver.onCompleted(); } } } @@ -334,11 +338,7 @@ public FeedbackOutputStream getOutput( this.deadlineAfter = deadlineAfter; this.deadlineAfterUnits = deadlineAfterUnits; this.onReadyHandler = onReadyHandler; - synchronized (this) { - if (writeObserver == null) { - initiateWrite(); - } - } + initiateWrite(); return this; } diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index dd52f7769e..41442da5fb 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -205,7 +205,6 @@ void commitActive(long committedSize) { log.log( Level.FINEST, format("delivering committed_size for %s of %d", name, committedSize)); responseObserver.onNext(response); - responseObserver.onCompleted(); } catch (Exception e) { log.log(Level.SEVERE, format("error delivering committed_size to %s", name), e); } @@ -326,6 +325,9 @@ private void handleWrite(String resourceName, long offset, ByteString data, bool throws EntryLimitException { long committedSize; try { + if (offset == 0) { + write.reset(); + } committedSize = getCommittedSizeForWrite(); } catch (IOException e) { errorResponse(e); @@ -352,10 +354,6 @@ private void handleWrite(String resourceName, long offset, ByteString data, bool resourceName, name)) .asException()); } else { - if (offset == 0 && offset != committedSize) { - write.reset(); - committedSize = 0; - } if (earliestOffset < 0 || offset < earliestOffset) { earliestOffset = offset; } @@ -479,5 +477,23 @@ public void onError(Throwable t) { @Override public void onCompleted() { log.log(Level.FINER, format("write completed for %s", name)); + if (write == null) { + responseObserver.onCompleted(); + } else { + Futures.addCallback( + write.getFuture(), + new FutureCallback() { + @Override + public void onSuccess(Long committedSize) { + responseObserver.onCompleted(); + } + + @Override + public void onFailure(Throwable t) { + // ignore + } + }, + directExecutor()); + } } } diff --git a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java index b1cbed0e07..b4f118f1ad 100644 --- a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java @@ -1655,6 +1655,7 @@ public void onFailure(Throwable t) { } }, directExecutor()); + write.reset(); // prevents a queryWriteStatus at index 0 try (OutputStream out = write.getOutput(timeout.getSeconds(), SECONDS, () -> {})) { content.writeTo(out); } catch (IOException e) { diff --git a/src/main/java/build/buildfarm/worker/Executor.java b/src/main/java/build/buildfarm/worker/Executor.java index ee0de0b1ba..2891488f52 100644 --- a/src/main/java/build/buildfarm/worker/Executor.java +++ b/src/main/java/build/buildfarm/worker/Executor.java @@ -446,7 +446,7 @@ private Code executeCommand( "usePersistentWorker; got persistentWorkerCommand of : " + limits.persistentWorkerCommand); - Tree execTree = workerContext.getQueuedOperation(operationContext.queueEntry).getTree(); + Tree execTree = operationContext.tree; WorkFilesContext filesContext = WorkFilesContext.fromContext(execDir, execTree, operationContext.command); diff --git a/src/main/java/build/buildfarm/worker/InputFetcher.java b/src/main/java/build/buildfarm/worker/InputFetcher.java index 7be7a29e96..23a0d6af2f 100644 --- a/src/main/java/build/buildfarm/worker/InputFetcher.java +++ b/src/main/java/build/buildfarm/worker/InputFetcher.java @@ -31,6 +31,7 @@ import build.buildfarm.common.ProxyDirectoriesIndex; import build.buildfarm.v1test.ExecuteEntry; import build.buildfarm.v1test.QueuedOperation; +import build.buildfarm.v1test.Tree; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Stopwatch; import com.google.common.collect.Iterables; @@ -232,7 +233,7 @@ long fetchPolled(Stopwatch stopwatch) throws InterruptedException { boolean completed = false; try { long fetchUSecs = stopwatch.elapsed(MICROSECONDS); - proceedToOutput(queuedOperation.getAction(), command, execDir); + proceedToOutput(queuedOperation.getAction(), command, execDir, queuedOperation.getTree()); completed = true; return stopwatch.elapsed(MICROSECONDS) - fetchUSecs; } finally { @@ -248,7 +249,7 @@ long fetchPolled(Stopwatch stopwatch) throws InterruptedException { } } - private void proceedToOutput(Action action, Command command, Path execDir) + private void proceedToOutput(Action action, Command command, Path execDir, Tree tree) throws InterruptedException { // switch poller to disable deadline operationContext.poller.pause(); @@ -266,6 +267,7 @@ private void proceedToOutput(Action action, Command command, Path execDir) .setExecDir(execDir) .setAction(action) .setCommand(command) + .setTree(tree) .build(); boolean claimed = owner.output().claim(fetchedOperationContext); operationContext.poller.pause(); diff --git a/src/main/java/build/buildfarm/worker/OperationContext.java b/src/main/java/build/buildfarm/worker/OperationContext.java index ef73e1bbf9..7220fc100b 100644 --- a/src/main/java/build/buildfarm/worker/OperationContext.java +++ b/src/main/java/build/buildfarm/worker/OperationContext.java @@ -19,6 +19,7 @@ import build.bazel.remote.execution.v2.ExecuteResponse; import build.buildfarm.common.Poller; import build.buildfarm.v1test.QueueEntry; +import build.buildfarm.v1test.Tree; import com.google.longrunning.Operation; import java.nio.file.Path; @@ -29,6 +30,7 @@ public final class OperationContext { final Path execDir; final Action action; final Command command; + final Tree tree; final QueueEntry queueEntry; private OperationContext( @@ -38,6 +40,7 @@ private OperationContext( Path execDir, Action action, Command command, + Tree tree, QueueEntry queueEntry) { this.executeResponse = executeResponse; this.operation = operation; @@ -45,6 +48,7 @@ private OperationContext( this.execDir = execDir; this.action = action; this.command = command; + this.tree = tree; this.queueEntry = queueEntry; } @@ -55,6 +59,7 @@ public static class Builder { private Path execDir; private Action action; private Command command; + private Tree tree; private QueueEntry queueEntry; private Builder( @@ -64,6 +69,7 @@ private Builder( Path execDir, Action action, Command command, + Tree tree, QueueEntry queueEntry) { this.executeResponse = executeResponse; this.operation = operation; @@ -71,6 +77,7 @@ private Builder( this.execDir = execDir; this.action = action; this.command = command; + this.tree = tree; this.queueEntry = queueEntry; } @@ -99,6 +106,11 @@ public Builder setCommand(Command command) { return this; } + public Builder setTree(Tree tree) { + this.tree = tree; + return this; + } + public Builder setQueueEntry(QueueEntry queueEntry) { this.queueEntry = queueEntry; return this; @@ -106,7 +118,7 @@ public Builder setQueueEntry(QueueEntry queueEntry) { public OperationContext build() { return new OperationContext( - executeResponse, operation, poller, execDir, action, command, queueEntry); + executeResponse, operation, poller, execDir, action, command, tree, queueEntry); } } @@ -118,10 +130,12 @@ public static Builder newBuilder() { /* execDir=*/ null, /* action=*/ null, /* command=*/ null, + /* tree=*/ null, /* queueEntry=*/ null); } public Builder toBuilder() { - return new Builder(executeResponse, operation, poller, execDir, action, command, queueEntry); + return new Builder( + executeResponse, operation, poller, execDir, action, command, tree, queueEntry); } } diff --git a/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java b/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java index 2e1918b5d5..5b36340ba9 100644 --- a/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java +++ b/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java @@ -173,6 +173,7 @@ public boolean isReady() { .setResourceName(resourceName) .setData(shortContent) .build()); + verify(write, times(1)).reset(); requestObserver.onNext( WriteRequest.newBuilder().setWriteOffset(0).setData(content).setFinishWrite(true).build()); assertThat(futureResponder.get()) @@ -181,8 +182,8 @@ public boolean isReady() { verify(write, atLeastOnce()).getCommittedSize(); verify(write, atLeastOnce()) .getOutput(any(Long.class), any(TimeUnit.class), any(Runnable.class)); - verify(write, times(1)).reset(); - verify(write, times(1)).getFuture(); + verify(write, times(2)).reset(); + verify(write, times(2)).getFuture(); } @Test @@ -263,7 +264,7 @@ public boolean isReady() { verify(write, atLeastOnce()).getCommittedSize(); verify(write, atLeastOnce()) .getOutput(any(Long.class), any(TimeUnit.class), any(Runnable.class)); - verify(write, times(2)).getFuture(); + verify(write, times(3)).getFuture(); } static class CountingReadObserver implements StreamObserver { From d24939316f96078016223f1dd1725ced721bcb34 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 30 Nov 2023 13:39:16 -0500 Subject: [PATCH 160/214] BuildfarmExecutors moved to its own target (#1557) --- src/main/java/build/buildfarm/cas/BUILD | 1 + src/main/java/build/buildfarm/common/BUILD | 54 ++++++++++++++++--- .../java/build/buildfarm/instance/shard/BUILD | 1 + .../java/build/buildfarm/worker/shard/BUILD | 1 + 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/BUILD b/src/main/java/build/buildfarm/cas/BUILD index 43e2daccde..2af2edc8df 100644 --- a/src/main/java/build/buildfarm/cas/BUILD +++ b/src/main/java/build/buildfarm/cas/BUILD @@ -8,6 +8,7 @@ java_library( ], deps = [ "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common:BuildfarmExecutors", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/common/resources", diff --git a/src/main/java/build/buildfarm/common/BUILD b/src/main/java/build/buildfarm/common/BUILD index 76a40cfa9f..a214140840 100644 --- a/src/main/java/build/buildfarm/common/BUILD +++ b/src/main/java/build/buildfarm/common/BUILD @@ -1,11 +1,14 @@ java_library( name = "common", - srcs = glob([ - "*.java", - "function/*.java", - "io/*.java", - "net/*.java", - ]), + srcs = glob( + [ + "*.java", + "function/*.java", + "io/*.java", + "net/*.java", + ], + exclude = ["BuildfarmExecutors.java"], + ), plugins = [":lombok"], visibility = ["//visibility:public"], deps = [ @@ -38,6 +41,45 @@ java_library( ], ) +java_library( + name = "BuildfarmExecutors", + srcs = [ + "BuildfarmExecutors.java", + ], + plugins = [":lombok"], + visibility = ["//visibility:public"], + deps = [ + "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common/config", + "//src/main/java/build/buildfarm/common/resources", + "//src/main/java/build/buildfarm/common/resources:resource_java_proto", + "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", + "//third_party/jedis", + "@googleapis//:google_longrunning_operations_java_proto", + "@googleapis//:google_rpc_code_java_proto", + "@googleapis//:google_rpc_error_details_java_proto", + "@maven//:com_github_jnr_jnr_constants", + "@maven//:com_github_jnr_jnr_ffi", + "@maven//:com_github_jnr_jnr_posix", + "@maven//:com_github_luben_zstd_jni", + "@maven//:com_github_oshi_oshi_core", + "@maven//:com_google_code_findbugs_jsr305", + "@maven//:com_google_guava_failureaccess", + "@maven//:com_google_guava_guava", + "@maven//:com_google_protobuf_protobuf_java", + "@maven//:com_google_protobuf_protobuf_java_util", + "@maven//:commons_io_commons_io", + "@maven//:io_grpc_grpc_api", + "@maven//:io_grpc_grpc_context", + "@maven//:io_grpc_grpc_protobuf", + "@maven//:io_prometheus_simpleclient", + "@maven//:org_apache_commons_commons_compress", + "@maven//:org_projectlombok_lombok", + "@maven//:org_threeten_threetenbp", + "@remote_apis//:build_bazel_remote_execution_v2_remote_execution_java_proto", + ], +) + java_plugin( name = "lombok", generates_api = True, diff --git a/src/main/java/build/buildfarm/instance/shard/BUILD b/src/main/java/build/buildfarm/instance/shard/BUILD index 38e6992aae..9512f7fd70 100644 --- a/src/main/java/build/buildfarm/instance/shard/BUILD +++ b/src/main/java/build/buildfarm/instance/shard/BUILD @@ -8,6 +8,7 @@ java_library( "//src/main/java/build/buildfarm/backplane", "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common:BuildfarmExecutors", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/common/redis", diff --git a/src/main/java/build/buildfarm/worker/shard/BUILD b/src/main/java/build/buildfarm/worker/shard/BUILD index b62e4369de..4fa52c985d 100644 --- a/src/main/java/build/buildfarm/worker/shard/BUILD +++ b/src/main/java/build/buildfarm/worker/shard/BUILD @@ -7,6 +7,7 @@ java_library( "//src/main/java/build/buildfarm/backplane", "//src/main/java/build/buildfarm/cas", "//src/main/java/build/buildfarm/common", + "//src/main/java/build/buildfarm/common:BuildfarmExecutors", "//src/main/java/build/buildfarm/common/config", "//src/main/java/build/buildfarm/common/grpc", "//src/main/java/build/buildfarm/common/services", From a7ef69354e783f1571b7995863c5df1f665a2af7 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:00:08 -0800 Subject: [PATCH 161/214] Update Jedis connection error handling for addWorker (#1552) --- .../buildfarm/common/redis/RedisClient.java | 3 +++ .../common/redis/RedisClientTest.java | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/main/java/build/buildfarm/common/redis/RedisClient.java b/src/main/java/build/buildfarm/common/redis/RedisClient.java index bd1e4578a1..6db7849df3 100644 --- a/src/main/java/build/buildfarm/common/redis/RedisClient.java +++ b/src/main/java/build/buildfarm/common/redis/RedisClient.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import redis.clients.jedis.JedisCluster; +import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; import redis.clients.jedis.exceptions.JedisDataException; import redis.clients.jedis.exceptions.JedisException; @@ -153,6 +154,8 @@ public T call(JedisContext withJedis) throws IOException { } } throw new IOException(status.withCause(cause == null ? e : cause).asRuntimeException()); + } catch (JedisClusterMaxAttemptsException e) { + throw new IOException(Status.UNAVAILABLE.withCause(e.getCause()).asRuntimeException()); } } } diff --git a/src/test/java/build/buildfarm/common/redis/RedisClientTest.java b/src/test/java/build/buildfarm/common/redis/RedisClientTest.java index dd124227c9..f6855af23c 100644 --- a/src/test/java/build/buildfarm/common/redis/RedisClientTest.java +++ b/src/test/java/build/buildfarm/common/redis/RedisClientTest.java @@ -26,6 +26,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import redis.clients.jedis.JedisCluster; +import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException; import redis.clients.jedis.exceptions.JedisConnectionException; @RunWith(JUnit4.class) @@ -75,4 +76,22 @@ public void runExceptionSocketTimeoutExceptionIsDeadlineExceeded() } assertThat(status.getCode()).isEqualTo(Code.DEADLINE_EXCEEDED); } + + @Test + public void runJedisClusterMaxAttemptsExceptionIsUnavailable() { + RedisClient client = new RedisClient(mock(JedisCluster.class)); + Status status = Status.UNKNOWN; + try { + JedisClusterMaxAttemptsException jcoe = + new JedisClusterMaxAttemptsException("No more cluster attempts left."); + jcoe.addSuppressed(new JedisConnectionException(new SocketException("Connection reset"))); + client.run( + jedis -> { + throw jcoe; + }); + } catch (IOException e) { + status = Status.fromThrowable(e); + } + assertThat(status.getCode()).isEqualTo(Code.UNAVAILABLE); + } } From a06b095eeabda77ac67c1d21991fd9571bf9e474 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Mon, 4 Dec 2023 23:48:05 -0500 Subject: [PATCH 162/214] add github action to package and publish the helm chart as a released artifact (#1556) * bundle with helm publish release with gh cli * add a basic doc for the helm chart --- .../buildfarm-helm-chart-publish.yml | 25 +++++++++++++++++++ README.md | 12 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/buildfarm-helm-chart-publish.yml diff --git a/.github/workflows/buildfarm-helm-chart-publish.yml b/.github/workflows/buildfarm-helm-chart-publish.yml new file mode 100644 index 0000000000..0207d1593b --- /dev/null +++ b/.github/workflows/buildfarm-helm-chart-publish.yml @@ -0,0 +1,25 @@ +--- +name: Package and Publish Helm Chart + +on: + push: + tags: + - '*' + +env: + GH_TOKEN: ${{ github.token }} + +jobs: + build: + if: github.repository == 'bazelbuild/bazel-buildfarm' + name: Package and Release BuildFarm Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: helm package + run: |- + set -ex + helm dep up kubernetes/helm-charts/buildfarm + helm package kubernetes/helm-charts/buildfarm + gh release create "${{ github.ref_name }}" *.tgz diff --git a/README.md b/README.md index cd9caf8ee3..ab861d609e 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,15 @@ load("@build_buildfarm//:images.bzl", "buildfarm_images") buildfarm_images() ``` + +### Helm Chart + +To install with helm: + +```bash +helm install \ + -n bazel-buildfarm \ + --create-namespace \ + bazel-buildfarm \ + "https://github.com/bazelbuild/bazel-buildfarm/releases/download/${BUILDFARM_VERSION:-2.7.1}/buildfarm-${CHART_VERSION:-0.1.0}.tgz" +``` From 68182ec9757140b7e309219612da427e56e2a72a Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 6 Dec 2023 15:48:12 -0500 Subject: [PATCH 163/214] Assert correct context called for WSO responses (#1561) --- .../common/services/WriteStreamObserver.java | 2 +- .../services/WriteStreamObserverTest.java | 65 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index 41442da5fb..99581c7498 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -493,7 +493,7 @@ public void onFailure(Throwable t) { // ignore } }, - directExecutor()); + withCancellation.fixedContextExecutor(directExecutor())); } } } diff --git a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java index b6d144a66b..b41ad18645 100644 --- a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java +++ b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java @@ -1,11 +1,14 @@ package build.buildfarm.common.services; import static build.buildfarm.common.resources.ResourceParser.uploadResourceName; +import static com.google.common.truth.Truth.assertThat; import static java.util.concurrent.TimeUnit.SECONDS; import static org.mockito.Mockito.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; @@ -138,4 +141,66 @@ public void noErrorWhenContextCancelled() throws Exception { any(RequestMetadata.class)); verifyZeroInteractions(responseObserver); } + + @Test + public void observerCalledInRequestContext() throws Exception { + Context.Key REQ_KEY = Context.key("requester"); + Instance instance = mock(Instance.class); + StreamObserver responseObserver = + spy( + new StreamObserver() { + @Override + public void onNext(WriteResponse response) { + assertThat(REQ_KEY.get()).isEqualTo("true"); + } + + @Override + public void onError(Throwable t) { + assertThat(REQ_KEY.get()).isEqualTo("true"); + } + + @Override + public void onCompleted() { + assertThat(REQ_KEY.get()).isEqualTo("true"); + } + }); + ByteString data = ByteString.copyFromUtf8("contextual data"); + Digest digest = DIGEST_UTIL.compute(data); + UUID uuid = UUID.randomUUID(); + UploadBlobRequest uploadBlobRequest = + UploadBlobRequest.newBuilder() + .setBlob(BlobInformation.newBuilder().setDigest(digest)) + .setUuid(uuid.toString()) + .build(); + SettableFuture future = SettableFuture.create(); + Write write = mock(Write.class); + when(write.getFuture()).thenReturn(future); + when(write.isComplete()).thenReturn(Boolean.TRUE); + when(instance.getBlobWrite( + eq(Compressor.Value.IDENTITY), eq(digest), eq(uuid), any(RequestMetadata.class))) + .thenReturn(write); + + Context requester = Context.current().withValue(REQ_KEY, "true"); + assertThat(REQ_KEY.get()).isNull(); + WriteStreamObserver observer = + requester.call( + () -> new WriteStreamObserver(instance, 1, SECONDS, () -> {}, responseObserver)); + requester.run( + () -> + observer.onNext( + WriteRequest.newBuilder() + .setResourceName(uploadResourceName(uploadBlobRequest)) + .setData(data) + .build())); + requester.run(observer::onCompleted); + verify(responseObserver, never()).onCompleted(); + + future.set(digest.getSizeBytes()); + + verify(write, times(1)).isComplete(); + verify(instance, times(1)) + .getBlobWrite( + eq(Compressor.Value.IDENTITY), eq(digest), eq(uuid), any(RequestMetadata.class)); + verify(responseObserver, times(1)).onCompleted(); + } } From e26a000c2be825dde2991eddeb7036e947b131c8 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 12 Dec 2023 02:12:38 -0500 Subject: [PATCH 164/214] Write onNext requires onCompleted to follow (#1565) For reasons passing understanding, a WriteResponse is not delivered to a client solely from onNext to be received by a client called via bsStub. onCompleted must follow the onNext for a timely delivery of the response, particularly when it occurs before an onCompleted from the client. This does not seem to affect the bazel client, which could indicate a difference in behavior between grpc versions, or simply that it manages to complete its upload completely ignorant of the early return status. More investigation is required. This will fix hanging builds which occur with exec-only workers failing to complete uploads to shard peers. --- .../common/services/WriteStreamObserver.java | 16 +---- .../services/ByteStreamServiceTest.java | 4 +- .../services/WriteStreamObserverTest.java | 65 ------------------- 3 files changed, 3 insertions(+), 82 deletions(-) diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index 99581c7498..c2518921a0 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -205,6 +205,7 @@ void commitActive(long committedSize) { log.log( Level.FINEST, format("delivering committed_size for %s of %d", name, committedSize)); responseObserver.onNext(response); + responseObserver.onCompleted(); } catch (Exception e) { log.log(Level.SEVERE, format("error delivering committed_size to %s", name), e); } @@ -479,21 +480,6 @@ public void onCompleted() { log.log(Level.FINER, format("write completed for %s", name)); if (write == null) { responseObserver.onCompleted(); - } else { - Futures.addCallback( - write.getFuture(), - new FutureCallback() { - @Override - public void onSuccess(Long committedSize) { - responseObserver.onCompleted(); - } - - @Override - public void onFailure(Throwable t) { - // ignore - } - }, - withCancellation.fixedContextExecutor(directExecutor())); } } } diff --git a/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java b/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java index 5b36340ba9..85b16dacf5 100644 --- a/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java +++ b/src/test/java/build/buildfarm/common/services/ByteStreamServiceTest.java @@ -183,7 +183,7 @@ public boolean isReady() { verify(write, atLeastOnce()) .getOutput(any(Long.class), any(TimeUnit.class), any(Runnable.class)); verify(write, times(2)).reset(); - verify(write, times(2)).getFuture(); + verify(write, times(1)).getFuture(); } @Test @@ -264,7 +264,7 @@ public boolean isReady() { verify(write, atLeastOnce()).getCommittedSize(); verify(write, atLeastOnce()) .getOutput(any(Long.class), any(TimeUnit.class), any(Runnable.class)); - verify(write, times(3)).getFuture(); + verify(write, times(2)).getFuture(); } static class CountingReadObserver implements StreamObserver { diff --git a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java index b41ad18645..b6d144a66b 100644 --- a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java +++ b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java @@ -1,14 +1,11 @@ package build.buildfarm.common.services; import static build.buildfarm.common.resources.ResourceParser.uploadResourceName; -import static com.google.common.truth.Truth.assertThat; import static java.util.concurrent.TimeUnit.SECONDS; import static org.mockito.Mockito.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; @@ -141,66 +138,4 @@ public void noErrorWhenContextCancelled() throws Exception { any(RequestMetadata.class)); verifyZeroInteractions(responseObserver); } - - @Test - public void observerCalledInRequestContext() throws Exception { - Context.Key REQ_KEY = Context.key("requester"); - Instance instance = mock(Instance.class); - StreamObserver responseObserver = - spy( - new StreamObserver() { - @Override - public void onNext(WriteResponse response) { - assertThat(REQ_KEY.get()).isEqualTo("true"); - } - - @Override - public void onError(Throwable t) { - assertThat(REQ_KEY.get()).isEqualTo("true"); - } - - @Override - public void onCompleted() { - assertThat(REQ_KEY.get()).isEqualTo("true"); - } - }); - ByteString data = ByteString.copyFromUtf8("contextual data"); - Digest digest = DIGEST_UTIL.compute(data); - UUID uuid = UUID.randomUUID(); - UploadBlobRequest uploadBlobRequest = - UploadBlobRequest.newBuilder() - .setBlob(BlobInformation.newBuilder().setDigest(digest)) - .setUuid(uuid.toString()) - .build(); - SettableFuture future = SettableFuture.create(); - Write write = mock(Write.class); - when(write.getFuture()).thenReturn(future); - when(write.isComplete()).thenReturn(Boolean.TRUE); - when(instance.getBlobWrite( - eq(Compressor.Value.IDENTITY), eq(digest), eq(uuid), any(RequestMetadata.class))) - .thenReturn(write); - - Context requester = Context.current().withValue(REQ_KEY, "true"); - assertThat(REQ_KEY.get()).isNull(); - WriteStreamObserver observer = - requester.call( - () -> new WriteStreamObserver(instance, 1, SECONDS, () -> {}, responseObserver)); - requester.run( - () -> - observer.onNext( - WriteRequest.newBuilder() - .setResourceName(uploadResourceName(uploadBlobRequest)) - .setData(data) - .build())); - requester.run(observer::onCompleted); - verify(responseObserver, never()).onCompleted(); - - future.set(digest.getSizeBytes()); - - verify(write, times(1)).isComplete(); - verify(instance, times(1)) - .getBlobWrite( - eq(Compressor.Value.IDENTITY), eq(digest), eq(uuid), any(RequestMetadata.class)); - verify(responseObserver, times(1)).onCompleted(); - } } From 859abb6d7de0b88704b693140a22bbf9329a0e7d Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Tue, 12 Dec 2023 15:41:40 -0800 Subject: [PATCH 165/214] chore: update maven dependencies (#1434) * chore(deps): bump com.amazonaws:aws-java-sdk-* Update to 1.12.544 * chore(deps): bump org.redisson:redisson Update to 3.23.4 * chore(deps): bump org.threeten:threetenbp Update to 1.6.8 * chore(deps): bump org.snakeyaml:snakeyaml Update to 2.2 * chore(deps): bump com.github.docker-java:docker-java * chore(deps): bump com.github.jnr:* Bumping all packages in this groupId to the latest. * chore(deps): bump com.github.serceman:jnr-fuse * chore(deps): bump com.github.oshi:oshi-core * chore(deps): bump com.google.auth:* Oauth libraries to the latest. * chore(deps): bump com.google.code.findbugs:jsr305 * chore(deps): bump com.google.code.gson:gson * chore(deps): bump com.google.j2objc:j2objc-annotations * chore(deps): bump com.google.jimfs:jimfs * chore(deps): bump org.slf4j.slf4j-simple * chore(deps): bump com.jayway.jsonpath:json-path * chore(deps): bump io.netty:* * chore(deps): bump io.prometheus:* * chore(deps): bump junit:junit * chore(deps): bump org.apache.commons:commons-compress * chore(deps): bump org.apache.commons:commons-pool2 * chore(deps): bump org.apache.commons:commons-lang3 * chore(deps): bump commons-io:commons-io * chore(deps): bump me.dinowernli:java-grpc-prometheus * chore(deps): bump org.checkerframework:checker-qual * chore(deps): bump com.google.truth:truth * chore(deps): bump org.openjdk.jmh:* --- defs.bzl | 68 +++++++++---------- .../instance/stub/StubInstanceTest.java | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/defs.bzl b/defs.bzl index ea145d1b9f..ad0790593e 100644 --- a/defs.bzl +++ b/defs.bzl @@ -55,63 +55,63 @@ def buildfarm_init(name = "buildfarm"): name: the name of the repository """ maven_install( - artifacts = ["com.amazonaws:aws-java-sdk-%s:1.11.729" % module for module in COM_AWS_MODULES] + + artifacts = ["com.amazonaws:aws-java-sdk-%s:1.12.544" % module for module in COM_AWS_MODULES] + [ "com.fasterxml.jackson.core:jackson-databind:2.15.0", "com.github.ben-manes.caffeine:caffeine:2.9.0", - "com.github.docker-java:docker-java:3.2.11", + "com.github.docker-java:docker-java:3.3.3", "com.github.fppt:jedis-mock:1.0.10", - "com.github.jnr:jffi:1.2.16", - "com.github.jnr:jffi:jar:native:1.2.16", - "com.github.jnr:jnr-constants:0.9.9", - "com.github.jnr:jnr-ffi:2.1.7", - "com.github.jnr:jnr-posix:3.0.53", + "com.github.jnr:jffi:1.3.11", + "com.github.jnr:jffi:jar:native:1.3.11", + "com.github.jnr:jnr-constants:0.10.4", + "com.github.jnr:jnr-ffi:2.2.14", + "com.github.jnr:jnr-posix:3.1.17", "com.github.pcj:google-options:1.0.0", - "com.github.serceman:jnr-fuse:0.5.5", + "com.github.serceman:jnr-fuse:0.5.7", "com.github.luben:zstd-jni:1.5.5-7", - "com.github.oshi:oshi-core:6.4.0", - "com.google.auth:google-auth-library-credentials:0.9.1", - "com.google.auth:google-auth-library-oauth2-http:0.9.1", - "com.google.code.findbugs:jsr305:3.0.1", - "com.google.code.gson:gson:2.9.0", + "com.github.oshi:oshi-core:6.4.5", + "com.google.auth:google-auth-library-credentials:1.19.0", + "com.google.auth:google-auth-library-oauth2-http:1.19.0", + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.10.1", "com.google.errorprone:error_prone_annotations:2.22.0", "com.google.errorprone:error_prone_core:2.22.0", "com.google.guava:failureaccess:1.0.1", "com.google.guava:guava:32.1.1-jre", - "com.google.j2objc:j2objc-annotations:1.1", - "com.google.jimfs:jimfs:1.1", + "com.google.j2objc:j2objc-annotations:2.8", + "com.google.jimfs:jimfs:1.3.0", "com.google.protobuf:protobuf-java-util:3.19.1", "com.google.protobuf:protobuf-java:3.19.1", - "com.google.truth:truth:0.44", - "org.slf4j:slf4j-simple:1.7.35", + "com.google.truth:truth:1.1.5", + "org.slf4j:slf4j-simple:2.0.9", "com.googlecode.json-simple:json-simple:1.1.1", - "com.jayway.jsonpath:json-path:2.4.0", + "com.jayway.jsonpath:json-path:2.8.0", "org.bouncycastle:bcprov-jdk15on:1.70", "net.jcip:jcip-annotations:1.0", - ] + ["io.netty:netty-%s:4.1.94.Final" % module for module in IO_NETTY_MODULES] + + ] + ["io.netty:netty-%s:4.1.97.Final" % module for module in IO_NETTY_MODULES] + ["io.grpc:grpc-%s:1.56.1" % module for module in IO_GRPC_MODULES] + [ - "io.prometheus:simpleclient:0.10.0", - "io.prometheus:simpleclient_hotspot:0.10.0", - "io.prometheus:simpleclient_httpserver:0.10.0", - "junit:junit:4.13.1", + "io.prometheus:simpleclient:0.15.0", + "io.prometheus:simpleclient_hotspot:0.15.0", + "io.prometheus:simpleclient_httpserver:0.15.0", + "junit:junit:4.13.2", "javax.annotation:javax.annotation-api:1.3.2", "net.javacrumbs.future-converter:future-converter-java8-guava:1.2.0", - "org.apache.commons:commons-compress:1.21", - "org.apache.commons:commons-pool2:2.9.0", - "org.apache.commons:commons-lang3:3.12.0", - "commons-io:commons-io:2.11.0", - "me.dinowernli:java-grpc-prometheus:0.5.0", + "org.apache.commons:commons-compress:1.23.0", + "org.apache.commons:commons-pool2:2.11.1", + "org.apache.commons:commons-lang3:3.13.0", + "commons-io:commons-io:2.13.0", + "me.dinowernli:java-grpc-prometheus:0.6.0", "org.apache.tomcat:annotations-api:6.0.53", - "org.checkerframework:checker-qual:2.5.2", + "org.checkerframework:checker-qual:3.38.0", "org.mockito:mockito-core:2.25.0", - "org.openjdk.jmh:jmh-core:1.23", - "org.openjdk.jmh:jmh-generator-annprocess:1.23", - "org.redisson:redisson:3.13.1", - "org.threeten:threetenbp:1.3.3", + "org.openjdk.jmh:jmh-core:1.37", + "org.openjdk.jmh:jmh-generator-annprocess:1.37", + "org.redisson:redisson:3.23.4", + "org.threeten:threetenbp:1.6.8", "org.xerial:sqlite-jdbc:3.34.0", "org.jetbrains:annotations:16.0.2", - "org.yaml:snakeyaml:2.0", + "org.yaml:snakeyaml:2.2", "org.projectlombok:lombok:1.18.30", ], generate_compat_repositories = True, diff --git a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java index e3845494b8..526946af1e 100644 --- a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java @@ -320,7 +320,7 @@ public void batchUpdateBlobs( ImmutableList digests = ImmutableList.of(DIGEST_UTIL.compute(first), DIGEST_UTIL.compute(last)); assertThat(instance.putAllBlobs(blobs, RequestMetadata.getDefaultInstance())) - .containsAllIn(digests); + .containsAtLeastElementsIn(digests); } @Test From 27194c7ab70176e1e4dde779298b25ce8d9cff54 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Tue, 12 Dec 2023 15:51:39 -0800 Subject: [PATCH 166/214] build: support compiling protobuf on macOS (#1563) MacOS needs extra args to convince it to support C++14. --- .bazelrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bazelrc b/.bazelrc index c3caf4d8fb..5cc10724d9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -24,3 +24,6 @@ common --incompatible_disallow_empty_glob # TODO: migrate all dependencies from WORKSPACE to MODULE.bazel # https://github.com/bazelbuild/bazel-buildfarm/issues/1479 common --noenable_bzlmod + +# Support protobuf on macOS with Xcode 15.x +common:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14 From 1046e979580eff501e6b498bba8ddb6c1a955562 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Tue, 12 Dec 2023 15:52:28 -0800 Subject: [PATCH 167/214] tests: bump bazelversion for integration tests (#1566) Bumping 5.2.0 -> 6.4.0 --- src/test/many/.bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/many/.bazelversion b/src/test/many/.bazelversion index 7cbea073be..19b860c187 100644 --- a/src/test/many/.bazelversion +++ b/src/test/many/.bazelversion @@ -1 +1 @@ -5.2.0 \ No newline at end of file +6.4.0 From 8d6e93fe0798978bff997c78458ac00fc35d0eeb Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Tue, 12 Dec 2023 21:20:25 -0500 Subject: [PATCH 168/214] [tests] add unit test for local resources (#1558) Add a unit test related to handling of local resources. --- .../resources/LocalResourceSetUtilsTest.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/test/java/build/buildfarm/worker/resources/LocalResourceSetUtilsTest.java diff --git a/src/test/java/build/buildfarm/worker/resources/LocalResourceSetUtilsTest.java b/src/test/java/build/buildfarm/worker/resources/LocalResourceSetUtilsTest.java new file mode 100644 index 0000000000..94387e8834 --- /dev/null +++ b/src/test/java/build/buildfarm/worker/resources/LocalResourceSetUtilsTest.java @@ -0,0 +1,51 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.worker.resources; + +import build.bazel.remote.execution.v2.Platform; +import build.buildfarm.v1test.QueueEntry; +import java.util.concurrent.Semaphore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * @class LocalResourceSetUtilsTest + * @brief Tests how local resources are claimed and released. + * @details Shows behaviour of local resource claims and releases. + */ +@RunWith(JUnit4.class) +public class LocalResourceSetUtilsTest { + // Function under test: releaseClaims + // Reason for testing: Show its okay to return claims that were never taken. + // Failure explanation: can't return claims that were never taken. + @Test + public void decideResourceLimitationsTestCoreSetting() throws Exception { + // ARRANGE + LocalResourceSet resourceSet = new LocalResourceSet(); + resourceSet.resources.put("FOO", new Semaphore(1)); + + QueueEntry entry = + QueueEntry.newBuilder() + .setPlatform( + Platform.newBuilder() + .addProperties( + Platform.Property.newBuilder().setName("resource:FOO").setValue("10"))) + .build(); + + // ACT + LocalResourceSetUtils.releaseClaims(entry.getPlatform(), resourceSet); + } +} From fe2eba2adf62d8e4918bb11aa8b7b19be0e0e9a6 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Wed, 13 Dec 2023 06:19:52 -0800 Subject: [PATCH 169/214] refactor: swap HealthStatusManager (#1568) Swapping to the recommended class that isn't deprecated. Also, remove unnecessary String.format(...) with no format args. --- src/main/java/build/buildfarm/server/BuildFarmServer.java | 6 ++---- src/main/java/build/buildfarm/worker/shard/Worker.java | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index d963454de0..5d25339be8 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -41,8 +41,8 @@ import io.grpc.ServerBuilder; import io.grpc.ServerInterceptor; import io.grpc.health.v1.HealthCheckResponse.ServingStatus; +import io.grpc.protobuf.services.HealthStatusManager; import io.grpc.protobuf.services.ProtoReflectionService; -import io.grpc.services.HealthStatusManager; import io.grpc.util.TransmitStatusRuntimeExceptionInterceptor; import io.prometheus.client.Counter; import java.io.File; @@ -55,7 +55,6 @@ import lombok.extern.java.Log; import org.bouncycastle.jce.provider.BouncyCastleProvider; -@SuppressWarnings("deprecation") @Log public class BuildFarmServer extends LoggingMain { private static final java.util.logging.Logger nettyLogger = @@ -88,8 +87,7 @@ public class BuildFarmServer extends LoggingMain { */ public void prepareServerForGracefulShutdown() { if (configs.getServer().getGracefulShutdownSeconds() == 0) { - log.info( - String.format("Graceful Shutdown is not enabled. Server is shutting down immediately.")); + log.info("Graceful Shutdown is not enabled. Server is shutting down immediately."); } else { try { log.info( diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index ce7a3e7385..6b175e1350 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -70,8 +70,8 @@ import io.grpc.Status; import io.grpc.Status.Code; import io.grpc.health.v1.HealthCheckResponse.ServingStatus; +import io.grpc.protobuf.services.HealthStatusManager; import io.grpc.protobuf.services.ProtoReflectionService; -import io.grpc.services.HealthStatusManager; import io.prometheus.client.Counter; import io.prometheus.client.Gauge; import java.io.File; @@ -125,7 +125,6 @@ public final class Worker extends LoggingMain { private WorkerInstance instance; - @SuppressWarnings("deprecation") private final HealthStatusManager healthStatusManager = new HealthStatusManager(); private Server server; From 284845a9c9dcba2021849ca7c37a0e05e672a614 Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Fri, 15 Dec 2023 20:24:02 -0800 Subject: [PATCH 170/214] Update log level for blob location adjust (#1573) --- .../java/build/buildfarm/instance/shard/ServerInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java index b4f118f1ad..50c1de2f6f 100644 --- a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java @@ -795,7 +795,7 @@ private Set filterAndAdjustWorkersForDigest( .immutableCopy(); if (!workersToBeRemoved.isEmpty()) { try { - log.log(Level.INFO, format("adjusting locations for the digest %s", digest)); + log.log(Level.FINE, format("adjusting locations for the digest %s", digest)); backplane.adjustBlobLocations(digest, Collections.emptySet(), workersToBeRemoved); } catch (IOException e) { log.log( From 89509537ebcdb8617a548e237a1ebd1daf3b1609 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Fri, 15 Dec 2023 20:30:37 -0800 Subject: [PATCH 171/214] feat: Redis password from file (#1569) * feat(config): read Redis password from Redis URI or redis password file * tests(common): add a test for build.buildfarm.common.config.Backplane * docs(configuration): document redisPasswordFile Documenting new configuration parameter and the precedence of each password option. --- _site/docs/configuration/configuration.md | 71 ++++++++++--------- .../java/build/buildfarm/common/config/BUILD | 4 ++ .../buildfarm/common/config/Backplane.java | 31 ++++++++ .../java/build/buildfarm/common/config/BUILD | 1 + .../common/config/BackplaneTest.java | 55 ++++++++++++++ 5 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 src/test/java/build/buildfarm/common/config/BackplaneTest.java diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ebbb8ca0e4..9e9d0ab0f9 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -172,41 +172,42 @@ server: ### Redis Backplane -| Configuration | Accepted and _Default_ Values | Environment Var | Command Line Argument | Description | -|------------------------------|------------------------------------------|-----------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type | _SHARD_ | | | Type of backplane. Currently, the only implementation is SHARD utilizing Redis | -| redisUri | String, redis://localhost:6379 | REDIS_URI | --redis_uri | Redis cluster endpoint. This must be a single URI | -| redisPassword | String, _null_ | | | Redis password, if applicable | -| redisNodes | List of Strings, _null_ | | | List of individual Redis nodes, if applicable | -| jedisPoolMaxTotal | Integer, _4000_ | | | The size of the Redis connection pool | -| workersHashName | String, _Workers_ | | | Redis key used to store a hash of registered workers | -| workerChannel | String, _WorkerChannel_ | | | Redis pubsub channel key where changes of the cluster membership are announced | -| actionCachePrefix | String, _ActionCache_ | | | Redis key prefix for all ActionCache entries | -| actionCacheExpire | Integer, _2419200_ | | | The TTL maintained for ActionCache entries, not refreshed on getActionResult hit | -| actionBlacklistPrefix | String, _ActionBlacklist_ | | | Redis key prefix for all blacklisted actions, which are rejected | -| actionBlacklistExpire | Integer, _3600_ | | | The TTL maintained for action blacklist entries | -| invocationBlacklistPrefix | String, _InvocationBlacklist_ | | | Redis key prefix for blacklisted invocations, suffixed with a a tool invocation ID | -| operationPrefix | String, _Operation_ | | | Redis key prefix for all operations, suffixed with the operation's name | -| operationExpire | Integer, _604800_ | | | The TTL maintained for all operations, updated on each modification | -| preQueuedOperationsListName | String, _{Arrival}:PreQueuedOperations_ | | | Redis key used to store a list of ExecuteEntry awaiting transformation into QueryEntry | -| processingListName | String, _{Arrival}:ProcessingOperations_ | | | Redis key of a list used to ensure reliable processing of arrival queue entries with operation watch monitoring | -| processingPrefix | String, _Processing_ | | | Redis key prefix for operations which are being dequeued from the arrival queue | -| processingTimeoutMillis | Integer, _20000_ | | | Delay (in ms) used to populate processing operation entries | -| queuedOperationsListName | String, _{Execution}:QueuedOperations_ | | | Redis key used to store a list of QueueEntry awaiting execution by workers | -| dispatchingPrefix | String, _Dispatching_ | | | Redis key prefix for operations which are being dequeued from the ready to run queue | -| dispatchingTimeoutMillis | Integer, _10000_ | | | Delay (in ms) used to populate dispatching operation entries | -| dispatchedOperationsHashName | String, _DispatchedOperations_ | | | Redis key of a hash of operation names to the worker lease for its execution, which are monitored by the dispatched monitor | -| operationChannelPrefix | String, _OperationChannel_ | | | Redis pubsub channel prefix suffixed by an operation name | -| casPrefix | String, _ContentAddressableStorage_ | | | Redis key prefix suffixed with a blob digest that maps to a set of workers with that blob's availability | -| casExpire | Integer, _604800_ | | | The TTL maintained for CAS entries, which is not refreshed on any read access of the blob | -| subscribeToBackplane | boolean, _true_ | | | Enable an agent of the backplane client which subscribes to worker channel and operation channel events. If disabled, responsiveness of watchers and CAS are reduced | -| runFailsafeOperation | boolean, _true_ | | | Enable an agent in the backplane client which monitors watched operations and ensures they are in a known maintained, or expirable state | -| maxQueueDepth | Integer, _100000_ | | | Maximum length that the ready to run queue is allowed to reach to control an arrival flow for execution | -| maxPreQueueDepth | Integer, _1000000_ | | | Maximum lengh that the arrival queue is allowed to reach to control load on the Redis cluster | -| priorityQueue | boolean, _false_ | | | Priority queue type allows prioritizing operations based on Bazel's --remote_execution_priority= flag | -| timeout | Integer, _10000_ | | | Default timeout | -| maxAttempts | Integer, _20_ | | | Maximum number of execution attempts | -| cacheCas | boolean, _false_ | | | | +| Configuration | Accepted and _Default_ Values | Environment Var | Command Line Argument | Description | +|------------------------------|------------------------------------------|-----------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| type | _SHARD_ | | | Type of backplane. Currently, the only implementation is SHARD utilizing Redis | +| redisUri | String, redis://localhost:6379 | REDIS_URI | --redis_uri | Redis cluster endpoint. This must be a single URI. This can embed a username/password per RFC-3986 Section 3.2.1 and this will take precedence over `redisPassword` and `redisPasswordFile`. | +| redisPassword | String, _null_ | | | Redis password, if applicable | +| redisPasswordFile | String, _null_ | | | File to read for a Redis password. If specified, this takes precedence over `redisPassword` | +| redisNodes | List of Strings, _null_ | | | List of individual Redis nodes, if applicable | +| jedisPoolMaxTotal | Integer, _4000_ | | | The size of the Redis connection pool | +| workersHashName | String, _Workers_ | | | Redis key used to store a hash of registered workers | +| workerChannel | String, _WorkerChannel_ | | | Redis pubsub channel key where changes of the cluster membership are announced | +| actionCachePrefix | String, _ActionCache_ | | | Redis key prefix for all ActionCache entries | +| actionCacheExpire | Integer, _2419200_ | | | The TTL maintained for ActionCache entries, not refreshed on getActionResult hit | +| actionBlacklistPrefix | String, _ActionBlacklist_ | | | Redis key prefix for all blacklisted actions, which are rejected | +| actionBlacklistExpire | Integer, _3600_ | | | The TTL maintained for action blacklist entries | +| invocationBlacklistPrefix | String, _InvocationBlacklist_ | | | Redis key prefix for blacklisted invocations, suffixed with a a tool invocation ID | +| operationPrefix | String, _Operation_ | | | Redis key prefix for all operations, suffixed with the operation's name | +| operationExpire | Integer, _604800_ | | | The TTL maintained for all operations, updated on each modification | +| preQueuedOperationsListName | String, _{Arrival}:PreQueuedOperations_ | | | Redis key used to store a list of ExecuteEntry awaiting transformation into QueryEntry | +| processingListName | String, _{Arrival}:ProcessingOperations_ | | | Redis key of a list used to ensure reliable processing of arrival queue entries with operation watch monitoring | +| processingPrefix | String, _Processing_ | | | Redis key prefix for operations which are being dequeued from the arrival queue | +| processingTimeoutMillis | Integer, _20000_ | | | Delay (in ms) used to populate processing operation entries | +| queuedOperationsListName | String, _{Execution}:QueuedOperations_ | | | Redis key used to store a list of QueueEntry awaiting execution by workers | +| dispatchingPrefix | String, _Dispatching_ | | | Redis key prefix for operations which are being dequeued from the ready to run queue | +| dispatchingTimeoutMillis | Integer, _10000_ | | | Delay (in ms) used to populate dispatching operation entries | +| dispatchedOperationsHashName | String, _DispatchedOperations_ | | | Redis key of a hash of operation names to the worker lease for its execution, which are monitored by the dispatched monitor | +| operationChannelPrefix | String, _OperationChannel_ | | | Redis pubsub channel prefix suffixed by an operation name | +| casPrefix | String, _ContentAddressableStorage_ | | | Redis key prefix suffixed with a blob digest that maps to a set of workers with that blob's availability | +| casExpire | Integer, _604800_ | | | The TTL maintained for CAS entries, which is not refreshed on any read access of the blob | +| subscribeToBackplane | boolean, _true_ | | | Enable an agent of the backplane client which subscribes to worker channel and operation channel events. If disabled, responsiveness of watchers and CAS are reduced | +| runFailsafeOperation | boolean, _true_ | | | Enable an agent in the backplane client which monitors watched operations and ensures they are in a known maintained, or expirable state | +| maxQueueDepth | Integer, _100000_ | | | Maximum length that the ready to run queue is allowed to reach to control an arrival flow for execution | +| maxPreQueueDepth | Integer, _1000000_ | | | Maximum lengh that the arrival queue is allowed to reach to control load on the Redis cluster | +| priorityQueue | boolean, _false_ | | | Priority queue type allows prioritizing operations based on Bazel's --remote_execution_priority= flag | +| timeout | Integer, _10000_ | | | Default timeout | +| maxAttempts | Integer, _20_ | | | Maximum number of execution attempts | +| cacheCas | boolean, _false_ | | | | Example: diff --git a/src/main/java/build/buildfarm/common/config/BUILD b/src/main/java/build/buildfarm/common/config/BUILD index 4d9c8eb7a0..843774e2a0 100644 --- a/src/main/java/build/buildfarm/common/config/BUILD +++ b/src/main/java/build/buildfarm/common/config/BUILD @@ -10,13 +10,17 @@ java_library( "//src/main/protobuf:build_buildfarm_v1test_buildfarm_java_proto", "@googleapis//:google_longrunning_operations_java_proto", "@googleapis//:google_rpc_code_java_proto", + "@jedis//jar", + "@maven//:com_github_oshi_oshi_core", "@maven//:com_github_pcj_google_options", + "@maven//:com_google_code_findbugs_jsr305", "@maven//:com_google_guava_guava", "@maven//:com_google_protobuf_protobuf_java", "@maven//:com_google_protobuf_protobuf_java_util", "@maven//:io_grpc_grpc_api", "@maven//:me_dinowernli_java_grpc_prometheus", "@maven//:org_projectlombok_lombok", + "@maven//:org_redisson_redisson", "@maven//:org_yaml_snakeyaml", ], ) diff --git a/src/main/java/build/buildfarm/common/config/Backplane.java b/src/main/java/build/buildfarm/common/config/Backplane.java index cc15a6028a..16a90e9111 100644 --- a/src/main/java/build/buildfarm/common/config/Backplane.java +++ b/src/main/java/build/buildfarm/common/config/Backplane.java @@ -1,10 +1,15 @@ package build.buildfarm.common.config; +import com.google.common.base.Strings; +import java.net.URI; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; import lombok.AccessLevel; import lombok.Data; import lombok.Getter; +import oshi.util.FileUtil; +import redis.clients.jedis.util.JedisURIHelper; @Data public class Backplane { @@ -46,6 +51,7 @@ public enum BACKPLANE_TYPE { private int maxPreQueueDepth = 1000000; private boolean priorityQueue = false; private Queue[] queues = {}; + private String redisCredentialFile; private String redisPassword; private int timeout = 10000; private String[] redisNodes = {}; @@ -56,4 +62,29 @@ public enum BACKPLANE_TYPE { // These limited resources are shared across all workers. // An example would be a limited number of seats to a license server. private List resources = new ArrayList<>(); + + /** + * Look in several prioritized ways to get a Redis password: + * + *

    + *
  1. the password in the Redis URI (wherever that came from) + *
  2. The `redisPassword` from config YAML + *
  3. the `redisCredentialFile`. + *
+ * + * @return The redis password, or null if unset. + */ + public @Nullable String getRedisPassword() { + URI redisProperUri = URI.create(getRedisUri()); + if (!Strings.isNullOrEmpty(JedisURIHelper.getPassword(redisProperUri))) { + return JedisURIHelper.getPassword(redisProperUri); + } + + if (!Strings.isNullOrEmpty(redisCredentialFile)) { + // Get the password from the config file. + return FileUtil.getStringFromFile(redisCredentialFile); + } + + return Strings.emptyToNull(redisPassword); + } } diff --git a/src/test/java/build/buildfarm/common/config/BUILD b/src/test/java/build/buildfarm/common/config/BUILD index 4819a6bca8..1c411712fa 100644 --- a/src/test/java/build/buildfarm/common/config/BUILD +++ b/src/test/java/build/buildfarm/common/config/BUILD @@ -5,6 +5,7 @@ java_test( deps = [ "//src/main/java/build/buildfarm/common/config", "//src/test/java/build/buildfarm:test_runner", + "@maven//:com_google_truth_truth", "@maven//:io_grpc_grpc_api", "@maven//:io_grpc_grpc_testing", "@maven//:me_dinowernli_java_grpc_prometheus", diff --git a/src/test/java/build/buildfarm/common/config/BackplaneTest.java b/src/test/java/build/buildfarm/common/config/BackplaneTest.java new file mode 100644 index 0000000000..9cf61eadc5 --- /dev/null +++ b/src/test/java/build/buildfarm/common/config/BackplaneTest.java @@ -0,0 +1,55 @@ +// Copyright 2023 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package build.buildfarm.common.config; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * @class BackplaneTest + * @brief Tests utility functions for Backplane configuration overrides + */ +@RunWith(JUnit4.class) +public class BackplaneTest { + + @Before + public void assertNoEnvVariable() { + // If a REDIS_PASSWORD env variable is set, it wins. We're not mocking env vars. + assertThat(System.getenv("REDIS_PASSWORD")).isNull(); + } + + @Test + public void testRedisPasswordFromUri() { + Backplane b = new Backplane(); + String testRedisUri = "redis://user:pass1@redisHost.redisDomain"; + b.setRedisUri(testRedisUri); + assertThat(b.getRedisPassword()).isEqualTo("pass1"); + } + + /** + * Validate that the redis URI password is higher priority than the `redisPassword` in the config + */ + @Test + public void testRedisPasswordPriorities() { + Backplane b = new Backplane(); + b.setRedisUri("redis://user:pass1@redisHost.redisDomain"); + b.setRedisPassword("pass2"); + assertThat(b.getRedisPassword()).isEqualTo("pass1"); + } +} From a4551f025b8cfc6b3052fe9420d4df8a45aa499f Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Fri, 15 Dec 2023 21:27:44 -0800 Subject: [PATCH 172/214] docs: update AUTHORS and CONTRIBUTORS (#1572) Adding myself and my copyright holder to `CONTRIBUTORS` and `AUTHORS`, respectively. --- AUTHORS | 1 + CONTRIBUTORS | 1 + 2 files changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index f9314dfc35..ed0de30898 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Uber Technologies Inc. Aurora Innovation, Inc. VMware, Inc. +Salesforce, Inc. diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1eb0fc98cd..9961c13001 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -13,3 +13,4 @@ George Gensure Yuriy Belenitsky Trevor Hickey Jacob Mou +Jason Schroeder From f9140c49aa8b17803775649f322cefade3f09770 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:07:07 -0500 Subject: [PATCH 173/214] Identify Graceful Shutdown errors with severe (#1574) Ensure that the log reflects these as errors, not just info --- src/main/java/build/buildfarm/server/BuildFarmServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/server/BuildFarmServer.java b/src/main/java/build/buildfarm/server/BuildFarmServer.java index 5d25339be8..be5f934539 100644 --- a/src/main/java/build/buildfarm/server/BuildFarmServer.java +++ b/src/main/java/build/buildfarm/server/BuildFarmServer.java @@ -87,7 +87,7 @@ public class BuildFarmServer extends LoggingMain { */ public void prepareServerForGracefulShutdown() { if (configs.getServer().getGracefulShutdownSeconds() == 0) { - log.info("Graceful Shutdown is not enabled. Server is shutting down immediately."); + log.severe("Graceful Shutdown is not enabled. Server is shutting down immediately."); } else { try { log.info( @@ -96,7 +96,7 @@ public void prepareServerForGracefulShutdown() { configs.getServer().getGracefulShutdownSeconds())); SECONDS.sleep(configs.getServer().getGracefulShutdownSeconds()); } catch (InterruptedException e) { - log.info( + log.severe( "Graceful Shutdown - The server graceful shutdown is interrupted: " + e.getMessage()); } finally { log.info( From f76893ed0690367003223605a53242d14383a1dc Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:09:23 -0500 Subject: [PATCH 174/214] Remove orphaned DequeueResults (#1575) --- .../buildfarm/worker/DequeueResults.java | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/main/java/build/buildfarm/worker/DequeueResults.java diff --git a/src/main/java/build/buildfarm/worker/DequeueResults.java b/src/main/java/build/buildfarm/worker/DequeueResults.java deleted file mode 100644 index f449907db0..0000000000 --- a/src/main/java/build/buildfarm/worker/DequeueResults.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package build.buildfarm.worker; - -/** - * @class DequeueResults - * @brief The results of evaluating a dequeued operation. - * @details Contains information about whether the operation should be kept and if resources were - * claimed. - */ -public class DequeueResults { - /** - * @field keep - * @brief Whether the operation should be kept. - * @details Operations not kept should be put back on the queue. - */ - public boolean keep = false; - - /** - * @field resourcesClaimed - * @brief Whether resources have been claimed while deciding to keep operation. - * @details If resources are claimed but the operation is not kept, the resources should be - * released. - */ - public boolean resourcesClaimed = false; -} From 1fa3c43d79838e3e4f5f757654c338a8fed7a807 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:09:43 -0500 Subject: [PATCH 175/214] Clean up bf-mount usage/refactor (#1576) --- .../java/build/buildfarm/tools/Mount.java | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/main/java/build/buildfarm/tools/Mount.java b/src/main/java/build/buildfarm/tools/Mount.java index a0a4528d22..acd61f1f11 100644 --- a/src/main/java/build/buildfarm/tools/Mount.java +++ b/src/main/java/build/buildfarm/tools/Mount.java @@ -37,10 +37,14 @@ class Mount { @SuppressWarnings("BusyWait") - public static void main(String[] args) throws Exception { - String host = args[0]; - String instanceName = args[1]; - DigestUtil digestUtil = DigestUtil.forHash(args[2]); + public static void mount( + String host, + String instanceName, + DigestUtil digestUtil, + String root, + Digest inputRoot, + String name) + throws IOException, InterruptedException { ManagedChannel channel = createChannel(host); Instance instance = new StubInstance(instanceName, digestUtil, channel); @@ -48,7 +52,7 @@ public static void main(String[] args) throws Exception { FuseCAS fuse = new FuseCAS( - cwd.resolve(args[3]), + cwd.resolve(root), new InputStreamFactory() { final Map cache = new HashMap<>(); @@ -75,8 +79,7 @@ public synchronized InputStream newInput( } }); - // FIXME make bettar - fuse.createInputRoot(args[5], DigestUtil.parseDigest(args[4])); + fuse.createInputRoot(name, inputRoot); try { //noinspection InfiniteLoopStatement @@ -89,4 +92,21 @@ public synchronized InputStream newInput( fuse.stop(); } } + + public static void main(String[] args) throws Exception { + if (args.length != 6) { + System.err.println( + "Usage: bf-mount "); + System.err.println("\nMount an REAPI directory specified by 'digest' at 'name' under 'root'"); + System.exit(1); + } + + String host = args[0]; + String instanceName = args[1]; + DigestUtil digestUtil = DigestUtil.forHash(args[2]); + String root = args[3]; + Digest inputRoot = DigestUtil.parseDigest(args[4]); + String name = args[5]; + mount(host, instanceName, digestUtil, root, inputRoot, name); + } } From cf3ac777ebb7e801ff09889fd588a97be75e5686 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:10:17 -0500 Subject: [PATCH 176/214] Clean up bf-mount usage/refactor (#1577) From ce31446defdcc90db2971f787c1d79403b5310b4 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:10:32 -0500 Subject: [PATCH 177/214] Refactor WriteStreamObserver logging (#1578) --- .../common/services/WriteStreamObserver.java | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index c2518921a0..e1e23fa5b8 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -178,19 +178,11 @@ synchronized void commitSynchronized(long committedSize) { } commitActive(committedSize); } catch (RuntimeException e) { - RequestMetadata requestMetadata = TracingMetadataUtils.fromCurrentContext(); Status status = Status.fromThrowable(e); if (errorResponse(status.asException())) { - log.log( + logWriteActivity( status.getCode() == Status.Code.CANCELLED ? Level.FINER : Level.SEVERE, - format( - "%s-%s: %s -> %s -> %s: error committing %s", - requestMetadata.getToolDetails().getToolName(), - requestMetadata.getToolDetails().getToolVersion(), - requestMetadata.getCorrelatedInvocationsId(), - requestMetadata.getToolInvocationId(), - requestMetadata.getActionId(), - name), + "committing", e); } } @@ -240,7 +232,9 @@ public void onSuccess(Long committedSize) { @SuppressWarnings("NullableProblems") @Override public void onFailure(Throwable t) { - errorResponse(t); + if (errorResponse(t)) { + logWriteActivity("completing", t); + } } }, withCancellation.fixedContextExecutor(directExecutor())); @@ -258,6 +252,26 @@ public void onFailure(Throwable t) { } } + private void logWriteActivity(String activity, Throwable t) { + logWriteActivity(Level.SEVERE, activity, t); + } + + private void logWriteActivity(Level level, String activity, Throwable t) { + RequestMetadata requestMetadata = TracingMetadataUtils.fromCurrentContext(); + log.log( + level, + format( + "%s-%s: %s -> %s -> %s: error %s %s", + requestMetadata.getToolDetails().getToolName(), + requestMetadata.getToolDetails().getToolVersion(), + requestMetadata.getCorrelatedInvocationsId(), + requestMetadata.getToolInvocationId(), + requestMetadata.getActionId(), + activity, + name), + t); + } + private void logWriteRequest(WriteRequest request, Exception e) { log.log( Level.WARNING, @@ -331,7 +345,9 @@ private void handleWrite(String resourceName, long offset, ByteString data, bool } committedSize = getCommittedSizeForWrite(); } catch (IOException e) { - errorResponse(e); + if (errorResponse(e)) { + logWriteActivity("querying", e); + } return; } if (offset != 0 && offset > committedSize) { From 2a6f68c80abd94a72665d18a38cf8ab757d53d13 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:10:54 -0500 Subject: [PATCH 178/214] Determine PipelineStage exception severity (#1579) Select pipeline stage terminations based on exception type. InterruptedExceptions are terminable. Errors are uncaught and will terminate the stage. All others are logged with the pipeline continuing. --- .../build/buildfarm/worker/PipelineStage.java | 51 +++++++--- .../build/buildfarm/worker/PipelineTest.java | 95 +++++++++++++++++++ 2 files changed, 131 insertions(+), 15 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/PipelineStage.java b/src/main/java/build/buildfarm/worker/PipelineStage.java index ecc78f8e7e..49bd392a2e 100644 --- a/src/main/java/build/buildfarm/worker/PipelineStage.java +++ b/src/main/java/build/buildfarm/worker/PipelineStage.java @@ -46,7 +46,7 @@ public String getName() { return name; } - private void runInterruptible() throws InterruptedException { + protected void runInterruptible() throws InterruptedException { while (!output.isClosed() || isClaimed()) { iterate(); } @@ -58,23 +58,44 @@ private void runInterruptible() throws InterruptedException { @Override public void run() { - try { - runInterruptible(); - } catch (InterruptedException e) { - // ignore - } catch (Exception e) { - getLogger() - .log(Level.SEVERE, format("%s::run(): stage terminated due to exception", name), e); - } finally { - boolean wasInterrupted = Thread.interrupted(); + boolean keepRunningStage = true; + while (keepRunningStage) { try { - close(); - } finally { - if (wasInterrupted) { - Thread.currentThread().interrupt(); - } + runInterruptible(); + + // If the run finishes without exception, the stage can also stop running. + keepRunningStage = false; + + } catch (Exception e) { + keepRunningStage = decideTermination(e); } } + + close(); + } + + /** + * @brief When the stage has an uncaught exception, this method determines whether the pipeline + * stage should terminate. + * @details This is a customization of the pipeline stage to allow logging exceptions but keeping + * the pipeline stage running. + * @return Whether the stage should terminate or continue running. + */ + private boolean decideTermination(Exception e) { + // This is a normal way for the pipeline stage to terminate. + // If an interrupt is received, there is no reason to continue the pipeline stage. + if (e instanceof InterruptedException) { + getLogger() + .log(Level.INFO, String.format("%s::run(): stage terminated due to interrupt", name)); + return false; + } + + // On the other hand, this is an abnormal way for a pipeline stage to terminate. + // For robustness of the distributed system, we may want to log the error but continue the + // pipeline stage. + getLogger() + .log(Level.SEVERE, String.format("%s::run(): stage terminated due to exception", name), e); + return true; } public String name() { diff --git a/src/test/java/build/buildfarm/worker/PipelineTest.java b/src/test/java/build/buildfarm/worker/PipelineTest.java index f414b8cefe..866f6f19e3 100644 --- a/src/test/java/build/buildfarm/worker/PipelineTest.java +++ b/src/test/java/build/buildfarm/worker/PipelineTest.java @@ -14,6 +14,11 @@ package build.buildfarm.worker; +import static com.google.common.truth.Truth.assertThat; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import java.util.logging.Logger; import lombok.extern.java.Log; import org.junit.Test; @@ -71,4 +76,94 @@ public void run() { pipeline.start(); pipeline.join(); } + + // Create a test stage that exists because of an interrupt. + // This proves the stage can be interupted. + public class TestStage extends PipelineStage { + public TestStage(String name) { + super(name, null, null, null); + } + + @Override + protected void runInterruptible() throws InterruptedException { + throw new InterruptedException("Interrupt"); + } + + @Override + public void put(OperationContext operationContext) throws InterruptedException {} + + @Override + OperationContext take() { + throw new UnsupportedOperationException(); + } + + @Override + public Logger getLogger() { + return log; + } + } + + // This test demonstrates that the stage will end and the pipeline will finish because it was + // interrupted. + @Test + public void stageExitsOnInterrupt() throws InterruptedException { + Pipeline pipeline = new Pipeline(); + TestStage stage = new TestStage("test"); + pipeline.add(stage, 1); + pipeline.start(); + pipeline.join(); + } + + // Create a test stage that doesn't exit because of an a non-interrupt exception. + // This proves the stage is robust enough continue running when experiencing an exception. + public class ContinueStage extends PipelineStage { + public ContinueStage(String name) { + super(name, null, null, null); + } + + @Override + protected void runInterruptible() throws InterruptedException { + throw new RuntimeException("Exception"); + } + + @Override + public void put(OperationContext operationContext) throws InterruptedException {} + + @Override + OperationContext take() { + throw new UnsupportedOperationException(); + } + + @Override + public Logger getLogger() { + return log; + } + } + + // This test demonstrates that the stage will NOT end and the pipeline will NOT finish because a + // non-interrupt exception was thrown. + @Test + public void stageContinuesOnException() throws InterruptedException { + Pipeline pipeline = new Pipeline(); + ContinueStage stage = new ContinueStage("test"); + pipeline.add(stage, 1); + pipeline.start(); + + boolean didNotThrow = false; + try { + CompletableFuture.runAsync( + () -> { + try { + pipeline.join(); + } catch (InterruptedException e) { + } + return; + }) + .get(1, TimeUnit.SECONDS); + } catch (TimeoutException e) { + didNotThrow = true; + } catch (Exception e) { + } + assertThat(didNotThrow).isTrue(); + } } From a0ec481d0c1635552bbe949be015064b549068da Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:11:10 -0500 Subject: [PATCH 179/214] Authored sandbox asNobody behavior (#1580) Describe a boolean authored to supply the as-nobody wrapper published with buildfarm deployments that should serve as a quick mechanism for any install to use non-buildfarm (typically root) uids for actions. --- .../build/buildfarm/common/config/SandboxSettings.java | 7 +++++++ .../build/buildfarm/worker/shard/ShardWorkerContext.java | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index f432989015..f9873faf2b 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -32,6 +32,13 @@ public class SandboxSettings { */ public boolean alwaysUseSandbox = false; + /** + * @field alwaysUseAsNobody + * @brief Whether or not to always use the as-nobody wrapper when running actions. + * @details It may be preferred to enforce this wrapper instead of relying on client selection. + */ + public boolean alwaysUseAsNobody = false; + /** * @field alwaysUseCgroups * @brief Whether or not to use cgroups when sandboxing actions. diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index 37e46a5892..d6b2d54145 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -979,6 +979,10 @@ IOResource limitSpecifiedExecution( addLinuxSandboxCli(arguments, options); } + if (configs.getWorker().getSandboxSettings().isAlwaysUseAsNobody() || limits.fakeUsername) { + arguments.add(configs.getExecutionWrappers().getAsNobody()); + } + if (limits.time.skipSleep) { arguments.add(configs.getExecutionWrappers().getSkipSleep()); @@ -1043,8 +1047,6 @@ private LinuxSandboxOptions decideLinuxSandboxOptions( private void addLinuxSandboxCli( ImmutableList.Builder arguments, LinuxSandboxOptions options) { - arguments.add(configs.getExecutionWrappers().getAsNobody()); - // Choose the sandbox which is built and deployed with the worker image. arguments.add(configs.getExecutionWrappers().getLinuxSandbox()); From 915612379e5e658076e4b95b6ee432ec5ab01d25 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sat, 16 Dec 2023 11:11:28 -0500 Subject: [PATCH 180/214] Provide Additional sandbox write paths in config (#1581) Deployments may specify the paths that should be writable in sandbox --- .../buildfarm/common/config/SandboxSettings.java | 16 ++++++++++++++++ .../worker/shard/ShardWorkerContext.java | 8 +++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/build/buildfarm/common/config/SandboxSettings.java b/src/main/java/build/buildfarm/common/config/SandboxSettings.java index f9873faf2b..db198b7c8e 100644 --- a/src/main/java/build/buildfarm/common/config/SandboxSettings.java +++ b/src/main/java/build/buildfarm/common/config/SandboxSettings.java @@ -14,6 +14,8 @@ package build.buildfarm.common.config; +import java.util.ArrayList; +import java.util.List; import lombok.Data; /** @@ -53,6 +55,20 @@ public class SandboxSettings { */ public boolean alwaysUseTmpFs = false; + /** + * @field additionalWritePaths + * @brief Additional paths the sandbox is allowed to write to. + * @details Suggestions may include: /tmp, /dev/shm + */ + public List additionalWritePaths = new ArrayList(); + + /** + * @field tmpFsPaths + * @brief Additional paths the sandbox uses for tmpfs + * @details Suggestions may include: /tmp + */ + public List tmpFsPaths = new ArrayList(); + /** * @field selectForBlockNetwork * @brief If the action requires "block network" use the sandbox to fulfill this request. diff --git a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java index d6b2d54145..71bc76e9e4 100644 --- a/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java +++ b/src/main/java/build/buildfarm/worker/shard/ShardWorkerContext.java @@ -1021,13 +1021,11 @@ private LinuxSandboxOptions decideLinuxSandboxOptions( // TODO: provide proper support for bazel sandbox's fakeUsername "-U" flag. // options.fakeUsername = limits.fakeUsername; - // these were hardcoded in bazel based on a filesystem configuration typical to ours - // TODO: they may be incorrect for say Windows, and support will need adjusted in the future. - options.writableFiles.add("/tmp"); - options.writableFiles.add("/dev/shm"); + options.writableFiles.addAll( + configs.getWorker().getSandboxSettings().getAdditionalWritePaths()); if (limits.tmpFs) { - options.tmpfsDirs.add("/tmp"); + options.writableFiles.addAll(configs.getWorker().getSandboxSettings().getTmpFsPaths()); } if (limits.debugAfterExecution) { From b48032ba7e1f98867f044d3e2289da69108308a4 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 18 Dec 2023 14:40:55 -0500 Subject: [PATCH 181/214] Declare stat block information for FuseCAS (#1582) Useful so that a `du` and other block related tools work on the mounted directory. --- src/main/java/build/buildfarm/worker/FuseCAS.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/worker/FuseCAS.java b/src/main/java/build/buildfarm/worker/FuseCAS.java index 68489cbe2e..b9697d0133 100644 --- a/src/main/java/build/buildfarm/worker/FuseCAS.java +++ b/src/main/java/build/buildfarm/worker/FuseCAS.java @@ -547,6 +547,9 @@ public int getattr(String path, FileStat stat) { return -ErrorCodes.ENOENT(); } + // stock block size + stat.st_blksize.set(4096); + if (entry.isSymlink()) { stat.st_mode.set(FileStat.S_IFLNK | 0777); } else if (entry.isDirectory()) { @@ -554,9 +557,13 @@ public int getattr(String path, FileStat stat) { } else { int mode = entry.isExecutable() ? 0555 : 0444; stat.st_mode.set(FileStat.S_IFREG | mode); - stat.st_nlink.set(1); - stat.st_size.set(entry.size()); + stat.st_nlink.set(1); // should fix this for number of digests pointing to it } + long size = entry.size(); + long blksize = stat.st_blksize.get(); + long blocks = (size + blksize - 1) / blksize; + stat.st_size.set(size); + stat.st_blocks.set(blocks); return 0; } From 2097ef997a0d42a3c0290deb104b3660d697de1d Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 18 Dec 2023 16:06:24 -0500 Subject: [PATCH 182/214] Try a new version of jekyll (#1583) Current version is failing with a gem bundler error --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 064cde87fe..a4facca3c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: ${{ runner.os }}-gems- # Use GitHub Deploy Action to build and deploy to Github - - uses: jeffreytse/jekyll-deploy-action@v0.4.0 + - uses: jeffreytse/jekyll-deploy-action@v0.5.0 with: provider: 'github' token: ${{ secrets.GH_TOKEN }} # It's your Personal Access Token(PAT) From d4de791d62046f8f0479e6d53091365e03e9d647 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Thu, 21 Dec 2023 14:46:24 -0500 Subject: [PATCH 183/214] include (un)zip in images (#1590) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 11c3379edc..6b843cc0be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM ubuntu:18.04 RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retries RUN apt-get update -RUN apt-get -y install wget git python gcc openjdk-8-jdk g++ redis redis-server +RUN apt-get -y install wget git zip python gcc openjdk-8-jdk g++ redis redis-server RUN wget --tries=10 -O get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py RUN python2 get-pip.py RUN pip install python-dateutil From f320a8145312052e42c8f5fe672ec8f392e07d5c Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 21 Dec 2023 12:07:01 -0800 Subject: [PATCH 184/214] Remove rules k8s (#1587) * build: remove rules_k8s The repo was archived May 12, 2023. * chore: remove unused k8s templates Please use the helm chart instead. * chore: Tiltfile updates to use helm chart instead --- Tiltfile | 24 +- defs.bzl | 3 - deps.bzl | 8 - kubernetes/deployments/BUILD | 25 -- kubernetes/deployments/kubernetes.yaml | 303 --------------------- kubernetes/deployments/redis-cluster.yaml | 22 -- kubernetes/deployments/server.yaml | 28 -- kubernetes/deployments/shard-worker.yaml | 32 --- kubernetes/services/BUILD | 31 --- kubernetes/services/grafana.yaml | 82 ------ kubernetes/services/jaeger.yaml | 305 ---------------------- kubernetes/services/open-telemetry.yaml | 218 ---------------- kubernetes/services/redis-cluster.yaml | 11 - kubernetes/services/shard-worker.yaml | 17 -- 14 files changed, 3 insertions(+), 1106 deletions(-) delete mode 100644 kubernetes/deployments/BUILD delete mode 100644 kubernetes/deployments/kubernetes.yaml delete mode 100644 kubernetes/deployments/redis-cluster.yaml delete mode 100644 kubernetes/deployments/server.yaml delete mode 100644 kubernetes/deployments/shard-worker.yaml delete mode 100644 kubernetes/services/BUILD delete mode 100644 kubernetes/services/grafana.yaml delete mode 100644 kubernetes/services/jaeger.yaml delete mode 100644 kubernetes/services/open-telemetry.yaml delete mode 100644 kubernetes/services/redis-cluster.yaml delete mode 100644 kubernetes/services/shard-worker.yaml diff --git a/Tiltfile b/Tiltfile index 454f13253b..b706a79122 100644 --- a/Tiltfile +++ b/Tiltfile @@ -34,7 +34,7 @@ def server_deps(): # Inform tilt about the custom images built within the repository. # When you change code, these images will be re-built and re-deployed. custom_build( - ref='buildfarm-shard-worker-image', + ref='bazelbuild/buildfarm-worker', command=( 'bazelisk build --javabase=@bazel_tools//tools/jdk:remote_jdk11 //:buildfarm-shard-worker.tar && ' + 'docker load < bazel-bin/buildfarm-shard-worker.tar && ' + @@ -44,7 +44,7 @@ custom_build( deps = worker_deps() ) custom_build( - ref='buildfarm-server-image', + ref='bazelbuild/buildfarm-server', command=( 'bazelisk build --javabase=@bazel_tools//tools/jdk:remote_jdk11 //:buildfarm-server.tar && ' + 'docker load < bazel-bin/buildfarm-server.tar && ' + @@ -58,22 +58,4 @@ local_resource("unit tests",'bazelisk test --javabase=@bazel_tools//tools/jdk:re # Object definitions for kubernetes. # Tilt will automatically correlate them to any above docker images. -k8s_yaml(local('bazelisk run //kubernetes/deployments:kubernetes')) -k8s_yaml(local('bazelisk run //kubernetes/deployments:server')) -k8s_yaml(local('bazelisk run //kubernetes/deployments:shard-worker')) -k8s_yaml(local('bazelisk run //kubernetes/deployments:redis-cluster')) -k8s_yaml(local('bazelisk run //kubernetes/services:grafana')) -k8s_yaml(local('bazelisk run //kubernetes/services:redis-cluster')) -k8s_yaml(local('bazelisk run //kubernetes/services:shard-worker')) -k8s_yaml(local('bazelisk run //kubernetes/services:open-telemetry')) -k8s_yaml(local('bazelisk run //kubernetes/services:jaeger')) - -# Expose endpoints outside the kubernetes cluster. -k8s_resource('server', port_forwards=[8980,9092], labels="buildfarm-cluster") -k8s_resource('shard-worker', port_forwards=[8981,9091], labels="buildfarm-cluster") -k8s_resource('redis-cluster', port_forwards=6379, labels="buildfarm-cluster") -k8s_resource('otel-agent', labels="tracing") -k8s_resource('otel-collector', port_forwards=[4317,4318], labels="tracing") -k8s_resource('simplest', port_forwards=[14269,16686], labels="tracing") -k8s_resource('kubernetes-dashboard', port_forwards=8443) -k8s_resource('grafana', port_forwards=3000, labels="metrics") +k8s_yaml(helm('kubernetes/helm-charts/buildfarm')) diff --git a/defs.bzl b/defs.bzl index ad0790593e..a6114caa27 100644 --- a/defs.bzl +++ b/defs.bzl @@ -11,7 +11,6 @@ load( load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS", "grpc_java_repositories") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") -load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories") IO_NETTY_MODULES = [ "buffer", @@ -133,8 +132,6 @@ def buildfarm_init(name = "buildfarm"): grpc_java_repositories() - k8s_repositories() - native.bind( name = "jar/redis/clients/jedis", actual = "@jedis//jar", diff --git a/deps.bzl b/deps.bzl index 51dfbb953b..1d9f015226 100644 --- a/deps.bzl +++ b/deps.bzl @@ -25,14 +25,6 @@ def archive_dependencies(third_party): "url": "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), }, - # Kubernetes rules. Useful for local development with tilt. - { - "name": "io_bazel_rules_k8s", - "strip_prefix": "rules_k8s-0.7", - "url": "https://github.com/bazelbuild/rules_k8s/archive/refs/tags/v0.7.tar.gz", - "sha256": "ce5b9bc0926681e2e7f2147b49096f143e6cbc783e71bc1d4f36ca76b00e6f4a", - }, - # Needed for "well-known protos" and @com_google_protobuf//:protoc. { "name": "com_google_protobuf", diff --git a/kubernetes/deployments/BUILD b/kubernetes/deployments/BUILD deleted file mode 100644 index cd2051dce8..0000000000 --- a/kubernetes/deployments/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -load("@io_bazel_rules_k8s//k8s:object.bzl", "k8s_object") - -k8s_object( - name = "kubernetes", - kind = "deployment", - template = ":kubernetes.yaml", -) - -k8s_object( - name = "server", - kind = "deployment", - template = ":server.yaml", -) - -k8s_object( - name = "shard-worker", - kind = "deployment", - template = ":shard-worker.yaml", -) - -k8s_object( - name = "redis-cluster", - kind = "deployment", - template = ":redis-cluster.yaml", -) diff --git a/kubernetes/deployments/kubernetes.yaml b/kubernetes/deployments/kubernetes.yaml deleted file mode 100644 index 5bc400448e..0000000000 --- a/kubernetes/deployments/kubernetes.yaml +++ /dev/null @@ -1,303 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: v1 -kind: Namespace -metadata: - name: kubernetes-dashboard - ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard - namespace: kubernetes-dashboard - ---- - -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard - namespace: kubernetes-dashboard -spec: - ports: - - port: 443 - targetPort: 8443 - selector: - k8s-app: kubernetes-dashboard - ---- - -apiVersion: v1 -kind: Secret -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard-certs - namespace: kubernetes-dashboard -type: Opaque - ---- - -apiVersion: v1 -kind: Secret -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard-csrf - namespace: kubernetes-dashboard -type: Opaque -data: - csrf: "" - ---- - -apiVersion: v1 -kind: Secret -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard-key-holder - namespace: kubernetes-dashboard -type: Opaque - ---- - -kind: ConfigMap -apiVersion: v1 -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard-settings - namespace: kubernetes-dashboard - ---- - -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard - namespace: kubernetes-dashboard -rules: - # Allow Dashboard to get, update and delete Dashboard exclusive secrets. - - apiGroups: [""] - resources: ["secrets"] - resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs", "kubernetes-dashboard-csrf"] - verbs: ["get", "update", "delete"] - # Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map. - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["kubernetes-dashboard-settings"] - verbs: ["get", "update"] - # Allow Dashboard to get metrics. - - apiGroups: [""] - resources: ["services"] - resourceNames: ["heapster", "dashboard-metrics-scraper"] - verbs: ["proxy"] - - apiGroups: [""] - resources: ["services/proxy"] - resourceNames: ["heapster", "http:heapster:", "https:heapster:", "dashboard-metrics-scraper", "http:dashboard-metrics-scraper"] - verbs: ["get"] - ---- - -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard -rules: - # Allow Metrics Scraper to get metrics from the Metrics server - - apiGroups: ["metrics.k8s.io"] - resources: ["pods", "nodes"] - verbs: ["get", "list", "watch"] - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard - namespace: kubernetes-dashboard -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: kubernetes-dashboard -subjects: - - kind: ServiceAccount - name: kubernetes-dashboard - namespace: kubernetes-dashboard - ---- - -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: kubernetes-dashboard -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: kubernetes-dashboard -subjects: - - kind: ServiceAccount - name: kubernetes-dashboard - namespace: kubernetes-dashboard - ---- - -kind: Deployment -apiVersion: apps/v1 -metadata: - labels: - k8s-app: kubernetes-dashboard - name: kubernetes-dashboard - namespace: kubernetes-dashboard -spec: - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - k8s-app: kubernetes-dashboard - template: - metadata: - labels: - k8s-app: kubernetes-dashboard - spec: - containers: - - name: kubernetes-dashboard - image: kubernetesui/dashboard:v2.4.0 - imagePullPolicy: Always - ports: - - containerPort: 8443 - protocol: TCP - args: - - --auto-generate-certificates - - --namespace=kubernetes-dashboard - # Uncomment the following line to manually specify Kubernetes API server Host - # If not specified, Dashboard will attempt to auto discover the API server and connect - # to it. Uncomment only if the default does not work. - # - --apiserver-host=http://my-address:port - volumeMounts: - - name: kubernetes-dashboard-certs - mountPath: /certs - # Create on-disk volume to store exec logs - - mountPath: /tmp - name: tmp-volume - livenessProbe: - httpGet: - scheme: HTTPS - path: / - port: 8443 - initialDelaySeconds: 30 - timeoutSeconds: 30 - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - runAsUser: 1001 - runAsGroup: 2001 - volumes: - - name: kubernetes-dashboard-certs - secret: - secretName: kubernetes-dashboard-certs - - name: tmp-volume - emptyDir: {} - serviceAccountName: kubernetes-dashboard - nodeSelector: - "kubernetes.io/os": linux - # Comment the following tolerations if Dashboard must not be deployed on master - tolerations: - - key: node-role.kubernetes.io/master - effect: NoSchedule - ---- - -kind: Service -apiVersion: v1 -metadata: - labels: - k8s-app: dashboard-metrics-scraper - name: dashboard-metrics-scraper - namespace: kubernetes-dashboard -spec: - ports: - - port: 8000 - targetPort: 8000 - selector: - k8s-app: dashboard-metrics-scraper - ---- - -kind: Deployment -apiVersion: apps/v1 -metadata: - labels: - k8s-app: dashboard-metrics-scraper - name: dashboard-metrics-scraper - namespace: kubernetes-dashboard -spec: - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - k8s-app: dashboard-metrics-scraper - template: - metadata: - labels: - k8s-app: dashboard-metrics-scraper - spec: - securityContext: - seccompProfile: - type: RuntimeDefault - containers: - - name: dashboard-metrics-scraper - image: kubernetesui/metrics-scraper:v1.0.7 - ports: - - containerPort: 8000 - protocol: TCP - livenessProbe: - httpGet: - scheme: HTTP - path: / - port: 8000 - initialDelaySeconds: 30 - timeoutSeconds: 30 - volumeMounts: - - mountPath: /tmp - name: tmp-volume - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - runAsUser: 1001 - runAsGroup: 2001 - serviceAccountName: kubernetes-dashboard - nodeSelector: - "kubernetes.io/os": linux - # Comment the following tolerations if Dashboard must not be deployed on master - tolerations: - - key: node-role.kubernetes.io/master - effect: NoSchedule - volumes: - - name: tmp-volume - emptyDir: {} diff --git a/kubernetes/deployments/redis-cluster.yaml b/kubernetes/deployments/redis-cluster.yaml deleted file mode 100644 index 9cd6263d45..0000000000 --- a/kubernetes/deployments/redis-cluster.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: redis-cluster - labels: - name: redis-cluster -spec: - replicas: 1 - selector: - matchLabels: - name: redis-cluster - template: - metadata: - labels: - name: redis-cluster - spec: - #subdomain: primary - containers: - - name: redis-cluster - image: redis:5.0.4 - ports: - - containerPort: 6379 diff --git a/kubernetes/deployments/server.yaml b/kubernetes/deployments/server.yaml deleted file mode 100644 index 163f65697f..0000000000 --- a/kubernetes/deployments/server.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: server - labels: - name: server -spec: - replicas: 1 - selector: - matchLabels: - name: server - template: - metadata: - labels: - name: server - spec: - containers: - - name: server - image: buildfarm-server-image - ports: - - containerPort: 8980 - name: "server-comm" - - containerPort: 9092 - name: "server-metrics" - env: - - name: REDIS_URI - value: "redis://redis-cluster-service:6379" - diff --git a/kubernetes/deployments/shard-worker.yaml b/kubernetes/deployments/shard-worker.yaml deleted file mode 100644 index 7a914b6db0..0000000000 --- a/kubernetes/deployments/shard-worker.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: shard-worker - labels: - name: shard-worker -spec: - replicas: 1 - selector: - matchLabels: - name: shard-worker - template: - metadata: - labels: - name: shard-worker - spec: - containers: - - name: shard-worker - image: buildfarm-shard-worker-image - resources: - limits: - cpu: "2" - requests: - cpu: "2" - ports: - - containerPort: 8981 - name: "worker-comm" - - containerPort: 9091 - name: "worker-metrics" - env: - - name: REDIS_URI - value: "redis://redis-cluster-service:6379" diff --git a/kubernetes/services/BUILD b/kubernetes/services/BUILD deleted file mode 100644 index 071e6344f7..0000000000 --- a/kubernetes/services/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_k8s//k8s:object.bzl", "k8s_object") - -k8s_object( - name = "redis-cluster", - kind = "service", - template = ":redis-cluster.yaml", -) - -k8s_object( - name = "shard-worker", - kind = "service", - template = ":shard-worker.yaml", -) - -k8s_object( - name = "open-telemetry", - kind = "service", - template = ":open-telemetry.yaml", -) - -k8s_object( - name = "jaeger", - kind = "service", - template = ":jaeger.yaml", -) - -k8s_object( - name = "grafana", - kind = "service", - template = ":grafana.yaml", -) diff --git a/kubernetes/services/grafana.yaml b/kubernetes/services/grafana.yaml deleted file mode 100644 index b87cbef235..0000000000 --- a/kubernetes/services/grafana.yaml +++ /dev/null @@ -1,82 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: grafana-pvc -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: grafana - name: grafana -spec: - selector: - matchLabels: - app: grafana - template: - metadata: - labels: - app: grafana - spec: - securityContext: - fsGroup: 472 - supplementalGroups: - - 0 - containers: - - name: grafana - image: grafana/grafana:8.2.5 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 3000 - name: http-grafana - protocol: TCP - readinessProbe: - failureThreshold: 3 - httpGet: - path: /robots.txt - port: 3000 - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: 3000 - timeoutSeconds: 1 - resources: - requests: - cpu: 250m - memory: 750Mi - volumeMounts: - - mountPath: /var/lib/grafana - name: grafana-pv - volumes: - - name: grafana-pv - persistentVolumeClaim: - claimName: grafana-pvc ---- -apiVersion: v1 -kind: Service -metadata: - name: grafana -spec: - ports: - - port: 3000 - protocol: TCP - targetPort: http-grafana - selector: - app: grafana - sessionAffinity: None - type: LoadBalancer \ No newline at end of file diff --git a/kubernetes/services/jaeger.yaml b/kubernetes/services/jaeger.yaml deleted file mode 100644 index d5900caf6b..0000000000 --- a/kubernetes/services/jaeger.yaml +++ /dev/null @@ -1,305 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: service-account - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - name: simplest ---- -apiVersion: v1 -data: - sampling: '{"default_strategy":{"param":1,"type":"probabilistic"}}' -kind: ConfigMap -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: sampling-configuration - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-sampling-configuration - app.kubernetes.io/part-of: jaeger - name: simplest-sampling-configuration ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: query-ingress - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-query - app.kubernetes.io/part-of: jaeger - name: simplest-query -spec: - defaultBackend: - service: - name: simplest-query - port: - number: 16686 -status: - loadBalancer: {} ---- -apiVersion: v1 -kind: Service -metadata: - annotations: - prometheus.io/scrape: "false" - service.beta.openshift.io/serving-cert-secret-name: simplest-collector-headless-tls - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: service-collector - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-collector - app.kubernetes.io/part-of: jaeger - name: simplest-collector-headless -spec: - clusterIP: None - ports: - - name: http-zipkin - port: 9411 - targetPort: 0 - - name: grpc-http - port: 14250 - targetPort: 0 - - name: c-tchan-trft - port: 14267 - targetPort: 0 - - name: http-c-binary-trft - port: 14268 - targetPort: 0 - selector: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger -status: - loadBalancer: {} ---- -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: service-collector - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-collector - app.kubernetes.io/part-of: jaeger - name: simplest-collector -spec: - ports: - - name: http-zipkin - port: 9411 - targetPort: 0 - - name: grpc-http - port: 14250 - targetPort: 0 - - name: c-tchan-trft - port: 14267 - targetPort: 0 - - name: http-c-binary-trft - port: 14268 - targetPort: 0 - selector: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - type: ClusterIP -status: - loadBalancer: {} ---- -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: service-query - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-query - app.kubernetes.io/part-of: jaeger - name: simplest-query -spec: - ports: - - name: http-query - port: 16686 - targetPort: 16686 - - name: grpc-query - port: 16685 - targetPort: 16685 - selector: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - type: ClusterIP -status: - loadBalancer: {} ---- -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: service-agent - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest-agent - app.kubernetes.io/part-of: jaeger - name: simplest-agent -spec: - clusterIP: None - ports: - - name: zk-compact-trft - port: 5775 - protocol: UDP - targetPort: 0 - - name: config-rest - port: 5778 - targetPort: 0 - - name: jg-compact-trft - port: 6831 - protocol: UDP - targetPort: 0 - - name: jg-binary-trft - port: 6832 - protocol: UDP - targetPort: 0 - selector: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger -status: - loadBalancer: {} ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - linkerd.io/inject: disabled - prometheus.io/port: "14269" - prometheus.io/scrape: "true" - sidecar.istio.io/inject: "false" - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - name: simplest -spec: - selector: - matchLabels: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - strategy: - type: Recreate - template: - metadata: - annotations: - linkerd.io/inject: disabled - prometheus.io/port: "14269" - prometheus.io/scrape: "true" - sidecar.istio.io/inject: "false" - creationTimestamp: null - labels: - app: jaeger - app.kubernetes.io/component: all-in-one - app.kubernetes.io/instance: simplest - app.kubernetes.io/managed-by: jaeger-operator - app.kubernetes.io/name: simplest - app.kubernetes.io/part-of: jaeger - spec: - containers: - - args: - - --sampling.strategies-file=/etc/jaeger/sampling/sampling.json - env: - - name: SPAN_STORAGE_TYPE - value: memory - - name: COLLECTOR_ZIPKIN_HOST_PORT - value: :9411 - - name: JAEGER_DISABLED - value: "false" - image: jaegertracing/all-in-one:1.30.0 - livenessProbe: - failureThreshold: 5 - httpGet: - path: / - port: 14269 - initialDelaySeconds: 5 - periodSeconds: 15 - name: jaeger - ports: - - containerPort: 5775 - name: zk-compact-trft - protocol: UDP - - containerPort: 5778 - name: config-rest - - containerPort: 6831 - name: jg-compact-trft - protocol: UDP - - containerPort: 6832 - name: jg-binary-trft - protocol: UDP - - containerPort: 9411 - name: zipkin - - containerPort: 14267 - name: c-tchan-trft - - containerPort: 14268 - name: c-binary-trft - - containerPort: 16686 - name: query - - containerPort: 14269 - name: admin-http - - containerPort: 14250 - name: grpc - readinessProbe: - httpGet: - path: / - port: 14269 - initialDelaySeconds: 1 - resources: {} - volumeMounts: - - mountPath: /etc/jaeger/sampling - name: simplest-sampling-configuration-volume - readOnly: true - enableServiceLinks: false - serviceAccountName: simplest - volumes: - - configMap: - items: - - key: sampling - path: sampling.json - name: simplest-sampling-configuration - name: simplest-sampling-configuration-volume -status: {} diff --git a/kubernetes/services/open-telemetry.yaml b/kubernetes/services/open-telemetry.yaml deleted file mode 100644 index 494b8504e5..0000000000 --- a/kubernetes/services/open-telemetry.yaml +++ /dev/null @@ -1,218 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: otel-agent-conf - labels: - app: opentelemetry - component: otel-agent-conf -data: - otel-agent-config: | - receivers: - otlp: - protocols: - grpc: - http: - exporters: - otlp: - endpoint: "otel-collector.default:4317" - tls: - insecure: true - sending_queue: - num_consumers: 4 - queue_size: 100 - retry_on_failure: - enabled: true - processors: - batch: - memory_limiter: - # 80% of maximum memory up to 2G - limit_mib: 400 - # 25% of limit up to 2G - spike_limit_mib: 100 - check_interval: 5s - extensions: - zpages: {} - memory_ballast: - # Memory Ballast size should be max 1/3 to 1/2 of memory. - size_mib: 165 - service: - extensions: [zpages, memory_ballast] - pipelines: - traces: - receivers: [otlp] - processors: [memory_limiter, batch] - exporters: [otlp] ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: otel-agent - labels: - app: opentelemetry - component: otel-agent -spec: - selector: - matchLabels: - app: opentelemetry - component: otel-agent - template: - metadata: - labels: - app: opentelemetry - component: otel-agent - spec: - containers: - - command: - - "/otelcol" - - "--config=/conf/otel-agent-config.yaml" - image: otel/opentelemetry-collector:0.38.0 - name: otel-agent - resources: - limits: - cpu: 500m - memory: 500Mi - requests: - cpu: 100m - memory: 100Mi - ports: - - containerPort: 55679 # ZPages endpoint. - - containerPort: 4317 # Default OpenTelemetry receiver port. - - containerPort: 8888 # Metrics. - volumeMounts: - - name: otel-agent-config-vol - mountPath: /conf - volumes: - - configMap: - name: otel-agent-conf - items: - - key: otel-agent-config - path: otel-agent-config.yaml - name: otel-agent-config-vol ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: otel-collector-conf - labels: - app: opentelemetry - component: otel-collector-conf -data: - otel-collector-config: | - receivers: - otlp: - protocols: - grpc: - http: - processors: - batch: - memory_limiter: - # 80% of maximum memory up to 2G - limit_mib: 1500 - # 25% of limit up to 2G - spike_limit_mib: 512 - check_interval: 5s - extensions: - zpages: {} - memory_ballast: - # Memory Ballast size should be max 1/3 to 1/2 of memory. - size_mib: 683 - exporters: - otlp: - endpoint: "http://someotlp.target.com:4317" # Replace with a real endpoint. - tls: - insecure: true - jaeger: - endpoint: "simplest-collector:14250" - tls: - insecure: true - service: - extensions: [zpages, memory_ballast] - pipelines: - traces/1: - receivers: [otlp] - processors: [memory_limiter, batch] - exporters: [jaeger] ---- -apiVersion: v1 -kind: Service -metadata: - name: otel-collector - labels: - app: opentelemetry - component: otel-collector -spec: - ports: - - name: otlp-grpc # Default endpoint for OpenTelemetry gRPC receiver. - port: 4317 - protocol: TCP - targetPort: 4317 - - name: otlp-http # Default endpoint for OpenTelemetry HTTP receiver. - port: 4318 - protocol: TCP - targetPort: 4318 - - name: metrics # Default endpoint for querying metrics. - port: 8888 - selector: - component: otel-collector ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: otel-collector - labels: - app: opentelemetry - component: otel-collector -spec: - selector: - matchLabels: - app: opentelemetry - component: otel-collector - minReadySeconds: 5 - progressDeadlineSeconds: 120 - replicas: 1 #TODO - adjust this to your own requirements - template: - metadata: - labels: - app: opentelemetry - component: otel-collector - spec: - containers: - - command: - - "/otelcol" - - "--config=/conf/otel-collector-config.yaml" - image: otel/opentelemetry-collector:0.38.0 - name: otel-collector - resources: - limits: - cpu: 1 - memory: 2Gi - requests: - cpu: 200m - memory: 400Mi - ports: - - containerPort: 55679 # Default endpoint for ZPages. - - containerPort: 4317 # Default endpoint for OpenTelemetry receiver. - - containerPort: 14250 # Default endpoint for Jaeger gRPC receiver. - - containerPort: 14268 # Default endpoint for Jaeger HTTP receiver. - - containerPort: 9411 # Default endpoint for Zipkin receiver. - - containerPort: 8888 # Default endpoint for querying metrics. - volumeMounts: - - name: otel-collector-config-vol - mountPath: /conf -# - name: otel-collector-secrets -# mountPath: /secrets - volumes: - - configMap: - name: otel-collector-conf - items: - - key: otel-collector-config - path: otel-collector-config.yaml - name: otel-collector-config-vol -# - secret: -# name: otel-collector-secrets -# items: -# - key: cert.pem -# path: cert.pem -# - key: key.pem -# path: key.pem \ No newline at end of file diff --git a/kubernetes/services/redis-cluster.yaml b/kubernetes/services/redis-cluster.yaml deleted file mode 100644 index 116dbcea39..0000000000 --- a/kubernetes/services/redis-cluster.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: redis-cluster-service -spec: - selector: - name: redis-cluster - ports: - - protocol: TCP - port: 6379 - targetPort: 6379 diff --git a/kubernetes/services/shard-worker.yaml b/kubernetes/services/shard-worker.yaml deleted file mode 100644 index 0e89e0f313..0000000000 --- a/kubernetes/services/shard-worker.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: shard-worker-service -spec: - selector: - name: shard-worker - ports: - - name: "communication" - protocol: TCP - port: 8981 - targetPort: 8981 - - name: "metrics" - protocol: TCP - port: 9091 - targetPort: 9091 - From 2870a3ffd68a255d26eaa8f066a2d4b13d2701b8 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 21 Dec 2023 12:08:03 -0800 Subject: [PATCH 185/214] chore: bump rules_license to 0.0.7 (#1585) Updating rules_license https://github.com/bazelbuild/rules_license/releases/tag/0.0.7 --- deps.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps.bzl b/deps.bzl index 1d9f015226..00260e5ccd 100644 --- a/deps.bzl +++ b/deps.bzl @@ -56,10 +56,10 @@ def archive_dependencies(third_party): }, { "name": "rules_license", - "sha256": "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381", + "sha256": "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", "urls": [ - "https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", ], }, From 1b52ac01a4e6869f9015e39cb7b0cc423236264d Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 21 Dec 2023 12:10:32 -0800 Subject: [PATCH 186/214] Bump rules_go and gazelle (#1584) * deps: bump rules_go Updating to 0.43.0 https://github.com/bazelbuild/rules_go/releases/tag/v0.43.0 * deps: bump gazelle Updating to 0.34.0 https://github.com/bazelbuild/bazel-gazelle/releases/tag/v0.34.0 --- deps.bzl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/deps.bzl b/deps.bzl index 00260e5ccd..a289610b23 100644 --- a/deps.bzl +++ b/deps.bzl @@ -111,16 +111,19 @@ def archive_dependencies(third_party): # Updated versions of io_bazel_rules_docker dependencies for bazel compatibility { "name": "io_bazel_rules_go", - "sha256": "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3", + "sha256": "d6ab6b57e48c09523e93050f13698f708428cfd5e619252e369d377af6597707", "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip", ], }, { "name": "bazel_gazelle", - "sha256": "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809", - "urls": ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz"], + "sha256": "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf", + "urls": [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", + ], }, # Bazel is referenced as a dependency so that buildfarm can access the linux-sandbox as a potential execution wrapper. From 78b001c06f08d97b8e9f2b25399b852fd013988b Mon Sep 17 00:00:00 2001 From: Trevor Hickey Date: Tue, 2 Jan 2024 08:29:04 -0500 Subject: [PATCH 187/214] [CI] skip server/worker audit on mac (#1592) * do not audit server/worker jars on mac Avoid python dependencies on mac unit test CI * Update presubmit.yml comment reference to underlying issue --------- Co-authored-by: George Gensure --- .bazelci/presubmit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index dfdf37f892..43aeba5380 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -63,7 +63,8 @@ tasks: USE_BAZEL_VERSION: 17be878292730359c9c90efdceabed26126df7ae build_flags: - "--cxxopt=-std=c++14" - - "--build_tag_filters=-container" + # FIXME: remove audit subtraction when https://github.com/bazelbuild/bazel-buildfarm/issues/1595 fixed + - "--build_tag_filters=-container,-audit" build_targets: - "..." test_flags: From b5425e0045d65b266bcee5991c0b8cbf9ee7a35b Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Tue, 2 Jan 2024 10:22:39 -0500 Subject: [PATCH 188/214] Helm Chart: latest image tags not v-prefixed (#1591) * latest images with versions not v-prefixed * stage 0.2.0 of the Helm chart --- README.md | 2 +- kubernetes/helm-charts/buildfarm/Chart.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab861d609e..fa66df79c8 100644 --- a/README.md +++ b/README.md @@ -142,5 +142,5 @@ helm install \ -n bazel-buildfarm \ --create-namespace \ bazel-buildfarm \ - "https://github.com/bazelbuild/bazel-buildfarm/releases/download/${BUILDFARM_VERSION:-2.7.1}/buildfarm-${CHART_VERSION:-0.1.0}.tgz" + "https://github.com/bazelbuild/bazel-buildfarm/releases/download/${BUILDFARM_VERSION:-2.8.0}/buildfarm-${CHART_VERSION:-0.2.0}.tgz" ``` diff --git a/kubernetes/helm-charts/buildfarm/Chart.yaml b/kubernetes/helm-charts/buildfarm/Chart.yaml index ce443957dd..dc92b0f61b 100644 --- a/kubernetes/helm-charts/buildfarm/Chart.yaml +++ b/kubernetes/helm-charts/buildfarm/Chart.yaml @@ -15,16 +15,16 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v2.5.0" +appVersion: 2.8.0 dependencies: - condition: redis.enabled name: redis repository: https://charts.helm.sh/stable - version: 10.5.7 \ No newline at end of file + version: 10.5.7 From 41b44945751a6fe9ab5de93f5288f2310ae08b48 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 2 Jan 2024 16:23:58 -0500 Subject: [PATCH 189/214] Update helm values to use safe defaults (#1597) Removed values which will likely cause problems for execution and CFC saturation from helm chart: inputFetchStage_width and execute_stage_width both can be discovered from available processors maxSizeBytes for filesystem cas is automatically 90% of underlying file storage, down from a value 10x the actual bytes on storage requested below. path, names, and configuration for root, filesystem, and publicName can all be defaulted/derived safely. --- kubernetes/helm-charts/buildfarm/values.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/kubernetes/helm-charts/buildfarm/values.yaml b/kubernetes/helm-charts/buildfarm/values.yaml index 3bb2994b7a..f1e21a97c9 100644 --- a/kubernetes/helm-charts/buildfarm/values.yaml +++ b/kubernetes/helm-charts/buildfarm/values.yaml @@ -27,16 +27,6 @@ config: recordBesEvents: true worker: port: 8982 - publicName: "localhost:8982" - executeStageWidth: 80 - inputFetchStageWidth: 8 - realInputDirectories: - - "external" - root: "/tmp/worker" - storages: - - type: FILESYSTEM - path: "cache" - maxSizeBytes: 536870912000 # 500 * 1024 * 1024 * 1024 server: image: From 088b8e12f2a5ec8fbfde33f73a1e3077eb2622fe Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 2 Jan 2024 20:56:51 -0500 Subject: [PATCH 190/214] Properly balance over nodes, not slot ranges (#1598) Slot ranges must not associate multiple times on a single node for use with balanced queues designed to be load balanced. --- .../common/redis/RedisNodeHashes.java | 18 +++++++++++++----- .../common/redis/RedisNodeHashesMockTest.java | 10 ++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java b/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java index 5588ba8adf..689c7d46f4 100644 --- a/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java +++ b/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java @@ -15,8 +15,10 @@ package build.buildfarm.common.redis; import com.google.common.collect.ImmutableList; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisPool; @@ -41,7 +43,7 @@ public class RedisNodeHashes { @SuppressWarnings({"unchecked", "rawtypes"}) public static List getEvenlyDistributedHashes(JedisCluster jedis) { try { - List> slotRanges = getSlotRanges(jedis); + List> slotRanges = getNodeSlotRanges(jedis); ImmutableList.Builder hashTags = ImmutableList.builder(); for (List slotRange : slotRanges) { // we can use any slot that is in range for the node. @@ -66,7 +68,7 @@ public static List getEvenlyDistributedHashes(JedisCluster jedis) { public static List getEvenlyDistributedHashesWithPrefix( JedisCluster jedis, String prefix) { try { - List> slotRanges = getSlotRanges(jedis); + List> slotRanges = getNodeSlotRanges(jedis); ImmutableList.Builder hashTags = ImmutableList.builder(); for (List slotRange : slotRanges) { // we can use any slot that is in range for the node. @@ -88,16 +90,22 @@ public static List getEvenlyDistributedHashesWithPrefix( * @note Suggested return identifier: slotRanges. */ @SuppressWarnings("unchecked") - private static List> getSlotRanges(JedisCluster jedis) { + private static List> getNodeSlotRanges(JedisCluster jedis) { // get slot information for each node List slots = getClusterSlots(jedis); + Set nodes = new HashSet<>(); // convert slot information into a list of slot ranges ImmutableList.Builder> slotRanges = ImmutableList.builder(); for (Object slotInfoObj : slots) { List slotInfo = (List) slotInfoObj; - List slotNums = slotInfoToSlotRange(slotInfo); - slotRanges.add(slotNums); + List slotRangeNodes = (List) slotInfo.get(2); + // 2 is primary node id + String nodeId = (String) slotRangeNodes.get(2); + if (nodes.add(nodeId)) { + List slotNums = slotInfoToSlotRange(slotInfo); + slotRanges.add(slotNums); + } } return slotRanges.build(); diff --git a/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java b/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java index 3d421e6afa..f6627d37e3 100644 --- a/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java +++ b/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java @@ -47,7 +47,10 @@ public class RedisNodeHashesMockTest { public void getEvenlyDistributedHashesCanRetrieveDistributedHashes() throws Exception { // ARRANGE Jedis node = mock(Jedis.class); - when(node.clusterSlots()).thenReturn(Collections.singletonList(Arrays.asList(0L, 100L))); + when(node.clusterSlots()) + .thenReturn( + Collections.singletonList( + Arrays.asList(0L, 100L, Arrays.asList(null, null, "nodeId")))); JedisPool pool = mock(JedisPool.class); when(pool.getResource()).thenReturn(node); @@ -97,7 +100,10 @@ public void getEvenlyDistributedHashesWithPrefixExpectedPrefixHashes() throws Ex // ARRANGE Jedis node = mock(Jedis.class); when(node.clusterSlots()) - .thenReturn(Arrays.asList(Arrays.asList(0L, 100L), Arrays.asList(101L, 200L))); + .thenReturn( + Arrays.asList( + Arrays.asList(0L, 100L, Arrays.asList(null, null, "nodeId1")), + Arrays.asList(101L, 200L, Arrays.asList(null, null, "nodeId2")))); JedisPool pool = mock(JedisPool.class); when(pool.getResource()).thenReturn(node); From 6b5db62f75b506ab603c262eec24b3ccedb03483 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Wed, 3 Jan 2024 09:52:01 -0500 Subject: [PATCH 191/214] fix the shard-worker HPA. it is a StatefulSet and not a Deployment (#1596) --- .../buildfarm/templates/shard-worker/autoscaler.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml index 4389c793b6..5cdfe05e1f 100644 --- a/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/autoscaler.yaml @@ -15,7 +15,7 @@ spec: minReplicas: {{ .Values.shardWorker.autoscaling.minReplicas }} scaleTargetRef: apiVersion: apps/v1 - kind: Deployment + kind: StatefulSet name: {{ include "buildfarm.fullname" . }}-shard-worker targetCPUUtilizationPercentage: {{ .Values.shardWorker.autoscaling.targetCPUUtilizationPercentage }} {{- end }} From 413021d940da9d2f0569fb5a3823548030e66dc8 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 3 Jan 2024 09:52:12 -0500 Subject: [PATCH 192/214] Use integer ids for Sqlite bidirectional index (#1599) The cost in size for a single table bidirectional index is vast compared to the use of 3nf integer keys. Experimental estimates offer a decrease in file size of 90%. --- .../cas/cfc/SqliteFileDirectoriesIndex.java | 65 +++++++++++++++---- .../cas/cfc/DirectoriesIndexTest.java | 1 + 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java index 030c749037..e634616660 100644 --- a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java +++ b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java @@ -57,13 +57,19 @@ private void open() { throw new RuntimeException(e); } + String createDirectoriesSql = + "CREATE TABLE directories (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; + String createFilesSql = "CREATE TABLE files (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; String createEntriesSql = "CREATE TABLE entries (\n" - + " path TEXT NOT NULL,\n" - + " directory TEXT NOT NULL\n" + + " file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,\n" + + " directory_id INTEGER NOT NULL REFERENCES directories(id) ON DELETE CASCADE,\n" + + " PRIMARY KEY (file_id, directory_id)\n" + ")"; try (Statement stmt = conn.createStatement()) { + stmt.execute(createDirectoriesSql); + stmt.execute(createFilesSql); stmt.execute(createEntriesSql); } catch (SQLException e) { throw new RuntimeException(e); @@ -77,11 +83,13 @@ private void open() { public synchronized void start() { open(); - String createPathIndexSql = "CREATE INDEX path_idx ON entries (path)"; - String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory)"; + String createPathIndexSql = "CREATE INDEX file_idx ON entries (file_id)"; + String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory_id)"; + String enforceForeignKeys = "PRAGMA foreign_keys=ON"; try (Statement stmt = conn.createStatement()) { stmt.execute(createPathIndexSql); stmt.execute(createDirectoryIndexSql); + stmt.execute(enforceForeignKeys); } catch (SQLException e) { throw new RuntimeException(e); } @@ -101,7 +109,8 @@ public void close() { private Set removeEntryDirectories(String entry) { open(); - String selectSql = "SELECT directory FROM entries WHERE path = ?"; + String selectSql = + "SELECT d.name as directory FROM files f INNER JOIN entries e ON f.id = e.file_id INNER JOIN directories d ON d.id = e.directory_id WHERE f.name = ?"; ImmutableSet.Builder directoriesBuilder = ImmutableSet.builder(); try (PreparedStatement selectStatement = conn.prepareStatement(selectSql)) { @@ -116,7 +125,7 @@ private Set removeEntryDirectories(String entry) { } // all directories featuring this entry are now invalid ImmutableSet directories = directoriesBuilder.build(); - String deleteSql = "DELETE FROM entries where directory = ?"; + String deleteSql = "DELETE FROM directories where name = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { conn.setAutoCommit(false); for (Digest directory : directories) { @@ -128,6 +137,14 @@ private Set removeEntryDirectories(String entry) { } catch (SQLException e) { throw new RuntimeException(e); } + // clear out orphaned files + try (Statement orphanStatement = conn.createStatement()) { + String deleteOrphanSql = + "DELETE FROM files WHERE id NOT IN (SELECT DISTINCT file_id FROM entries)"; + orphanStatement.execute(deleteOrphanSql); + } catch (SQLException e) { + throw new RuntimeException(e); + } return directories; } @@ -138,16 +155,41 @@ public synchronized Set removeEntry(String entry) throws IOException { return directories; } + // inserts here specifically avoids integer key maintenance in java private synchronized void addEntriesDirectory(Set entries, Digest directory) { open(); - String digest = DigestUtil.toString(directory); - String insertSql = "INSERT INTO entries (path, directory) VALUES (?,?)"; - try (PreparedStatement insertStatement = conn.prepareStatement(insertSql)) { + String directoryName = DigestUtil.toString(directory); + String filesInsertSql = "INSERT OR IGNORE INTO files (name) VALUES (?)"; + try (PreparedStatement filesInsertStatement = conn.prepareStatement(filesInsertSql)) { + conn.setAutoCommit(false); + for (String entry : entries) { + filesInsertStatement.setString(1, entry); + filesInsertStatement.addBatch(); + } + filesInsertStatement.executeBatch(); + conn.commit(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + // should be novel directory + String directoriesInsertSql = "INSERT INTO directories (name) VALUES (?)"; + try (PreparedStatement directoriesInsertStatement = + conn.prepareStatement(directoriesInsertSql)) { + conn.setAutoCommit(false); + directoriesInsertStatement.setString(1, directoryName); + directoriesInsertStatement.executeUpdate(); + conn.commit(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + String entriesInsertSql = + "INSERT INTO entries (file_id, directory_id) SELECT f.id, d.id FROM files f, directories d WHERE f.name = ? AND d.name = ?"; + try (PreparedStatement insertStatement = conn.prepareStatement(entriesInsertSql)) { conn.setAutoCommit(false); - insertStatement.setString(2, digest); for (String entry : entries) { insertStatement.setString(1, entry); + insertStatement.setString(2, directoryName); insertStatement.addBatch(); } insertStatement.executeBatch(); @@ -168,8 +210,9 @@ private void removeEntriesDirectory(Digest directory) { open(); String digest = DigestUtil.toString(directory); - String deleteSql = "DELETE FROM entries WHERE directory = ?"; + String deleteSql = "DELETE FROM directories WHERE name = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { + conn.setAutoCommit(true); deleteStatement.setString(1, digest); deleteStatement.executeUpdate(); } catch (SQLException e) { diff --git a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java index 3eec66def7..b4effa2bc8 100644 --- a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java @@ -51,6 +51,7 @@ protected DirectoriesIndexTest(Path root, DirectoriesIndexType type) { } else { throw new IllegalArgumentException("DirectoriesIndex type is not supported."); } + directoriesIndex.start(); } @Before From 16b3aeaf99a6687bd67dc62abe29e17b2c7eae34 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 3 Jan 2024 10:50:01 -0500 Subject: [PATCH 193/214] Write cleanups (#1600) * Guard against writeObserver null race * Avoid cancellation log for StubWriteOutputStream Cancels will happen for all server->worker uploads on context cancels initiated by clients, and are normal behaviors. * Guarantee null write response for onCompleted Avoid a complaint by gRPC that a client-streaming request was completed without a response * Reset remote CAS write on initial Prevents the StubWriteOutputStream from issuing an unnecessary initial queryWriteStatus. --- .../common/grpc/StubWriteOutputStream.java | 35 ++++++++++++------- .../common/services/WriteStreamObserver.java | 8 ++++- .../worker/shard/RemoteCasWriter.java | 1 + 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java index 855b650ff9..0b2b7199f0 100644 --- a/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java +++ b/src/main/java/build/buildfarm/common/grpc/StubWriteOutputStream.java @@ -15,6 +15,7 @@ package build.buildfarm.common.grpc; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; import static com.google.common.util.concurrent.Futures.immediateFuture; import static java.lang.String.format; import static java.util.logging.Level.WARNING; @@ -164,12 +165,18 @@ private void flushSome(boolean finishWrite) { request.setResourceName(resourceName); } synchronized (this) { - writeObserver.onNext(request.build()); + // writeObserver can be nulled by a completion race + // expect that we are completed in this case + if (writeObserver != null) { + writeObserver.onNext(request.build()); + wasReset = false; + writtenBytes += offset; + offset = 0; + sentResourceName = true; + } else { + checkState(writeFuture.isDone(), "writeObserver nulled without completion"); + } } - wasReset = false; - writtenBytes += offset; - offset = 0; - sentResourceName = true; } @Override @@ -231,14 +238,16 @@ public void onNext(WriteResponse response) { @Override public void onError(Throwable t) { - log.log( - WARNING, - format( - "%s: write(%s) on worker %s after %d bytes of content", - Status.fromThrowable(t).getCode().name(), - resourceName, - bsStub.get().getChannel().authority(), - writtenBytes)); + if (Status.fromThrowable(t).getCode() != Code.CANCELLED) { + log.log( + WARNING, + format( + "%s: write(%s) on worker %s after %d bytes of content", + Status.fromThrowable(t).getCode().name(), + resourceName, + bsStub.get().getChannel().authority(), + writtenBytes)); + } writeFuture.setException(exceptionTranslator.apply(t)); } diff --git a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java index e1e23fa5b8..2eba90eba5 100644 --- a/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java +++ b/src/main/java/build/buildfarm/common/services/WriteStreamObserver.java @@ -72,6 +72,8 @@ public class WriteStreamObserver implements StreamObserver { private boolean initialized = false; private volatile boolean committed = false; private String name = null; + + @GuardedBy("this") private Write write = null; @GuardedBy("this") @@ -492,9 +494,13 @@ public void onError(Throwable t) { } @Override - public void onCompleted() { + public synchronized void onCompleted() { log.log(Level.FINER, format("write completed for %s", name)); if (write == null) { + // we must return with a response lest we emit a grpc warning + // there can be no meaningful response at this point, as we + // have no idea what the size was + responseObserver.onNext(WriteResponse.getDefaultInstance()); responseObserver.onCompleted(); } } diff --git a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java index b03c2794e7..7c379077a6 100644 --- a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java +++ b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java @@ -84,6 +84,7 @@ private long writeToCasMember(Digest digest, InputStream in) String workerName = getRandomWorker(); Write write = getCasMemberWrite(digest, workerName); + write.reset(); try { return streamIntoWriteFuture(in, write, digest).get(); } catch (ExecutionException e) { From 51608f7dccf4edc8c2b2d285287f13eda09e6fe5 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Wed, 3 Jan 2024 09:32:24 -0800 Subject: [PATCH 194/214] fix: format without placeholders (#1586) These instances of `format(...)` do not have placeholders and there's nothing to format. --- .../java/build/buildfarm/server/services/FetchService.java | 2 +- src/main/java/build/buildfarm/worker/shard/Worker.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/build/buildfarm/server/services/FetchService.java b/src/main/java/build/buildfarm/server/services/FetchService.java index 35be1784e2..17a33c68ca 100644 --- a/src/main/java/build/buildfarm/server/services/FetchService.java +++ b/src/main/java/build/buildfarm/server/services/FetchService.java @@ -72,7 +72,7 @@ private void fetchBlob( if (expectedDigest == null) { responseObserver.onError( Status.INVALID_ARGUMENT - .withDescription(format("Missing qualifier 'checksum.sri'")) + .withDescription("Missing qualifier 'checksum.sri'") .asException()); } else if (request.getUrisCount() != 0) { addCallback( diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 6b175e1350..ecfd68e15f 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -144,8 +144,7 @@ public final class Worker extends LoggingMain { public void prepareWorkerForGracefulShutdown() { if (configs.getWorker().getGracefulShutdownSeconds() == 0) { log.info( - String.format( - "Graceful Shutdown is not enabled. Worker is shutting down without finishing executions in progress.")); + "Graceful Shutdown is not enabled. Worker is shutting down without finishing executions in progress."); } else { inGracefulShutdown = true; log.info( @@ -158,7 +157,7 @@ public void prepareWorkerForGracefulShutdown() { if (pipeline.isEmpty()) { log.info("Graceful Shutdown - no work in the pipeline."); } else { - log.info(String.format("Graceful Shutdown - waiting for executions to finish.")); + log.info("Graceful Shutdown - waiting for executions to finish."); } while (!pipeline.isEmpty() && timeWaited < timeOut) { SECONDS.sleep(scanRate); From 74b1f5685ebb43fca9a3b018469107c6ff82abca Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Wed, 3 Jan 2024 10:18:30 -0800 Subject: [PATCH 195/214] chore: Update proto file styling (#1594) * chore: Update proto file styling * fix path * move protp styling to file * add new line at eof --- .bazelci/format.sh | 5 +-- .clang-format | 2 + .../resources/proto/build_event_stream.proto | 24 ++++++++--- .../src/main/resources/proto/buildfarm.proto | 40 ++++++++++++++----- .../main/resources/proto/command_line.proto | 8 +++- .../src/main/resources/proto/descriptor.proto | 4 +- .../resources/proto/remote_execution.proto | 4 +- defs.bzl | 2 +- deps.bzl | 6 +-- .../build/buildfarm/v1test/buildfarm.proto | 24 ++++++++--- third_party/clang_toolchain.patch | 15 +++---- 11 files changed, 94 insertions(+), 40 deletions(-) create mode 100644 .clang-format diff --git a/.bazelci/format.sh b/.bazelci/format.sh index 8b096d0890..f1255c9c2e 100755 --- a/.bazelci/format.sh +++ b/.bazelci/format.sh @@ -72,18 +72,17 @@ run_java_formatter () { } run_proto_formatter () { - # Check whether any formatting changes need to be made. # This is intended to be done by the CI. if [[ "$@" == "--check" ]] then - find . -name '*.proto' -exec $BAZEL run $CLANG_FORMAT -- -i --dry-run --Werror {} + + find $PWD -name '*.proto' -exec $BAZEL run $CLANG_FORMAT -- -i --dry-run --Werror {} + handle_format_error_check return fi # Fixes formatting issues - find . -name '*.proto' -exec $BAZEL run $CLANG_FORMAT -- -i {} + + find $PWD -name '*.proto' -exec $BAZEL run $CLANG_FORMAT -- -i {} + } run_buildifier () { diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..455f9ec9dc --- /dev/null +++ b/.clang-format @@ -0,0 +1,2 @@ +Language: Proto +AllowShortFunctionsOnASingleLine: Empty diff --git a/admin/main/src/main/resources/proto/build_event_stream.proto b/admin/main/src/main/resources/proto/build_event_stream.proto index 133b9fffea..9c4cbcee58 100644 --- a/admin/main/src/main/resources/proto/build_event_stream.proto +++ b/admin/main/src/main/resources/proto/build_event_stream.proto @@ -34,7 +34,9 @@ message BuildEventId { // Generic identifier for a build event. This is the default type of // BuildEventId, but should not be used outside testing; nevertheless, // tools should handle build events with this kind of id gracefully. - message UnknownBuildEventId { string details = 1; } + message UnknownBuildEventId { + string details = 1; + } // Identifier of an event reporting progress. Those events are also used to // chain in events that come early. @@ -82,7 +84,9 @@ message BuildEventId { // have been skipped for some reason, if the actual expansion was still // carried out (e.g., if keep_going is set). In this case, the // pattern_skipped choice in the id field is to be made. - message PatternExpandedId { repeated string pattern = 1; } + message PatternExpandedId { + repeated string pattern = 1; + } message WorkspaceConfigId {} @@ -141,7 +145,9 @@ message BuildEventId { // any case, it will report some form of error (i.e., the payload will be an // Aborted event); there are no regular events using this identifier. The // purpose of those events is to serve as the root cause of a failed target. - message UnconfiguredLabelId { string label = 1; } + message UnconfiguredLabelId { + string label = 1; + } // Identifier of an event reporting an event associated with a configured // label, usually a visibility error. In any case, an event with such an @@ -313,7 +319,9 @@ message WorkspaceConfig { // like name and relevant entries of rc-files and client environment variables. // However, it does contain enough information to reproduce the build // invocation. -message UnstructuredCommandLine { repeated string args = 1; } +message UnstructuredCommandLine { + repeated string args = 1; +} // Payload of an event reporting on the parsed options, grouped in various ways. message OptionsParsed { @@ -328,7 +336,9 @@ message OptionsParsed { // Payload of an event indicating that an external resource was fetched. This // event will only occur in streams where an actual fetch happened, not in ones // where a cached copy of the entity to be fetched was used. -message Fetch { bool success = 1; } +message Fetch { + bool success = 1; +} // Payload of an event reporting the workspace status. Key-value pairs can be // provided by specifying the workspace_status_command to an executable that @@ -664,7 +674,9 @@ message BuildMetrics { } // Event providing additional statistics/logs after completion of the build. -message BuildToolLogs { repeated File log = 1; } +message BuildToolLogs { + repeated File log = 1; +} // Message describing a build event. Events will have an identifier that // is unique within a given build invocation; they also announce follow-up diff --git a/admin/main/src/main/resources/proto/buildfarm.proto b/admin/main/src/main/resources/proto/buildfarm.proto index d391847cb9..4349babc16 100644 --- a/admin/main/src/main/resources/proto/buildfarm.proto +++ b/admin/main/src/main/resources/proto/buildfarm.proto @@ -77,7 +77,9 @@ message ShutDownWorkerGracefullyRequest { message ShutDownWorkerGracefullyRequestResults {} -message DisableScaleInProtectionRequest { string instance_name = 1; } +message DisableScaleInProtectionRequest { + string instance_name = 1; +} message DisableScaleInProtectionRequestResults {} @@ -200,7 +202,9 @@ service OperationQueue { } } -message OperationsStatusRequest { string instance_name = 1; } +message OperationsStatusRequest { + string instance_name = 1; +} message TakeOperationRequest { // The instance of the execution system to operate against. A server may @@ -262,9 +266,13 @@ message AwsMetricsConfig { string region = 4; } -message GcpMetricsConfig { string operations_metrics_topic = 1; } +message GcpMetricsConfig { + string operations_metrics_topic = 1; +} -message LogMetricsConfig { string log_level = 1; } +message LogMetricsConfig { + string log_level = 1; +} message AdminConfig { string deployment_environment = 1; @@ -279,7 +287,9 @@ message AdminConfig { bool enable_graceful_shutdown = 5; } -message AwsAdminConfig { string region = 1; } +message AwsAdminConfig { + string region = 1; +} message GcpAdminConfig {} @@ -404,7 +414,9 @@ message ProvisionedQueue { build.bazel.remote.execution.v2.Platform platform = 2; } -message ProvisionedQueuesConfig { repeated ProvisionedQueue queues = 1; } +message ProvisionedQueuesConfig { + repeated ProvisionedQueue queues = 1; +} message RedisShardBackplaneConfig { // the uri endpoint of the redis target. This must be a single host entry @@ -681,7 +693,9 @@ message OperationChange { google.longrunning.Operation operation = 2; } - message Expire { bool force = 1; } + message Expire { + bool force = 1; + } google.protobuf.Timestamp effectiveAt = 1; @@ -870,7 +884,9 @@ message ExecutionWrapper { message ExecutionPolicy { string name = 1; - oneof policy { ExecutionWrapper wrapper = 2; } + oneof policy { + ExecutionWrapper wrapper = 2; + } } message WorkerConfig { @@ -964,7 +980,9 @@ message TreeIteratorToken { repeated build.bazel.remote.execution.v2.Digest directories = 1; } -message OperationIteratorToken { string operation_name = 1; } +message OperationIteratorToken { + string operation_name = 1; +} message BlobWriteKey { build.bazel.remote.execution.v2.Digest digest = 1; @@ -1040,7 +1058,9 @@ message WorkerProfileRequest {} message WorkerListRequest {} -message WorkerListMessage { repeated string workers = 1; } +message WorkerListMessage { + repeated string workers = 1; +} service WorkerProfile { rpc GetWorkerProfile(WorkerProfileRequest) returns (WorkerProfileMessage) {} diff --git a/admin/main/src/main/resources/proto/command_line.proto b/admin/main/src/main/resources/proto/command_line.proto index 628ac3c8ba..181f5d6314 100644 --- a/admin/main/src/main/resources/proto/command_line.proto +++ b/admin/main/src/main/resources/proto/command_line.proto @@ -53,10 +53,14 @@ message CommandLineSection { } // Wrapper to allow a list of strings in the "oneof" section_type. -message ChunkList { repeated string chunk = 1; } +message ChunkList { + repeated string chunk = 1; +} // Wrapper to allow a list of options in the "oneof" section_type. -message OptionList { repeated Option option = 1; } +message OptionList { + repeated Option option = 1; +} // A single command line option. // diff --git a/admin/main/src/main/resources/proto/descriptor.proto b/admin/main/src/main/resources/proto/descriptor.proto index 7316bc3d6e..f68b49bd33 100644 --- a/admin/main/src/main/resources/proto/descriptor.proto +++ b/admin/main/src/main/resources/proto/descriptor.proto @@ -53,7 +53,9 @@ option optimize_for = SPEED; // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. -message FileDescriptorSet { repeated FileDescriptorProto file = 1; } +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} // Describes a complete .proto file. message FileDescriptorProto { diff --git a/admin/main/src/main/resources/proto/remote_execution.proto b/admin/main/src/main/resources/proto/remote_execution.proto index f6ceaca5b5..3d5ae35cb6 100644 --- a/admin/main/src/main/resources/proto/remote_execution.proto +++ b/admin/main/src/main/resources/proto/remote_execution.proto @@ -1532,7 +1532,9 @@ message DigestFunction { } // Describes the server/instance capabilities for updating the action cache. -message ActionCacheUpdateCapabilities { bool update_enabled = 1; } +message ActionCacheUpdateCapabilities { + bool update_enabled = 1; +} // Allowed values for priority in // [ResultsCachePolicy][google.devtools.remoteexecution.v2.ResultsCachePolicy] diff --git a/defs.bzl b/defs.bzl index a6114caa27..9ca4aec502 100644 --- a/defs.bzl +++ b/defs.bzl @@ -139,5 +139,5 @@ def buildfarm_init(name = "buildfarm"): llvm_toolchain( name = "llvm_toolchain", - llvm_version = "10.0.0", + llvm_version = "16.0.0", ) diff --git a/deps.bzl b/deps.bzl index a289610b23..ff66198bc9 100644 --- a/deps.bzl +++ b/deps.bzl @@ -92,9 +92,9 @@ def archive_dependencies(third_party): # Used to format proto files { "name": "com_grail_bazel_toolchain", - "sha256": "ee74a364a978fa3c85ea56d736010bfc44ea22b439691e9cefdf72284d6c9b93", - "strip_prefix": "bazel-toolchain-d46339675a83e3517d955f5456e525501c3e05b8", - "url": "https://github.com/grailbio/bazel-toolchain/archive/d46339675a83e3517d955f5456e525501c3e05b8.tar.gz", + "sha256": "95f0bab6982c7e5a83447e08bf32fa7a47f210169da5e5ec62411fef0d8e7f59", + "strip_prefix": "bazel-toolchain-0.9", + "url": "https://github.com/grailbio/bazel-toolchain/archive/refs/tags/0.9.tar.gz", "patch_args": ["-p1"], "patches": ["%s:clang_toolchain.patch" % third_party], }, diff --git a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto index 9632593f11..798f6fc9b1 100644 --- a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto +++ b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto @@ -77,7 +77,9 @@ message ShutDownWorkerGracefullyRequest { message ShutDownWorkerGracefullyRequestResults {} -message DisableScaleInProtectionRequest { string instance_name = 1; } +message DisableScaleInProtectionRequest { + string instance_name = 1; +} message DisableScaleInProtectionRequestResults {} @@ -200,7 +202,9 @@ service OperationQueue { } } -message BackplaneStatusRequest { string instance_name = 1; } +message BackplaneStatusRequest { + string instance_name = 1; +} message TakeOperationRequest { // The instance of the execution system to operate against. A server may @@ -301,7 +305,9 @@ message OperationChange { google.longrunning.Operation operation = 2; } - message Expire { bool force = 1; } + message Expire { + bool force = 1; + } google.protobuf.Timestamp effectiveAt = 1; @@ -556,14 +562,18 @@ message ExecutionWrapper { message ExecutionPolicy { string name = 1; - oneof policy { ExecutionWrapper wrapper = 2; } + oneof policy { + ExecutionWrapper wrapper = 2; + } } message TreeIteratorToken { repeated build.bazel.remote.execution.v2.Digest directories = 1; } -message OperationIteratorToken { string operation_name = 1; } +message OperationIteratorToken { + string operation_name = 1; +} message BlobWriteKey { build.bazel.remote.execution.v2.Digest digest = 1; @@ -643,7 +653,9 @@ message WorkerProfileRequest {} message WorkerListRequest {} -message WorkerListMessage { repeated string workers = 1; } +message WorkerListMessage { + repeated string workers = 1; +} service WorkerProfile { rpc GetWorkerProfile(WorkerProfileRequest) returns (WorkerProfileMessage) {} diff --git a/third_party/clang_toolchain.patch b/third_party/clang_toolchain.patch index a3921abf32..0c4176768c 100644 --- a/third_party/clang_toolchain.patch +++ b/third_party/clang_toolchain.patch @@ -1,12 +1,13 @@ diff --git a/toolchain/BUILD.llvm_repo b/toolchain/BUILD.llvm_repo -index 4158551..7bd9c54 100644 +index 94a1a98..922e6de 100644 --- a/toolchain/BUILD.llvm_repo +++ b/toolchain/BUILD.llvm_repo -@@ -70,6 +70,7 @@ filegroup( - "lib/lib*.dylib", - "lib/clang/*/lib/**/*.dylib", +@@ -61,6 +61,7 @@ filegroup( + # clang_rt.*.o supply crtbegin and crtend sections. + "lib/**/clang_rt.*.o", ], -+ allow_empty = True, - ), - ) ++ allow_empty = True, + exclude = [ + "lib/libLLVM*.a", + "lib/libclang*.a", From e51f1e16aa04a924675d0dd649387067ab9fbd1e Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:12:15 -0800 Subject: [PATCH 196/214] fix: Periodically Refresh Active Storage Workers With StartTime (#1549) * fix: Periodically Refresh Active Storage Workers With startTime --- .../instance/shard/RedisShardBackplane.java | 90 +++++++++---------- .../instance/shard/RedisShardSubscriber.java | 25 ++++-- .../build/buildfarm/v1test/buildfarm.proto | 4 +- .../shard/RedisShardBackplaneTest.java | 40 +++++++-- 4 files changed, 93 insertions(+), 66 deletions(-) diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 535473f2a9..382f2a8f5c 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -15,6 +15,7 @@ package build.buildfarm.instance.shard; import static java.lang.String.format; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import build.bazel.remote.execution.v2.ActionResult; @@ -79,15 +80,14 @@ import io.grpc.Deadline; import java.io.IOException; import java.time.Instant; -import java.util.AbstractMap; import java.util.ArrayList; -import java.util.Collections; import java.util.Date; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.function.Consumer; import java.util.function.Function; @@ -144,7 +144,7 @@ public class RedisShardBackplane implements Backplane { private @Nullable RedisClient client = null; private Deadline storageWorkersDeadline = null; - private final Set storageWorkerSet = Collections.synchronizedSet(new HashSet<>()); + private final Map storageWorkers = new ConcurrentHashMap<>(); private final Supplier> recentExecuteWorkers; private DistributedState state = new DistributedState(); @@ -182,7 +182,7 @@ public RedisShardBackplane( Suppliers.memoizeWithExpiration( () -> { try { - return client.call(this::fetchAndExpireExecuteWorkers); + return client.call(this::fetchAndExpireExecuteWorkers).keySet(); } catch (IOException e) { throw new RuntimeException(e); } @@ -478,10 +478,7 @@ private void startSubscriptionThread() { subscriberService = BuildfarmExecutors.getSubscriberPool(); subscriber = new RedisShardSubscriber( - watchers, - storageWorkerSet, - configs.getBackplane().getWorkerChannel(), - subscriberService); + watchers, storageWorkers, configs.getBackplane().getWorkerChannel(), subscriberService); operationSubscription = new RedisShardSubscription( @@ -594,13 +591,14 @@ public void observe(Operation operation) { @Override public void addWorker(ShardWorker shardWorker) throws IOException { String json = JsonFormat.printer().print(shardWorker); + Timestamp effectiveAt = Timestamps.fromMillis(shardWorker.getFirstRegisteredAt()); String workerChangeJson = JsonFormat.printer() .print( WorkerChange.newBuilder() .setEffectiveAt(toTimestamp(Instant.now())) .setName(shardWorker.getEndpoint()) - .setAdd(WorkerChange.Add.getDefaultInstance()) + .setAdd(WorkerChange.Add.newBuilder().setEffectiveAt(effectiveAt).build()) .build()); client.call( jedis -> { @@ -648,7 +646,7 @@ public boolean removeWorker(String name, String reason) throws IOException { .setRemove(WorkerChange.Remove.newBuilder().setSource(source).setReason(reason).build()) .build(); String workerChangeJson = JsonFormat.printer().print(workerChange); - return storageWorkerSet.remove(name) + return storageWorkers.remove(name) != null && client.call( jedis -> removeWorkerAndPublish(jedis, name, workerChangeJson, /* storage=*/ true)); } @@ -697,45 +695,41 @@ public void deregisterWorker(String workerName) throws IOException { removeWorker(workerName, "Requested shutdown"); } - @SuppressWarnings("ConstantConditions") + /** + * Returns a new set containing copies of the storage workers. Note: This method does not grant + * access to the shared storage set. + */ @Override - public synchronized Set getStorageWorkers() throws IOException { - if (storageWorkersDeadline == null || storageWorkersDeadline.isExpired()) { - synchronized (storageWorkerSet) { - Set newWorkerSet = client.call(this::fetchAndExpireStorageWorkers); - storageWorkerSet.clear(); - storageWorkerSet.addAll(newWorkerSet); - } - storageWorkersDeadline = Deadline.after(workerSetMaxAge, SECONDS); - } - return new HashSet<>(storageWorkerSet); + public Set getStorageWorkers() throws IOException { + refreshStorageWorkersIfExpired(); + return new HashSet<>(storageWorkers.keySet()); } @Override public Map getWorkersStartTimeInEpochSecs(Set workerNames) throws IOException { - if (workerNames.isEmpty()) { - return Collections.emptyMap(); - } - List workerList = client.call(jedis -> state.storageWorkers.mget(jedis, workerNames)); + refreshStorageWorkersIfExpired(); + Map workerAndStartTime = new HashMap<>(); + workerNames.forEach( + worker -> { + ShardWorker workerInfo = storageWorkers.get(worker); + if (workerInfo != null) { + workerAndStartTime.put( + worker, MILLISECONDS.toSeconds(workerInfo.getFirstRegisteredAt())); + } + }); + return workerAndStartTime; + } - return workerList.stream() - .filter(Objects::nonNull) - .map( - workerJson -> { - try { - ShardWorker.Builder builder = ShardWorker.newBuilder(); - JsonFormat.parser().merge(workerJson, builder); - ShardWorker worker = builder.build(); - return new AbstractMap.SimpleEntry<>( - worker.getEndpoint(), worker.getFirstRegisteredAt() / 1000L); - } catch (InvalidProtocolBufferException e) { - return null; - } - }) - .filter(Objects::nonNull) - .collect( - Collectors.toMap(AbstractMap.SimpleEntry::getKey, AbstractMap.SimpleEntry::getValue)); + private synchronized void refreshStorageWorkersIfExpired() throws IOException { + if (storageWorkersDeadline == null || storageWorkersDeadline.isExpired()) { + synchronized (storageWorkers) { + Map newWorkers = client.call(this::fetchAndExpireStorageWorkers); + storageWorkers.clear(); + storageWorkers.putAll(newWorkers); + } + storageWorkersDeadline = Deadline.after(workerSetMaxAge, SECONDS); + } } @Override @@ -798,18 +792,18 @@ private void removeInvalidWorkers( } } - private Set fetchAndExpireStorageWorkers(JedisCluster jedis) { + private Map fetchAndExpireStorageWorkers(JedisCluster jedis) { return fetchAndExpireWorkers(jedis, state.storageWorkers.asMap(jedis), /* storage=*/ true); } - private Set fetchAndExpireExecuteWorkers(JedisCluster jedis) { + private Map fetchAndExpireExecuteWorkers(JedisCluster jedis) { return fetchAndExpireWorkers(jedis, state.executeWorkers.asMap(jedis), /* storage=*/ false); } - private Set fetchAndExpireWorkers( + private Map fetchAndExpireWorkers( JedisCluster jedis, Map workers, boolean publish) { long now = System.currentTimeMillis(); - Set returnWorkers = Sets.newConcurrentHashSet(); + Map returnWorkers = Maps.newConcurrentMap(); ImmutableList.Builder invalidWorkers = ImmutableList.builder(); for (Map.Entry entry : workers.entrySet()) { String json = entry.getValue(); @@ -824,7 +818,7 @@ private Set fetchAndExpireWorkers( if (worker.getExpireAt() <= now) { invalidWorkers.add(worker); } else { - returnWorkers.add(worker.getEndpoint()); + returnWorkers.put(worker.getEndpoint(), worker); } } } catch (InvalidProtocolBufferException e) { diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java b/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java index 637be2a383..9e68f0f41a 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardSubscriber.java @@ -20,6 +20,7 @@ import build.buildfarm.instance.server.WatchFuture; import build.buildfarm.v1test.OperationChange; +import build.buildfarm.v1test.ShardWorker; import build.buildfarm.v1test.WorkerChange; import com.google.common.collect.ImmutableList; import com.google.common.collect.ListMultimap; @@ -27,9 +28,10 @@ import com.google.longrunning.Operation; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; import java.time.Instant; import java.util.List; -import java.util.Set; +import java.util.Map; import java.util.concurrent.Executor; import java.util.function.Consumer; import java.util.function.Predicate; @@ -59,13 +61,13 @@ void complete() { } private final ListMultimap watchers; - private final Set workers; + private final Map workers; private final String workerChannel; private final Executor executor; RedisShardSubscriber( ListMultimap watchers, - Set workers, + Map workers, String workerChannel, Executor executor) { this.watchers = watchers; @@ -250,23 +252,28 @@ void onWorkerChange(WorkerChange workerChange) { workerChange.getName(), workerChange.getEffectiveAt())); break; case ADD: - addWorker(workerChange.getName()); + addWorker(workerChange); break; case REMOVE: - removeWorker(workerChange.getName()); + removeWorker(workerChange); break; } } - void addWorker(String worker) { + void addWorker(WorkerChange workerChange) { synchronized (workers) { - workers.add(worker); + workers.put( + workerChange.getName(), + ShardWorker.newBuilder() + .setEndpoint(workerChange.getName()) + .setFirstRegisteredAt(Timestamps.toMillis(workerChange.getAdd().getEffectiveAt())) + .build()); } } - boolean removeWorker(String worker) { + boolean removeWorker(WorkerChange workerChange) { synchronized (workers) { - return workers.remove(worker); + return workers.remove(workerChange.getName()) != null; } } diff --git a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto index 798f6fc9b1..2785b27b70 100644 --- a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto +++ b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto @@ -279,7 +279,9 @@ message ShardWorker { } message WorkerChange { - message Add {} + message Add { + google.protobuf.Timestamp effectiveAt = 1; + } message Remove { string source = 1; diff --git a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java index 3772459cf7..bf7360eeee 100644 --- a/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java +++ b/src/test/java/build/buildfarm/instance/shard/RedisShardBackplaneTest.java @@ -16,6 +16,7 @@ import static build.buildfarm.instance.shard.RedisShardBackplane.parseOperationChange; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; @@ -32,6 +33,7 @@ import build.buildfarm.v1test.ExecuteEntry; import build.buildfarm.v1test.OperationChange; import build.buildfarm.v1test.QueueEntry; +import build.buildfarm.v1test.ShardWorker; import build.buildfarm.v1test.WorkerChange; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -40,7 +42,6 @@ import java.io.IOException; import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; @@ -364,13 +365,13 @@ public void testGetWorkersStartTime() throws IOException { Set workerNames = ImmutableSet.of("worker1", "worker2", "missing_worker"); String storageWorkerKey = configs.getBackplane().getWorkersHashName() + "_storage"; - List workersJson = - Arrays.asList( - "{\"endpoint\": \"worker1\", \"expireAt\": \"1686981022917\", \"workerType\": 3, \"firstRegisteredAt\": \"1685292624000\"}", - "{\"endpoint\": \"worker2\", \"expireAt\": \"1686981022917\", \"workerType\": 3, \"firstRegisteredAt\": \"1685282624000\"}", - null); - when(jedisCluster.hmget(storageWorkerKey, "worker1", "worker2", "missing_worker")) - .thenReturn(workersJson); + Map workersJson = + Map.of( + "worker1", + "{\"endpoint\": \"worker1\", \"expireAt\": \"9999999999999\", \"workerType\": 3, \"firstRegisteredAt\": \"1685292624000\"}", + "worker2", + "{\"endpoint\": \"worker2\", \"expireAt\": \"9999999999999\", \"workerType\": 3, \"firstRegisteredAt\": \"1685282624000\"}"); + when(jedisCluster.hgetAll(storageWorkerKey)).thenReturn(workersJson); Map workersStartTime = backplane.getWorkersStartTimeInEpochSecs(workerNames); assertThat(workersStartTime.size()).isEqualTo(2); assertThat(workersStartTime.get("worker1")).isEqualTo(1685292624L); @@ -398,4 +399,27 @@ public void getDigestInsertTime() throws IOException { .isGreaterThan(Instant.now().getEpochSecond() - expirationInSecs + ttl - 2); assertThat(insertTimeInSecs).isAtMost(Instant.now().getEpochSecond() - expirationInSecs + ttl); } + + @Test + public void testAddWorker() throws IOException { + ShardWorker shardWorker = + ShardWorker.newBuilder().setWorkerType(3).setFirstRegisteredAt(1703065913000L).build(); + JedisCluster jedisCluster = mock(JedisCluster.class); + when(mockJedisClusterFactory.get()).thenReturn(jedisCluster); + when(jedisCluster.hset(anyString(), anyString(), anyString())).thenReturn(1L); + RedisShardBackplane backplane = createBackplane("add-worker-test"); + backplane.start("addWorker/test:0000"); + backplane.addWorker(shardWorker); + verify(jedisCluster, times(1)) + .hset( + configs.getBackplane().getWorkersHashName() + "_storage", + "", + JsonFormat.printer().print(shardWorker)); + verify(jedisCluster, times(1)) + .hset( + configs.getBackplane().getWorkersHashName() + "_execute", + "", + JsonFormat.printer().print(shardWorker)); + verify(jedisCluster, times(1)).publish(anyString(), anyString()); + } } From c79b213be32f40e1f592c0a055876586d069082a Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 4 Jan 2024 11:47:25 -0500 Subject: [PATCH 197/214] Revert "Use integer ids for Sqlite bidirectional index (#1599)" (#1603) This reverts commit 413021d940da9d2f0569fb5a3823548030e66dc8. --- .../cas/cfc/SqliteFileDirectoriesIndex.java | 65 ++++--------------- .../cas/cfc/DirectoriesIndexTest.java | 1 - 2 files changed, 11 insertions(+), 55 deletions(-) diff --git a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java index e634616660..030c749037 100644 --- a/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java +++ b/src/main/java/build/buildfarm/cas/cfc/SqliteFileDirectoriesIndex.java @@ -57,19 +57,13 @@ private void open() { throw new RuntimeException(e); } - String createDirectoriesSql = - "CREATE TABLE directories (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; - String createFilesSql = "CREATE TABLE files (id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)"; String createEntriesSql = "CREATE TABLE entries (\n" - + " file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,\n" - + " directory_id INTEGER NOT NULL REFERENCES directories(id) ON DELETE CASCADE,\n" - + " PRIMARY KEY (file_id, directory_id)\n" + + " path TEXT NOT NULL,\n" + + " directory TEXT NOT NULL\n" + ")"; try (Statement stmt = conn.createStatement()) { - stmt.execute(createDirectoriesSql); - stmt.execute(createFilesSql); stmt.execute(createEntriesSql); } catch (SQLException e) { throw new RuntimeException(e); @@ -83,13 +77,11 @@ private void open() { public synchronized void start() { open(); - String createPathIndexSql = "CREATE INDEX file_idx ON entries (file_id)"; - String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory_id)"; - String enforceForeignKeys = "PRAGMA foreign_keys=ON"; + String createPathIndexSql = "CREATE INDEX path_idx ON entries (path)"; + String createDirectoryIndexSql = "CREATE INDEX directory_idx ON entries (directory)"; try (Statement stmt = conn.createStatement()) { stmt.execute(createPathIndexSql); stmt.execute(createDirectoryIndexSql); - stmt.execute(enforceForeignKeys); } catch (SQLException e) { throw new RuntimeException(e); } @@ -109,8 +101,7 @@ public void close() { private Set removeEntryDirectories(String entry) { open(); - String selectSql = - "SELECT d.name as directory FROM files f INNER JOIN entries e ON f.id = e.file_id INNER JOIN directories d ON d.id = e.directory_id WHERE f.name = ?"; + String selectSql = "SELECT directory FROM entries WHERE path = ?"; ImmutableSet.Builder directoriesBuilder = ImmutableSet.builder(); try (PreparedStatement selectStatement = conn.prepareStatement(selectSql)) { @@ -125,7 +116,7 @@ private Set removeEntryDirectories(String entry) { } // all directories featuring this entry are now invalid ImmutableSet directories = directoriesBuilder.build(); - String deleteSql = "DELETE FROM directories where name = ?"; + String deleteSql = "DELETE FROM entries where directory = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { conn.setAutoCommit(false); for (Digest directory : directories) { @@ -137,14 +128,6 @@ private Set removeEntryDirectories(String entry) { } catch (SQLException e) { throw new RuntimeException(e); } - // clear out orphaned files - try (Statement orphanStatement = conn.createStatement()) { - String deleteOrphanSql = - "DELETE FROM files WHERE id NOT IN (SELECT DISTINCT file_id FROM entries)"; - orphanStatement.execute(deleteOrphanSql); - } catch (SQLException e) { - throw new RuntimeException(e); - } return directories; } @@ -155,41 +138,16 @@ public synchronized Set removeEntry(String entry) throws IOException { return directories; } - // inserts here specifically avoids integer key maintenance in java private synchronized void addEntriesDirectory(Set entries, Digest directory) { open(); - String directoryName = DigestUtil.toString(directory); - String filesInsertSql = "INSERT OR IGNORE INTO files (name) VALUES (?)"; - try (PreparedStatement filesInsertStatement = conn.prepareStatement(filesInsertSql)) { - conn.setAutoCommit(false); - for (String entry : entries) { - filesInsertStatement.setString(1, entry); - filesInsertStatement.addBatch(); - } - filesInsertStatement.executeBatch(); - conn.commit(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - // should be novel directory - String directoriesInsertSql = "INSERT INTO directories (name) VALUES (?)"; - try (PreparedStatement directoriesInsertStatement = - conn.prepareStatement(directoriesInsertSql)) { - conn.setAutoCommit(false); - directoriesInsertStatement.setString(1, directoryName); - directoriesInsertStatement.executeUpdate(); - conn.commit(); - } catch (SQLException e) { - throw new RuntimeException(e); - } - String entriesInsertSql = - "INSERT INTO entries (file_id, directory_id) SELECT f.id, d.id FROM files f, directories d WHERE f.name = ? AND d.name = ?"; - try (PreparedStatement insertStatement = conn.prepareStatement(entriesInsertSql)) { + String digest = DigestUtil.toString(directory); + String insertSql = "INSERT INTO entries (path, directory) VALUES (?,?)"; + try (PreparedStatement insertStatement = conn.prepareStatement(insertSql)) { conn.setAutoCommit(false); + insertStatement.setString(2, digest); for (String entry : entries) { insertStatement.setString(1, entry); - insertStatement.setString(2, directoryName); insertStatement.addBatch(); } insertStatement.executeBatch(); @@ -210,9 +168,8 @@ private void removeEntriesDirectory(Digest directory) { open(); String digest = DigestUtil.toString(directory); - String deleteSql = "DELETE FROM directories WHERE name = ?"; + String deleteSql = "DELETE FROM entries WHERE directory = ?"; try (PreparedStatement deleteStatement = conn.prepareStatement(deleteSql)) { - conn.setAutoCommit(true); deleteStatement.setString(1, digest); deleteStatement.executeUpdate(); } catch (SQLException e) { diff --git a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java index b4effa2bc8..3eec66def7 100644 --- a/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/DirectoriesIndexTest.java @@ -51,7 +51,6 @@ protected DirectoriesIndexTest(Path root, DirectoriesIndexType type) { } else { throw new IllegalArgumentException("DirectoriesIndex type is not supported."); } - directoriesIndex.start(); } @Before From 044597e12210c8cbca6b0b71ba0062b1eba0243a Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Sat, 6 Jan 2024 17:17:58 -0800 Subject: [PATCH 198/214] Separate fields for storage and execute workers in BackplaneStatus (#1605) --- .../build/buildfarm/instance/shard/RedisShardBackplane.java | 6 +++++- src/main/protobuf/build/buildfarm/v1test/buildfarm.proto | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java index 382f2a8f5c..84a9f2e525 100644 --- a/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java +++ b/src/main/java/build/buildfarm/instance/shard/RedisShardBackplane.java @@ -1468,7 +1468,11 @@ public boolean canPrequeue() throws IOException { @Override public BackplaneStatus backplaneStatus() throws IOException { BackplaneStatus.Builder builder = BackplaneStatus.newBuilder(); - builder.addAllActiveWorkers(Sets.union(getExecuteWorkers(), getStorageWorkers())); + Set executeWorkers = getExecuteWorkers(); + Set storageWorkers = getStorageWorkers(); + builder.addAllActiveExecuteWorkers(executeWorkers); + builder.addAllActiveStorageWorkers(storageWorkers); + builder.addAllActiveWorkers(Sets.union(executeWorkers, storageWorkers)); builder.setDispatchedSize(client.call(jedis -> state.dispatchedOperations.size(jedis))); builder.setOperationQueue(state.operationQueue.status(client.call(jedis -> jedis))); builder.setPrequeue(state.prequeue.status(client.call(jedis -> jedis))); diff --git a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto index 2785b27b70..a47f691438 100644 --- a/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto +++ b/src/main/protobuf/build/buildfarm/v1test/buildfarm.proto @@ -448,8 +448,13 @@ message BackplaneStatus { DispatchedOperationsStatus dispatched_operations = 9; + // Maintained for backward compatibility. repeated string active_workers = 4; + repeated string active_storage_workers = 12; + + repeated string active_execute_workers = 13; + int64 cas_lookup_size = 5; int64 action_cache_size = 6; From 74316e707f068e7b81c1d00eb2c9e4d90da1caba Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 8 Jan 2024 15:59:24 -0500 Subject: [PATCH 199/214] Decode nodeId with jedis util SafeEncoder (#1607) Node name strings provided via `cluster slots` will be byte arrays that require decoding. Use the inbuilt SafeEncoder from jedis which is used to decode all other strings. --- .../build/buildfarm/common/redis/RedisNodeHashes.java | 3 ++- .../buildfarm/common/redis/RedisNodeHashesMockTest.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java b/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java index 689c7d46f4..62eb957621 100644 --- a/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java +++ b/src/main/java/build/buildfarm/common/redis/RedisNodeHashes.java @@ -24,6 +24,7 @@ import redis.clients.jedis.JedisPool; import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.exceptions.JedisNoReachableClusterNodeException; +import redis.clients.jedis.util.SafeEncoder; /** * @class RedisNodeHashes @@ -101,7 +102,7 @@ private static List> getNodeSlotRanges(JedisCluster jedis) { List slotInfo = (List) slotInfoObj; List slotRangeNodes = (List) slotInfo.get(2); // 2 is primary node id - String nodeId = (String) slotRangeNodes.get(2); + String nodeId = (String) SafeEncoder.encode((byte[]) slotRangeNodes.get(2)); if (nodes.add(nodeId)) { List slotNums = slotInfoToSlotRange(slotInfo); slotRanges.add(slotNums); diff --git a/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java b/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java index f6627d37e3..fe1e755f8b 100644 --- a/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java +++ b/src/test/java/build/buildfarm/common/redis/RedisNodeHashesMockTest.java @@ -29,6 +29,7 @@ import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisPool; +import redis.clients.jedis.util.SafeEncoder; /** * @class RedisNodeHashesMockTest @@ -50,7 +51,7 @@ public void getEvenlyDistributedHashesCanRetrieveDistributedHashes() throws Exce when(node.clusterSlots()) .thenReturn( Collections.singletonList( - Arrays.asList(0L, 100L, Arrays.asList(null, null, "nodeId")))); + Arrays.asList(0L, 100L, Arrays.asList(null, null, SafeEncoder.encode("nodeId"))))); JedisPool pool = mock(JedisPool.class); when(pool.getResource()).thenReturn(node); @@ -102,8 +103,9 @@ public void getEvenlyDistributedHashesWithPrefixExpectedPrefixHashes() throws Ex when(node.clusterSlots()) .thenReturn( Arrays.asList( - Arrays.asList(0L, 100L, Arrays.asList(null, null, "nodeId1")), - Arrays.asList(101L, 200L, Arrays.asList(null, null, "nodeId2")))); + Arrays.asList(0L, 100L, Arrays.asList(null, null, SafeEncoder.encode("nodeId1"))), + Arrays.asList( + 101L, 200L, Arrays.asList(null, null, SafeEncoder.encode("nodeId2"))))); JedisPool pool = mock(JedisPool.class); when(pool.getResource()).thenReturn(node); From b62a4ce976e0d932cec52a4adadec7d573a324a0 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Tue, 9 Jan 2024 06:47:42 -0800 Subject: [PATCH 200/214] build: start adopting bzlmod (#1564) * build: start adopting bzlmod Only four bazel dependencies were found in the existing bzlmod registry (https://registry.bazel.build/) * build: swap io_bazel_rules_go for bzlmod * build: swap gazelle for bzlmod * tests: support bzlmod I don't know why. But it works. * build: leave breadcrumbs for bzlmod migration * build(chore): MODULE.bazel.lock * build: swap buildtools for buildifier_prebuilt There are conflicts with go tooling between buildtools and protobuf. --- .bazelrc | 4 +- BUILD | 2 +- MODULE.bazel | 19 +- MODULE.bazel.lock | 8484 +++++++++++++++++ deps.bzl | 60 +- .../examples/ExampleConfigsTest.java | 6 +- 6 files changed, 8507 insertions(+), 68 deletions(-) create mode 100644 MODULE.bazel.lock diff --git a/.bazelrc b/.bazelrc index 5cc10724d9..60199a4cbe 100644 --- a/.bazelrc +++ b/.bazelrc @@ -21,9 +21,7 @@ test --test_tag_filters=-redis,-integration # https://buildkite.com/bazel/bazelisk-plus-incompatible-flags common --incompatible_disallow_empty_glob -# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel -# https://github.com/bazelbuild/bazel-buildfarm/issues/1479 -common --noenable_bzlmod +common --enable_bzlmod # Support protobuf on macOS with Xcode 15.x common:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14 diff --git a/BUILD b/BUILD index c0400a6061..d82be09f83 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") +load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@io_bazel_rules_docker//java:image.bzl", "java_image") load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs") load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs") diff --git a/MODULE.bazel b/MODULE.bazel index cabbbe697c..83268eda13 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,2 +1,17 @@ -# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel -# https://github.com/bazelbuild/bazel-buildfarm/issues/1479 +module( + name = "build_buildfarm", + repo_name = "build_buildfarm", +) + +bazel_dep(name = "gazelle", version = "0.34.0", repo_name = "bazel_gazelle") +bazel_dep(name = "platforms", version = "0.0.7") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "rules_go", version = "0.43.0", repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_jvm_external", version = "5.3") +bazel_dep(name = "rules_license", version = "0.0.7") + +bazel_dep( + name = "buildifier_prebuilt", + version = "6.4.0", + dev_dependency = True, +) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 0000000000..a58ae1defb --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,8484 @@ +{ + "lockFileVersion": 3, + "moduleFileHash": "3f11511a2b9a5f6fb04a3324b46b42a4fa6bcae5f2aed6e1f6f6cf980cfd218e", + "flags": { + "cmdRegistries": [ + "https://bcr.bazel.build/" + ], + "cmdModuleOverrides": {}, + "allowedYankedVersions": [], + "envVarAllowedYankedVersions": "", + "ignoreDevDependency": false, + "directDependenciesMode": "WARNING", + "compatibilityMode": "ERROR" + }, + "localOverrideHashes": { + "bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787" + }, + "moduleDepGraph": { + "": { + "name": "build_buildfarm", + "version": "", + "key": "", + "repoName": "build_buildfarm", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", + "extensionName": "maven", + "usingModule": "", + "location": { + "file": "@@//:MODULE.bazel", + "line": 47, + "column": 22 + }, + "imports": { + "maven": "maven", + "unpinned_maven": "unpinned_maven" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "artifacts": [ + "com.amazonaws:aws-java-sdk-s3:1.12.544", + "com.amazonaws:aws-java-sdk-secretsmanager:1.12.544", + "com.fasterxml.jackson.core:jackson-databind:2.15.0", + "com.github.ben-manes.caffeine:caffeine:2.9.0", + "com.github.docker-java:docker-java:3.3.3", + "com.github.fppt:jedis-mock:1.0.10", + "com.github.jnr:jffi:1.3.11", + "com.github.jnr:jffi:jar:native:1.3.11", + "com.github.jnr:jnr-constants:0.10.4", + "com.github.jnr:jnr-ffi:2.2.14", + "com.github.jnr:jnr-posix:3.1.17", + "com.github.pcj:google-options:1.0.0", + "com.github.serceman:jnr-fuse:0.5.7", + "com.github.luben:zstd-jni:1.5.5-7", + "com.github.oshi:oshi-core:6.4.5", + "com.google.auth:google-auth-library-credentials:1.19.0", + "com.google.auth:google-auth-library-oauth2-http:1.19.0", + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.10.1", + "com.google.errorprone:error_prone_annotations:2.22.0", + "com.google.errorprone:error_prone_core:2.22.0", + "com.google.guava:failureaccess:1.0.1", + "com.google.guava:guava:32.1.1-jre", + "com.google.j2objc:j2objc-annotations:2.8", + "com.google.jimfs:jimfs:1.3.0", + "com.google.protobuf:protobuf-java-util:3.19.1", + "com.google.protobuf:protobuf-java:3.19.1", + "com.google.truth:truth:1.1.5", + "org.slf4j:slf4j-simple:2.0.9", + "com.googlecode.json-simple:json-simple:1.1.1", + "com.jayway.jsonpath:json-path:2.8.0", + "org.bouncycastle:bcprov-jdk15on:1.70", + "net.jcip:jcip-annotations:1.0", + "io.netty:netty-buffer:4.1.97.Final", + "io.netty:netty-codec:4.1.97.Final", + "io.netty:netty-codec-http:4.1.97.Final", + "io.netty:netty-codec-http2:4.1.97.Final", + "io.netty:netty-codec-socks:4.1.97.Final", + "io.netty:netty-common:4.1.97.Final", + "io.netty:netty-handler:4.1.97.Final", + "io.netty:netty-handler-proxy:4.1.97.Final", + "io.netty:netty-resolver:4.1.97.Final", + "io.netty:netty-transport:4.1.97.Final", + "io.netty:netty-transport-native-epoll:4.1.97.Final", + "io.netty:netty-transport-native-kqueue:4.1.97.Final", + "io.netty:netty-transport-native-unix-common:4.1.97.Final", + "io.grpc:grpc-api:1.56.1", + "io.grpc:grpc-auth:1.56.1", + "io.grpc:grpc-core:1.56.1", + "io.grpc:grpc-context:1.56.1", + "io.grpc:grpc-netty:1.56.1", + "io.grpc:grpc-stub:1.56.1", + "io.grpc:grpc-protobuf:1.56.1", + "io.grpc:grpc-testing:1.56.1", + "io.grpc:grpc-services:1.56.1", + "io.grpc:grpc-netty-shaded:1.56.1", + "io.prometheus:simpleclient:0.15.0", + "io.prometheus:simpleclient_hotspot:0.15.0", + "io.prometheus:simpleclient_httpserver:0.15.0", + "junit:junit:4.13.2", + "javax.annotation:javax.annotation-api:1.3.2", + "net.javacrumbs.future-converter:future-converter-java8-guava:1.2.0", + "org.apache.commons:commons-compress:1.23.0", + "org.apache.commons:commons-pool2:2.11.1", + "org.apache.commons:commons-lang3:3.13.0", + "commons-io:commons-io:2.13.0", + "me.dinowernli:java-grpc-prometheus:0.6.0", + "org.apache.tomcat:annotations-api:6.0.53", + "org.checkerframework:checker-qual:3.38.0", + "org.mockito:mockito-core:2.25.0", + "org.openjdk.jmh:jmh-core:1.37", + "org.openjdk.jmh:jmh-generator-annprocess:1.37", + "org.redisson:redisson:3.23.4", + "org.threeten:threetenbp:1.6.8", + "org.xerial:sqlite-jdbc:3.34.0", + "org.jetbrains:annotations:16.0.2", + "org.yaml:snakeyaml:2.2", + "org.projectlombok:lombok:1.18.30" + ], + "fail_if_repin_required": true, + "generate_compat_repositories": true, + "lock_file": "//:maven_install.json" + }, + "devDependency": false, + "location": { + "file": "@@//:MODULE.bazel", + "line": 48, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_gazelle": "gazelle@0.34.0", + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "io_bazel_rules_go": "rules_go@0.43.0", + "rules_jvm_external": "rules_jvm_external@5.3", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "gazelle@0.34.0": { + "name": "gazelle", + "version": "0.34.0", + "key": "gazelle@0.34.0", + "repoName": "bazel_gazelle", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@io_bazel_rules_go//go:extensions.bzl", + "extensionName": "go_sdk", + "usingModule": "gazelle@0.34.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel", + "line": 12, + "column": 23 + }, + "imports": { + "go_host_compatible_sdk_label": "go_host_compatible_sdk_label" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_gazelle//internal/bzlmod:non_module_deps.bzl", + "extensionName": "non_module_deps", + "usingModule": "gazelle@0.34.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel", + "line": 20, + "column": 32 + }, + "imports": { + "bazel_gazelle_go_repository_cache": "bazel_gazelle_go_repository_cache", + "bazel_gazelle_go_repository_tools": "bazel_gazelle_go_repository_tools", + "bazel_gazelle_is_bazel_module": "bazel_gazelle_is_bazel_module" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_gazelle//:extensions.bzl", + "extensionName": "go_deps", + "usingModule": "gazelle@0.34.0", + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel", + "line": 28, + "column": 24 + }, + "imports": { + "com_github_bazelbuild_buildtools": "com_github_bazelbuild_buildtools", + "com_github_bmatcuk_doublestar_v4": "com_github_bmatcuk_doublestar_v4", + "com_github_fsnotify_fsnotify": "com_github_fsnotify_fsnotify", + "com_github_google_go_cmp": "com_github_google_go_cmp", + "com_github_pmezard_go_difflib": "com_github_pmezard_go_difflib", + "org_golang_x_mod": "org_golang_x_mod", + "org_golang_x_sync": "org_golang_x_sync", + "org_golang_x_tools": "org_golang_x_tools", + "org_golang_x_tools_go_vcs": "org_golang_x_tools_go_vcs", + "bazel_gazelle_go_repository_config": "bazel_gazelle_go_repository_config" + }, + "devImports": [], + "tags": [ + { + "tagName": "from_file", + "attributeValues": { + "go_mod": "//:go.mod" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel", + "line": 29, + "column": 18 + } + }, + { + "tagName": "module", + "attributeValues": { + "path": "golang.org/x/tools", + "sum": "h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=", + "version": "v0.13.0" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel", + "line": 33, + "column": 15 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "com_google_protobuf": "protobuf@3.19.6", + "io_bazel_rules_go": "rules_go@0.43.0", + "rules_proto": "rules_proto@4.0.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "gazelle~0.34.0", + "urls": [ + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz" + ], + "integrity": "sha256-tzh/cu+1n4duTarkLx05EtDUVWPqx8sj0d4LCUq1iM8=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "platforms@0.0.7": { + "name": "platforms", + "version": "0.0.7", + "key": "platforms@0.0.7", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "platforms", + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" + ], + "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_cc@0.0.9": { + "name": "rules_cc", + "version": "0.0.9", + "key": "rules_cc@0.0.9", + "repoName": "rules_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "rules_cc@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", + "line": 9, + "column": 29 + }, + "imports": { + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_cc~0.0.9", + "urls": [ + "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + ], + "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", + "strip_prefix": "rules_cc-0.0.9", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_go@0.43.0": { + "name": "rules_go", + "version": "0.43.0", + "key": "rules_go@0.43.0", + "repoName": "io_bazel_rules_go", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@go_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@io_bazel_rules_go//go/private:extensions.bzl", + "extensionName": "non_module_dependencies", + "usingModule": "rules_go@0.43.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 14, + "column": 40 + }, + "imports": { + "io_bazel_rules_nogo": "io_bazel_rules_nogo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@io_bazel_rules_go//go:extensions.bzl", + "extensionName": "go_sdk", + "usingModule": "rules_go@0.43.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 20, + "column": 23 + }, + "imports": { + "go_toolchains": "go_toolchains" + }, + "devImports": [], + "tags": [ + { + "tagName": "download", + "attributeValues": { + "name": "go_default_sdk", + "version": "1.21.1" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 21, + "column": 16 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@gazelle//:extensions.bzl", + "extensionName": "go_deps", + "usingModule": "rules_go@0.43.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 31, + "column": 24 + }, + "imports": { + "com_github_gogo_protobuf": "com_github_gogo_protobuf", + "com_github_golang_mock": "com_github_golang_mock", + "com_github_golang_protobuf": "com_github_golang_protobuf", + "org_golang_google_genproto": "org_golang_google_genproto", + "org_golang_google_grpc": "org_golang_google_grpc", + "org_golang_google_protobuf": "org_golang_google_protobuf", + "org_golang_x_net": "org_golang_x_net" + }, + "devImports": [], + "tags": [ + { + "tagName": "from_file", + "attributeValues": { + "go_mod": "//:go.mod" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 32, + "column": 18 + } + }, + { + "tagName": "module", + "attributeValues": { + "path": "github.com/gogo/protobuf", + "sum": "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=", + "version": "v1.3.2" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_go/0.43.0/MODULE.bazel", + "line": 33, + "column": 15 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_features": "bazel_features@1.1.1", + "bazel_skylib": "bazel_skylib@1.4.1", + "platforms": "platforms@0.0.7", + "rules_proto": "rules_proto@4.0.0", + "com_google_protobuf": "protobuf@3.19.6", + "gazelle": "gazelle@0.34.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_go~0.43.0", + "urls": [ + "https://github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip" + ], + "integrity": "sha256-1qtrV+SMCVI+kwUPE2mPcIQoz9XmGSUuNp03evZZdwc=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_jvm_external@5.3": { + "name": "rules_jvm_external", + "version": "5.3", + "key": "rules_jvm_external@5.3", + "repoName": "rules_jvm_external", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl", + "extensionName": "non_module_deps", + "usingModule": "rules_jvm_external@5.3", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel", + "line": 9, + "column": 32 + }, + "imports": { + "io_bazel_rules_kotlin": "io_bazel_rules_kotlin" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": ":extensions.bzl", + "extensionName": "maven", + "usingModule": "rules_jvm_external@5.3", + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel", + "line": 16, + "column": 22 + }, + "imports": { + "rules_jvm_external_deps": "rules_jvm_external_deps" + }, + "devImports": [], + "tags": [ + { + "tagName": "install", + "attributeValues": { + "name": "rules_jvm_external_deps", + "artifacts": [ + "com.google.auth:google-auth-library-credentials:1.17.0", + "com.google.auth:google-auth-library-oauth2-http:1.17.0", + "com.google.cloud:google-cloud-core:2.18.1", + "com.google.cloud:google-cloud-storage:2.22.3", + "com.google.code.gson:gson:2.10.1", + "com.google.googlejavaformat:google-java-format:1.17.0", + "com.google.guava:guava:32.0.0-jre", + "org.apache.maven:maven-artifact:3.9.2", + "software.amazon.awssdk:s3:2.20.78" + ], + "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel", + "line": 18, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "io_bazel_stardoc": "stardoc@0.5.3", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_jvm_external~5.3", + "urls": [ + "https://github.com/bazelbuild/rules_jvm_external/releases/download/5.3/rules_jvm_external-5.3.tar.gz" + ], + "integrity": "sha256-0x42m4VDIspQmOoSxp1xdd7ZcUNeVcGN2d1fKcxSSaw=", + "strip_prefix": "rules_jvm_external-5.3", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_license@0.0.7": { + "name": "rules_license", + "version": "0.0.7", + "key": "rules_license@0.0.7", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_license~0.0.7", + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + ], + "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "bazel_tools@_": { + "name": "bazel_tools", + "version": "", + "key": "bazel_tools@_", + "repoName": "bazel_tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all", + "@local_config_sh//:local_sh_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 17, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc", + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", + "extensionName": "xcode_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 21, + "column": 32 + }, + "imports": { + "local_config_xcode": "local_config_xcode" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 24, + "column": 32 + }, + "imports": { + "local_jdk": "local_jdk", + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", + "extensionName": "sh_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 35, + "column": 39 + }, + "imports": { + "local_config_sh": "local_config_sh" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", + "extensionName": "remote_coverage_tools_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 39, + "column": 48 + }, + "imports": { + "remote_coverage_tools": "remote_coverage_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", + "extensionName": "remote_android_tools_extensions", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 42, + "column": 42 + }, + "imports": { + "android_gmaven_r8": "android_gmaven_r8", + "android_tools": "android_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "rules_java": "rules_java@7.1.0", + "rules_license": "rules_license@0.0.7", + "rules_proto": "rules_proto@4.0.0", + "rules_python": "rules_python@0.4.0", + "platforms": "platforms@0.0.7", + "com_google_protobuf": "protobuf@3.19.6", + "zlib": "zlib@1.3", + "build_bazel_apple_support": "apple_support@1.5.0", + "local_config_platform": "local_config_platform@_" + } + }, + "local_config_platform@_": { + "name": "local_config_platform", + "version": "", + "key": "local_config_platform@_", + "repoName": "local_config_platform", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_" + } + }, + "bazel_skylib@1.4.1": { + "name": "bazel_skylib", + "version": "1.4.1", + "key": "bazel_skylib@1.4.1", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_skylib~1.4.1", + "urls": [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz" + ], + "integrity": "sha256-uKFSeQF3QYCvx5iusoxGNL3M8ZxNmOe90c550f6aqtc=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "protobuf@3.19.6": { + "name": "protobuf", + "version": "3.19.6", + "key": "protobuf@3.19.6", + "repoName": "protobuf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "zlib": "zlib@1.3", + "rules_python": "rules_python@0.4.0", + "rules_cc": "rules_cc@0.0.9", + "rules_proto": "rules_proto@4.0.0", + "rules_java": "rules_java@7.1.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "protobuf~3.19.6", + "urls": [ + "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip" + ], + "integrity": "sha256-OH4sVZuyx8G8N5jE5s/wFTgaebJ1hpavy/johzC0c4k=", + "strip_prefix": "protobuf-3.19.6", + "remote_patches": { + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/relative_repo_names.patch": "sha256-w/5gw/zGv8NFId+669hcdw1Uus2lxgYpulATHIwIByI=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/remove_dependency_on_rules_jvm_external.patch": "sha256-THUTnVgEBmjA0W7fKzIyZOVG58DnW9HQTkr4D2zKUUc=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/add_module_dot_bazel_for_examples.patch": "sha256-s/b1gi3baK3LsXefI2rQilhmkb2R5jVJdnT6zEcdfHY=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/module_dot_bazel.patch": "sha256-S0DEni8zgx7rHscW3z/rCEubQnYec0XhNet640cw0h4=" + }, + "remote_patch_strip": 1 + } + } + }, + "rules_proto@4.0.0": { + "name": "rules_proto", + "version": "4.0.0", + "key": "rules_proto@4.0.0", + "repoName": "rules_proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_proto~4.0.0", + "urls": [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.zip" + ], + "integrity": "sha256-Lr5z6xyuRA19pNtRYMGjKaynwQpck4H/lwYyVjyhoq4=", + "strip_prefix": "rules_proto-4.0.0", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_proto/4.0.0/patches/module_dot_bazel.patch": "sha256-MclJO7tIAM2ElDAmscNId9pKTpOuDGHgVlW/9VBOIp0=" + }, + "remote_patch_strip": 0 + } + } + }, + "bazel_features@1.1.1": { + "name": "bazel_features", + "version": "1.1.1", + "key": "bazel_features@1.1.1", + "repoName": "bazel_features", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_features//private:extensions.bzl", + "extensionName": "version_extension", + "usingModule": "bazel_features@1.1.1", + "location": { + "file": "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel", + "line": 6, + "column": 24 + }, + "imports": { + "bazel_features_globals": "bazel_features_globals", + "bazel_features_version": "bazel_features_version" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_features~1.1.1", + "urls": [ + "https://github.com/bazel-contrib/bazel_features/releases/download/v1.1.1/bazel_features-v1.1.1.tar.gz" + ], + "integrity": "sha256-YsJuQn5cvHUQJERpJ2IuOYqdzfMsZDJSOIFXCdEcEag=", + "strip_prefix": "bazel_features-1.1.1", + "remote_patches": { + "https://bcr.bazel.build/modules/bazel_features/1.1.1/patches/module_dot_bazel_version.patch": "sha256-+56MAEsc7bYN/Pzhn252ZQUxiRzZg9bynXj1qpsmCYs=" + }, + "remote_patch_strip": 1 + } + } + }, + "stardoc@0.5.3": { + "name": "stardoc", + "version": "0.5.3", + "key": "stardoc@0.5.3", + "repoName": "stardoc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "rules_java": "rules_java@7.1.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "stardoc~0.5.3", + "urls": [ + "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz" + ], + "integrity": "sha256-P9j+xN3sPGcL2BCQTi4zFwvt/hL5Ct+UNQgYS+RYyLs=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/stardoc/0.5.3/patches/module_dot_bazel.patch": "sha256-Lgpy9OCr0zBWYuHoyM1rJJrgxn23X/bwgICEF7XiEug=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_java@7.1.0": { + "name": "rules_java", + "version": "7.1.0", + "key": "rules_java@7.1.0", + "repoName": "rules_java", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains:all", + "@local_jdk//:runtime_toolchain_definition", + "@local_jdk//:bootstrap_runtime_toolchain_definition", + "@remotejdk11_linux_toolchain_config_repo//:all", + "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk11_linux_s390x_toolchain_config_repo//:all", + "@remotejdk11_macos_toolchain_config_repo//:all", + "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk11_win_toolchain_config_repo//:all", + "@remotejdk11_win_arm64_toolchain_config_repo//:all", + "@remotejdk17_linux_toolchain_config_repo//:all", + "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk17_linux_s390x_toolchain_config_repo//:all", + "@remotejdk17_macos_toolchain_config_repo//:all", + "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk17_win_toolchain_config_repo//:all", + "@remotejdk17_win_arm64_toolchain_config_repo//:all", + "@remotejdk21_linux_toolchain_config_repo//:all", + "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk21_macos_toolchain_config_repo//:all", + "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk21_win_toolchain_config_repo//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "rules_java@7.1.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel", + "line": 19, + "column": 27 + }, + "imports": { + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", + "local_jdk": "local_jdk", + "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", + "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", + "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", + "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", + "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", + "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", + "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", + "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", + "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", + "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", + "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", + "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", + "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", + "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", + "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", + "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", + "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", + "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_skylib": "bazel_skylib@1.4.1", + "rules_proto": "rules_proto@4.0.0", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0", + "urls": [ + "https://github.com/bazelbuild/rules_java/releases/download/7.1.0/rules_java-7.1.0.tar.gz" + ], + "integrity": "sha256-o3pOX2OrgnFuXdau75iO2EYcegC46TYnImKJn1h81OE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_python@0.4.0": { + "name": "rules_python", + "version": "0.4.0", + "key": "rules_python@0.4.0", + "repoName": "rules_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@bazel_tools//tools/python:autodetecting_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_python//bzlmod:extensions.bzl", + "extensionName": "pip_install", + "usingModule": "rules_python@0.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel", + "line": 7, + "column": 28 + }, + "imports": { + "pypi__click": "pypi__click", + "pypi__pip": "pypi__pip", + "pypi__pip_tools": "pypi__pip_tools", + "pypi__pkginfo": "pypi__pkginfo", + "pypi__setuptools": "pypi__setuptools", + "pypi__wheel": "pypi__wheel" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0", + "urls": [ + "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz" + ], + "integrity": "sha256-lUqom0kb5KCDMEosuDgBnIuMNyCnq7nEy4GseiQjDOo=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/propagate_pip_install_dependencies.patch": "sha256-v7S/dem/mixg63MF4KoRGDA4KEol9ab/tIVp+6Xq0D0=", + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/module_dot_bazel.patch": "sha256-kG4VIfWxQazzTuh50mvsx6pmyoRVA4lfH5rkto/Oq+Y=" + }, + "remote_patch_strip": 1 + } + } + }, + "zlib@1.3": { + "name": "zlib", + "version": "1.3", + "key": "zlib@1.3", + "repoName": "zlib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "zlib~1.3", + "urls": [ + "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + ], + "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", + "strip_prefix": "zlib-1.3", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", + "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + }, + "remote_patch_strip": 0 + } + } + }, + "apple_support@1.5.0": { + "name": "apple_support", + "version": "1.5.0", + "key": "apple_support@1.5.0", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.5.0", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", + "line": 17, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "apple_support~1.5.0", + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + ], + "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + } + }, + "moduleExtensions": { + "@@apple_support~1.5.0//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc" + } + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc_toolchains" + } + } + } + } + }, + "@@bazel_features~1.1.1//private:extensions.bzl%version_extension": { + "general": { + "bzlTransitiveDigest": "xm7Skm1Las5saxzFWt2hbS+e68BWi+MXyt6+lKIhjPA=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "bazel_features_version": { + "bzlFile": "@@bazel_features~1.1.1//private:version_repo.bzl", + "ruleClassName": "version_repo", + "attributes": { + "name": "bazel_features~1.1.1~version_extension~bazel_features_version" + } + }, + "bazel_features_globals": { + "bzlFile": "@@bazel_features~1.1.1//private:globals_repo.bzl", + "ruleClassName": "globals_repo", + "attributes": { + "name": "bazel_features~1.1.1~version_extension~bazel_features_globals", + "globals": { + "RunEnvironmentInfo": "5.3.0", + "DefaultInfo": "0.0.1", + "__TestingOnly_NeverAvailable": "1000000000.0.0" + } + } + } + } + } + }, + "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "O9sf6ilKWU9Veed02jG9o2HM/xgV/UAyciuFBuxrFRY=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_cc": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc" + } + }, + "local_config_cc_toolchains": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf_toolchains", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc_toolchains" + } + } + } + } + }, + "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { + "general": { + "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_xcode": { + "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", + "ruleClassName": "xcode_autoconf", + "attributes": { + "name": "bazel_tools~xcode_configure_extension~local_config_xcode", + "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", + "remote_xcode": "" + } + } + } + } + }, + "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { + "general": { + "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_sh": { + "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", + "ruleClassName": "sh_config", + "attributes": { + "name": "bazel_tools~sh_configure_extension~local_config_sh" + } + } + } + } + }, + "@@rules_go~0.43.0//go:extensions.bzl%go_sdk": { + "os:osx,arch:aarch64": { + "bzlTransitiveDigest": "X7FY+0kUDFpsa3ulS9IPEJAqEW8vwFdmD7u4epims+M=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "go_default_sdk": { + "bzlFile": "@@rules_go~0.43.0//go/private:sdk.bzl", + "ruleClassName": "go_download_sdk_rule", + "attributes": { + "name": "rules_go~0.43.0~go_sdk~go_default_sdk", + "goos": "", + "goarch": "", + "sdks": {}, + "experiments": [], + "patches": [], + "patch_strip": 0, + "urls": [ + "https://dl.google.com/go/{}" + ], + "version": "1.21.1", + "strip_prefix": "go" + } + }, + "go_host_compatible_sdk_label": { + "bzlFile": "@@rules_go~0.43.0//go/private:extensions.bzl", + "ruleClassName": "host_compatible_toolchain", + "attributes": { + "name": "rules_go~0.43.0~go_sdk~go_host_compatible_sdk_label", + "toolchain": "@go_default_sdk//:ROOT" + } + }, + "go_toolchains": { + "bzlFile": "@@rules_go~0.43.0//go/private:sdk.bzl", + "ruleClassName": "go_multiple_toolchains", + "attributes": { + "name": "rules_go~0.43.0~go_sdk~go_toolchains", + "prefixes": [ + "_0000_go_default_sdk_" + ], + "geese": [ + "" + ], + "goarchs": [ + "" + ], + "sdk_repos": [ + "go_default_sdk" + ], + "sdk_types": [ + "remote" + ], + "sdk_versions": [ + "1.21.1" + ] + } + } + } + } + }, + "@@rules_java~7.1.0//java:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "iUIRqCK7tkhvcDJCAfPPqSd06IHG0a8HQD0xeQyVAqw=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remotejdk21_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "2a7a99a3ea263dbd8d32a67d1e6e363ba8b25c645c826f5e167a02bbafaff1fa", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" + ] + } + }, + "remote_java_tools_windows": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_windows", + "sha256": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_windows-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_windows-v13.1.zip" + ] + } + }, + "remotejdk11_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" + ] + } + }, + "remotejdk11_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" + } + }, + "remotejdk11_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" + ] + } + }, + "remotejdk11_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", + "strip_prefix": "jdk-11.0.13+8", + "urls": [ + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" + ] + } + }, + "remotejdk17_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "9639b87db586d0c89f7a9892ae47f421e442c64b97baebdff31788fbe23265bd", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" + ] + } + }, + "remotejdk11_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk21_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "0c0eadfbdc47a7ca64aeab51b9c061f71b6e4d25d2d87674512e9b6387e9e3a6", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz" + ] + } + }, + "remote_java_tools_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_linux", + "sha256": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_linux-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_linux-v13.1.zip" + ] + } + }, + "remotejdk21_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "e9959d500a0d9a7694ac243baf657761479da132f0f94720cbffd092150bd802", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip" + ] + } + }, + "remotejdk21_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "1fb64b8036c5d463d8ab59af06bf5b6b006811e6012e3b0eb6bccf57f1c55835", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk11_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk17_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk17_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" + ] + } + }, + "remote_java_tools_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_arm64", + "sha256": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_arm64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_arm64-v13.1.zip" + ] + } + }, + "remotejdk17_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk21_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" + } + }, + "local_jdk": { + "bzlFile": "@@rules_java~7.1.0//toolchains:local_java_repository.bzl", + "ruleClassName": "_local_java_repository_rule", + "attributes": { + "name": "rules_java~7.1.0~toolchains~local_jdk", + "java_home": "", + "version": "", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" + } + }, + "remote_java_tools_darwin_x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_x86_64", + "sha256": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_x86_64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_x86_64-v13.1.zip" + ] + } + }, + "remote_java_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools", + "sha256": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools-v13.1.zip" + ] + } + }, + "remotejdk17_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk17_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk11_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk21_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" + } + } + } + } + }, + "@@rules_jvm_external~5.3//:extensions.bzl%maven": { + "general": { + "bzlTransitiveDigest": "9VQBVBpk1BYX8MlZX/v6yoWpeoWbbeIDc8bZ2kiueLI=", + "accumulatedFileDigests": { + "@@//:maven_install.json": "a5ee74885480c4e38f70dd8ca3e8ef2b7d89c81a581bbc196965d22aabd9b2ab", + "@@rules_jvm_external~5.3//:rules_jvm_external_deps_install.json": "741ab2ef3843a43eaacb45d1448835c9deb99c95162279f513096eface8acd44" + }, + "envVariables": {}, + "generatedRepoSpecs": { + "io_grpc_grpc_netty_shaded_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_shaded_jar_sources_1_56_1", + "sha256": "4a7dd3517fc4540e926cd958b3a48ffc561f42ad9dfe31e3f2ccc13ba1742939", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1-sources.jar" + } + }, + "me_dinowernli_java_grpc_prometheus": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~me_dinowernli_java_grpc_prometheus", + "generating_repository": "maven", + "target_name": "me_dinowernli_java_grpc_prometheus" + } + }, + "com_sun_activation_jakarta_activation_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_sun_activation_jakarta_activation_1_2_1", + "sha256": "d84d4ba8b55cdb7fdcbb885e6939386367433f56f5ab8cfdc302a7c3587fa92b", + "urls": [ + "https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar" + ], + "downloaded_file_path": "com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar" + } + }, + "io_netty_netty_resolver_dns_jar_sources_4_1_96_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver_dns_jar_sources_4_1_96_Final", + "sha256": "77eeef5ac81bf4b1ad919dc0e7b44bd4f2a4f71418c57beb341685f299fdc963", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver-dns/4.1.96.Final/netty-resolver-dns-4.1.96.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-resolver-dns/4.1.96.Final/netty-resolver-dns-4.1.96.Final-sources.jar" + } + }, + "io_grpc_grpc_alts_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_alts_1_55_1", + "sha256": "9ab78b042d55cb501a2126c831896f3223e39c65085351b40a588b085ed6d431", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-alts/1.55.1/grpc-alts-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-alts/1.55.1/grpc-alts-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-alts/1.55.1/grpc-alts-1.55.1.jar" + } + }, + "com_github_jnr_jffi_1_3_11": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jffi_1_3_11", + "sha256": "74d3bce7397b4872ccb6a6fd84b8f260503f76509adc9548029f665852ad38d7", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jffi/1.3.11/jffi-1.3.11.jar" + ], + "downloaded_file_path": "com/github/jnr/jffi/1.3.11/jffi-1.3.11.jar" + } + }, + "io_prometheus_simpleclient_tracer_common_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_common_jar_sources_0_15_0", + "sha256": "ad5a691dc6b1b5096de0a209530c07a8f98d31d51895730136699a74caa1145a", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common/0.15.0/simpleclient_tracer_common-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_common/0.15.0/simpleclient_tracer_common-0.15.0-sources.jar" + } + }, + "com_google_truth_truth": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_truth_truth", + "generating_repository": "maven", + "target_name": "com_google_truth_truth" + } + }, + "io_opencensus_opencensus_api_jar_sources_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_opencensus_opencensus_api_jar_sources_0_31_1", + "sha256": "6748d57aaae81995514ad3e2fb11a95aa88e158b3f93450288018eaccf31e86b", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1-sources.jar" + ], + "downloaded_file_path": "io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1-sources.jar" + } + }, + "com_github_kevinstern_software_and_algorithms_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_kevinstern_software_and_algorithms_1_0", + "sha256": "61ab82439cef37343b14f53154c461619375373a56b9338e895709fb54e0864c", + "urls": [ + "https://repo1.maven.org/maven2/com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0.jar" + ], + "downloaded_file_path": "com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0.jar" + } + }, + "com_google_protobuf_protobuf_java_util": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_util", + "generating_repository": "maven", + "target_name": "com_google_protobuf_protobuf_java_util" + } + }, + "io_grpc_grpc_api_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_api_1_56_1", + "sha256": "b090b1bb5a3b066f7f2ef14b9ba68e3304de80ba34f90414aed3b519c30999e8", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-api/1.56.1/grpc-api-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-api/1.56.1/grpc-api-1.56.1.jar" + } + }, + "org_apache_commons_commons_compress_1_23_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_compress_1_23_0", + "sha256": "c267f17160e9ef662b4d78b7f29dca7c82b15c5cff2cb6a9865ef4ab3dd5b787", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0.jar" + } + }, + "org_reactivestreams_reactive_streams_1_0_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_reactivestreams_reactive_streams_1_0_3", + "sha256": "1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865", + "urls": [ + "https://repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar", + "https://maven.google.com/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" + ], + "downloaded_file_path": "org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar" + } + }, + "com_google_protobuf_protobuf_java_util_3_22_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_util_3_22_3", + "sha256": "c615f76879dc5c303e4df5b94a6afa39534058c7545db2d483fd95d9f63c8bfe", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.22.3/protobuf-java-util-3.22.3.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java-util/3.22.3/protobuf-java-util-3.22.3.jar" + } + }, + "org_reactivestreams_reactive_streams_1_0_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_reactivestreams_reactive_streams_1_0_4", + "sha256": "f75ca597789b3dac58f61857b9ac2e1034a68fa672db35055a8fb4509e325f28", + "urls": [ + "https://repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar" + ], + "downloaded_file_path": "org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar" + } + }, + "com_amazonaws_aws_java_sdk_s3_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_s3_1_12_544", + "sha256": "817b2fac490d3e02ecaf3253c2e2ab0bf6d2291a841574cec70464312d669230", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-s3/1.12.544/aws-java-sdk-s3-1.12.544.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-s3/1.12.544/aws-java-sdk-s3-1.12.544.jar" + } + }, + "joda_time_joda_time_2_8_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~joda_time_joda_time_2_8_1", + "sha256": "b4670b95f75957c974284c5f3ada966040be2578f643c5c6083d262162061fa2", + "urls": [ + "https://repo1.maven.org/maven2/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar" + ], + "downloaded_file_path": "joda-time/joda-time/2.8.1/joda-time-2.8.1.jar" + } + }, + "com_amazonaws_aws_java_sdk_s3": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_s3", + "generating_repository": "maven", + "target_name": "com_amazonaws_aws_java_sdk_s3" + } + }, + "com_github_fppt_jedis_mock": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_fppt_jedis_mock", + "generating_repository": "maven", + "target_name": "com_github_fppt_jedis_mock" + } + }, + "com_jayway_jsonpath_json_path_2_8_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_jayway_jsonpath_json_path_2_8_0", + "sha256": "9601707e95cd79fb98570a01ea8cfb857b5cde948744d6e0edf733c11002c95b", + "urls": [ + "https://repo1.maven.org/maven2/com/jayway/jsonpath/json-path/2.8.0/json-path-2.8.0.jar" + ], + "downloaded_file_path": "com/jayway/jsonpath/json-path/2.8.0/json-path-2.8.0.jar" + } + }, + "com_google_errorprone_error_prone_annotations_jar_sources_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotations_jar_sources_2_22_0", + "sha256": "c989d7144e4b3313514972df85f8f9dfd53b300e1359e13ca5e6453965c8fcef", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0-sources.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0-sources.jar" + } + }, + "io_prometheus_simpleclient_tracer_otel_agent_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_otel_agent_jar_sources_0_15_0", + "sha256": "9071a9ecf1473fd9c71c27082c549dd4e5686039444efb662392b1f3391a5d36", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent/0.15.0/simpleclient_tracer_otel_agent-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_otel_agent/0.15.0/simpleclient_tracer_otel_agent-0.15.0-sources.jar" + } + }, + "com_github_serceman_jnr_fuse": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_serceman_jnr_fuse", + "generating_repository": "maven", + "target_name": "com_github_serceman_jnr_fuse" + } + }, + "org_checkerframework_checker_qual_jar_sources_3_38_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_checkerframework_checker_qual_jar_sources_3_38_0", + "sha256": "c1184779ca27c09efe55b54109bf8a2b654112c6e8b28105c0c2dcc5a84465b1", + "urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.38.0/checker-qual-3.38.0-sources.jar" + ], + "downloaded_file_path": "org/checkerframework/checker-qual/3.38.0/checker-qual-3.38.0-sources.jar" + } + }, + "org_bouncycastle_bcprov_jdk15on_1_70": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcprov_jdk15on_1_70", + "sha256": "8f3c20e3e2d565d26f33e8d4857a37d0d7f8ac39b62a7026496fcab1bdac30d4", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.70/bcprov-jdk15on-1.70.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcprov-jdk15on/1.70/bcprov-jdk15on-1.70.jar" + } + }, + "com_google_code_gson_gson_2_10_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_gson_gson_2_10_1", + "sha256": "4241c14a7727c34feea6507ec801318a3d4a90f070e4525681079fb94ee4c593", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar" + ], + "downloaded_file_path": "com/google/code/gson/gson/2.10.1/gson-2.10.1.jar" + } + }, + "io_netty_netty_handler_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_jar_sources_4_1_97_Final", + "sha256": "905739df92b7fe6468504e1e91b964654381eb3d162766f39552d06a0cbf4cd3", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final-sources.jar" + } + }, + "io_netty_netty_codec_dns_4_1_96_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_dns_4_1_96_Final", + "sha256": "857d0213bd4e504ad897a7c0f967ef3f728f120feea3e824729dad525b44bbce", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-dns/4.1.96.Final/netty-codec-dns-4.1.96.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-dns/4.1.96.Final/netty-codec-dns-4.1.96.Final.jar" + } + }, + "com_google_errorprone_error_prone_core_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_core_2_22_0", + "sha256": "32a3df226a9a47f48dd895a9a89678d50ac404282c33400781c38757e8143f2c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0.jar" + } + }, + "com_fasterxml_jackson_core_jackson_databind": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_databind", + "generating_repository": "maven", + "target_name": "com_fasterxml_jackson_core_jackson_databind" + } + }, + "io_prometheus_simpleclient_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_jar_sources_0_15_0", + "sha256": "996c0ae2c1f6fe658865f8b3b3d073d136bd60de1a37fa78db2d52db328d1adb", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient/0.15.0/simpleclient-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient/0.15.0/simpleclient-0.15.0-sources.jar" + } + }, + "org_ow2_asm_asm_tree_jar_sources_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_tree_jar_sources_9_2", + "sha256": "c35bc5b4b6c54bf15abec34ab821cf9d0801a64451f4f6070d93dcb87122aa08", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2-sources.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-tree/9.2/asm-tree-9.2-sources.jar" + } + }, + "io_netty_netty_transport_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_jar_sources_4_1_97_Final", + "sha256": "2ee8b4402c42f9bbbb3b4a14cce1f80d0b48f2115c718ea464f3050f58c70b2e", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final-sources.jar" + } + }, + "org_apache_commons_commons_math3_3_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_math3_3_6_1", + "sha256": "1e56d7b058d28b65abd256b8458e3885b674c1d588fa43cd7d1cbb9c7ef2b308", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar" + } + }, + "org_jboss_marshalling_jboss_marshalling_river_jar_sources_2_0_11_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jboss_marshalling_jboss_marshalling_river_jar_sources_2_0_11_Final", + "sha256": "c3cb3209f18c0d1fec289669426b105d5247ad53ae98326369c9b4db4b80ceac", + "urls": [ + "https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling-river/2.0.11.Final/jboss-marshalling-river-2.0.11.Final-sources.jar" + ], + "downloaded_file_path": "org/jboss/marshalling/jboss-marshalling-river/2.0.11.Final/jboss-marshalling-river-2.0.11.Final-sources.jar" + } + }, + "jakarta_annotation_jakarta_annotation_api_jar_sources_1_3_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_annotation_jakarta_annotation_api_jar_sources_1_3_5", + "sha256": "aa27e9291dce4ddbb0aea52a1cbef41c6330b96b0ae387a995ed412b68a3af7c", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5-sources.jar" + ], + "downloaded_file_path": "jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5-sources.jar" + } + }, + "org_apache_commons_commons_compress_jar_sources_1_23_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_compress_jar_sources_1_23_0", + "sha256": "2ba017aee1a90ebd2b27ba245c2338f37bf23948f035a2bd75becf623906b709", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0-sources.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0-sources.jar" + } + }, + "com_github_docker_java_docker_java_transport_netty_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_netty_3_3_3", + "sha256": "30152706a19f46f97bea55e85182762d8b5d2d23bea5e465af403537677f879b", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport-netty/3.3.3/docker-java-transport-netty-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport-netty/3.3.3/docker-java-transport-netty-3.3.3.jar" + } + }, + "io_netty_netty_transport_native_epoll_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_epoll_4_1_97_Final", + "sha256": "418a0d0d66d2d52a63a0e2cd5377f8c3186db47c09e3b8af39a43fec39c077fe", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_common_jar_sources_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_common_jar_sources_1_2_0", + "sha256": "24f849eb33ef57a4ea597052f8fa78cbe14076cb36160e7b37a6373d1f162a70", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-common/1.2.0/future-converter-common-1.2.0-sources.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-common/1.2.0/future-converter-common-1.2.0-sources.jar" + } + }, + "com_google_errorprone_error_prone_type_annotations_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_type_annotations_2_22_0", + "sha256": "6618b1d28df562622b77187b5c6dfc9c4c97851af73bd64dc0300efe9a439b20", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0.jar" + } + }, + "com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_jar_sources_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_jar_sources_2_10_3", + "sha256": "b15fd7237ceb93aa289e22bb21335249e3cd33cd6a0fd1be769e6fc63b1513b5", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.10.3/jackson-jaxrs-json-provider-2.10.3-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.10.3/jackson-jaxrs-json-provider-2.10.3-sources.jar" + } + }, + "net_java_dev_jna_jna_platform_jar_sources_5_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_java_dev_jna_jna_platform_jar_sources_5_13_0", + "sha256": "2f39937649df7e74f36f2b56ee2f15c15d4f9218fde43369c48a6b51e3cc087e", + "urls": [ + "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0-sources.jar" + ], + "downloaded_file_path": "net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0-sources.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_java8_common_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_java8_common_1_2_0", + "sha256": "bed25293fabbf59e048f67f88e55140ebc1cfa4fa899e397545d0193e866a65c", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-java8-common/1.2.0/future-converter-java8-common-1.2.0.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-java8-common/1.2.0/future-converter-java8-common-1.2.0.jar" + } + }, + "io_prometheus_simpleclient_hotspot": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_hotspot", + "generating_repository": "maven", + "target_name": "io_prometheus_simpleclient_hotspot" + } + }, + "io_netty_netty_codec": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec", + "generating_repository": "maven", + "target_name": "io_netty_netty_codec" + } + }, + "net_javacrumbs_future_converter_future_converter_guava_common_jar_sources_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_guava_common_jar_sources_1_2_0", + "sha256": "f5a6c226632ab0c4225962146c8b4dbbfd8db75f1b573c2da29268ac1beecc57", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-guava-common/1.2.0/future-converter-guava-common-1.2.0-sources.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-guava-common/1.2.0/future-converter-guava-common-1.2.0-sources.jar" + } + }, + "io_grpc_grpc_api_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_api_1_55_1", + "sha256": "9f21b1585b1c578cf905fb4c926ce895494207cb5bf456a64a24c458850f51d3", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-api/1.55.1/grpc-api-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-api/1.55.1/grpc-api-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-api/1.55.1/grpc-api-1.55.1.jar" + } + }, + "com_fasterxml_jackson_module_jackson_module_jaxb_annotations_jar_sources_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_module_jackson_module_jaxb_annotations_jar_sources_2_10_3", + "sha256": "81e7738e3a836c465e3170cab143e1c3182c3ca5dd3cfabfceb9a23fe0939a34", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.10.3/jackson-module-jaxb-annotations-2.10.3-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.10.3/jackson-module-jaxb-annotations-2.10.3-sources.jar" + } + }, + "com_google_errorprone_error_prone_core_jar_sources_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_core_jar_sources_2_22_0", + "sha256": "98c52d46fe499a61eea86234f5463bba6968c595dacddb38d89c161e354c62b4", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0-sources.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_core/2.22.0/error_prone_core-2.22.0-sources.jar" + } + }, + "net_bytebuddy_byte_buddy_jar_sources_1_14_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_bytebuddy_byte_buddy_jar_sources_1_14_5", + "sha256": "143dd9fe73f0566cc703934b7fd15abbb97bfab045064c2f176067e70456a136", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5-sources.jar" + ], + "downloaded_file_path": "net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5-sources.jar" + } + }, + "com_google_protobuf_protobuf_java_util_3_23_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_util_3_23_1", + "sha256": "35d78f70fcba8ecaad6b2025a4879099a27997079158500a08fafebad8918c8c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.23.1/protobuf-java-util-3.23.1.jar", + "https://maven.google.com/com/google/protobuf/protobuf-java-util/3.23.1/protobuf-java-util-3.23.1.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java-util/3.23.1/protobuf-java-util-3.23.1.jar" + } + }, + "org_ow2_asm_asm_9_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_9_5", + "sha256": "b62e84b5980729751b0458c534cf1366f727542bb8d158621335682a460f0353", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.5/asm-9.5.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm/9.5/asm-9.5.jar" + } + }, + "software_amazon_ion_ion_java_jar_sources_1_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_ion_ion_java_jar_sources_1_0_2", + "sha256": "d827fc9775443697bbcdfeb8ea2d3d75bf5ad7f2ca540dabda1a5f83cd0a39de", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2-sources.jar" + ], + "downloaded_file_path": "software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2-sources.jar" + } + }, + "io_netty_netty_resolver_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver_jar_sources_4_1_97_Final", + "sha256": "dd687a7b2016d38d92d988172b787c713d786e5b8c37896796b156e6798cbd95", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final-sources.jar" + } + }, + "org_pcollections_pcollections_jar_sources_3_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_pcollections_pcollections_jar_sources_3_1_4", + "sha256": "38d91b91467dedcedfd36b6b5f577008fd51748ce74150ebe11ec1227acce218", + "urls": [ + "https://repo1.maven.org/maven2/org/pcollections/pcollections/3.1.4/pcollections-3.1.4-sources.jar" + ], + "downloaded_file_path": "org/pcollections/pcollections/3.1.4/pcollections-3.1.4-sources.jar" + } + }, + "com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava", + "sha256": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" + ], + "downloaded_file_path": "com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar" + } + }, + "com_jayway_jsonpath_json_path_jar_sources_2_8_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_jayway_jsonpath_json_path_jar_sources_2_8_0", + "sha256": "ce1d02241b445abf7f4c067b94d77c917fa06fbcbb048519b932a2197a2cc3fd", + "urls": [ + "https://repo1.maven.org/maven2/com/jayway/jsonpath/json-path/2.8.0/json-path-2.8.0-sources.jar" + ], + "downloaded_file_path": "com/jayway/jsonpath/json-path/2.8.0/json-path-2.8.0-sources.jar" + } + }, + "com_google_code_gson_gson": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_gson_gson", + "generating_repository": "maven", + "target_name": "com_google_code_gson_gson" + } + }, + "org_json_json_20220320": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_json_json_20220320", + "sha256": "1edf7fcea79a16b8dfdd3bc988ddec7f8908b1f7762fdf00d39acb037542747a", + "urls": [ + "https://repo1.maven.org/maven2/org/json/json/20220320/json-20220320.jar" + ], + "downloaded_file_path": "org/json/json/20220320/json-20220320.jar" + } + }, + "com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_2_10_3", + "sha256": "3b6b74311d094990e6d8de356363988050fb2bf5389138b198b01a0ceb9a9668", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.10.3/jackson-jaxrs-base-2.10.3.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.10.3/jackson-jaxrs-base-2.10.3.jar" + } + }, + "com_google_api_grpc_gapic_google_cloud_storage_v2_2_22_3_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_gapic_google_cloud_storage_v2_2_22_3_alpha", + "sha256": "2843f647000e82fe1d3b89eff32a15aab7671d917c90b739f31c9aa895bf957a", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/gapic-google-cloud-storage-v2/2.22.3-alpha/gapic-google-cloud-storage-v2-2.22.3-alpha.jar", + "https://maven.google.com/com/google/api/grpc/gapic-google-cloud-storage-v2/2.22.3-alpha/gapic-google-cloud-storage-v2-2.22.3-alpha.jar" + ], + "downloaded_file_path": "com/google/api/grpc/gapic-google-cloud-storage-v2/2.22.3-alpha/gapic-google-cloud-storage-v2-2.22.3-alpha.jar" + } + }, + "com_github_ben_manes_caffeine_caffeine_3_0_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_ben_manes_caffeine_caffeine_3_0_5", + "sha256": "8a9b54d3506a3b92ee46b217bcee79196b21ca6d52dc2967c686a205fb2f9c15", + "urls": [ + "https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5.jar" + ], + "downloaded_file_path": "com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5.jar" + } + }, + "org_jodd_jodd_core_jar_sources_5_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jodd_jodd_core_jar_sources_5_1_6", + "sha256": "2eb5a3af95296bc941767870bf5cb242ba7ee59a5eb0524c73e734578f6c6c16", + "urls": [ + "https://repo1.maven.org/maven2/org/jodd/jodd-core/5.1.6/jodd-core-5.1.6-sources.jar" + ], + "downloaded_file_path": "org/jodd/jodd-core/5.1.6/jodd-core-5.1.6-sources.jar" + } + }, + "org_jetbrains_annotations": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jetbrains_annotations", + "generating_repository": "maven", + "target_name": "org_jetbrains_annotations" + } + }, + "com_amazonaws_aws_java_sdk_core_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_core_1_12_544", + "sha256": "79682855ea21bd65094ad97109f9b3e4361d3e02926f5ee14ade3411c7ca43da", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-core/1.12.544/aws-java-sdk-core-1.12.544.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-core/1.12.544/aws-java-sdk-core-1.12.544.jar" + } + }, + "org_checkerframework_checker_qual_3_38_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_checkerframework_checker_qual_3_38_0", + "sha256": "9bd02cbe679a58afa0fba44c9621fe70130653e8c4564eb8d65e14bbfe26b7f8", + "urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.38.0/checker-qual-3.38.0.jar" + ], + "downloaded_file_path": "org/checkerframework/checker-qual/3.38.0/checker-qual-3.38.0.jar" + } + }, + "org_glassfish_hk2_external_jakarta_inject_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_external_jakarta_inject_2_6_1", + "sha256": "5e88c123b3e41bca788b2683118867d9b6dec714247ea91c588aed46a36ee24f", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject/2.6.1/jakarta.inject-2.6.1.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/external/jakarta.inject/2.6.1/jakarta.inject-2.6.1.jar" + } + }, + "io_netty_netty_codec_socks_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_socks_jar_sources_4_1_97_Final", + "sha256": "2b48738f837dfc66833b811f6a4eab7fc3a75abd47fee3e7572de7653e5172de", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.1.97.Final/netty-codec-socks-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-socks/4.1.97.Final/netty-codec-socks-4.1.97.Final-sources.jar" + } + }, + "com_google_http_client_google_http_client_apache_v2_1_43_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_apache_v2_1_43_1", + "sha256": "18b25a8bed630a7b90204b7020f72219fdda643935fca6405e6e3937ae92b361", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-apache-v2/1.43.1/google-http-client-apache-v2-1.43.1.jar", + "https://maven.google.com/com/google/http-client/google-http-client-apache-v2/1.43.1/google-http-client-apache-v2-1.43.1.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-apache-v2/1.43.1/google-http-client-apache-v2-1.43.1.jar" + } + }, + "io_netty_netty_transport_classes_epoll_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_classes_epoll_4_1_86_Final", + "sha256": "3cc7eb87d85d6b4bf3d596a172a92df09f8d746c2b283c85543c95795b51edda", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.86.Final/netty-transport-classes-epoll-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-transport-classes-epoll/4.1.86.Final/netty-transport-classes-epoll-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-classes-epoll/4.1.86.Final/netty-transport-classes-epoll-4.1.86.Final.jar" + } + }, + "com_github_jnr_jnr_x86asm_jar_sources_1_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_x86asm_jar_sources_1_0_2", + "sha256": "3c983efd496f95ea5382ca014f96613786826136e0ce13d5c1cbc3097ea92ca0", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2-sources.jar" + } + }, + "io_netty_netty_codec_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_4_1_97_Final", + "sha256": "bcc96737a0f912fcf031cf8c45ebda352a90a40437db0832caad3d5a63618b38", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final.jar" + } + }, + "com_google_code_gson_gson_jar_sources_2_10_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_gson_gson_jar_sources_2_10_1", + "sha256": "eee1cc5c1f4267ee194cc245777e68084738ef390acd763354ce0ff6bfb7bcc1", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1-sources.jar" + ], + "downloaded_file_path": "com/google/code/gson/gson/2.10.1/gson-2.10.1-sources.jar" + } + }, + "org_threeten_threetenbp": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_threeten_threetenbp", + "generating_repository": "maven", + "target_name": "org_threeten_threetenbp" + } + }, + "com_github_jnr_jnr_ffi_2_2_14": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_ffi_2_2_14", + "sha256": "01fafe177b1e3136b3789aeb0ff0884ae1e24b5ada711192f67084103697f2d4", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-ffi/2.2.14/jnr-ffi-2.2.14.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-ffi/2.2.14/jnr-ffi-2.2.14.jar" + } + }, + "com_google_auto_value_auto_value_annotations_1_10_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_value_auto_value_annotations_1_10_1", + "sha256": "a4fe0a211925e938a8510d741763ee1171a11bf931f5891ef4d4ee84fca72be2", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1.jar" + ], + "downloaded_file_path": "com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1.jar" + } + }, + "org_ow2_asm_asm_tree_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_tree_9_2", + "sha256": "aabf9bd23091a4ebfc109c1f3ee7cf3e4b89f6ba2d3f51c5243f16b3cffae011", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar" + } + }, + "com_google_inject_guice_jar_sources_5_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_inject_guice_jar_sources_5_1_0", + "sha256": "79484227656350f8ea315198ed2ebdc8583e7ba42ecd90d367d66a7e491de52e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/inject/guice/5.1.0/guice-5.1.0-sources.jar" + ], + "downloaded_file_path": "com/google/inject/guice/5.1.0/guice-5.1.0-sources.jar" + } + }, + "com_google_api_client_google_api_client_2_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_client_google_api_client_2_2_0", + "sha256": "58eca9fb0a869391689ffc828b3bd0b19ac76042ff9fab4881eddf7fde76903f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api-client/google-api-client/2.2.0/google-api-client-2.2.0.jar", + "https://maven.google.com/com/google/api-client/google-api-client/2.2.0/google-api-client-2.2.0.jar" + ], + "downloaded_file_path": "com/google/api-client/google-api-client/2.2.0/google-api-client-2.2.0.jar" + } + }, + "rules_jvm_external_deps": { + "bzlFile": "@@rules_jvm_external~5.3//:coursier.bzl", + "ruleClassName": "pinned_coursier_fetch", + "attributes": { + "name": "rules_jvm_external~5.3~maven~rules_jvm_external_deps", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-core\", \"version\": \"2.18.1\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-storage\", \"version\": \"2.22.3\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.googlejavaformat\", \"artifact\": \"google-java-format\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.0.0-jre\" }", + "{ \"group\": \"org.apache.maven\", \"artifact\": \"maven-artifact\", \"version\": \"3.9.2\" }", + "{ \"group\": \"software.amazon.awssdk\", \"artifact\": \"s3\", \"version\": \"2.20.78\" }" + ], + "fetch_sources": true, + "fetch_javadoc": false, + "generate_compat_repositories": false, + "maven_install_json": "@@rules_jvm_external~5.3//:rules_jvm_external_deps_install.json", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "jetify": false, + "jetify_include_list": [ + "*" + ], + "additional_netrc_lines": [], + "fail_if_repin_required": false, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn" + } + }, + "net_javacrumbs_future_converter_future_converter_java8_guava": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_java8_guava", + "generating_repository": "maven", + "target_name": "net_javacrumbs_future_converter_future_converter_java8_guava" + } + }, + "com_google_http_client_google_http_client_appengine_1_43_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_appengine_1_43_1", + "sha256": "93762484a9324f824455b24da0cb698a7e3467e2e4962ee541a14ff1922c3a88", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine/1.43.1/google-http-client-appengine-1.43.1.jar", + "https://maven.google.com/com/google/http-client/google-http-client-appengine/1.43.1/google-http-client-appengine-1.43.1.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-appengine/1.43.1/google-http-client-appengine-1.43.1.jar" + } + }, + "io_grpc_grpc_auth_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_auth_1_56_1", + "sha256": "ac365e11532a4b779a2ac80ecc64dcbd3bafbdd666e08e22ffdb5c855069e3f9", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar" + } + }, + "com_google_auto_service_auto_service_annotations_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_service_auto_service_annotations_1_0_1", + "sha256": "c7bec54b7b5588b5967e870341091c5691181d954cf2039f1bf0a6eeb837473b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar" + ], + "downloaded_file_path": "com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1.jar" + } + }, + "io_grpc_grpc_xds_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_xds_1_55_1", + "sha256": "08e618b3e166981f86d8bd1623f161d6432923183c55338db77df49a2fb23893", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-xds/1.55.1/grpc-xds-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-xds/1.55.1/grpc-xds-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-xds/1.55.1/grpc-xds-1.55.1.jar" + } + }, + "com_fasterxml_jackson_core_jackson_annotations_jar_sources_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_annotations_jar_sources_2_15_2", + "sha256": "ce8e910f66e0c60d0beec66ccfe308a2426d606c85e67c76a5377dafb52eb4da", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2-sources.jar" + } + }, + "junit_junit_4_13_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~junit_junit_4_13_2", + "sha256": "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3", + "urls": [ + "https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar" + ], + "downloaded_file_path": "junit/junit/4.13.2/junit-4.13.2.jar" + } + }, + "com_google_guava_guava_32_1_1_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_guava_32_1_1_jre", + "sha256": "91fbba37f1c8b251cf9ea9e7d3a369eb79eb1e6a5df1d4bbf483dd0380740281", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar" + ], + "downloaded_file_path": "com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre.jar" + } + }, + "com_googlecode_json_simple_json_simple": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_googlecode_json_simple_json_simple", + "generating_repository": "maven", + "target_name": "com_googlecode_json_simple_json_simple" + } + }, + "io_netty_netty_codec_socks_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_socks_4_1_97_Final", + "sha256": "24081cae8a9685ff3fcde141f5050f28589c22e2ae6c447854e044df6d308028", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.1.97.Final/netty-codec-socks-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-socks/4.1.97.Final/netty-codec-socks-4.1.97.Final.jar" + } + }, + "com_esotericsoftware_minlog_1_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_minlog_1_3_1", + "sha256": "5d4d632cfbebfe0a7644501cc303570b691406181bee65e9916b921c767d7c72", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/minlog/1.3.1/minlog-1.3.1.jar" + ], + "downloaded_file_path": "com/esotericsoftware/minlog/1.3.1/minlog-1.3.1.jar" + } + }, + "org_hamcrest_hamcrest_core_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_hamcrest_hamcrest_core_1_3", + "sha256": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9", + "urls": [ + "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" + ], + "downloaded_file_path": "org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" + } + }, + "com_google_http_client_google_http_client_1_42_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_1_42_3", + "sha256": "e395dd1765e3e6bceb0c610706bcf4128de84bd6e65cf1d4adbf998b4114161c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.42.3/google-http-client-1.42.3.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client/1.42.3/google-http-client-1.42.3.jar" + } + }, + "org_jodd_jodd_bean_5_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jodd_jodd_bean_5_1_6", + "sha256": "d07d805fe0d59b5d2dbc85d0ebfcf30f52d7fd5a3ff89ff4fbea1e46b1319705", + "urls": [ + "https://repo1.maven.org/maven2/org/jodd/jodd-bean/5.1.6/jodd-bean-5.1.6.jar" + ], + "downloaded_file_path": "org/jodd/jodd-bean/5.1.6/jodd-bean-5.1.6.jar" + } + }, + "me_dinowernli_java_grpc_prometheus_0_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~me_dinowernli_java_grpc_prometheus_0_6_0", + "sha256": "badf9c84d9ea4b598bfa3fc690c85a8f6d863265829b9cb79f33884d48729ed8", + "urls": [ + "https://repo1.maven.org/maven2/me/dinowernli/java-grpc-prometheus/0.6.0/java-grpc-prometheus-0.6.0.jar" + ], + "downloaded_file_path": "me/dinowernli/java-grpc-prometheus/0.6.0/java-grpc-prometheus-0.6.0.jar" + } + }, + "org_mockito_mockito_core_jar_sources_2_25_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_mockito_mockito_core_jar_sources_2_25_0", + "sha256": "2230169d4ffad6f6c1b07bba0e81e30fa734941faf073e847839c695907645ff", + "urls": [ + "https://repo1.maven.org/maven2/org/mockito/mockito-core/2.25.0/mockito-core-2.25.0-sources.jar" + ], + "downloaded_file_path": "org/mockito/mockito-core/2.25.0/mockito-core-2.25.0-sources.jar" + } + }, + "org_slf4j_jcl_over_slf4j_1_7_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_jcl_over_slf4j_1_7_30", + "sha256": "71e9ee37b9e4eb7802a2acc5f41728a4cf3915e7483d798db3b4ff2ec8847c50", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar" + ], + "downloaded_file_path": "org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar" + } + }, + "org_json_json_jar_sources_20220320": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_json_json_jar_sources_20220320", + "sha256": "741ba87153d52919259b085e9a066a603b7efe41ede242336f4e3232d230a899", + "urls": [ + "https://repo1.maven.org/maven2/org/json/json/20220320/json-20220320-sources.jar" + ], + "downloaded_file_path": "org/json/json/20220320/json-20220320-sources.jar" + } + }, + "io_grpc_grpc_stub": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_stub", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_stub" + } + }, + "com_google_errorprone_error_prone_check_api_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_check_api_2_22_0", + "sha256": "1717bbf65757b8e1a83f3b0aa78c5ac25a6493008bc730091d404cf798fc0639", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0.jar" + } + }, + "com_github_pcj_google_options_1_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_pcj_google_options_1_0_0", + "sha256": "f1f84449b46390a7fa73aac0b5acdec4312d6174146af0db1c92425c7005fdce", + "urls": [ + "https://repo1.maven.org/maven2/com/github/pcj/google-options/1.0.0/google-options-1.0.0.jar" + ], + "downloaded_file_path": "com/github/pcj/google-options/1.0.0/google-options-1.0.0.jar" + } + }, + "com_github_luben_zstd_jni": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_luben_zstd_jni", + "generating_repository": "maven", + "target_name": "com_github_luben_zstd_jni" + } + }, + "com_github_jnr_jnr_posix_3_1_17": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_posix_3_1_17", + "sha256": "9e24abedd700a1d8f0a2787566f2d0c4f3e4fbdb8be543d4b434ce445923c757", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-posix/3.1.17/jnr-posix-3.1.17.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-posix/3.1.17/jnr-posix-3.1.17.jar" + } + }, + "net_bytebuddy_byte_buddy_agent_1_9_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_bytebuddy_byte_buddy_agent_1_9_7", + "sha256": "145ce0fab5390374e69b2b4070d65fedaa2b07c3cfad06b330bea1b6dcfa826f", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.9.7/byte-buddy-agent-1.9.7.jar" + ], + "downloaded_file_path": "net/bytebuddy/byte-buddy-agent/1.9.7/byte-buddy-agent-1.9.7.jar" + } + }, + "io_github_eisop_dataflow_errorprone_jar_sources_3_34_0_eisop1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_github_eisop_dataflow_errorprone_jar_sources_3_34_0_eisop1", + "sha256": "ec56c0f0a96c5e22a3608f2cf9f41c11b5698fee92dd665c21c2dc918e65ef9f", + "urls": [ + "https://repo1.maven.org/maven2/io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1-sources.jar" + ], + "downloaded_file_path": "io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1-sources.jar" + } + }, + "io_netty_netty_transport_native_kqueue": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_kqueue", + "generating_repository": "maven", + "target_name": "io_netty_netty_transport_native_kqueue" + } + }, + "org_jboss_marshalling_jboss_marshalling_2_0_11_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jboss_marshalling_jboss_marshalling_2_0_11_Final", + "sha256": "93d6257e1ac0f93ba6ff85827c9ef65b5efabf7bd2241fb3b4caf6c426f4f149", + "urls": [ + "https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling/2.0.11.Final/jboss-marshalling-2.0.11.Final.jar" + ], + "downloaded_file_path": "org/jboss/marshalling/jboss-marshalling/2.0.11.Final/jboss-marshalling-2.0.11.Final.jar" + } + }, + "com_google_truth_truth_1_1_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_truth_truth_1_1_5", + "sha256": "7f6d50d6f43a102942ef2c5a05f37a84f77788bb448cf33cceebf86d34e575c0", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.5/truth-1.1.5.jar" + ], + "downloaded_file_path": "com/google/truth/truth/1.1.5/truth-1.1.5.jar" + } + }, + "io_netty_netty_transport_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_4_1_97_Final", + "sha256": "197fd2d6c6b4afe677d9e95bf2e36b49a0bcabdfce0583683fb73f29a3f5a407", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final.jar" + } + }, + "io_grpc_grpc_context_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_context_jar_sources_1_56_1", + "sha256": "315a2c4145c3362131d4af25c27ae9cd4924f8f84e661a31402c56b223bcb956", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-context/1.56.1/grpc-context-1.56.1-sources.jar" + } + }, + "org_slf4j_slf4j_api_2_0_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_api_2_0_9", + "sha256": "0818930dc8d7debb403204611691da58e49d42c50b6ffcfdce02dadb7c3c2b6c", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar" + ], + "downloaded_file_path": "org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar" + } + }, + "com_google_j2objc_j2objc_annotations_2_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_j2objc_j2objc_annotations_2_8", + "sha256": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed", + "urls": [ + "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar" + ], + "downloaded_file_path": "com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar" + } + }, + "io_netty_netty_codec_http2_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http2_4_1_97_Final", + "sha256": "51fabf675563b59dc51dde22d29dbc5a20f836469cf48b8d53a07d3db0d775ad", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.97.Final/netty-codec-http2-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http2/4.1.97.Final/netty-codec-http2-4.1.97.Final.jar" + } + }, + "io_prometheus_simpleclient_common_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_common_0_15_0", + "sha256": "8d2fa21b5c7959010818245788bd43131633dea989d3facb28cec45b2da37918", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_common/0.15.0/simpleclient_common-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_common/0.15.0/simpleclient_common-0.15.0.jar" + } + }, + "net_java_dev_jna_jna_jar_sources_5_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_java_dev_jna_jna_jar_sources_5_13_0", + "sha256": "a4c45843e8f60df141c4f37602365a421bb278ca1ef30ba0a043d6a871dd29f4", + "urls": [ + "https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0-sources.jar" + ], + "downloaded_file_path": "net/java/dev/jna/jna/5.13.0/jna-5.13.0-sources.jar" + } + }, + "io_prometheus_simpleclient_hotspot_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_hotspot_0_15_0", + "sha256": "3c99768b090065bc0b25219061f94970aa569a2e363488d9120c79769d78c1a6", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_hotspot/0.15.0/simpleclient_hotspot-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_hotspot/0.15.0/simpleclient_hotspot-0.15.0.jar" + } + }, + "org_jboss_marshalling_jboss_marshalling_river_2_0_11_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jboss_marshalling_jboss_marshalling_river_2_0_11_Final", + "sha256": "f3fa6545d15163468e1639fe3087de22234a9fd027a52be6e532bfe7bde6c554", + "urls": [ + "https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling-river/2.0.11.Final/jboss-marshalling-river-2.0.11.Final.jar" + ], + "downloaded_file_path": "org/jboss/marshalling/jboss-marshalling-river/2.0.11.Final/jboss-marshalling-river-2.0.11.Final.jar" + } + }, + "org_luaj_luaj_jse_jar_sources_3_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_luaj_luaj_jse_jar_sources_3_0_1", + "sha256": "e9fc8eb5593ef489bafb79b5561b49114e8a233834f160c4657efe927a613f53", + "urls": [ + "https://repo1.maven.org/maven2/org/luaj/luaj-jse/3.0.1/luaj-jse-3.0.1-sources.jar" + ], + "downloaded_file_path": "org/luaj/luaj-jse/3.0.1/luaj-jse-3.0.1-sources.jar" + } + }, + "io_netty_netty_resolver_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver_4_1_86_Final", + "sha256": "7628a1309d7f2443dc41d8923a7f269e2981b9616f80a999eb7264ae6bcbfdba", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.86.Final/netty-resolver-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-resolver/4.1.86.Final/netty-resolver-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-resolver/4.1.86.Final/netty-resolver-4.1.86.Final.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_java8_guava_jar_sources_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_java8_guava_jar_sources_1_2_0", + "sha256": "3e209e1d6e80d1cde253ac0e28d50588112d0128a9bf05dae7f4aea3a36bdc03", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-java8-guava/1.2.0/future-converter-java8-guava-1.2.0-sources.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-java8-guava/1.2.0/future-converter-java8-guava-1.2.0-sources.jar" + } + }, + "org_jetbrains_annotations_jar_sources_16_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jetbrains_annotations_jar_sources_16_0_2", + "sha256": "699c2e6786e86fa5df5c82ffd0490d829107daa6225c0cffa290860abe4c1a80", + "urls": [ + "https://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/annotations-16.0.2-sources.jar" + ], + "downloaded_file_path": "org/jetbrains/annotations/16.0.2/annotations-16.0.2-sources.jar" + } + }, + "software_amazon_awssdk_crt_core_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_crt_core_2_20_78", + "sha256": "f83ba65ea519cfcc2306994527d6432a969ac8efb418abfcf38128d08467f7cf", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/crt-core/2.20.78/crt-core-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/crt-core/2.20.78/crt-core-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/crt-core/2.20.78/crt-core-2.20.78.jar" + } + }, + "com_google_guava_failureaccess": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_failureaccess", + "generating_repository": "maven", + "target_name": "com_google_guava_failureaccess" + } + }, + "com_google_cloud_google_cloud_core_http_2_18_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_cloud_google_cloud_core_http_2_18_1", + "sha256": "52466ba755e309ae43977209897aac76f40103115cf37ca755a428dae5a190ae", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-http/2.18.1/google-cloud-core-http-2.18.1.jar", + "https://maven.google.com/com/google/cloud/google-cloud-core-http/2.18.1/google-cloud-core-http-2.18.1.jar" + ], + "downloaded_file_path": "com/google/cloud/google-cloud-core-http/2.18.1/google-cloud-core-http-2.18.1.jar" + } + }, + "javax_annotation_javax_annotation_api": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_annotation_javax_annotation_api", + "generating_repository": "maven", + "target_name": "javax_annotation_javax_annotation_api" + } + }, + "io_opencensus_opencensus_api_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_opencensus_opencensus_api_0_31_1", + "sha256": "f1474d47f4b6b001558ad27b952e35eda5cc7146788877fc52938c6eba24b382", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1.jar" + ], + "downloaded_file_path": "io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1.jar" + } + }, + "io_netty_netty_transport_classes_epoll_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_classes_epoll_jar_sources_4_1_97_Final", + "sha256": "96e2dbe0d3d8d4dae3ddc23443c174388373c1f6dd76401e23a26bd952bf4d08", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final-sources.jar" + } + }, + "io_netty_netty_codec_http2_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http2_4_1_86_Final", + "sha256": "e8e8e28e6ab6bb989aed904778922045f388cfb420bc1eb37abf4df8801db167", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.86.Final/netty-codec-http2-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-codec-http2/4.1.86.Final/netty-codec-http2-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http2/4.1.86.Final/netty-codec-http2-4.1.86.Final.jar" + } + }, + "commons_io_commons_io": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_io_commons_io", + "generating_repository": "maven", + "target_name": "commons_io_commons_io" + } + }, + "io_netty_netty_transport_native_unix_common": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_unix_common", + "generating_repository": "maven", + "target_name": "io_netty_netty_transport_native_unix_common" + } + }, + "org_javassist_javassist_jar_sources_3_28_0_GA": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_javassist_javassist_jar_sources_3_28_0_GA", + "sha256": "0b6cf0d138dc208263a2a0a39b1daae217707d58d79d7a4973a68ce62f8c2d1f", + "urls": [ + "https://repo1.maven.org/maven2/org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA-sources.jar" + ], + "downloaded_file_path": "org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA-sources.jar" + } + }, + "me_dinowernli_java_grpc_prometheus_jar_sources_0_6_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~me_dinowernli_java_grpc_prometheus_jar_sources_0_6_0", + "sha256": "a9029bdc0712ee294862aaa0c65e1308705472bb9fe429095b346a964be7b731", + "urls": [ + "https://repo1.maven.org/maven2/me/dinowernli/java-grpc-prometheus/0.6.0/java-grpc-prometheus-0.6.0-sources.jar" + ], + "downloaded_file_path": "me/dinowernli/java-grpc-prometheus/0.6.0/java-grpc-prometheus-0.6.0-sources.jar" + } + }, + "org_apache_maven_maven_artifact_3_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_maven_maven_artifact_3_9_2", + "sha256": "f2174221d412a79572817b5aa77125348f43266670b6329a9881cdccf7bbc4b1", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/maven/maven-artifact/3.9.2/maven-artifact-3.9.2.jar", + "https://maven.google.com/org/apache/maven/maven-artifact/3.9.2/maven-artifact-3.9.2.jar" + ], + "downloaded_file_path": "org/apache/maven/maven-artifact/3.9.2/maven-artifact-3.9.2.jar" + } + }, + "io_netty_netty_common": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_common", + "generating_repository": "maven", + "target_name": "io_netty_netty_common" + } + }, + "com_google_j2objc_j2objc_annotations_jar_sources_2_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_j2objc_j2objc_annotations_jar_sources_2_8", + "sha256": "7413eed41f111453a08837f5ac680edded7faed466cbd35745e402e13f4cc3f5", + "urls": [ + "https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8-sources.jar" + ], + "downloaded_file_path": "com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8-sources.jar" + } + }, + "com_github_jnr_jffi_jar_sources_1_3_11": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jffi_jar_sources_1_3_11", + "sha256": "df7dcc8843d61e60c5fe606e860646f1a82d11d2dc41a3d230da87fc0bcf4291", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jffi/1.3.11/jffi-1.3.11-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jffi/1.3.11/jffi-1.3.11-sources.jar" + } + }, + "org_apache_commons_commons_lang3_jar_sources_3_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_lang3_jar_sources_3_13_0", + "sha256": "6152e03a6c29e0d9dd1415aaa42cb13f6fab5fc5b2333077c29b498927535453", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0-sources.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0-sources.jar" + } + }, + "software_amazon_eventstream_eventstream_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_eventstream_eventstream_1_0_1", + "sha256": "0c37d8e696117f02c302191b8110b0d0eb20fa412fce34c3a269ec73c16ce822", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar", + "https://maven.google.com/software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" + ], + "downloaded_file_path": "software/amazon/eventstream/eventstream/1.0.1/eventstream-1.0.1.jar" + } + }, + "com_github_docker_java_docker_java_transport_jersey_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_jersey_3_3_3", + "sha256": "7574d831272a56268f4468b901059cafdca6e10176c87fec83f65d26d28c6fb0", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport-jersey/3.3.3/docker-java-transport-jersey-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport-jersey/3.3.3/docker-java-transport-jersey-3.3.3.jar" + } + }, + "org_glassfish_hk2_hk2_utils_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_utils_jar_sources_2_6_1", + "sha256": "36552a965412a1d5a9eb2ee0282fd224151e79ac5dc42ae794f0bac67e523dc5", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils/2.6.1/hk2-utils-2.6.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-utils/2.6.1/hk2-utils-2.6.1-sources.jar" + } + }, + "io_netty_netty_handler": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler", + "generating_repository": "maven", + "target_name": "io_netty_netty_handler" + } + }, + "com_google_api_grpc_proto_google_common_protos_jar_sources_2_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_proto_google_common_protos_jar_sources_2_17_0", + "sha256": "cadaaa7232e1469abf515b99f2642b120fed9f68d6f36899ee493058b2159f18", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.17.0/proto-google-common-protos-2.17.0-sources.jar" + ], + "downloaded_file_path": "com/google/api/grpc/proto-google-common-protos/2.17.0/proto-google-common-protos-2.17.0-sources.jar" + } + }, + "net_minidev_accessors_smart_jar_sources_2_4_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_minidev_accessors_smart_jar_sources_2_4_9", + "sha256": "4b6022d773826980f124e7a2aed243cea6541238bc1bed785e2ce86076567f50", + "urls": [ + "https://repo1.maven.org/maven2/net/minidev/accessors-smart/2.4.9/accessors-smart-2.4.9-sources.jar" + ], + "downloaded_file_path": "net/minidev/accessors-smart/2.4.9/accessors-smart-2.4.9-sources.jar" + } + }, + "com_fasterxml_jackson_core_jackson_core_jar_sources_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_core_jar_sources_2_15_2", + "sha256": "4b29fe878549425194521d5c3270fae13f9c82cfcad639ebffea0963431bef45", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2-sources.jar" + } + }, + "net_java_dev_jna_jna_platform_5_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_java_dev_jna_jna_platform_5_13_0", + "sha256": "474d7b88f6e97009b6ec1d98c3024dd95c23187c65dabfbc35331bcac3d173dd", + "urls": [ + "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar" + ], + "downloaded_file_path": "net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar" + } + }, + "io_grpc_grpc_protobuf_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_1_56_1", + "sha256": "46185731a718d723d853723610a77e9062da9a6fc8b4ff14f370ba10cf097893", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1.jar" + } + }, + "org_openjdk_jmh_jmh_core": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_core", + "generating_repository": "maven", + "target_name": "org_openjdk_jmh_jmh_core" + } + }, + "com_github_serceman_jnr_fuse_jar_sources_0_5_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_serceman_jnr_fuse_jar_sources_0_5_7", + "sha256": "68a7003b43945ec3083fe2b8a5b882ff515449075122fcd6fb85f0c30bb750ab", + "urls": [ + "https://repo1.maven.org/maven2/com/github/serceman/jnr-fuse/0.5.7/jnr-fuse-0.5.7-sources.jar" + ], + "downloaded_file_path": "com/github/serceman/jnr-fuse/0.5.7/jnr-fuse-0.5.7-sources.jar" + } + }, + "com_google_truth_truth_jar_sources_1_1_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_truth_truth_jar_sources_1_1_5", + "sha256": "f1a94449ed48392525626f4e5edeff5c6e66af21c4c009ebb49b5109ac5db6b2", + "urls": [ + "https://repo1.maven.org/maven2/com/google/truth/truth/1.1.5/truth-1.1.5-sources.jar" + ], + "downloaded_file_path": "com/google/truth/truth/1.1.5/truth-1.1.5-sources.jar" + } + }, + "org_jodd_jodd_core_5_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jodd_jodd_core_5_1_6", + "sha256": "4b504519263a98202480d3cf73562dff8245edc582350cc5f37d5965a0298122", + "urls": [ + "https://repo1.maven.org/maven2/org/jodd/jodd-core/5.1.6/jodd-core-5.1.6.jar" + ], + "downloaded_file_path": "org/jodd/jodd-core/5.1.6/jodd-core-5.1.6.jar" + } + }, + "org_objenesis_objenesis_jar_sources_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_objenesis_objenesis_jar_sources_3_3", + "sha256": "d06164f8ca002c8ef193cef2d682822014dd330505616af93a3fb64226fc131d", + "urls": [ + "https://repo1.maven.org/maven2/org/objenesis/objenesis/3.3/objenesis-3.3-sources.jar" + ], + "downloaded_file_path": "org/objenesis/objenesis/3.3/objenesis-3.3-sources.jar" + } + }, + "io_grpc_grpc_core": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_core", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_core" + } + }, + "com_google_guava_guava_32_0_0_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_guava_32_0_0_jre", + "sha256": "39f3550b0343d8d19dd4e83bd165b58ea3389d2ddb9f2148e63903f79ecdb114", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava/32.0.0-jre/guava-32.0.0-jre.jar", + "https://maven.google.com/com/google/guava/guava/32.0.0-jre/guava-32.0.0-jre.jar" + ], + "downloaded_file_path": "com/google/guava/guava/32.0.0-jre/guava-32.0.0-jre.jar" + } + }, + "io_netty_netty_codec_socks": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_socks", + "generating_repository": "maven", + "target_name": "io_netty_netty_codec_socks" + } + }, + "org_apache_httpcomponents_httpcore_jar_sources_4_4_15": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpcore_jar_sources_4_4_15", + "sha256": "1510fc72cf2858244bdeb0d7f5d266fe584ecbd2ffe0d91b10a6d80641cd1985", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15-sources.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15-sources.jar" + } + }, + "com_github_jnr_jnr_x86asm_1_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_x86asm_1_0_2", + "sha256": "39f3675b910e6e9b93825f8284bec9f4ad3044cd20a6f7c8ff9e2f8695ebf21e", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar" + } + }, + "software_amazon_awssdk_annotations_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_annotations_2_20_78", + "sha256": "90ce2bb257ffa63942831f7329e28cf22fa4caf0cc96ee4f2f4557b7554eae1e", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/annotations/2.20.78/annotations-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/annotations/2.20.78/annotations-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/annotations/2.20.78/annotations-2.20.78.jar" + } + }, + "io_grpc_grpc_netty": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_netty" + } + }, + "io_grpc_grpc_testing": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_testing", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_testing" + } + }, + "io_grpc_grpc_api_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_api_jar_sources_1_56_1", + "sha256": "e5e58482c95a332706d6c12a758d55ec195b01a3e54e2a38a6239ed7a3de26c0", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-api/1.56.1/grpc-api-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-api/1.56.1/grpc-api-1.56.1-sources.jar" + } + }, + "org_ow2_asm_asm_jar_sources_9_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_jar_sources_9_5", + "sha256": "11214bbba797e0615402b8d57fd4be83c93a65244c5a88778015520d61078376", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.5/asm-9.5-sources.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm/9.5/asm-9.5-sources.jar" + } + }, + "io_prometheus_simpleclient": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient", + "generating_repository": "maven", + "target_name": "io_prometheus_simpleclient" + } + }, + "com_google_jimfs_jimfs_jar_sources_1_3_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_jimfs_jimfs_jar_sources_1_3_0", + "sha256": "aa30e127e68ddba8e76395d14806f838f22c9ef904b07ff0266dfc5de7163059", + "urls": [ + "https://repo1.maven.org/maven2/com/google/jimfs/jimfs/1.3.0/jimfs-1.3.0-sources.jar" + ], + "downloaded_file_path": "com/google/jimfs/jimfs/1.3.0/jimfs-1.3.0-sources.jar" + } + }, + "com_google_apis_google_api_services_storage_v1_rev20230301_2_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_apis_google_api_services_storage_v1_rev20230301_2_0_0", + "sha256": "857ac102129477c55487ed94fd7e021b6093bd88370f9ccac799456a0ff86af9", + "urls": [ + "https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage/v1-rev20230301-2.0.0/google-api-services-storage-v1-rev20230301-2.0.0.jar", + "https://maven.google.com/com/google/apis/google-api-services-storage/v1-rev20230301-2.0.0/google-api-services-storage-v1-rev20230301-2.0.0.jar" + ], + "downloaded_file_path": "com/google/apis/google-api-services-storage/v1-rev20230301-2.0.0/google-api-services-storage-v1-rev20230301-2.0.0.jar" + } + }, + "io_netty_netty_codec_http2": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http2", + "generating_repository": "maven", + "target_name": "io_netty_netty_codec_http2" + } + }, + "io_grpc_grpc_auth_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_auth_1_55_1", + "sha256": "45d9bfaf837c41abf01e087773f535ea5afa6faad1faecbc6f32cb9ae423adef", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-auth/1.55.1/grpc-auth-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-auth/1.55.1/grpc-auth-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-auth/1.55.1/grpc-auth-1.55.1.jar" + } + }, + "com_google_auth_google_auth_library_credentials_1_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_credentials_1_17_0", + "sha256": "5de364ee7a9ce95d8715bf124bdb0d949d37649914db846cc7005584fba7ce4d", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/1.17.0/google-auth-library-credentials-1.17.0.jar", + "https://maven.google.com/com/google/auth/google-auth-library-credentials/1.17.0/google-auth-library-credentials-1.17.0.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-credentials/1.17.0/google-auth-library-credentials-1.17.0.jar" + } + }, + "com_github_jnr_jnr_constants_jar_sources_0_10_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_constants_jar_sources_0_10_4", + "sha256": "696f737f76a29d900401e52277274c3c12a47cb70d00eb9e3619f3ff0b261a5f", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-constants/0.10.4/jnr-constants-0.10.4-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-constants/0.10.4/jnr-constants-0.10.4-sources.jar" + } + }, + "io_grpc_grpc_services_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_services_1_56_1", + "sha256": "0d14ece28e97b30aa9ef1b63782d48261dd63738ef1c5615afefb8b963c121c8", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_common_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_common_1_2_0", + "sha256": "567aeb2907088298fe5e67fd0fb1843571c24b46ef5b369f495c3d52c654b67b", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-common/1.2.0/future-converter-common-1.2.0.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-common/1.2.0/future-converter-common-1.2.0.jar" + } + }, + "org_codehaus_plexus_plexus_utils_3_5_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_codehaus_plexus_plexus_utils_3_5_1", + "sha256": "86e0255d4c879c61b4833ed7f13124e8bb679df47debb127326e7db7dd49a07b", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar", + "https://maven.google.com/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar" + ], + "downloaded_file_path": "org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar" + } + }, + "com_github_fppt_jedis_mock_jar_sources_1_0_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_fppt_jedis_mock_jar_sources_1_0_10", + "sha256": "315cd23d9c010ceee598fc594d4674b63f4bcd0375fe8c2b90d79ce50a12bb7e", + "urls": [ + "https://repo1.maven.org/maven2/com/github/fppt/jedis-mock/1.0.10/jedis-mock-1.0.10-sources.jar" + ], + "downloaded_file_path": "com/github/fppt/jedis-mock/1.0.10/jedis-mock-1.0.10-sources.jar" + } + }, + "io_grpc_grpc_protobuf_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_1_55_1", + "sha256": "a170ef578cd94bf81c57f46cca9328e2db5136f45e18da80af26bbebcca9618c", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.55.1/grpc-protobuf-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-protobuf/1.55.1/grpc-protobuf-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf/1.55.1/grpc-protobuf-1.55.1.jar" + } + }, + "org_glassfish_jersey_inject_jersey_hk2_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_inject_jersey_hk2_2_30_1", + "sha256": "cd5f4c10cf4915d1c217c295fc8b4eadceda7a28f9488b1d01de6b8792b33496", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2/2.30.1/jersey-hk2-2.30.1.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/inject/jersey-hk2/2.30.1/jersey-hk2-2.30.1.jar" + } + }, + "net_java_dev_jna_jna_5_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_java_dev_jna_jna_5_13_0", + "sha256": "66d4f819a062a51a1d5627bffc23fac55d1677f0e0a1feba144aabdd670a64bb", + "urls": [ + "https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar" + ], + "downloaded_file_path": "net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar" + } + }, + "com_google_http_client_google_http_client_1_43_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_1_43_1", + "sha256": "834e37b0af2cfe80b297be4d6a5c8fd0ccab1d0b13e9b8d7ac921e8dd2f251ec", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.43.1/google-http-client-1.43.1.jar", + "https://maven.google.com/com/google/http-client/google-http-client/1.43.1/google-http-client-1.43.1.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client/1.43.1/google-http-client-1.43.1.jar" + } + }, + "io_opencensus_opencensus_proto_0_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_opencensus_opencensus_proto_0_2_0", + "sha256": "0c192d451e9dd74e98721b27d02f0e2b6bca44b51563b5dabf2e211f7a3ebf13", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar", + "https://maven.google.com/io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar" + ], + "downloaded_file_path": "io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar" + } + }, + "com_fasterxml_jackson_core_jackson_databind_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_databind_2_15_2", + "sha256": "0eb2fdad6e40ab8832a78c9b22f58196dd970594e8d3d5a26ead87847c4f3a96", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2.jar" + } + }, + "org_slf4j_slf4j_api_1_7_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_api_1_7_30", + "sha256": "cdba07964d1bb40a0761485c6b1e8c2f8fd9eb1d19c53928ac0d7f9510105c57", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar", + "https://maven.google.com/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" + ], + "downloaded_file_path": "org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar" + } + }, + "io_grpc_grpc_grpclb_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_grpclb_1_55_1", + "sha256": "9d0dcf87d99a1042a3a2343e96d394220c6be07cf1a5082d5df066e2077b3428", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-grpclb/1.55.1/grpc-grpclb-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-grpclb/1.55.1/grpc-grpclb-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-grpclb/1.55.1/grpc-grpclb-1.55.1.jar" + } + }, + "com_esotericsoftware_minlog_jar_sources_1_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_minlog_jar_sources_1_3_1", + "sha256": "fdaf83a8c51295eff3a8109473ce7b213582738f71593e16b1efa012ff1f99b5", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/minlog/1.3.1/minlog-1.3.1-sources.jar" + ], + "downloaded_file_path": "com/esotericsoftware/minlog/1.3.1/minlog-1.3.1-sources.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_java8_guava_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_java8_guava_1_2_0", + "sha256": "3b47ae8e2b2bfad810586c37537f002273c05237bd3adecafe9f9f57a2b18fde", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-java8-guava/1.2.0/future-converter-java8-guava-1.2.0.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-java8-guava/1.2.0/future-converter-java8-guava-1.2.0.jar" + } + }, + "com_google_errorprone_error_prone_annotations_2_18_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotations_2_18_0", + "sha256": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar", + "https://maven.google.com/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar" + } + }, + "com_google_cloud_google_cloud_core_2_18_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_cloud_google_cloud_core_2_18_1", + "sha256": "8a8da77a17193fae86012722237736db7d08cb6fac8df50a311427c95b26d4a6", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core/2.18.1/google-cloud-core-2.18.1.jar", + "https://maven.google.com/com/google/cloud/google-cloud-core/2.18.1/google-cloud-core-2.18.1.jar" + ], + "downloaded_file_path": "com/google/cloud/google-cloud-core/2.18.1/google-cloud-core-2.18.1.jar" + } + }, + "com_github_jnr_jffi_jar_native_1_3_11": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jffi_jar_native_1_3_11", + "sha256": "f4c26c0a4a3eddfdbaaf4dda77d4d9f7d148ba4208798f32ce475ce4d6778744", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jffi/1.3.11/jffi-1.3.11-native.jar" + ], + "downloaded_file_path": "com/github/jnr/jffi/1.3.11/jffi-1.3.11-native.jar" + } + }, + "com_google_errorprone_error_prone_annotations": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotations", + "generating_repository": "maven", + "target_name": "com_google_errorprone_error_prone_annotations" + } + }, + "io_netty_netty_codec_dns_jar_sources_4_1_96_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_dns_jar_sources_4_1_96_Final", + "sha256": "080f78aa2451386f7c0ac993ed4b3eae28ea3b337c606aee29b0c723e01f9588", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-dns/4.1.96.Final/netty-codec-dns-4.1.96.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-dns/4.1.96.Final/netty-codec-dns-4.1.96.Final-sources.jar" + } + }, + "io_netty_netty_handler_proxy_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_proxy_4_1_97_Final", + "sha256": "c789f30d0905a09b2a17c4cf397e1b57b0d63db714624eb0dec2282b9619e206", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler-proxy/4.1.97.Final/netty-handler-proxy-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-handler-proxy/4.1.97.Final/netty-handler-proxy-4.1.97.Final.jar" + } + }, + "io_projectreactor_reactor_core_jar_sources_3_5_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_projectreactor_reactor_core_jar_sources_3_5_3", + "sha256": "c4193dbe135cc2a1db71c55771249158f611d3663e0f42b3ede5ab9e4302bce4", + "urls": [ + "https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.5.3/reactor-core-3.5.3-sources.jar" + ], + "downloaded_file_path": "io/projectreactor/reactor-core/3.5.3/reactor-core-3.5.3-sources.jar" + } + }, + "com_google_errorprone_error_prone_type_annotations_jar_sources_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_type_annotations_jar_sources_2_22_0", + "sha256": "84bbb947f3de91d97eee9abb6c5648c5b61d0fb4d132f86c4d7c80e4357e5da6", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0-sources.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_type_annotations/2.22.0/error_prone_type_annotations-2.22.0-sources.jar" + } + }, + "com_google_api_grpc_proto_google_common_protos_2_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_proto_google_common_protos_2_17_0", + "sha256": "4ef1fe0c327fc1521d1d753b0b1c4a875a54bd14ebded3afff0ca395320b6ea9", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.17.0/proto-google-common-protos-2.17.0.jar" + ], + "downloaded_file_path": "com/google/api/grpc/proto-google-common-protos/2.17.0/proto-google-common-protos-2.17.0.jar" + } + }, + "io_netty_netty_codec_http_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http_jar_sources_4_1_97_Final", + "sha256": "fd45d71121285bed020b3cc2515288d252b9c07cbc4934a63615d7d8c8855289", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.97.Final/netty-codec-http-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http/4.1.97.Final/netty-codec-http-4.1.97.Final-sources.jar" + } + }, + "io_netty_netty_transport_native_epoll": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_epoll", + "generating_repository": "maven", + "target_name": "io_netty_netty_transport_native_epoll" + } + }, + "software_amazon_awssdk_aws_xml_protocol_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_aws_xml_protocol_2_20_78", + "sha256": "c7977c61aeb3f74e471bedde0ab6ca44447af4cbff309c63f5e7d2a26dbcba7a", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-xml-protocol/2.20.78/aws-xml-protocol-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/aws-xml-protocol/2.20.78/aws-xml-protocol-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/aws-xml-protocol/2.20.78/aws-xml-protocol-2.20.78.jar" + } + }, + "com_sun_activation_jakarta_activation_jar_sources_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_sun_activation_jakarta_activation_jar_sources_1_2_1", + "sha256": "d254da455b0e1e36c7a9db2f0910fea9e8a012cbc85160207328e16bd3aea753", + "urls": [ + "https://repo1.maven.org/maven2/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1-sources.jar" + ], + "downloaded_file_path": "com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1-sources.jar" + } + }, + "io_grpc_grpc_testing_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_testing_1_56_1", + "sha256": "b4cd4f2c410040fb097108eb6b7fa84826365b4d91844bd30b21f4e97eee906d", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-testing/1.56.1/grpc-testing-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-testing/1.56.1/grpc-testing-1.56.1.jar" + } + }, + "org_glassfish_hk2_external_aopalliance_repackaged_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_external_aopalliance_repackaged_2_6_1", + "sha256": "bad77f9278d753406360af9e4747bd9b3161554ea9cd3d62411a0ae1f2c141fd", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged/2.6.1/aopalliance-repackaged-2.6.1.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/external/aopalliance-repackaged/2.6.1/aopalliance-repackaged-2.6.1.jar" + } + }, + "org_openjdk_jmh_jmh_core_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_core_1_37", + "sha256": "dc0eaf2bbf0036a70b60798c785d6e03a9daf06b68b8edb0f1ba9eb3421baeb3", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar" + ], + "downloaded_file_path": "org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar" + } + }, + "io_netty_netty_codec_http_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http_4_1_86_Final", + "sha256": "3f6ceb3112cfcf7b70545eb5111220ce57db54d593f23f64c38333bb22c40b84", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.86.Final/netty-codec-http-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-codec-http/4.1.86.Final/netty-codec-http-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http/4.1.86.Final/netty-codec-http-4.1.86.Final.jar" + } + }, + "aopalliance_aopalliance_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~aopalliance_aopalliance_1_0", + "sha256": "0addec670fedcd3f113c5c8091d783280d23f75e3acb841b61a9cdb079376a08", + "urls": [ + "https://repo1.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" + ], + "downloaded_file_path": "aopalliance/aopalliance/1.0/aopalliance-1.0.jar" + } + }, + "org_reactivestreams_reactive_streams_jar_sources_1_0_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_reactivestreams_reactive_streams_jar_sources_1_0_4", + "sha256": "5a7a36ae9536698c434ebe119feb374d721210fee68eb821a37ef3859b64b708", + "urls": [ + "https://repo1.maven.org/maven2/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4-sources.jar" + ], + "downloaded_file_path": "org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4-sources.jar" + } + }, + "com_google_http_client_google_http_client_jackson2_1_43_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_jackson2_1_43_1", + "sha256": "1d41fa103da432dc49b41a321effc3e2fda722a3dc896a89dcdc3a4d5fe82255", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2/1.43.1/google-http-client-jackson2-1.43.1.jar", + "https://maven.google.com/com/google/http-client/google-http-client-jackson2/1.43.1/google-http-client-jackson2-1.43.1.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-jackson2/1.43.1/google-http-client-jackson2-1.43.1.jar" + } + }, + "io_netty_netty_transport_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_4_1_86_Final", + "sha256": "f6726dcd54e4922b46b3b4f4467b443a70a30eb08a62620c8fe502d8cb802c9f", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport/4.1.86.Final/netty-transport-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-transport/4.1.86.Final/netty-transport-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport/4.1.86.Final/netty-transport-4.1.86.Final.jar" + } + }, + "com_amazonaws_jmespath_java_jar_sources_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_jmespath_java_jar_sources_1_12_544", + "sha256": "496d7f1c237d107b3c4c766ff603ba6b3e773e59c590e3ed0156f56fdb3d0b4a", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/jmespath-java/1.12.544/jmespath-java-1.12.544-sources.jar" + ], + "downloaded_file_path": "com/amazonaws/jmespath-java/1.12.544/jmespath-java-1.12.544-sources.jar" + } + }, + "com_github_kevinstern_software_and_algorithms_jar_sources_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_kevinstern_software_and_algorithms_jar_sources_1_0", + "sha256": "37a46c7f8f6c5064ceb398be472c17507b1e7e7bfc72399c57efb5fa5310a8ae", + "urls": [ + "https://repo1.maven.org/maven2/com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0-sources.jar" + ], + "downloaded_file_path": "com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0-sources.jar" + } + }, + "com_github_pcj_google_options": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_pcj_google_options", + "generating_repository": "maven", + "target_name": "com_github_pcj_google_options" + } + }, + "io_github_eisop_dataflow_errorprone_3_34_0_eisop1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_github_eisop_dataflow_errorprone_3_34_0_eisop1", + "sha256": "89b4f5d2bd5059f067c5982a0e5988b87dfc8a8234795d68c6f3178846de3319", + "urls": [ + "https://repo1.maven.org/maven2/io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1.jar" + ], + "downloaded_file_path": "io/github/eisop/dataflow-errorprone/3.34.0-eisop1/dataflow-errorprone-3.34.0-eisop1.jar" + } + }, + "com_github_docker_java_docker_java_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_jar_sources_3_3_3", + "sha256": "ddc2c925a8b58cc47e5d683c770c9f261f6a6b7db028b38dd289be0e51a7c3df", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java/3.3.3/docker-java-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java/3.3.3/docker-java-3.3.3-sources.jar" + } + }, + "io_prometheus_simpleclient_tracer_otel_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_otel_jar_sources_0_15_0", + "sha256": "f83fcb43addcd77adeb34ff00ee27141060ac103597272eb44f2d73aea4addea", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel/0.15.0/simpleclient_tracer_otel-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_otel/0.15.0/simpleclient_tracer_otel-0.15.0-sources.jar" + } + }, + "io_reactivex_rxjava3_rxjava_3_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_reactivex_rxjava3_rxjava_3_1_6", + "sha256": "34682bd3ec6f043c5defb589a2d18113ba3e2d2372dd401744f8e4815c1db638", + "urls": [ + "https://repo1.maven.org/maven2/io/reactivex/rxjava3/rxjava/3.1.6/rxjava-3.1.6.jar" + ], + "downloaded_file_path": "io/reactivex/rxjava3/rxjava/3.1.6/rxjava-3.1.6.jar" + } + }, + "com_github_jnr_jnr_a64asm_jar_sources_1_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_a64asm_jar_sources_1_0_0", + "sha256": "2106b98c7d794fb01237e7243d975b9bc8450aa87bf34f93d7b5fcc651af7ff1", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-a64asm/1.0.0/jnr-a64asm-1.0.0-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-a64asm/1.0.0/jnr-a64asm-1.0.0-sources.jar" + } + }, + "io_netty_netty_transport_classes_kqueue_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_classes_kqueue_4_1_97_Final", + "sha256": "964ef63eb24a5c979f0af473da13f9574497e11bd41543a66d10609d34013b9f", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-kqueue/4.1.97.Final/netty-transport-classes-kqueue-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-classes-kqueue/4.1.97.Final/netty-transport-classes-kqueue-4.1.97.Final.jar" + } + }, + "commons_io_commons_io_jar_sources_2_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_io_commons_io_jar_sources_2_13_0", + "sha256": "1c7bece2e87ac49b24f09ec3c5ceb51560edd7a259889fceef96dda9c046a1b3", + "urls": [ + "https://repo1.maven.org/maven2/commons-io/commons-io/2.13.0/commons-io-2.13.0-sources.jar" + ], + "downloaded_file_path": "commons-io/commons-io/2.13.0/commons-io-2.13.0-sources.jar" + } + }, + "org_codehaus_mojo_animal_sniffer_annotations_jar_sources_1_23": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_codehaus_mojo_animal_sniffer_annotations_jar_sources_1_23", + "sha256": "4878fcc6808dbc88085a4622db670e703867754bc4bc40312c52bf3a3510d019", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23-sources.jar" + ], + "downloaded_file_path": "org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23-sources.jar" + } + }, + "com_google_inject_guice_5_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_inject_guice_5_1_0", + "sha256": "4130e50bfac48099c860f0d903b91860c81a249c90f38245f8fed58fc817bc26", + "urls": [ + "https://repo1.maven.org/maven2/com/google/inject/guice/5.1.0/guice-5.1.0.jar" + ], + "downloaded_file_path": "com/google/inject/guice/5.1.0/guice-5.1.0.jar" + } + }, + "org_slf4j_slf4j_simple_jar_sources_2_0_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_simple_jar_sources_2_0_9", + "sha256": "45423388e9fc51af94ac936842211353dbde78c29350d1ed97445ed3e37416cd", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/2.0.9/slf4j-simple-2.0.9-sources.jar" + ], + "downloaded_file_path": "org/slf4j/slf4j-simple/2.0.9/slf4j-simple-2.0.9-sources.jar" + } + }, + "org_apache_commons_commons_pool2_jar_sources_2_11_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_pool2_jar_sources_2_11_1", + "sha256": "00f8a2910e6c36784384f382fb6edc61a0e856c550ee866e8d285cdd3c167111", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.11.1/commons-pool2-2.11.1-sources.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-pool2/2.11.1/commons-pool2-2.11.1-sources.jar" + } + }, + "com_amazonaws_aws_java_sdk_core_jar_sources_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_core_jar_sources_1_12_544", + "sha256": "e1cc8b011d35e4d71ba452fbf0c2777a6dc2a2a4668ea8c9e72a610f77f1a71d", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-core/1.12.544/aws-java-sdk-core-1.12.544-sources.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-core/1.12.544/aws-java-sdk-core-1.12.544-sources.jar" + } + }, + "com_github_jnr_jnr_constants": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_constants", + "generating_repository": "maven", + "target_name": "com_github_jnr_jnr_constants" + } + }, + "com_google_auto_auto_common_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_auto_common_1_2_1", + "sha256": "f43f29fe2a6ebaf04b2598cdeec32a4e346d49a9404e990f5fc19c19f3a28d0e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/auto-common/1.2.1/auto-common-1.2.1.jar" + ], + "downloaded_file_path": "com/google/auto/auto-common/1.2.1/auto-common-1.2.1.jar" + } + }, + "io_grpc_grpc_protobuf": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_protobuf" + } + }, + "io_prometheus_simpleclient_tracer_otel_agent_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_otel_agent_0_15_0", + "sha256": "0cbb4c29d17e9fe71bb2cec013c2999ae8a9050f237ad33211761b40d2586e0b", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent/0.15.0/simpleclient_tracer_otel_agent-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_otel_agent/0.15.0/simpleclient_tracer_otel_agent-0.15.0.jar" + } + }, + "io_netty_netty_buffer_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_buffer_4_1_86_Final", + "sha256": "e42e15f47c865266b1faa6e038ebfd7ddadcf9f4ae9e6617edd4881dbd4abe88", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.86.Final/netty-buffer-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-buffer/4.1.86.Final/netty-buffer-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-buffer/4.1.86.Final/netty-buffer-4.1.86.Final.jar" + } + }, + "io_netty_netty_codec_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_4_1_86_Final", + "sha256": "0456840b5c851dad6cab881cd1a9ad5d916db65d81048145df1d9a6d03325bea", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.86.Final/netty-codec-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-codec/4.1.86.Final/netty-codec-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec/4.1.86.Final/netty-codec-4.1.86.Final.jar" + } + }, + "org_openjdk_jmh_jmh_generator_annprocess_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_generator_annprocess_1_37", + "sha256": "6a5604b5b804e0daca1145df1077609321687734a8b49387e49f10557c186c77", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar" + ], + "downloaded_file_path": "org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37.jar" + } + }, + "org_projectlombok_lombok_jar_sources_1_18_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_projectlombok_lombok_jar_sources_1_18_30", + "sha256": "d41c3ab349c0ec484449b545d2ac5c26ccc9c8b23f2dbbd6176382469f9eac71", + "urls": [ + "https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.30/lombok-1.18.30-sources.jar" + ], + "downloaded_file_path": "org/projectlombok/lombok/1.18.30/lombok-1.18.30-sources.jar" + } + }, + "org_apache_tomcat_annotations_api_6_0_53": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_tomcat_annotations_api_6_0_53", + "sha256": "253829d3c12b7381d1044fc22c6436cff025fe0d459e4a329413e560a7d0dd13", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/tomcat/annotations-api/6.0.53/annotations-api-6.0.53.jar" + ], + "downloaded_file_path": "org/apache/tomcat/annotations-api/6.0.53/annotations-api-6.0.53.jar" + } + }, + "io_perfmark_perfmark_api_jar_sources_0_26_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_perfmark_perfmark_api_jar_sources_0_26_0", + "sha256": "7379e0fef0c32d69f3ebae8f271f426fc808613f1cfbc29e680757f348ba8aa4", + "urls": [ + "https://repo1.maven.org/maven2/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0-sources.jar" + ], + "downloaded_file_path": "io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0-sources.jar" + } + }, + "software_amazon_awssdk_aws_query_protocol_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_aws_query_protocol_2_20_78", + "sha256": "74c9b42046e3829836d2351a3a0bb06ae54f7e4f0c3d319c9b68166f245db549", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-query-protocol/2.20.78/aws-query-protocol-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/aws-query-protocol/2.20.78/aws-query-protocol-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/aws-query-protocol/2.20.78/aws-query-protocol-2.20.78.jar" + } + }, + "org_projectlombok_lombok_1_18_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_projectlombok_lombok_1_18_30", + "sha256": "14151b47582d570b4de16a147ece3bdbd19ace4aee5bde3a5578c87db9ecb998", + "urls": [ + "https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" + ], + "downloaded_file_path": "org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" + } + }, + "org_apache_tomcat_annotations_api": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_tomcat_annotations_api", + "generating_repository": "maven", + "target_name": "org_apache_tomcat_annotations_api" + } + }, + "io_netty_netty_resolver_dns_4_1_96_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver_dns_4_1_96_Final", + "sha256": "09a4f0cc4fc7af083515cfb84d6e70af4223dfe129858274cf506cc626f5175e", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver-dns/4.1.96.Final/netty-resolver-dns-4.1.96.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-resolver-dns/4.1.96.Final/netty-resolver-dns-4.1.96.Final.jar" + } + }, + "com_google_api_grpc_proto_google_common_protos_2_19_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_proto_google_common_protos_2_19_1", + "sha256": "5557ee1b7f44a80fa595cdcedcc52ed3be143ce25408181c3ad136006cdd749f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-common-protos/2.19.1/proto-google-common-protos-2.19.1.jar", + "https://maven.google.com/com/google/api/grpc/proto-google-common-protos/2.19.1/proto-google-common-protos-2.19.1.jar" + ], + "downloaded_file_path": "com/google/api/grpc/proto-google-common-protos/2.19.1/proto-google-common-protos-2.19.1.jar" + } + }, + "com_github_oshi_oshi_core_jar_sources_6_4_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_oshi_oshi_core_jar_sources_6_4_5", + "sha256": "1ff5c3475458db16fce29e1aabce48242fe80221144de4b2a1dc62bd18f15062", + "urls": [ + "https://repo1.maven.org/maven2/com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5-sources.jar" + ], + "downloaded_file_path": "com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5-sources.jar" + } + }, + "javax_inject_javax_inject_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_inject_javax_inject_1", + "sha256": "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff", + "urls": [ + "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar" + ], + "downloaded_file_path": "javax/inject/javax.inject/1/javax.inject-1.jar" + } + }, + "org_jodd_jodd_bean_jar_sources_5_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jodd_jodd_bean_jar_sources_5_1_6", + "sha256": "961cff0114d349d3491293eea0c74a910b8676326c1af682f07e500782180160", + "urls": [ + "https://repo1.maven.org/maven2/org/jodd/jodd-bean/5.1.6/jodd-bean-5.1.6-sources.jar" + ], + "downloaded_file_path": "org/jodd/jodd-bean/5.1.6/jodd-bean-5.1.6-sources.jar" + } + }, + "software_amazon_awssdk_s3_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_s3_2_20_78", + "sha256": "0a21d9d740f20e8d65985b8e31154a6603f4f15a7c5acea5a70957745519327b", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/s3/2.20.78/s3-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/s3/2.20.78/s3-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/s3/2.20.78/s3-2.20.78.jar" + } + }, + "com_google_android_annotations_jar_sources_4_1_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_android_annotations_jar_sources_4_1_1_4", + "sha256": "e9b667aa958df78ea1ad115f7bbac18a5869c3128b1d5043feb360b0cfce9d40", + "urls": [ + "https://repo1.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4-sources.jar" + ], + "downloaded_file_path": "com/google/android/annotations/4.1.1.4/annotations-4.1.1.4-sources.jar" + } + }, + "org_glassfish_hk2_hk2_utils_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_utils_2_6_1", + "sha256": "30727f79086452fdefdab08451d982c2082aa239d9f75cdeb1ba271e3c887036", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-utils/2.6.1/hk2-utils-2.6.1.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-utils/2.6.1/hk2-utils-2.6.1.jar" + } + }, + "com_google_android_annotations_4_1_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_android_annotations_4_1_1_4", + "sha256": "ba734e1e84c09d615af6a09d33034b4f0442f8772dec120efb376d86a565ae15", + "urls": [ + "https://repo1.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar" + ], + "downloaded_file_path": "com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar" + } + }, + "com_github_pcj_google_options_jar_sources_1_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_pcj_google_options_jar_sources_1_0_0", + "sha256": "3871275e5323aaa132ed043c3c3bf6620f5fe73c8aeb456ce992db9ce5d59768", + "urls": [ + "https://repo1.maven.org/maven2/com/github/pcj/google-options/1.0.0/google-options-1.0.0-sources.jar" + ], + "downloaded_file_path": "com/github/pcj/google-options/1.0.0/google-options-1.0.0-sources.jar" + } + }, + "com_google_guava_failureaccess_jar_sources_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_failureaccess_jar_sources_1_0_1", + "sha256": "092346eebbb1657b51aa7485a246bf602bb464cc0b0e2e1c7e7201fadce1e98f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1-sources.jar" + ], + "downloaded_file_path": "com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1-sources.jar" + } + }, + "redis_clients_jedis_jar_sources_4_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~redis_clients_jedis_jar_sources_4_3_1", + "sha256": "8590d6ad29f6760424e5d832ee2f738b9790393c9986e6754a03427bfb8d5d04", + "urls": [ + "https://repo1.maven.org/maven2/redis/clients/jedis/4.3.1/jedis-4.3.1-sources.jar" + ], + "downloaded_file_path": "redis/clients/jedis/4.3.1/jedis-4.3.1-sources.jar" + } + }, + "com_google_api_grpc_proto_google_cloud_storage_v2_2_22_3_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_proto_google_cloud_storage_v2_2_22_3_alpha", + "sha256": "346cc208553f4b286868bd05ccf4558e3798609559ec2b8fc8b2ea5e15819d8b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-storage-v2/2.22.3-alpha/proto-google-cloud-storage-v2-2.22.3-alpha.jar", + "https://maven.google.com/com/google/api/grpc/proto-google-cloud-storage-v2/2.22.3-alpha/proto-google-cloud-storage-v2-2.22.3-alpha.jar" + ], + "downloaded_file_path": "com/google/api/grpc/proto-google-cloud-storage-v2/2.22.3-alpha/proto-google-cloud-storage-v2-2.22.3-alpha.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_oauth2_http", + "generating_repository": "maven", + "target_name": "com_google_auth_google_auth_library_oauth2_http" + } + }, + "io_github_java_diff_utils_java_diff_utils_jar_sources_4_12": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_github_java_diff_utils_java_diff_utils_jar_sources_4_12", + "sha256": "fa24217b6eaa115a05d4a8f0003fe913c62716ca2184d2e4f17de4a7d42a8822", + "urls": [ + "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12-sources.jar" + ], + "downloaded_file_path": "io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12-sources.jar" + } + }, + "commons_io_commons_io_2_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_io_commons_io_2_13_0", + "sha256": "671eaa39688dac2ffaa4645b3c9980ae2d0ea2471e4ae6a5da199cd15ae23666", + "urls": [ + "https://repo1.maven.org/maven2/commons-io/commons-io/2.13.0/commons-io-2.13.0.jar" + ], + "downloaded_file_path": "commons-io/commons-io/2.13.0/commons-io-2.13.0.jar" + } + }, + "commons_logging_commons_logging_jar_sources_1_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_logging_commons_logging_jar_sources_1_2", + "sha256": "44347acfe5860461728e9cb33251e97345be36f8a0dfd5c5130c172559455f41", + "urls": [ + "https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar" + ], + "downloaded_file_path": "commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar" + } + }, + "jakarta_activation_jakarta_activation_api_jar_sources_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_activation_jakarta_activation_api_jar_sources_1_2_1", + "sha256": "e9638b764202c0def1b4d54bd37a984c681b2ed46a548ae94ef3f7e4a4b58a31", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1-sources.jar" + ], + "downloaded_file_path": "jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1-sources.jar" + } + }, + "io_grpc_grpc_netty_shaded_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_shaded_1_55_1", + "sha256": "3dc035ea13bf854d4218bc6370ba8d786077a9e0d76337e61df7597a78a03c61", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.55.1/grpc-netty-shaded-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-netty-shaded/1.55.1/grpc-netty-shaded-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-netty-shaded/1.55.1/grpc-netty-shaded-1.55.1.jar" + } + }, + "com_github_luben_zstd_jni_jar_sources_1_5_5_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_luben_zstd_jni_jar_sources_1_5_5_7", + "sha256": "6560c8d5e307feebb75630032c3e16c07e079907cf0238cc45647495af704599", + "urls": [ + "https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.5-7/zstd-jni-1.5.5-7-sources.jar" + ], + "downloaded_file_path": "com/github/luben/zstd-jni/1.5.5-7/zstd-jni-1.5.5-7-sources.jar" + } + }, + "com_github_luben_zstd_jni_1_5_5_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_luben_zstd_jni_1_5_5_7", + "sha256": "edd7fc60c2aaa6b77d3436f667bf30b06202633761ec20d683638b40e8f11426", + "urls": [ + "https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.5-7/zstd-jni-1.5.5-7.jar" + ], + "downloaded_file_path": "com/github/luben/zstd-jni/1.5.5-7/zstd-jni-1.5.5-7.jar" + } + }, + "io_netty_netty_resolver": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver", + "generating_repository": "maven", + "target_name": "io_netty_netty_resolver" + } + }, + "org_redisson_redisson_3_23_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_redisson_redisson_3_23_4", + "sha256": "fe59768d63419b0073c0cbd6029d0be864ad5c9d233dd1337945f9edfe3df3ca", + "urls": [ + "https://repo1.maven.org/maven2/org/redisson/redisson/3.23.4/redisson-3.23.4.jar" + ], + "downloaded_file_path": "org/redisson/redisson/3.23.4/redisson-3.23.4.jar" + } + }, + "net_javacrumbs_future_converter_future_converter_guava_common_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_guava_common_1_2_0", + "sha256": "82bfab706005ea51c3e76958a62564367cf9cae207c0b1d55b9734876b9780c1", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-guava-common/1.2.0/future-converter-guava-common-1.2.0.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-guava-common/1.2.0/future-converter-guava-common-1.2.0.jar" + } + }, + "org_ow2_asm_asm_util_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_util_9_2", + "sha256": "ff5b3cd331ae8a9a804768280da98f50f424fef23dd3c788bb320e08c94ee598", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-util/9.2/asm-util-9.2.jar" + } + }, + "io_grpc_grpc_stub_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_stub_1_55_1", + "sha256": "58c114817d42237ce50a5f7677cf142564df64200e59c956e49302b6c8af616a", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-stub/1.55.1/grpc-stub-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-stub/1.55.1/grpc-stub-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-stub/1.55.1/grpc-stub-1.55.1.jar" + } + }, + "org_apache_commons_commons_lang3_3_12_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_lang3_3_12_0", + "sha256": "d919d904486c037f8d193412da0c92e22a9fa24230b9d67a57855c5c31c7e94e", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar", + "https://maven.google.com/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar" + } + }, + "com_github_docker_java_docker_java_transport_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_3_3_3", + "sha256": "103b94685f398b036cf9243cb8899680bcdb4e54c32340a32b2b5737a87a33ba", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport/3.3.3/docker-java-transport-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport/3.3.3/docker-java-transport-3.3.3.jar" + } + }, + "software_amazon_awssdk_auth_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_auth_2_20_78", + "sha256": "9eb0c3d97668b318ae5dcd127f434186a73d8e2552ad0fdd1fb71e3ffa5f0bec", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/auth/2.20.78/auth-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/auth/2.20.78/auth-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/auth/2.20.78/auth-2.20.78.jar" + } + }, + "io_grpc_grpc_core_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_core_jar_sources_1_56_1", + "sha256": "9fd5eb82e115bcfc3babadb486d37d1096e86ce869ae0d1ccc4270aec60351ef", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-core/1.56.1/grpc-core-1.56.1-sources.jar" + } + }, + "com_github_docker_java_docker_java_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_3_3_3", + "sha256": "3afb208216a17d8ce26a8f689303292701c87b974d43780cfba47bb2199a4467", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java/3.3.3/docker-java-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java/3.3.3/docker-java-3.3.3.jar" + } + }, + "org_apache_commons_commons_math3_jar_sources_3_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_math3_jar_sources_3_6_1", + "sha256": "e2ff85a3c360d56c51a7021614a194f3fbaf224054642ac535016f118322934d", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1-sources.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1-sources.jar" + } + }, + "com_fasterxml_jackson_core_jackson_core_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_core_2_15_2", + "sha256": "303c99e82b1faa91a0bae5d8fbeb56f7e2adf9b526a900dd723bf140d62bd4b4", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-core/2.15.2/jackson-core-2.15.2.jar" + } + }, + "io_netty_netty_transport_native_epoll_jar_linux_x86_64_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_epoll_jar_linux_x86_64_4_1_97_Final", + "sha256": "1e83fc9f82e5415cdbb688c6a5c6bbbd7d198e9fdd6fdf64b3dc5d54dd1acfd0", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final-linux-x86_64.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final-linux-x86_64.jar" + } + }, + "org_bouncycastle_bcpkix_jdk18on_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcpkix_jdk18on_1_75", + "sha256": "9e2c1db5a6ed29fbc36b438d39ca9feb901bb69bad0ce8d7bc735264bea79bd3", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk18on/1.75/bcpkix-jdk18on-1.75.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcpkix-jdk18on/1.75/bcpkix-jdk18on-1.75.jar" + } + }, + "org_reflections_reflections_0_10_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_reflections_reflections_0_10_2", + "sha256": "938a2d08fe54050d7610b944d8ddc3a09355710d9e6be0aac838dbc04e9a2825", + "urls": [ + "https://repo1.maven.org/maven2/org/reflections/reflections/0.10.2/reflections-0.10.2.jar" + ], + "downloaded_file_path": "org/reflections/reflections/0.10.2/reflections-0.10.2.jar" + } + }, + "com_github_fppt_jedis_mock_1_0_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_fppt_jedis_mock_1_0_10", + "sha256": "118684813167330681c6f1bebea2c1b67e3ed96bb862867437c0e4270d1fc88d", + "urls": [ + "https://repo1.maven.org/maven2/com/github/fppt/jedis-mock/1.0.10/jedis-mock-1.0.10.jar" + ], + "downloaded_file_path": "com/github/fppt/jedis-mock/1.0.10/jedis-mock-1.0.10.jar" + } + }, + "org_javassist_javassist_3_28_0_GA": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_javassist_javassist_3_28_0_GA", + "sha256": "57d0a9e9286f82f4eaa851125186997f811befce0e2060ff0a15a77f5a9dd9a7", + "urls": [ + "https://repo1.maven.org/maven2/org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA.jar" + ], + "downloaded_file_path": "org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA.jar" + } + }, + "com_google_http_client_google_http_client_gson_1_43_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_gson_1_43_1", + "sha256": "017406e5105a33147ab13baf7b491ff53d99e54a5e2b61b7ccd651e164229698", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson/1.43.1/google-http-client-gson-1.43.1.jar", + "https://maven.google.com/com/google/http-client/google-http-client-gson/1.43.1/google-http-client-gson-1.43.1.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-gson/1.43.1/google-http-client-gson-1.43.1.jar" + } + }, + "net_minidev_json_smart_2_4_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_minidev_json_smart_2_4_10", + "sha256": "70cab5e9488630dc631b1fc6e7fa550d95cddd19ba14db39ceca7cabfbd4e5ae", + "urls": [ + "https://repo1.maven.org/maven2/net/minidev/json-smart/2.4.10/json-smart-2.4.10.jar" + ], + "downloaded_file_path": "net/minidev/json-smart/2.4.10/json-smart-2.4.10.jar" + } + }, + "org_apache_httpcomponents_httpcore_4_4_15": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpcore_4_4_15", + "sha256": "3cbaed088c499a10f96dde58f39dc0e7985171abd88138ca1655a872011bb142", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar" + } + }, + "io_grpc_grpc_protobuf_lite_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_lite_1_56_1", + "sha256": "5605030f1668edf93ade7f24b0bfe5ecf943774e02cf0ac5cac02387ac910185", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar" + } + }, + "org_apache_httpcomponents_httpcore_4_4_16": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpcore_4_4_16", + "sha256": "6c9b3dd142a09dc468e23ad39aad6f75a0f2b85125104469f026e52a474e464f", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar", + "https://maven.google.com/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar" + } + }, + "org_slf4j_slf4j_simple": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_simple", + "generating_repository": "maven", + "target_name": "org_slf4j_slf4j_simple" + } + }, + "io_netty_netty_codec_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_jar_sources_4_1_97_Final", + "sha256": "3f512c1a7ffa112ce3f8a8fec9545017063ae06583e80e841bdee76477f891f4", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final-sources.jar" + } + }, + "org_xerial_sqlite_jdbc_3_34_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_xerial_sqlite_jdbc_3_34_0", + "sha256": "605979c94e7fe00437f1e10dcfa657a23f125c8eb4d2f0ec17e3f84613894cc3", + "urls": [ + "https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar" + ], + "downloaded_file_path": "org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar" + } + }, + "org_slf4j_jcl_over_slf4j_jar_sources_1_7_30": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_jcl_over_slf4j_jar_sources_1_7_30", + "sha256": "e746bd5e537c8ceeb0c815a4edbaa4169444f74e658038e1966d8a3596eb8d05", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30-sources.jar" + ], + "downloaded_file_path": "org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30-sources.jar" + } + }, + "io_grpc_grpc_netty_shaded_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_shaded_1_56_1", + "sha256": "b15257e1137d609a7e8eb9bf4f0cec06b78ee69c030282db0a66d17cc9c3eaf1", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1.jar" + } + }, + "com_google_protobuf_protobuf_java": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java", + "generating_repository": "maven", + "target_name": "com_google_protobuf_protobuf_java" + } + }, + "unpinned_maven": { + "bzlFile": "@@rules_jvm_external~5.3//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "name": "rules_jvm_external~5.3~maven~unpinned_maven", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.amazonaws\", \"artifact\": \"aws-java-sdk-s3\", \"version\": \"1.12.544\" }", + "{ \"group\": \"com.amazonaws\", \"artifact\": \"aws-java-sdk-secretsmanager\", \"version\": \"1.12.544\" }", + "{ \"group\": \"com.fasterxml.jackson.core\", \"artifact\": \"jackson-databind\", \"version\": \"2.15.0\" }", + "{ \"group\": \"com.github.ben-manes.caffeine\", \"artifact\": \"caffeine\", \"version\": \"2.9.0\" }", + "{ \"group\": \"com.github.docker-java\", \"artifact\": \"docker-java\", \"version\": \"3.3.3\" }", + "{ \"group\": \"com.github.fppt\", \"artifact\": \"jedis-mock\", \"version\": \"1.0.10\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jffi\", \"version\": \"1.3.11\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jffi\", \"version\": \"1.3.11\", \"packaging\": \"jar\", \"classifier\": \"native\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-constants\", \"version\": \"0.10.4\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-ffi\", \"version\": \"2.2.14\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-posix\", \"version\": \"3.1.17\" }", + "{ \"group\": \"com.github.pcj\", \"artifact\": \"google-options\", \"version\": \"1.0.0\" }", + "{ \"group\": \"com.github.serceman\", \"artifact\": \"jnr-fuse\", \"version\": \"0.5.7\" }", + "{ \"group\": \"com.github.luben\", \"artifact\": \"zstd-jni\", \"version\": \"1.5.5-7\" }", + "{ \"group\": \"com.github.oshi\", \"artifact\": \"oshi-core\", \"version\": \"6.4.5\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"failureaccess\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.1.1-jre\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"2.8\" }", + "{ \"group\": \"com.google.jimfs\", \"artifact\": \"jimfs\", \"version\": \"1.3.0\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java-util\", \"version\": \"3.19.1\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\", \"version\": \"3.19.1\" }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.5\" }", + "{ \"group\": \"org.slf4j\", \"artifact\": \"slf4j-simple\", \"version\": \"2.0.9\" }", + "{ \"group\": \"com.googlecode.json-simple\", \"artifact\": \"json-simple\", \"version\": \"1.1.1\" }", + "{ \"group\": \"com.jayway.jsonpath\", \"artifact\": \"json-path\", \"version\": \"2.8.0\" }", + "{ \"group\": \"org.bouncycastle\", \"artifact\": \"bcprov-jdk15on\", \"version\": \"1.70\" }", + "{ \"group\": \"net.jcip\", \"artifact\": \"jcip-annotations\", \"version\": \"1.0\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-buffer\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http2\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-socks\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-common\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler-proxy\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-api\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-auth\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-core\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-context\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-stub\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-testing\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-services\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty-shaded\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient\", \"version\": \"0.15.0\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient_hotspot\", \"version\": \"0.15.0\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient_httpserver\", \"version\": \"0.15.0\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", + "{ \"group\": \"net.javacrumbs.future-converter\", \"artifact\": \"future-converter-java8-guava\", \"version\": \"1.2.0\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-compress\", \"version\": \"1.23.0\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-pool2\", \"version\": \"2.11.1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-lang3\", \"version\": \"3.13.0\" }", + "{ \"group\": \"commons-io\", \"artifact\": \"commons-io\", \"version\": \"2.13.0\" }", + "{ \"group\": \"me.dinowernli\", \"artifact\": \"java-grpc-prometheus\", \"version\": \"0.6.0\" }", + "{ \"group\": \"org.apache.tomcat\", \"artifact\": \"annotations-api\", \"version\": \"6.0.53\" }", + "{ \"group\": \"org.checkerframework\", \"artifact\": \"checker-qual\", \"version\": \"3.38.0\" }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"2.25.0\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-core\", \"version\": \"1.37\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-generator-annprocess\", \"version\": \"1.37\" }", + "{ \"group\": \"org.redisson\", \"artifact\": \"redisson\", \"version\": \"3.23.4\" }", + "{ \"group\": \"org.threeten\", \"artifact\": \"threetenbp\", \"version\": \"1.6.8\" }", + "{ \"group\": \"org.xerial\", \"artifact\": \"sqlite-jdbc\", \"version\": \"3.34.0\" }", + "{ \"group\": \"org.jetbrains\", \"artifact\": \"annotations\", \"version\": \"16.0.2\" }", + "{ \"group\": \"org.yaml\", \"artifact\": \"snakeyaml\", \"version\": \"2.2\" }", + "{ \"group\": \"org.projectlombok\", \"artifact\": \"lombok\", \"version\": \"1.18.30\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": true, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "maven_install_json": "@@//:maven_install.json", + "resolve_timeout": 600, + "jetify": false, + "jetify_include_list": [ + "*" + ], + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn" + } + }, + "io_netty_netty_transport_native_unix_common_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_unix_common_4_1_86_Final", + "sha256": "ec26d03a06565791d57e997f793677ee4d3fc47b290b7951898c2ecd0232f115", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.86.Final/netty-transport-native-unix-common-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-transport-native-unix-common/4.1.86.Final/netty-transport-native-unix-common-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-unix-common/4.1.86.Final/netty-transport-native-unix-common-4.1.86.Final.jar" + } + }, + "com_github_oshi_oshi_core_6_4_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_oshi_oshi_core_6_4_5", + "sha256": "7e634fb57b8763b7803d5f9caaed46d19c3bdbe81ddd8a93e61528c700cdc09e", + "urls": [ + "https://repo1.maven.org/maven2/com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5.jar" + ], + "downloaded_file_path": "com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5.jar" + } + }, + "joda_time_joda_time_jar_sources_2_8_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~joda_time_joda_time_jar_sources_2_8_1", + "sha256": "59086b3e0608df2eac1b21063d6bae37851173e24efc4cacd6705326408723d9", + "urls": [ + "https://repo1.maven.org/maven2/joda-time/joda-time/2.8.1/joda-time-2.8.1-sources.jar" + ], + "downloaded_file_path": "joda-time/joda-time/2.8.1/joda-time-2.8.1-sources.jar" + } + }, + "com_google_protobuf_protobuf_java_3_22_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_3_22_3", + "sha256": "59d388ea6a2d2d76ae8efff7fd4d0c60c6f0f464c3d3ab9be8e5add092975708", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.22.3/protobuf-java-3.22.3.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java/3.22.3/protobuf-java-3.22.3.jar" + } + }, + "org_apache_commons_commons_lang3_3_13_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_lang3_3_13_0", + "sha256": "82f528cf718c7a3c2f30fc5bc784e3c6a0a10b17605dadb9e16c82ede11e6064", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar" + } + }, + "software_amazon_awssdk_profiles_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_profiles_2_20_78", + "sha256": "c54925f8710a63b545f272ad651b40fc4310c4d3f49df50257645604d6021f32", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/profiles/2.20.78/profiles-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/profiles/2.20.78/profiles-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/profiles/2.20.78/profiles-2.20.78.jar" + } + }, + "io_grpc_grpc_stub_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_stub_1_56_1", + "sha256": "64ffca5dde4565c4c0f876deea3d105341d45ce605b29053e79dc86a22f7953b", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1.jar" + } + }, + "io_grpc_grpc_protobuf_lite_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_lite_jar_sources_1_56_1", + "sha256": "515018e2d65b852e0fa99c6dcb6c1e711070e02bdb926ca5b3e04ed35ae0a874", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1-sources.jar" + } + }, + "com_googlecode_json_simple_json_simple_1_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_googlecode_json_simple_json_simple_1_1_1", + "sha256": "4e69696892b88b41c55d49ab2fdcc21eead92bf54acc588c0050596c3b75199c", + "urls": [ + "https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" + ], + "downloaded_file_path": "com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar" + } + }, + "io_netty_netty_transport_native_kqueue_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_kqueue_4_1_97_Final", + "sha256": "85916dd7569148bb3d4bc831d45846807b39d2b6f593dc8794a42ca71a4086c9", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final.jar" + } + }, + "io_grpc_grpc_auth_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_auth_jar_sources_1_56_1", + "sha256": "301967032288267e509448bdcd8ba42c726b5e58732b2d7d357f864e036f0e23", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1-sources.jar" + } + }, + "com_google_api_api_common_2_11_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_api_common_2_11_1", + "sha256": "21f67354fa308826395d2ed171d25416a8001d50ea70f82b68f2bdd17bb8947f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/api-common/2.11.1/api-common-2.11.1.jar", + "https://maven.google.com/com/google/api/api-common/2.11.1/api-common-2.11.1.jar" + ], + "downloaded_file_path": "com/google/api/api-common/2.11.1/api-common-2.11.1.jar" + } + }, + "io_netty_netty_transport_native_unix_common_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_unix_common_4_1_97_Final", + "sha256": "412fe140257c2dda5a5e15bee911298bd61928d03ee6be4db588e82c196c5dc6", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.97.Final/netty-transport-native-unix-common-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-unix-common/4.1.97.Final/netty-transport-native-unix-common-4.1.97.Final.jar" + } + }, + "com_google_oauth_client_google_oauth_client_1_34_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_oauth_client_google_oauth_client_1_34_1", + "sha256": "193edf97aefa28b93c5892bdc598bac34fa4c396588030084f290b1440e8b98a", + "urls": [ + "https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/1.34.1/google-oauth-client-1.34.1.jar", + "https://maven.google.com/com/google/oauth-client/google-oauth-client/1.34.1/google-oauth-client-1.34.1.jar" + ], + "downloaded_file_path": "com/google/oauth-client/google-oauth-client/1.34.1/google-oauth-client-1.34.1.jar" + } + }, + "com_amazonaws_aws_java_sdk_secretsmanager": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_secretsmanager", + "generating_repository": "maven", + "target_name": "com_amazonaws_aws_java_sdk_secretsmanager" + } + }, + "javax_cache_cache_api_jar_sources_1_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_cache_cache_api_jar_sources_1_1_1", + "sha256": "2387f48682d3475fd214a6b9c2d1ef732ae8ce9313a3b8f69e72449ce33c6068", + "urls": [ + "https://repo1.maven.org/maven2/javax/cache/cache-api/1.1.1/cache-api-1.1.1-sources.jar" + ], + "downloaded_file_path": "javax/cache/cache-api/1.1.1/cache-api-1.1.1-sources.jar" + } + }, + "org_bouncycastle_bcutil_jdk18on_jar_sources_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcutil_jdk18on_jar_sources_1_75", + "sha256": "bf827dd7283566804ba0583d02c80f43f0713896814e9dc56b1242ff5cc656a7", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcutil-jdk18on/1.75/bcutil-jdk18on-1.75-sources.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcutil-jdk18on/1.75/bcutil-jdk18on-1.75-sources.jar" + } + }, + "io_grpc_grpc_stub_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_stub_jar_sources_1_56_1", + "sha256": "da927063466a063aaee49ca7c43b8cd487d3f24d3b8bb694216304060f386b8c", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1-sources.jar" + } + }, + "net_sf_jopt_simple_jopt_simple_5_0_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_sf_jopt_simple_jopt_simple_5_0_4", + "sha256": "df26cc58f235f477db07f753ba5a3ab243ebe5789d9f89ecf68dd62ea9a66c28", + "urls": [ + "https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar" + ], + "downloaded_file_path": "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar" + } + }, + "jakarta_activation_jakarta_activation_api_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_activation_jakarta_activation_api_1_2_1", + "sha256": "8b0a0f52fa8b05c5431921a063ed866efaa41dadf2e3a7ee3e1961f2b0d9645b", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar" + ], + "downloaded_file_path": "jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar" + } + }, + "io_netty_netty_handler_proxy_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_proxy_jar_sources_4_1_97_Final", + "sha256": "19e0dac14e5028af4c7068a0a2872f50ad06588a5140a065648f1ab3c31cf5bc", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler-proxy/4.1.97.Final/netty-handler-proxy-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-handler-proxy/4.1.97.Final/netty-handler-proxy-4.1.97.Final-sources.jar" + } + }, + "io_netty_netty_transport_classes_kqueue_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_classes_kqueue_jar_sources_4_1_97_Final", + "sha256": "1db14659fab815b08ed06a60553bebabd402687d35b204f1af5add7396a549f4", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-kqueue/4.1.97.Final/netty-transport-classes-kqueue-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-classes-kqueue/4.1.97.Final/netty-transport-classes-kqueue-4.1.97.Final-sources.jar" + } + }, + "software_amazon_awssdk_regions_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_regions_2_20_78", + "sha256": "af2dd9874404ef3bda177000134b7d9e04279a24a726388175b4dff2590740d7", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/regions/2.20.78/regions-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/regions/2.20.78/regions-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/regions/2.20.78/regions-2.20.78.jar" + } + }, + "com_github_docker_java_docker_java_transport_netty_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_netty_jar_sources_3_3_3", + "sha256": "9c8e9b8e0bf0495470d19c22e27b832dc5f0025786106212b0de6a478b5abde3", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport-netty/3.3.3/docker-java-transport-netty-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport-netty/3.3.3/docker-java-transport-netty-3.3.3-sources.jar" + } + }, + "io_grpc_grpc_protobuf_lite_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_lite_1_55_1", + "sha256": "d0253390609c72ec09c31ae46e79b01cd72a2ce2ccae11176de550ffd475c853", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf-lite/1.55.1/grpc-protobuf-lite-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-protobuf-lite/1.55.1/grpc-protobuf-lite-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf-lite/1.55.1/grpc-protobuf-lite-1.55.1.jar" + } + }, + "io_grpc_grpc_services_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_services_jar_sources_1_56_1", + "sha256": "e9676fe1c41585babbe70c26a28b418b87a80e81ed49481a5dfaaace1a71162e", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-services/1.56.1/grpc-services-1.56.1-sources.jar" + } + }, + "net_minidev_accessors_smart_2_4_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_minidev_accessors_smart_2_4_9", + "sha256": "accdd5c7ac4c49b155890aaea1ffca2a9ccd5826b562dd95a99fc1887003e031", + "urls": [ + "https://repo1.maven.org/maven2/net/minidev/accessors-smart/2.4.9/accessors-smart-2.4.9.jar" + ], + "downloaded_file_path": "net/minidev/accessors-smart/2.4.9/accessors-smart-2.4.9.jar" + } + }, + "com_fasterxml_jackson_core_jackson_annotations_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_annotations_2_15_2", + "sha256": "04e21f94dcfee4b078fa5a5f53047b785aaba69d19de392f616e7a7fe5d3882f", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-annotations/2.15.2/jackson-annotations-2.15.2.jar" + } + }, + "aopalliance_aopalliance_jar_sources_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~aopalliance_aopalliance_jar_sources_1_0", + "sha256": "e6ef91d439ada9045f419c77543ebe0416c3cdfc5b063448343417a3e4a72123", + "urls": [ + "https://repo1.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar" + ], + "downloaded_file_path": "aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar" + } + }, + "org_threeten_threetenbp_1_6_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_threeten_threetenbp_1_6_8", + "sha256": "e4b1eb3d90c38a54c7f3384fda957e0b5bf0b41b40672a44ae8b03cb6c87ce06", + "urls": [ + "https://repo1.maven.org/maven2/org/threeten/threetenbp/1.6.8/threetenbp-1.6.8.jar" + ], + "downloaded_file_path": "org/threeten/threetenbp/1.6.8/threetenbp-1.6.8.jar" + } + }, + "io_netty_netty_handler_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_4_1_97_Final", + "sha256": "bd4771d19149cbc9c7464ed2d58035d79cdfed7adb59d38718b0d8e7a3dcc2de", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final.jar" + } + }, + "com_google_http_client_google_http_client_jar_sources_1_42_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_jar_sources_1_42_3", + "sha256": "60d3d16ff67d6a395a81560227f51d282d3c65235154a696cafafe9032f43d5f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client/1.42.3/google-http-client-1.42.3-sources.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client/1.42.3/google-http-client-1.42.3-sources.jar" + } + }, + "javax_inject_javax_inject_jar_sources_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_inject_javax_inject_jar_sources_1", + "sha256": "c4b87ee2911c139c3daf498a781967f1eb2e75bc1a8529a2e7b328a15d0e433e", + "urls": [ + "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1-sources.jar" + ], + "downloaded_file_path": "javax/inject/javax.inject/1/javax.inject-1-sources.jar" + } + }, + "io_netty_netty_handler_proxy": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_proxy", + "generating_repository": "maven", + "target_name": "io_netty_netty_handler_proxy" + } + }, + "com_esotericsoftware_reflectasm_1_11_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_reflectasm_1_11_9", + "sha256": "712b44da79a5b7f47a28cbfcb3d8ecfc872fae349c48aa4d3e38a5d69956afce", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/reflectasm/1.11.9/reflectasm-1.11.9.jar" + ], + "downloaded_file_path": "com/esotericsoftware/reflectasm/1.11.9/reflectasm-1.11.9.jar" + } + }, + "com_google_re2j_re2j_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_re2j_re2j_1_6", + "sha256": "c8b5c3472d4db594a865b2e47f835d07fb8b1415eeba559dccfb0a6945f033cd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/re2j/re2j/1.6/re2j-1.6.jar", + "https://maven.google.com/com/google/re2j/re2j/1.6/re2j-1.6.jar" + ], + "downloaded_file_path": "com/google/re2j/re2j/1.6/re2j-1.6.jar" + } + }, + "software_amazon_awssdk_apache_client_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_apache_client_2_20_78", + "sha256": "771923580e38678b7f66c3a63f4b5f79eef9ffb81027e2a422aed2713ce4138b", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/apache-client/2.20.78/apache-client-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/apache-client/2.20.78/apache-client-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/apache-client/2.20.78/apache-client-2.20.78.jar" + } + }, + "com_jayway_jsonpath_json_path": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_jayway_jsonpath_json_path", + "generating_repository": "maven", + "target_name": "com_jayway_jsonpath_json_path" + } + }, + "com_fasterxml_jackson_dataformat_jackson_dataformat_cbor_jar_sources_2_12_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_dataformat_jackson_dataformat_cbor_jar_sources_2_12_6", + "sha256": "1e70fe124ab0a0c3e9a909e75735799e987fb71b4f7649eb10199f4f3b873287", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.12.6/jackson-dataformat-cbor-2.12.6-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.12.6/jackson-dataformat-cbor-2.12.6-sources.jar" + } + }, + "org_bouncycastle_bcpkix_jdk18on_jar_sources_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcpkix_jdk18on_jar_sources_1_75", + "sha256": "bd621657020f859beff0c8279aef31380c18438596964da2c77a0542126bf780", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcpkix-jdk18on/1.75/bcpkix-jdk18on-1.75-sources.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcpkix-jdk18on/1.75/bcpkix-jdk18on-1.75-sources.jar" + } + }, + "org_redisson_redisson_jar_sources_3_23_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_redisson_redisson_jar_sources_3_23_4", + "sha256": "7701f55b848adeb366af2461e1323f50f2d8701e983b133b34f5085803cbbab6", + "urls": [ + "https://repo1.maven.org/maven2/org/redisson/redisson/3.23.4/redisson-3.23.4-sources.jar" + ], + "downloaded_file_path": "org/redisson/redisson/3.23.4/redisson-3.23.4-sources.jar" + } + }, + "org_threeten_threetenbp_jar_sources_1_6_8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_threeten_threetenbp_jar_sources_1_6_8", + "sha256": "6b68e90399fd0d97ee7abbe3918c87a236d52a3fb3c434359a11942f9a1abc59", + "urls": [ + "https://repo1.maven.org/maven2/org/threeten/threetenbp/1.6.8/threetenbp-1.6.8-sources.jar" + ], + "downloaded_file_path": "org/threeten/threetenbp/1.6.8/threetenbp-1.6.8-sources.jar" + } + }, + "io_netty_netty_common_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_common_jar_sources_4_1_97_Final", + "sha256": "54e96a125cb58b3ac067fa59b4a97fb6f1aadbac3f3092e6cc7fa88684de9964", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final-sources.jar" + } + }, + "org_glassfish_hk2_external_jakarta_inject_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_external_jakarta_inject_jar_sources_2_6_1", + "sha256": "fbbadf59b395bf326910de95682eaaa83dcc0f1d65cd4a077c6988deff6a527a", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/external/jakarta.inject/2.6.1/jakarta.inject-2.6.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/external/jakarta.inject/2.6.1/jakarta.inject-2.6.1-sources.jar" + } + }, + "org_bouncycastle_bcprov_jdk18on_jar_sources_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcprov_jdk18on_jar_sources_1_75", + "sha256": "72abfe335986c5f8d9f61489d5699dca7688303a7da60697cef77018187ac8bc", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk18on/1.75/bcprov-jdk18on-1.75-sources.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcprov-jdk18on/1.75/bcprov-jdk18on-1.75-sources.jar" + } + }, + "javax_annotation_javax_annotation_api_1_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_annotation_javax_annotation_api_1_3_2", + "sha256": "e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b", + "urls": [ + "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + ], + "downloaded_file_path": "javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" + } + }, + "io_prometheus_simpleclient_httpserver_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_httpserver_0_15_0", + "sha256": "a1a16e1f804e3382ed8b400220ecb2913c96412d937e618f54a7088e6eb432b6", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_httpserver/0.15.0/simpleclient_httpserver-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_httpserver/0.15.0/simpleclient_httpserver-0.15.0.jar" + } + }, + "com_google_auth_google_auth_library_credentials": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_credentials", + "generating_repository": "maven", + "target_name": "com_google_auth_google_auth_library_credentials" + } + }, + "com_google_jimfs_jimfs": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_jimfs_jimfs", + "generating_repository": "maven", + "target_name": "com_google_jimfs_jimfs" + } + }, + "org_slf4j_slf4j_simple_2_0_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_simple_2_0_9", + "sha256": "71f9c6de6dbaec2d10caa303faf08c5e749be53b242896c64c96b7c6bb6d62dc", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/2.0.9/slf4j-simple-2.0.9.jar" + ], + "downloaded_file_path": "org/slf4j/slf4j-simple/2.0.9/slf4j-simple-2.0.9.jar" + } + }, + "org_glassfish_jersey_core_jersey_client_jar_sources_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_core_jersey_client_jar_sources_2_30_1", + "sha256": "44618799a585b0529c7b1fc63bdf4e0c5faa11c9cc8fb27621f3b24106be9ab7", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client/2.30.1/jersey-client-2.30.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/core/jersey-client/2.30.1/jersey-client-2.30.1-sources.jar" + } + }, + "com_github_docker_java_docker_java_core_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_core_jar_sources_3_3_3", + "sha256": "4858f9c8671cd792067fdaa4e99f04f6a660f546d08e03041664b754b79235f8", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-core/3.3.3/docker-java-core-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-core/3.3.3/docker-java-core-3.3.3-sources.jar" + } + }, + "io_grpc_grpc_netty_shaded": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_shaded", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_netty_shaded" + } + }, + "io_netty_netty_common_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_common_4_1_86_Final", + "sha256": "a35a3f16e7cd45c5d8529aa3e7702d4ef3b36213ea332db59744ea348fc2ae99", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.86.Final/netty-common-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-common/4.1.86.Final/netty-common-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-common/4.1.86.Final/netty-common-4.1.86.Final.jar" + } + }, + "io_netty_netty_transport_native_kqueue_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_kqueue_jar_sources_4_1_97_Final", + "sha256": "2ea352ecbfc3cf601f98b0ffb06d30169ba40ed912fd68d66c0cd6f0bcf4d4b6", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final-sources.jar" + } + }, + "com_google_protobuf_protobuf_java_jar_sources_3_22_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_jar_sources_3_22_3", + "sha256": "49a699e1a696b4c6f681f4f0f9af5247fc97e0e665c5fbbbf797be7e7cd9c091", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.22.3/protobuf-java-3.22.3-sources.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java/3.22.3/protobuf-java-3.22.3-sources.jar" + } + }, + "io_netty_netty_buffer_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_buffer_4_1_97_Final", + "sha256": "a4393f5b395486cc74d0325c9b41311abb9513ba0fd7ef8cf46e9345c3bffbea", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final.jar" + } + }, + "software_amazon_awssdk_arns_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_arns_2_20_78", + "sha256": "83c9c5743f83375e1d4b5bedce3593107b4989beec96f809554f545feeae4f34", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/arns/2.20.78/arns-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/arns/2.20.78/arns-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/arns/2.20.78/arns-2.20.78.jar" + } + }, + "io_netty_netty_buffer_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_buffer_jar_sources_4_1_97_Final", + "sha256": "0b691a25682115d65da9e565589e39ee272227a972ecf0de936b475d42a4be48", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final-sources.jar" + } + }, + "io_grpc_grpc_services_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_services_1_55_1", + "sha256": "324d773ca903ce13b67686c98f28f56a201ee75cbb859de071d05683d06d337b", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-services/1.55.1/grpc-services-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-services/1.55.1/grpc-services-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-services/1.55.1/grpc-services-1.55.1.jar" + } + }, + "com_kohlschutter_junixsocket_junixsocket_common_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_kohlschutter_junixsocket_junixsocket_common_jar_sources_2_6_1", + "sha256": "066422249c845d9a0439a91fd1035e2bdf13b7552f03e94d1caef795afe53612", + "urls": [ + "https://repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-common/2.6.1/junixsocket-common-2.6.1-sources.jar" + ], + "downloaded_file_path": "com/kohlschutter/junixsocket/junixsocket-common/2.6.1/junixsocket-common-2.6.1-sources.jar" + } + }, + "com_github_jnr_jnr_posix": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_posix", + "generating_repository": "maven", + "target_name": "com_github_jnr_jnr_posix" + } + }, + "org_hamcrest_hamcrest_core_jar_sources_1_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_hamcrest_hamcrest_core_jar_sources_1_3", + "sha256": "e223d2d8fbafd66057a8848cc94222d63c3cedd652cc48eddc0ab5c39c0f84df", + "urls": [ + "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar" + ], + "downloaded_file_path": "org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar" + } + }, + "io_netty_netty_transport_native_epoll_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_epoll_jar_sources_4_1_97_Final", + "sha256": "a6e3591efc09729a68574bec1493bfc0d08019b6ed4a566b6cb4e8e45ab1e937", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-epoll/4.1.97.Final/netty-transport-native-epoll-4.1.97.Final-sources.jar" + } + }, + "com_google_auto_auto_common_jar_sources_1_2_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_auto_common_jar_sources_1_2_1", + "sha256": "6802fc6e48f84cacadab9418bc8eba732f4c6a4189fc8569b1f619cb88112b25", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/auto-common/1.2.1/auto-common-1.2.1-sources.jar" + ], + "downloaded_file_path": "com/google/auto/auto-common/1.2.1/auto-common-1.2.1-sources.jar" + } + }, + "software_amazon_awssdk_aws_core_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_aws_core_2_20_78", + "sha256": "83d02aa3fc781288b73b5392ef870282788cdd552fdf6ad31b9038e20a452395", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/aws-core/2.20.78/aws-core-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/aws-core/2.20.78/aws-core-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/aws-core/2.20.78/aws-core-2.20.78.jar" + } + }, + "net_jcip_jcip_annotations_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_jcip_jcip_annotations_1_0", + "sha256": "be5805392060c71474bf6c9a67a099471274d30b83eef84bfc4e0889a4f1dcc0", + "urls": [ + "https://repo1.maven.org/maven2/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" + ], + "downloaded_file_path": "net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" + } + }, + "org_checkerframework_checker_qual_3_33_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_checkerframework_checker_qual_3_33_0", + "sha256": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1", + "urls": [ + "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar", + "https://maven.google.com/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar" + ], + "downloaded_file_path": "org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar" + } + }, + "software_amazon_awssdk_third_party_jackson_core_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_third_party_jackson_core_2_20_78", + "sha256": "3bc11fd8888ab3b8026dec0894e51dd76a7460f4baac4c1adead7a03a87f8a44", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/third-party-jackson-core/2.20.78/third-party-jackson-core-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/third-party-jackson-core/2.20.78/third-party-jackson-core-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/third-party-jackson-core/2.20.78/third-party-jackson-core-2.20.78.jar" + } + }, + "com_github_docker_java_docker_java_core_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_core_3_3_3", + "sha256": "d1f60040b4666a6073d4a2e0b72fc86cfb1b77f36b093e46a4115ea255995267", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-core/3.3.3/docker-java-core-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-core/3.3.3/docker-java-core-3.3.3.jar" + } + }, + "net_minidev_json_smart_jar_sources_2_4_10": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_minidev_json_smart_jar_sources_2_4_10", + "sha256": "e2ece85df4e5489cf5644fd826d2875527a405233b02496b7520d871755f395d", + "urls": [ + "https://repo1.maven.org/maven2/net/minidev/json-smart/2.4.10/json-smart-2.4.10-sources.jar" + ], + "downloaded_file_path": "net/minidev/json-smart/2.4.10/json-smart-2.4.10-sources.jar" + } + }, + "com_google_j2objc_j2objc_annotations": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_j2objc_j2objc_annotations", + "generating_repository": "maven", + "target_name": "com_google_j2objc_j2objc_annotations" + } + }, + "org_projectlombok_lombok": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_projectlombok_lombok", + "generating_repository": "maven", + "target_name": "org_projectlombok_lombok" + } + }, + "software_amazon_awssdk_http_client_spi_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_http_client_spi_2_20_78", + "sha256": "a52f5fa04a3c7e5c15ae632e64c64c44d2d019a3ee609ddca38312039c7a5b24", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/http-client-spi/2.20.78/http-client-spi-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/http-client-spi/2.20.78/http-client-spi-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/http-client-spi/2.20.78/http-client-spi-2.20.78.jar" + } + }, + "unpinned_rules_jvm_external_deps": { + "bzlFile": "@@rules_jvm_external~5.3//:coursier.bzl", + "ruleClassName": "coursier_fetch", + "attributes": { + "name": "rules_jvm_external~5.3~maven~unpinned_rules_jvm_external_deps", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-core\", \"version\": \"2.18.1\" }", + "{ \"group\": \"com.google.cloud\", \"artifact\": \"google-cloud-storage\", \"version\": \"2.22.3\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.googlejavaformat\", \"artifact\": \"google-java-format\", \"version\": \"1.17.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.0.0-jre\" }", + "{ \"group\": \"org.apache.maven\", \"artifact\": \"maven-artifact\", \"version\": \"3.9.2\" }", + "{ \"group\": \"software.amazon.awssdk\", \"artifact\": \"s3\", \"version\": \"2.20.78\" }" + ], + "fail_on_missing_checksum": true, + "fetch_sources": true, + "fetch_javadoc": false, + "excluded_artifacts": [], + "generate_compat_repositories": false, + "version_conflict_policy": "default", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "maven_install_json": "@@rules_jvm_external~5.3//:rules_jvm_external_deps_install.json", + "resolve_timeout": 600, + "jetify": false, + "jetify_include_list": [ + "*" + ], + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn" + } + }, + "org_bouncycastle_bcutil_jdk18on_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcutil_jdk18on_1_75", + "sha256": "027f36578c1ffdf08878c1cc2aa1e191f4b9da119c1e8f113299c53f298fa664", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcutil-jdk18on/1.75/bcutil-jdk18on-1.75.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcutil-jdk18on/1.75/bcutil-jdk18on-1.75.jar" + } + }, + "org_jetbrains_annotations_16_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jetbrains_annotations_16_0_2", + "sha256": "245abad9a39eab1266ac9a8796980f462577e708ef3f6d43be2e008e4b72b9b4", + "urls": [ + "https://repo1.maven.org/maven2/org/jetbrains/annotations/16.0.2/annotations-16.0.2.jar" + ], + "downloaded_file_path": "org/jetbrains/annotations/16.0.2/annotations-16.0.2.jar" + } + }, + "com_google_http_client_google_http_client_gson_jar_sources_1_42_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_gson_jar_sources_1_42_3", + "sha256": "9e476cdfe8cd02f6691a3549ccc2016a3d2de4ad1d3ef5234145e73b2e61f732", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson/1.42.3/google-http-client-gson-1.42.3-sources.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-gson/1.42.3/google-http-client-gson-1.42.3-sources.jar" + } + }, + "software_amazon_awssdk_endpoints_spi_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_endpoints_spi_2_20_78", + "sha256": "9e20aaeb3dda2305bc04fea71d284a5ab53c562a896cc9206bcff52281585bb2", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/endpoints-spi/2.20.78/endpoints-spi-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/endpoints-spi/2.20.78/endpoints-spi-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/endpoints-spi/2.20.78/endpoints-spi-2.20.78.jar" + } + }, + "software_amazon_awssdk_json_utils_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_json_utils_2_20_78", + "sha256": "a8f0752527d123de28ddea281ad5829bbe10bbb657fe96da32b454f976042f50", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/json-utils/2.20.78/json-utils-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/json-utils/2.20.78/json-utils-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/json-utils/2.20.78/json-utils-2.20.78.jar" + } + }, + "io_grpc_grpc_netty_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_1_56_1", + "sha256": "0f457ae74e16c8928c004c1f2086dfdd2905f05c75a8a02ca6750e7d7dc6c8cc", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty/1.56.1/grpc-netty-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-netty/1.56.1/grpc-netty-1.56.1.jar" + } + }, + "io_prometheus_simpleclient_common_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_common_jar_sources_0_15_0", + "sha256": "4b43be524ff3b9e00dc3859170700d0a74194625586a49eef03ea616365d1bf8", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_common/0.15.0/simpleclient_common-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_common/0.15.0/simpleclient_common-0.15.0-sources.jar" + } + }, + "org_bouncycastle_bcprov_jdk15on_jar_sources_1_70": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcprov_jdk15on_jar_sources_1_70", + "sha256": "0252e39814e4403b5d91a7386c3a5ac3e1fe65d43c2d25fed8d45e8eebab2696", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/1.70/bcprov-jdk15on-1.70-sources.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcprov-jdk15on/1.70/bcprov-jdk15on-1.70-sources.jar" + } + }, + "io_opencensus_opencensus_contrib_http_util_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_opencensus_opencensus_contrib_http_util_0_31_1", + "sha256": "3ea995b55a4068be22989b70cc29a4d788c2d328d1d50613a7a9afd13fdd2d0a", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1.jar" + ], + "downloaded_file_path": "io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1.jar" + } + }, + "com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_jar_sources_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_jar_sources_2_15_2", + "sha256": "fcc3d81d341c72284a59639185558fb1035414b6f42724ae0dac013673cf62e9", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.2/jackson-dataformat-yaml-2.15.2-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.2/jackson-dataformat-yaml-2.15.2-sources.jar" + } + }, + "org_glassfish_jersey_inject_jersey_hk2_jar_sources_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_inject_jersey_hk2_jar_sources_2_30_1", + "sha256": "e4a24b58b0a7fa5089ee3008356a2ee252766bb12516fc2eda27cc54e935bcd9", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/inject/jersey-hk2/2.30.1/jersey-hk2-2.30.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/inject/jersey-hk2/2.30.1/jersey-hk2-2.30.1-sources.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_oauth2_http_1_19_0", + "sha256": "01bdf5c5cd85e10b794e401775d9909b56a38ffce313fbd39510a5d87ed56f58", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar" + } + }, + "com_github_jnr_jnr_ffi": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_ffi", + "generating_repository": "maven", + "target_name": "com_github_jnr_jnr_ffi" + } + }, + "software_amazon_awssdk_sdk_core_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_sdk_core_2_20_78", + "sha256": "1d060bab19739fa3a2071b4693b6fc31608a8c968e9554a0a2d2481343132498", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/sdk-core/2.20.78/sdk-core-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/sdk-core/2.20.78/sdk-core-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/sdk-core/2.20.78/sdk-core-2.20.78.jar" + } + }, + "software_amazon_awssdk_utils_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_utils_2_20_78", + "sha256": "bf346be5ab0af9267a1c8101378f37e76fc977e9d8f5b8e5cfc98221e4179374", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/utils/2.20.78/utils-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/utils/2.20.78/utils-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/utils/2.20.78/utils-2.20.78.jar" + } + }, + "com_google_auth_google_auth_library_credentials_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_credentials_1_19_0", + "sha256": "095984b0594888a47f311b3c9dcf6da9ed86feeea8f78140c55e14c27b0593e5", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar" + } + }, + "org_glassfish_hk2_hk2_locator_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_locator_2_6_1", + "sha256": "febc668deb9f2000c76bd4918d8086c0a4c74d07bd0c60486b72c6bd38b62874", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator/2.6.1/hk2-locator-2.6.1.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-locator/2.6.1/hk2-locator-2.6.1.jar" + } + }, + "io_projectreactor_reactor_core_3_5_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_projectreactor_reactor_core_3_5_3", + "sha256": "86017581188627ae6de5d3822882f3594f87f9289ec4479391790ccfd5631508", + "urls": [ + "https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.5.3/reactor-core-3.5.3.jar" + ], + "downloaded_file_path": "io/projectreactor/reactor-core/3.5.3/reactor-core-3.5.3.jar" + } + }, + "com_github_jnr_jnr_constants_0_10_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_constants_0_10_4", + "sha256": "9a5b8cf9798d9d0331b8d8966c5235a22c4307676e35803a24659e6d76096f78", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-constants/0.10.4/jnr-constants-0.10.4.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-constants/0.10.4/jnr-constants-0.10.4.jar" + } + }, + "com_kohlschutter_junixsocket_junixsocket_common_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_kohlschutter_junixsocket_junixsocket_common_2_6_1", + "sha256": "93d120e2d49ddf5bfdee8258762fc874b26c657f027f8d6ccc1a055156bfcde1", + "urls": [ + "https://repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-common/2.6.1/junixsocket-common-2.6.1.jar" + ], + "downloaded_file_path": "com/kohlschutter/junixsocket/junixsocket-common/2.6.1/junixsocket-common-2.6.1.jar" + } + }, + "com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_jaxrs_jackson_jaxrs_json_provider_2_10_3", + "sha256": "93026591dbb332030dbe865b9c811a016e470d8ff6daaa7031556d2185e62054", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.10.3/jackson-jaxrs-json-provider-2.10.3.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.10.3/jackson-jaxrs-json-provider-2.10.3.jar" + } + }, + "io_prometheus_simpleclient_tracer_common_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_common_0_15_0", + "sha256": "1baef082e619c06262e23de1b46ad35eb4df36ceb19be06ac7ef32a9833e12a4", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common/0.15.0/simpleclient_tracer_common-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_common/0.15.0/simpleclient_tracer_common-0.15.0.jar" + } + }, + "com_google_code_findbugs_jsr305_3_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_findbugs_jsr305_3_0_2", + "sha256": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + ], + "downloaded_file_path": "com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" + } + }, + "com_fasterxml_jackson_core_jackson_core_2_14_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_core_2_14_2", + "sha256": "b5d37a77c88277b97e3593c8740925216c06df8e4172bbde058528df04ad3e7a", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar", + "https://maven.google.com/com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar" + } + }, + "com_github_jnr_jnr_ffi_jar_sources_2_2_14": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_ffi_jar_sources_2_2_14", + "sha256": "07f3eca123769c9aaeadd2f8d05a3ac3ed009a41b52f77efd12487112d7482f5", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-ffi/2.2.14/jnr-ffi-2.2.14-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-ffi/2.2.14/jnr-ffi-2.2.14-sources.jar" + } + }, + "com_github_ben_manes_caffeine_caffeine": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_ben_manes_caffeine_caffeine", + "generating_repository": "maven", + "target_name": "com_github_ben_manes_caffeine_caffeine" + } + }, + "com_google_http_client_google_http_client_gson_1_42_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_http_client_google_http_client_gson_1_42_3", + "sha256": "8196efaa89c5f73b00b2b48edad02fcd78524259407c37ab1860737988545cee", + "urls": [ + "https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson/1.42.3/google-http-client-gson-1.42.3.jar" + ], + "downloaded_file_path": "com/google/http-client/google-http-client-gson/1.42.3/google-http-client-gson-1.42.3.jar" + } + }, + "io_grpc_grpc_api": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_api", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_api" + } + }, + "com_google_errorprone_error_prone_annotation_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotation_2_22_0", + "sha256": "554c42449c9920ea1f6baec1d1b8aaac404a88be653f7cb441ee059316f8a1d1", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0.jar" + } + }, + "org_glassfish_hk2_osgi_resource_locator_1_0_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_osgi_resource_locator_1_0_3", + "sha256": "aab5d7849f7cfcda2cc7c541ba1bd365151d42276f151c825387245dfde3dd74", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3.jar" + } + }, + "javax_annotation_javax_annotation_api_jar_sources_1_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_annotation_javax_annotation_api_jar_sources_1_3_2", + "sha256": "128971e52e0d84a66e3b6e049dab8ad7b2c58b7e1ad37fa2debd3d40c2947b95", + "urls": [ + "https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2-sources.jar" + ], + "downloaded_file_path": "javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2-sources.jar" + } + }, + "org_openjdk_jmh_jmh_core_jar_sources_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_core_jar_sources_1_37", + "sha256": "fd4beda07b3b94cd0e32199401bbb2d9ed3371a770c8c320761b9442ff3e8e05", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37-sources.jar" + ], + "downloaded_file_path": "org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37-sources.jar" + } + }, + "com_github_serceman_jnr_fuse_0_5_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_serceman_jnr_fuse_0_5_7", + "sha256": "ebe81ccbcbe1464996e5213ee24947cfba9eda7e9ffe154333f9bd8321217989", + "urls": [ + "https://repo1.maven.org/maven2/com/github/serceman/jnr-fuse/0.5.7/jnr-fuse-0.5.7.jar" + ], + "downloaded_file_path": "com/github/serceman/jnr-fuse/0.5.7/jnr-fuse-0.5.7.jar" + } + }, + "org_openjdk_jmh_jmh_generator_annprocess_jar_sources_1_37": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_generator_annprocess_jar_sources_1_37", + "sha256": "cc1b661fb209ae1a433e331e8e78bab680674153b0a6ac69d47d11c60fb5e47e", + "urls": [ + "https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37-sources.jar" + ], + "downloaded_file_path": "org/openjdk/jmh/jmh-generator-annprocess/1.37/jmh-generator-annprocess-1.37-sources.jar" + } + }, + "org_yaml_snakeyaml": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_yaml_snakeyaml", + "generating_repository": "maven", + "target_name": "org_yaml_snakeyaml" + } + }, + "com_google_auto_value_auto_value_annotations_jar_sources_1_10_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_value_auto_value_annotations_jar_sources_1_10_1", + "sha256": "44e6ce2884c18869422765b238f7f173faccd24643fabb5e95597382e80d50a8", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1-sources.jar" + ], + "downloaded_file_path": "com/google/auto/value/auto-value-annotations/1.10.1/auto-value-annotations-1.10.1-sources.jar" + } + }, + "io_grpc_grpc_rls_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_rls_1_55_1", + "sha256": "f828087440c2f6b274e196b21a6fb38db60648724c1be450f4d0ed991d819a6f", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-rls/1.55.1/grpc-rls-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-rls/1.55.1/grpc-rls-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-rls/1.55.1/grpc-rls-1.55.1.jar" + } + }, + "jakarta_xml_bind_jakarta_xml_bind_api_jar_sources_2_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_xml_bind_jakarta_xml_bind_api_jar_sources_2_3_2", + "sha256": "61ceb3ed35ecf99f1803eac9c4b8f12103c7531952beae38ba53cc727f405532", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2-sources.jar" + ], + "downloaded_file_path": "jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2-sources.jar" + } + }, + "com_google_googlejavaformat_google_java_format_1_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_googlejavaformat_google_java_format_1_17_0", + "sha256": "631ba54c39f6c20df027dc1420736df2e5e43c581880efdd1e46ddb4ce050e3e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/googlejavaformat/google-java-format/1.17.0/google-java-format-1.17.0.jar", + "https://maven.google.com/com/google/googlejavaformat/google-java-format/1.17.0/google-java-format-1.17.0.jar" + ], + "downloaded_file_path": "com/google/googlejavaformat/google-java-format/1.17.0/google-java-format-1.17.0.jar" + } + }, + "org_jboss_marshalling_jboss_marshalling_jar_sources_2_0_11_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_jboss_marshalling_jboss_marshalling_jar_sources_2_0_11_Final", + "sha256": "4e9b508e3423fb82a33e72c77fd4fe63f108f167fa648d50a933b1b71d9084f2", + "urls": [ + "https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling/2.0.11.Final/jboss-marshalling-2.0.11.Final-sources.jar" + ], + "downloaded_file_path": "org/jboss/marshalling/jboss-marshalling/2.0.11.Final/jboss-marshalling-2.0.11.Final-sources.jar" + } + }, + "com_google_guava_failureaccess_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_failureaccess_1_0_1", + "sha256": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" + ], + "downloaded_file_path": "com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar" + } + }, + "io_perfmark_perfmark_api_0_26_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_perfmark_perfmark_api_0_26_0", + "sha256": "b7d23e93a34537ce332708269a0d1404788a5b5e1949e82f5535fce51b3ea95b", + "urls": [ + "https://repo1.maven.org/maven2/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar" + ], + "downloaded_file_path": "io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar" + } + }, + "commons_codec_commons_codec_jar_sources_1_15": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_codec_commons_codec_jar_sources_1_15", + "sha256": "7019940b2298d333edb946e2db3d10f1caacbbd52bb64e85832cfd0017e049cc", + "urls": [ + "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.15/commons-codec-1.15-sources.jar" + ], + "downloaded_file_path": "commons-codec/commons-codec/1.15/commons-codec-1.15-sources.jar" + } + }, + "io_netty_netty_codec_http_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http_4_1_97_Final", + "sha256": "7d6cad9cbd015e41f69787ce6a34beeba032b381e32e88207908431dc812778a", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.1.97.Final/netty-codec-http-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http/4.1.97.Final/netty-codec-http-4.1.97.Final.jar" + } + }, + "io_netty_netty_codec_http2_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http2_jar_sources_4_1_97_Final", + "sha256": "7d8c2ec86545a19ccca24009809027f1745bc8339c8a97bcdc5833abd58e2ab3", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-codec-http2/4.1.97.Final/netty-codec-http2-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-codec-http2/4.1.97.Final/netty-codec-http2-4.1.97.Final-sources.jar" + } + }, + "software_amazon_awssdk_protocol_core_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_protocol_core_2_20_78", + "sha256": "9ae1459ad8bd5b6167997985ec7afebf9fc1105a3d727d8b485b276b5c2fbddb", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/protocol-core/2.20.78/protocol-core-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/protocol-core/2.20.78/protocol-core-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/protocol-core/2.20.78/protocol-core-2.20.78.jar" + } + }, + "io_netty_netty_resolver_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_resolver_4_1_97_Final", + "sha256": "38a018c6d9fb2cb11b72881354782b45080bbd20b9a0ad6cde28b80d431ed0b1", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final.jar" + } + }, + "io_grpc_grpc_context_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_context_1_56_1", + "sha256": "3d442ce08bfb1b487edf76d12e2dfd991c3877af32cf772a83c73d06f89743bc", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar" + } + }, + "io_prometheus_simpleclient_httpserver_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_httpserver_jar_sources_0_15_0", + "sha256": "b06cfea384c1a0e7d233c9325eb62d9ea4d144a744ce7991a5a96ef8bb5a361e", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_httpserver/0.15.0/simpleclient_httpserver-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_httpserver/0.15.0/simpleclient_httpserver-0.15.0-sources.jar" + } + }, + "com_google_api_gax_httpjson_0_113_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_gax_httpjson_0_113_1", + "sha256": "f7e4e84caa6577466fc828858193667135b291da044f007eafde99c0f929b781", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax-httpjson/0.113.1/gax-httpjson-0.113.1.jar", + "https://maven.google.com/com/google/api/gax-httpjson/0.113.1/gax-httpjson-0.113.1.jar" + ], + "downloaded_file_path": "com/google/api/gax-httpjson/0.113.1/gax-httpjson-0.113.1.jar" + } + }, + "jakarta_ws_rs_jakarta_ws_rs_api_jar_sources_2_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_ws_rs_jakarta_ws_rs_api_jar_sources_2_1_6", + "sha256": "5fb0591472e00439db7d1511caa40a39cda42e24b0bade6378f880384b7cc073", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api/2.1.6/jakarta.ws.rs-api-2.1.6-sources.jar" + ], + "downloaded_file_path": "jakarta/ws/rs/jakarta.ws.rs-api/2.1.6/jakarta.ws.rs-api-2.1.6-sources.jar" + } + }, + "org_objenesis_objenesis_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_objenesis_objenesis_3_3", + "sha256": "02dfd0b0439a5591e35b708ed2f5474eb0948f53abf74637e959b8e4ef69bfeb", + "urls": [ + "https://repo1.maven.org/maven2/org/objenesis/objenesis/3.3/objenesis-3.3.jar" + ], + "downloaded_file_path": "org/objenesis/objenesis/3.3/objenesis-3.3.jar" + } + }, + "org_openjdk_jmh_jmh_generator_annprocess": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_openjdk_jmh_jmh_generator_annprocess", + "generating_repository": "maven", + "target_name": "org_openjdk_jmh_jmh_generator_annprocess" + } + }, + "com_amazonaws_aws_java_sdk_s3_jar_sources_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_s3_jar_sources_1_12_544", + "sha256": "b91ef0fec99308cb3216fac69f9bb1a84149f05ab9b59e705107f492c02b4f64", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-s3/1.12.544/aws-java-sdk-s3-1.12.544-sources.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-s3/1.12.544/aws-java-sdk-s3-1.12.544-sources.jar" + } + }, + "com_github_docker_java_docker_java_transport_jersey_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_jersey_jar_sources_3_3_3", + "sha256": "05a26581bdde6519c4d87aaae7569eebd713f5fda9f8fa28b51216d2d364a18b", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport-jersey/3.3.3/docker-java-transport-jersey-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport-jersey/3.3.3/docker-java-transport-jersey-3.3.3-sources.jar" + } + }, + "io_netty_netty_transport_native_unix_common_jar_sources_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_unix_common_jar_sources_4_1_97_Final", + "sha256": "de1ea25a58fadbfa64061769281797cc9b133a48d0a039015d5b3d8f16cbfddc", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-unix-common/4.1.97.Final/netty-transport-native-unix-common-4.1.97.Final-sources.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-unix-common/4.1.97.Final/netty-transport-native-unix-common-4.1.97.Final-sources.jar" + } + }, + "org_codehaus_mojo_animal_sniffer_annotations_1_23": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_codehaus_mojo_animal_sniffer_annotations_1_23", + "sha256": "9ffe526bf43a6348e9d8b33b9cd6f580a7f5eed0cf055913007eda263de974d0", + "urls": [ + "https://repo1.maven.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar" + ], + "downloaded_file_path": "org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar" + } + }, + "net_sf_jopt_simple_jopt_simple_jar_sources_5_0_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_sf_jopt_simple_jopt_simple_jar_sources_5_0_4", + "sha256": "06b283801a5a94ef697b7f2c79a048c4e2f848b3daddda61cab74d882bdd97a5", + "urls": [ + "https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4-sources.jar" + ], + "downloaded_file_path": "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4-sources.jar" + } + }, + "com_fasterxml_jackson_dataformat_jackson_dataformat_cbor_2_12_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_dataformat_jackson_dataformat_cbor_2_12_6", + "sha256": "cfa008d15f052e69221e8c3193056ff95c3c594271321ccac8d72dc1a770619c", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.12.6/jackson-dataformat-cbor-2.12.6.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.12.6/jackson-dataformat-cbor-2.12.6.jar" + } + }, + "io_grpc_grpc_core_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_core_1_55_1", + "sha256": "c4782555fefb61c72898759a7d11f5f221811935bcf983efb478d796228b65dc", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-core/1.55.1/grpc-core-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-core/1.55.1/grpc-core-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-core/1.55.1/grpc-core-1.55.1.jar" + } + }, + "com_kohlschutter_junixsocket_junixsocket_native_common_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_kohlschutter_junixsocket_junixsocket_native_common_jar_sources_2_6_1", + "sha256": "4cef32dce262263e247d783f4ed7d90c5376190321e829ba5e985a8a27fbda06", + "urls": [ + "https://repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-native-common/2.6.1/junixsocket-native-common-2.6.1-sources.jar" + ], + "downloaded_file_path": "com/kohlschutter/junixsocket/junixsocket-native-common/2.6.1/junixsocket-native-common-2.6.1-sources.jar" + } + }, + "io_netty_netty_transport_native_kqueue_jar_osx_x86_64_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_native_kqueue_jar_osx_x86_64_4_1_97_Final", + "sha256": "6870051aca7fa4dc5d0f2938036215a269504c50d2e36c4af38fd00d22ad7d95", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final-osx-x86_64.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-native-kqueue/4.1.97.Final/netty-transport-native-kqueue-4.1.97.Final-osx-x86_64.jar" + } + }, + "io_reactivex_rxjava3_rxjava_jar_sources_3_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_reactivex_rxjava3_rxjava_jar_sources_3_1_6", + "sha256": "4479ead52c21dbfeb23646e378f77b7b396eda170619027d4213975e368b14ca", + "urls": [ + "https://repo1.maven.org/maven2/io/reactivex/rxjava3/rxjava/3.1.6/rxjava-3.1.6-sources.jar" + ], + "downloaded_file_path": "io/reactivex/rxjava3/rxjava/3.1.6/rxjava-3.1.6-sources.jar" + } + }, + "com_google_api_grpc_grpc_google_cloud_storage_v2_2_22_3_alpha": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_grpc_google_cloud_storage_v2_2_22_3_alpha", + "sha256": "c62c1c54e44d9e4622bd6f7f1285f8456efd50880c1e6d107f5e6680033138d0", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/grpc-google-cloud-storage-v2/2.22.3-alpha/grpc-google-cloud-storage-v2-2.22.3-alpha.jar", + "https://maven.google.com/com/google/api/grpc/grpc-google-cloud-storage-v2/2.22.3-alpha/grpc-google-cloud-storage-v2-2.22.3-alpha.jar" + ], + "downloaded_file_path": "com/google/api/grpc/grpc-google-cloud-storage-v2/2.22.3-alpha/grpc-google-cloud-storage-v2-2.22.3-alpha.jar" + } + }, + "com_github_jnr_jnr_posix_jar_sources_3_1_17": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_posix_jar_sources_3_1_17", + "sha256": "91c102c59c1d775adbd65353f5a795c4f48f6a8546a1845c679100fd5336db23", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-posix/3.1.17/jnr-posix-3.1.17-sources.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-posix/3.1.17/jnr-posix-3.1.17-sources.jar" + } + }, + "com_google_protobuf_protobuf_java_util_jar_sources_3_22_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_util_jar_sources_3_22_3", + "sha256": "5bb8af97af2131a2594c836baf3aadc0fd9640bdcf386c99bab901f6065e518f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util/3.22.3/protobuf-java-util-3.22.3-sources.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java-util/3.22.3/protobuf-java-util-3.22.3-sources.jar" + } + }, + "org_glassfish_hk2_hk2_api_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_api_2_6_1", + "sha256": "c2cb80a01e58440ae57d5ee59af4d4d94e5180e04aff112b0cb611c07d61e773", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-api/2.6.1/hk2-api-2.6.1.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-api/2.6.1/hk2-api-2.6.1.jar" + } + }, + "com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_10_3", + "sha256": "8099caad4ae189525ef94d337d72d3e888abefabbbacbc9f3d2f096d534f2fb5", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.10.3/jackson-module-jaxb-annotations-2.10.3.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.10.3/jackson-module-jaxb-annotations-2.10.3.jar" + } + }, + "org_apache_httpcomponents_httpclient_jar_sources_4_5_13": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpclient_jar_sources_4_5_13", + "sha256": "b1e9194fd83ce135831e28346731d9644cb2a08dea37ada2aa56ceb8f1b0c566", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13-sources.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13-sources.jar" + } + }, + "com_google_api_grpc_proto_google_iam_v1_1_14_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_grpc_proto_google_iam_v1_1_14_1", + "sha256": "65929519b53c68a1fba00091e34e441e11ee532bbe3790873f2b9e26f81cf98a", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-iam-v1/1.14.1/proto-google-iam-v1-1.14.1.jar", + "https://maven.google.com/com/google/api/grpc/proto-google-iam-v1/1.14.1/proto-google-iam-v1-1.14.1.jar" + ], + "downloaded_file_path": "com/google/api/grpc/proto-google-iam-v1/1.14.1/proto-google-iam-v1-1.14.1.jar" + } + }, + "software_amazon_awssdk_netty_nio_client_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_netty_nio_client_2_20_78", + "sha256": "56999d51ff6b3efdb5b09241a126a466c96f3d93f629e94b2db5634da2b6c659", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/netty-nio-client/2.20.78/netty-nio-client-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/netty-nio-client/2.20.78/netty-nio-client-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/netty-nio-client/2.20.78/netty-nio-client-2.20.78.jar" + } + }, + "com_esotericsoftware_kryo_jar_sources_5_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_kryo_jar_sources_5_5_0", + "sha256": "a7fe17d9e5c3f18ba2070b1356aeafc3f1626e8ebb6161a70d84c2f17adcd072", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/kryo/5.5.0/kryo-5.5.0-sources.jar" + ], + "downloaded_file_path": "com/esotericsoftware/kryo/5.5.0/kryo-5.5.0-sources.jar" + } + }, + "org_mockito_mockito_core": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_mockito_mockito_core", + "generating_repository": "maven", + "target_name": "org_mockito_mockito_core" + } + }, + "io_grpc_grpc_context_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_context_1_55_1", + "sha256": "541ec1d7ad3389f0b302461432a44b16fc1329153cd0e16faf2d2028b446340d", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-context/1.55.1/grpc-context-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-context/1.55.1/grpc-context-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-context/1.55.1/grpc-context-1.55.1.jar" + } + }, + "com_google_jimfs_jimfs_1_3_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_jimfs_jimfs_1_3_0", + "sha256": "82494408bb513f5512652e7b7f63d6f31f01eff57ce35c878644ffc2d25aee4f", + "urls": [ + "https://repo1.maven.org/maven2/com/google/jimfs/jimfs/1.3.0/jimfs-1.3.0.jar" + ], + "downloaded_file_path": "com/google/jimfs/jimfs/1.3.0/jimfs-1.3.0.jar" + } + }, + "org_ow2_asm_asm_analysis_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_analysis_9_2", + "sha256": "878fbe521731c072d14d2d65b983b1beae6ad06fda0007b6a8bae81f73f433c4", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar" + } + }, + "com_esotericsoftware_reflectasm_jar_sources_1_11_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_reflectasm_jar_sources_1_11_9", + "sha256": "8fc29f5069a1a43c38eb28b54f6850995734f31962813b13ac8a9b7a0624b45b", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/reflectasm/1.11.9/reflectasm-1.11.9-sources.jar" + ], + "downloaded_file_path": "com/esotericsoftware/reflectasm/1.11.9/reflectasm-1.11.9-sources.jar" + } + }, + "net_bytebuddy_byte_buddy_agent_jar_sources_1_9_7": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_bytebuddy_byte_buddy_agent_jar_sources_1_9_7", + "sha256": "f1ffcb60fb0cb3de2ab4ba36b3588f9c0f12b24e8eeb59f76c57664f42eaae80", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.9.7/byte-buddy-agent-1.9.7-sources.jar" + ], + "downloaded_file_path": "net/bytebuddy/byte-buddy-agent/1.9.7/byte-buddy-agent-1.9.7-sources.jar" + } + }, + "org_mockito_mockito_core_2_25_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_mockito_mockito_core_2_25_0", + "sha256": "28028d70cc27d61442948fcb3d249d9df5b37c47aa0b82490a3d049094ff411f", + "urls": [ + "https://repo1.maven.org/maven2/org/mockito/mockito-core/2.25.0/mockito-core-2.25.0.jar" + ], + "downloaded_file_path": "org/mockito/mockito-core/2.25.0/mockito-core-2.25.0.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http_1_17_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_oauth2_http_1_17_0", + "sha256": "b8148e1af0c4197aea707d0166b4ed70a75b8eee7246be7eb0228a4834095e70", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.17.0/google-auth-library-oauth2-http-1.17.0.jar", + "https://maven.google.com/com/google/auth/google-auth-library-oauth2-http/1.17.0/google-auth-library-oauth2-http-1.17.0.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-oauth2-http/1.17.0/google-auth-library-oauth2-http-1.17.0.jar" + } + }, + "io_netty_netty_buffer": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_buffer", + "generating_repository": "maven", + "target_name": "io_netty_netty_buffer" + } + }, + "com_amazonaws_jmespath_java_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_jmespath_java_1_12_544", + "sha256": "b707d67e8fcc87ffdf426bbe61bbe60ae97e865d35d6cec429a934d47fa2976c", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/jmespath-java/1.12.544/jmespath-java-1.12.544.jar" + ], + "downloaded_file_path": "com/amazonaws/jmespath-java/1.12.544/jmespath-java-1.12.544.jar" + } + }, + "com_google_errorprone_error_prone_check_api_jar_sources_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_check_api_jar_sources_2_22_0", + "sha256": "962656ccdd75e0f9891f5fbc5c53ea1ea381234eaadee50d3d04bafc094f0190", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0-sources.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_check_api/2.22.0/error_prone_check_api-2.22.0-sources.jar" + } + }, + "org_glassfish_hk2_osgi_resource_locator_jar_sources_1_0_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_osgi_resource_locator_jar_sources_1_0_3", + "sha256": "603d0e07134189505c76a8c8d5d4451a91bf1327a05f1f5bcea09bad61bd507e", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/osgi-resource-locator/1.0.3/osgi-resource-locator-1.0.3-sources.jar" + } + }, + "io_opencensus_opencensus_contrib_http_util_jar_sources_0_31_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_opencensus_opencensus_contrib_http_util_jar_sources_0_31_1", + "sha256": "d55afd5f96dc724bd903a77a38b0a344d0e59f02a64b9ab2f32618bc582ea924", + "urls": [ + "https://repo1.maven.org/maven2/io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1-sources.jar" + ], + "downloaded_file_path": "io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1-sources.jar" + } + }, + "io_grpc_grpc_testing_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_testing_jar_sources_1_56_1", + "sha256": "0e1ee432e6ec26940bce1726d47344772ba2afd60af93750d0fad54596c936ee", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-testing/1.56.1/grpc-testing-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-testing/1.56.1/grpc-testing-1.56.1-sources.jar" + } + }, + "io_prometheus_simpleclient_tracer_otel_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_tracer_otel_0_15_0", + "sha256": "0595251da49aa7997777b365ffdf97f5e2e88cd7f0dacf49add91b4fc8222b50", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel/0.15.0/simpleclient_tracer_otel-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_tracer_otel/0.15.0/simpleclient_tracer_otel-0.15.0.jar" + } + }, + "org_apache_httpcomponents_httpclient_4_5_13": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpclient_4_5_13", + "sha256": "6fe9026a566c6a5001608cf3fc32196641f6c1e5e1986d1037ccdbd5f31ef743", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar" + } + }, + "org_apache_httpcomponents_httpclient_4_5_14": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_httpcomponents_httpclient_4_5_14", + "sha256": "c8bc7e1c51a6d4ce72f40d2ebbabf1c4b68bfe76e732104b04381b493478e9d6", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar", + "https://maven.google.com/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar" + ], + "downloaded_file_path": "org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar" + } + }, + "com_google_guava_guava_jar_sources_32_1_1_jre": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_guava_jar_sources_32_1_1_jre", + "sha256": "5e7b6cebd2e9087a536c1054bf52a2e6a49c284772421f146640cfadc54ba573", + "urls": [ + "https://repo1.maven.org/maven2/com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre-sources.jar" + ], + "downloaded_file_path": "com/google/guava/guava/32.1.1-jre/guava-32.1.1-jre-sources.jar" + } + }, + "com_github_docker_java_docker_java_api_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_api_3_3_3", + "sha256": "8be2f41ddc33306b83f91e413fc1a07cee02db05e4c493456de3399e5bcb7b6c", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-api/3.3.3/docker-java-api-3.3.3.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-api/3.3.3/docker-java-api-3.3.3.jar" + } + }, + "io_grpc_grpc_core_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_core_1_56_1", + "sha256": "fddeafc25019b7e5600028d6398e9ed7383056d9aecaf95aec5c39c5085a4830", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar" + } + }, + "com_kohlschutter_junixsocket_junixsocket_native_common_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_kohlschutter_junixsocket_junixsocket_native_common_2_6_1", + "sha256": "61fbbd6cfd2b6df65c0e7b19b16ff4f755d6cb1d333b566f4286407f12f18670", + "urls": [ + "https://repo1.maven.org/maven2/com/kohlschutter/junixsocket/junixsocket-native-common/2.6.1/junixsocket-native-common-2.6.1.jar" + ], + "downloaded_file_path": "com/kohlschutter/junixsocket/junixsocket-native-common/2.6.1/junixsocket-native-common-2.6.1.jar" + } + }, + "com_google_cloud_google_cloud_storage_2_22_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_cloud_google_cloud_storage_2_22_3", + "sha256": "a9b6e2cf02c37dd3a09ca4b2a091fd07eb5487b95995691df898ec223bdad5ab", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-storage/2.22.3/google-cloud-storage-2.22.3.jar", + "https://maven.google.com/com/google/cloud/google-cloud-storage/2.22.3/google-cloud-storage-2.22.3.jar" + ], + "downloaded_file_path": "com/google/cloud/google-cloud-storage/2.22.3/google-cloud-storage-2.22.3.jar" + } + }, + "io_prometheus_simpleclient_hotspot_jar_sources_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_hotspot_jar_sources_0_15_0", + "sha256": "352f4a0940814a22691132e6b7abcea4add6a8ce322b22a88be5494064036437", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient_hotspot/0.15.0/simpleclient_hotspot-0.15.0-sources.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient_hotspot/0.15.0/simpleclient_hotspot-0.15.0-sources.jar" + } + }, + "jakarta_xml_bind_jakarta_xml_bind_api_2_3_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_xml_bind_jakarta_xml_bind_api_2_3_2", + "sha256": "69156304079bdeed9fc0ae3b39389f19b3cc4ba4443bc80508995394ead742ea", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar" + ], + "downloaded_file_path": "jakarta/xml/bind/jakarta.xml.bind-api/2.3.2/jakarta.xml.bind-api-2.3.2.jar" + } + }, + "com_google_errorprone_error_prone_annotation_jar_sources_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotation_jar_sources_2_22_0", + "sha256": "45507d9cb6e18174656fd09f5a34033700ba75562bfcb188ec1706da10c10157", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0-sources.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_annotation/2.22.0/error_prone_annotation-2.22.0-sources.jar" + } + }, + "org_pcollections_pcollections_3_1_4": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_pcollections_pcollections_3_1_4", + "sha256": "34f579ba075c8da2c8a0fedd0f04e21eac2fb6c660d90d0fabb573e8b4dc6918", + "urls": [ + "https://repo1.maven.org/maven2/org/pcollections/pcollections/3.1.4/pcollections-3.1.4.jar" + ], + "downloaded_file_path": "org/pcollections/pcollections/3.1.4/pcollections-3.1.4.jar" + } + }, + "io_grpc_grpc_context": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_context", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_context" + } + }, + "javax_cache_cache_api_1_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~javax_cache_cache_api_1_1_1", + "sha256": "9f34e007edfa82a7b2a2e1b969477dcf5099ce7f4f926fb54ce7e27c4a0cd54b", + "urls": [ + "https://repo1.maven.org/maven2/javax/cache/cache-api/1.1.1/cache-api-1.1.1.jar" + ], + "downloaded_file_path": "javax/cache/cache-api/1.1.1/cache-api-1.1.1.jar" + } + }, + "org_ow2_asm_asm_util_jar_sources_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_util_jar_sources_9_2", + "sha256": "b631d4561a24e84eaeee2c0495added214e4961ed328b02300f7d9b1f407c853", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.2/asm-util-9.2-sources.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-util/9.2/asm-util-9.2-sources.jar" + } + }, + "com_google_auth_google_auth_library_credentials_jar_sources_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_credentials_jar_sources_1_19_0", + "sha256": "f83533db6683adaf971f98dad16d74e8ac34909e5085b720e3c45542a3f1552c", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0-sources.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0-sources.jar" + } + }, + "io_netty_netty_transport_classes_epoll_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport_classes_epoll_4_1_97_Final", + "sha256": "ee65fa17fe65f18fd22269f92bddad85bfb3a263cf65eba01e116a2f30b86ff5", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final.jar" + } + }, + "org_ow2_asm_asm_analysis_jar_sources_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_analysis_jar_sources_9_2", + "sha256": "c5a6764bbcee9e4bcd8ee1ea33808f96b8b587371f329aa75a2f541f2ee1b0d5", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2-sources.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2-sources.jar" + } + }, + "com_google_code_findbugs_jsr305": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_findbugs_jsr305", + "generating_repository": "maven", + "target_name": "com_google_code_findbugs_jsr305" + } + }, + "com_amazonaws_aws_java_sdk_secretsmanager_jar_sources_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_secretsmanager_jar_sources_1_12_544", + "sha256": "d264b64ad371a864f8ba3a0af6876abb8f4ab3fe293812bab84a24e27d0b0982", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-secretsmanager/1.12.544/aws-java-sdk-secretsmanager-1.12.544-sources.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-secretsmanager/1.12.544/aws-java-sdk-secretsmanager-1.12.544-sources.jar" + } + }, + "com_google_auth_google_auth_library_oauth2_http_jar_sources_1_19_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auth_google_auth_library_oauth2_http_jar_sources_1_19_0", + "sha256": "3aabf134e1c21fb8b3573897f0aa9136ca58ebe0c76fb086ef9169b28e9f707e", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0-sources.jar" + ], + "downloaded_file_path": "com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0-sources.jar" + } + }, + "io_netty_netty_transport": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_transport", + "generating_repository": "maven", + "target_name": "io_netty_netty_transport" + } + }, + "commons_logging_commons_logging_1_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_logging_commons_logging_1_2", + "sha256": "daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636", + "urls": [ + "https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar" + ], + "downloaded_file_path": "commons-logging/commons-logging/1.2/commons-logging-1.2.jar" + } + }, + "jakarta_ws_rs_jakarta_ws_rs_api_2_1_6": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_ws_rs_jakarta_ws_rs_api_2_1_6", + "sha256": "4cea299c846c8a6e6470cbfc2f7c391bc29b9caa2f9264ac1064ba91691f4adf", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/ws/rs/jakarta.ws.rs-api/2.1.6/jakarta.ws.rs-api-2.1.6.jar" + ], + "downloaded_file_path": "jakarta/ws/rs/jakarta.ws.rs-api/2.1.6/jakarta.ws.rs-api-2.1.6.jar" + } + }, + "com_github_jnr_jffi": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jffi", + "generating_repository": "maven", + "target_name": "com_github_jnr_jffi" + } + }, + "com_googlecode_json_simple_json_simple_jar_sources_1_1_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_googlecode_json_simple_json_simple_jar_sources_1_1_1", + "sha256": "26960e02aeb64dc06ada259495ad2a553dd53ded9aaf6a84c3f5974a56ce24d6", + "urls": [ + "https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar" + ], + "downloaded_file_path": "com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1-sources.jar" + } + }, + "com_google_api_gax_2_28_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_gax_2_28_1", + "sha256": "dddd191a2621bc5a747800c417005618f9c1f03d3d5056cb0208905400f17fac", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax/2.28.1/gax-2.28.1.jar", + "https://maven.google.com/com/google/api/gax/2.28.1/gax-2.28.1.jar" + ], + "downloaded_file_path": "com/google/api/gax/2.28.1/gax-2.28.1.jar" + } + }, + "com_github_docker_java_docker_java_transport_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_transport_jar_sources_3_3_3", + "sha256": "0ec44c8b9349365c3dd2740ad41f9e65af079fd9a68bfc68a2d3efe5776ff687", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-transport/3.3.3/docker-java-transport-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-transport/3.3.3/docker-java-transport-3.3.3-sources.jar" + } + }, + "software_amazon_awssdk_metrics_spi_2_20_78": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_awssdk_metrics_spi_2_20_78", + "sha256": "41680096cb566090be0504eaf207dab91d680c16d57f68239260860871d7ab8f", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/awssdk/metrics-spi/2.20.78/metrics-spi-2.20.78.jar", + "https://maven.google.com/software/amazon/awssdk/metrics-spi/2.20.78/metrics-spi-2.20.78.jar" + ], + "downloaded_file_path": "software/amazon/awssdk/metrics-spi/2.20.78/metrics-spi-2.20.78.jar" + } + }, + "org_conscrypt_conscrypt_openjdk_uber_2_5_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_conscrypt_conscrypt_openjdk_uber_2_5_2", + "sha256": "eaf537d98e033d0f0451cd1b8cc74e02d7b55ec882da63c88060d806ba89c348", + "urls": [ + "https://repo1.maven.org/maven2/org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar", + "https://maven.google.com/org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar" + ], + "downloaded_file_path": "org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar" + } + }, + "com_github_ben_manes_caffeine_caffeine_jar_sources_3_0_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_ben_manes_caffeine_caffeine_jar_sources_3_0_5", + "sha256": "2cca8d1cdfdf33c1d0eec0214cdc6d93ff8a95136bf798465b10a5924a69bc65", + "urls": [ + "https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5-sources.jar" + ], + "downloaded_file_path": "com/github/ben-manes/caffeine/caffeine/3.0.5/caffeine-3.0.5-sources.jar" + } + }, + "com_github_docker_java_docker_java_api_jar_sources_3_3_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java_api_jar_sources_3_3_3", + "sha256": "cb262504c43a1ed7f79235a9f93611c322016bd6ca91a0ab37cfe21a55460a8b", + "urls": [ + "https://repo1.maven.org/maven2/com/github/docker-java/docker-java-api/3.3.3/docker-java-api-3.3.3-sources.jar" + ], + "downloaded_file_path": "com/github/docker-java/docker-java-api/3.3.3/docker-java-api-3.3.3-sources.jar" + } + }, + "org_checkerframework_checker_qual": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_checkerframework_checker_qual", + "generating_repository": "maven", + "target_name": "org_checkerframework_checker_qual" + } + }, + "org_glassfish_hk2_hk2_api_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_api_jar_sources_2_6_1", + "sha256": "636e56f6454a7c680271dd8e2e49d1fd50625bb9e206555a14ccf900188cc18c", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-api/2.6.1/hk2-api-2.6.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-api/2.6.1/hk2-api-2.6.1-sources.jar" + } + }, + "io_grpc_grpc_netty_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_netty_jar_sources_1_56_1", + "sha256": "3ce30acc50ab39f160948bae09c1c832093d6b23a533a20d1473466ca30a3783", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-netty/1.56.1/grpc-netty-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-netty/1.56.1/grpc-netty-1.56.1-sources.jar" + } + }, + "junit_junit_jar_sources_4_13_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~junit_junit_jar_sources_4_13_2", + "sha256": "34181df6482d40ea4c046b063cb53c7ffae94bdf1b1d62695bdf3adf9dea7e3a", + "urls": [ + "https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2-sources.jar" + ], + "downloaded_file_path": "junit/junit/4.13.2/junit-4.13.2-sources.jar" + } + }, + "org_ow2_asm_asm_commons_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_commons_9_2", + "sha256": "be4ce53138a238bb522cd781cf91f3ba5ce2f6ca93ec62d46a162a127225e0a6", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar" + } + }, + "com_google_protobuf_protobuf_java_3_23_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_protobuf_protobuf_java_3_23_1", + "sha256": "d9fd335a65165c760f53ae718878448627ce742ab6e9102dffe9bc2ea7b136ca", + "urls": [ + "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.23.1/protobuf-java-3.23.1.jar", + "https://maven.google.com/com/google/protobuf/protobuf-java/3.23.1/protobuf-java-3.23.1.jar" + ], + "downloaded_file_path": "com/google/protobuf/protobuf-java/3.23.1/protobuf-java-3.23.1.jar" + } + }, + "org_luaj_luaj_jse_3_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_luaj_luaj_jse_3_0_1", + "sha256": "9b1f0a3e8f68427c6d74c2bf00ae0e6dbfce35994d3001fed4cef6ecda50be55", + "urls": [ + "https://repo1.maven.org/maven2/org/luaj/luaj-jse/3.0.1/luaj-jse-3.0.1.jar" + ], + "downloaded_file_path": "org/luaj/luaj-jse/3.0.1/luaj-jse-3.0.1.jar" + } + }, + "org_glassfish_hk2_hk2_locator_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_hk2_locator_jar_sources_2_6_1", + "sha256": "d76811aeabe487e35001fb4a0ab3d986a091c331f4d61962c33f6c98f94e5053", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/hk2-locator/2.6.1/hk2-locator-2.6.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/hk2-locator/2.6.1/hk2-locator-2.6.1-sources.jar" + } + }, + "org_reflections_reflections_jar_sources_0_10_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_reflections_reflections_jar_sources_0_10_2", + "sha256": "7c8f0b91e298556ac8eebcbbb33de537baa146d80a7e5a6500e44cd8f76a91f4", + "urls": [ + "https://repo1.maven.org/maven2/org/reflections/reflections/0.10.2/reflections-0.10.2-sources.jar" + ], + "downloaded_file_path": "org/reflections/reflections/0.10.2/reflections-0.10.2-sources.jar" + } + }, + "org_apache_commons_commons_pool2": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_pool2", + "generating_repository": "maven", + "target_name": "org_apache_commons_commons_pool2" + } + }, + "io_github_java_diff_utils_java_diff_utils_4_12": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_github_java_diff_utils_java_diff_utils_4_12", + "sha256": "9990a2039778f6b4cc94790141c2868864eacee0620c6c459451121a901cd5b5", + "urls": [ + "https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar" + ], + "downloaded_file_path": "io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar" + } + }, + "maven": { + "bzlFile": "@@rules_jvm_external~5.3//:coursier.bzl", + "ruleClassName": "pinned_coursier_fetch", + "attributes": { + "name": "rules_jvm_external~5.3~maven~maven", + "repositories": [ + "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" + ], + "artifacts": [ + "{ \"group\": \"com.amazonaws\", \"artifact\": \"aws-java-sdk-s3\", \"version\": \"1.12.544\" }", + "{ \"group\": \"com.amazonaws\", \"artifact\": \"aws-java-sdk-secretsmanager\", \"version\": \"1.12.544\" }", + "{ \"group\": \"com.fasterxml.jackson.core\", \"artifact\": \"jackson-databind\", \"version\": \"2.15.0\" }", + "{ \"group\": \"com.github.ben-manes.caffeine\", \"artifact\": \"caffeine\", \"version\": \"2.9.0\" }", + "{ \"group\": \"com.github.docker-java\", \"artifact\": \"docker-java\", \"version\": \"3.3.3\" }", + "{ \"group\": \"com.github.fppt\", \"artifact\": \"jedis-mock\", \"version\": \"1.0.10\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jffi\", \"version\": \"1.3.11\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jffi\", \"version\": \"1.3.11\", \"packaging\": \"jar\", \"classifier\": \"native\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-constants\", \"version\": \"0.10.4\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-ffi\", \"version\": \"2.2.14\" }", + "{ \"group\": \"com.github.jnr\", \"artifact\": \"jnr-posix\", \"version\": \"3.1.17\" }", + "{ \"group\": \"com.github.pcj\", \"artifact\": \"google-options\", \"version\": \"1.0.0\" }", + "{ \"group\": \"com.github.serceman\", \"artifact\": \"jnr-fuse\", \"version\": \"0.5.7\" }", + "{ \"group\": \"com.github.luben\", \"artifact\": \"zstd-jni\", \"version\": \"1.5.5-7\" }", + "{ \"group\": \"com.github.oshi\", \"artifact\": \"oshi-core\", \"version\": \"6.4.5\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-credentials\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.auth\", \"artifact\": \"google-auth-library-oauth2-http\", \"version\": \"1.19.0\" }", + "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", + "{ \"group\": \"com.google.code.gson\", \"artifact\": \"gson\", \"version\": \"2.10.1\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_annotations\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.errorprone\", \"artifact\": \"error_prone_core\", \"version\": \"2.22.0\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"failureaccess\", \"version\": \"1.0.1\" }", + "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"32.1.1-jre\" }", + "{ \"group\": \"com.google.j2objc\", \"artifact\": \"j2objc-annotations\", \"version\": \"2.8\" }", + "{ \"group\": \"com.google.jimfs\", \"artifact\": \"jimfs\", \"version\": \"1.3.0\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java-util\", \"version\": \"3.19.1\" }", + "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\", \"version\": \"3.19.1\" }", + "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"1.1.5\" }", + "{ \"group\": \"org.slf4j\", \"artifact\": \"slf4j-simple\", \"version\": \"2.0.9\" }", + "{ \"group\": \"com.googlecode.json-simple\", \"artifact\": \"json-simple\", \"version\": \"1.1.1\" }", + "{ \"group\": \"com.jayway.jsonpath\", \"artifact\": \"json-path\", \"version\": \"2.8.0\" }", + "{ \"group\": \"org.bouncycastle\", \"artifact\": \"bcprov-jdk15on\", \"version\": \"1.70\" }", + "{ \"group\": \"net.jcip\", \"artifact\": \"jcip-annotations\", \"version\": \"1.0\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-buffer\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-http2\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-codec-socks\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-common\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-handler-proxy\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-resolver\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-epoll\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-kqueue\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.netty\", \"artifact\": \"netty-transport-native-unix-common\", \"version\": \"4.1.97.Final\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-api\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-auth\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-core\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-context\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-stub\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-testing\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-services\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-netty-shaded\", \"version\": \"1.56.1\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient\", \"version\": \"0.15.0\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient_hotspot\", \"version\": \"0.15.0\" }", + "{ \"group\": \"io.prometheus\", \"artifact\": \"simpleclient_httpserver\", \"version\": \"0.15.0\" }", + "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13.2\" }", + "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", + "{ \"group\": \"net.javacrumbs.future-converter\", \"artifact\": \"future-converter-java8-guava\", \"version\": \"1.2.0\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-compress\", \"version\": \"1.23.0\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-pool2\", \"version\": \"2.11.1\" }", + "{ \"group\": \"org.apache.commons\", \"artifact\": \"commons-lang3\", \"version\": \"3.13.0\" }", + "{ \"group\": \"commons-io\", \"artifact\": \"commons-io\", \"version\": \"2.13.0\" }", + "{ \"group\": \"me.dinowernli\", \"artifact\": \"java-grpc-prometheus\", \"version\": \"0.6.0\" }", + "{ \"group\": \"org.apache.tomcat\", \"artifact\": \"annotations-api\", \"version\": \"6.0.53\" }", + "{ \"group\": \"org.checkerframework\", \"artifact\": \"checker-qual\", \"version\": \"3.38.0\" }", + "{ \"group\": \"org.mockito\", \"artifact\": \"mockito-core\", \"version\": \"2.25.0\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-core\", \"version\": \"1.37\" }", + "{ \"group\": \"org.openjdk.jmh\", \"artifact\": \"jmh-generator-annprocess\", \"version\": \"1.37\" }", + "{ \"group\": \"org.redisson\", \"artifact\": \"redisson\", \"version\": \"3.23.4\" }", + "{ \"group\": \"org.threeten\", \"artifact\": \"threetenbp\", \"version\": \"1.6.8\" }", + "{ \"group\": \"org.xerial\", \"artifact\": \"sqlite-jdbc\", \"version\": \"3.34.0\" }", + "{ \"group\": \"org.jetbrains\", \"artifact\": \"annotations\", \"version\": \"16.0.2\" }", + "{ \"group\": \"org.yaml\", \"artifact\": \"snakeyaml\", \"version\": \"2.2\" }", + "{ \"group\": \"org.projectlombok\", \"artifact\": \"lombok\", \"version\": \"1.18.30\" }" + ], + "fetch_sources": true, + "fetch_javadoc": false, + "generate_compat_repositories": false, + "maven_install_json": "@@//:maven_install.json", + "override_targets": {}, + "strict_visibility": false, + "strict_visibility_value": [ + "@@//visibility:private" + ], + "jetify": false, + "jetify_include_list": [ + "*" + ], + "additional_netrc_lines": [], + "fail_if_repin_required": true, + "use_starlark_android_rules": false, + "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", + "duplicate_version_warning": "warn" + } + }, + "com_github_jnr_jnr_a64asm_1_0_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_jnr_jnr_a64asm_1_0_0", + "sha256": "53ae5ea7fa5c284e8279aa348e7b9de4548b0cae10bfd058fa217c791875e4cf", + "urls": [ + "https://repo1.maven.org/maven2/com/github/jnr/jnr-a64asm/1.0.0/jnr-a64asm-1.0.0.jar" + ], + "downloaded_file_path": "com/github/jnr/jnr-a64asm/1.0.0/jnr-a64asm-1.0.0.jar" + } + }, + "io_grpc_grpc_protobuf_jar_sources_1_56_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_protobuf_jar_sources_1_56_1", + "sha256": "62b6675a187374f8f4ea8d645d602930b587383fbb0979fa19e708f885499934", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1-sources.jar" + ], + "downloaded_file_path": "io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1-sources.jar" + } + }, + "com_esotericsoftware_kryo_5_5_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_esotericsoftware_kryo_5_5_0", + "sha256": "4b902a21d99f7b4c32e6f7400e91f9284fd184db881bb9e18328e14d8127f7f9", + "urls": [ + "https://repo1.maven.org/maven2/com/esotericsoftware/kryo/5.5.0/kryo-5.5.0.jar" + ], + "downloaded_file_path": "com/esotericsoftware/kryo/5.5.0/kryo-5.5.0.jar" + } + }, + "io_prometheus_simpleclient_httpserver": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_httpserver", + "generating_repository": "maven", + "target_name": "io_prometheus_simpleclient_httpserver" + } + }, + "io_prometheus_simpleclient_0_15_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_prometheus_simpleclient_0_15_0", + "sha256": "a43d6c00e3964a7063c1360ddcddc598df4f8e659a8313b27f90e4c555badb1d", + "urls": [ + "https://repo1.maven.org/maven2/io/prometheus/simpleclient/0.15.0/simpleclient-0.15.0.jar" + ], + "downloaded_file_path": "io/prometheus/simpleclient/0.15.0/simpleclient-0.15.0.jar" + } + }, + "com_google_cloud_google_cloud_core_grpc_2_18_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_cloud_google_cloud_core_grpc_2_18_1", + "sha256": "3021f5ac856552155edfb459a1f4c0b0bf3c5363e6fa4923a82af3e531ff33ad", + "urls": [ + "https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-grpc/2.18.1/google-cloud-core-grpc-2.18.1.jar", + "https://maven.google.com/com/google/cloud/google-cloud-core-grpc/2.18.1/google-cloud-core-grpc-2.18.1.jar" + ], + "downloaded_file_path": "com/google/cloud/google-cloud-core-grpc/2.18.1/google-cloud-core-grpc-2.18.1.jar" + } + }, + "jakarta_annotation_jakarta_annotation_api_1_3_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~jakarta_annotation_jakarta_annotation_api_1_3_5", + "sha256": "85fb03fc054cdf4efca8efd9b6712bbb418e1ab98241c4539c8585bbc23e1b8a", + "urls": [ + "https://repo1.maven.org/maven2/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar" + ], + "downloaded_file_path": "jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar" + } + }, + "org_bouncycastle_bcprov_jdk15on": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcprov_jdk15on", + "generating_repository": "maven", + "target_name": "org_bouncycastle_bcprov_jdk15on" + } + }, + "io_grpc_grpc_auth": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_auth", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_auth" + } + }, + "org_glassfish_hk2_external_aopalliance_repackaged_jar_sources_2_6_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_hk2_external_aopalliance_repackaged_jar_sources_2_6_1", + "sha256": "13392e5ad2540a5718abb1dc7c380ebd754c1b95c7d6140dd38bfeade1e6dd21", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged/2.6.1/aopalliance-repackaged-2.6.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/hk2/external/aopalliance-repackaged/2.6.1/aopalliance-repackaged-2.6.1-sources.jar" + } + }, + "net_jcip_jcip_annotations_jar_sources_1_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_jcip_jcip_annotations_jar_sources_1_0", + "sha256": "e3ad6ae439e3cf8a25372de838efaa1a95f8ef9b5053d5d94fafe89c8c09814e", + "urls": [ + "https://repo1.maven.org/maven2/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar" + ], + "downloaded_file_path": "net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar" + } + }, + "org_glassfish_jersey_core_jersey_common_jar_sources_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_core_jersey_common_jar_sources_2_30_1", + "sha256": "bbc91b531c2aa801e578fc6737498159071f3030688714e44ed80001e17813f7", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-common/2.30.1/jersey-common-2.30.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/core/jersey-common/2.30.1/jersey-common-2.30.1-sources.jar" + } + }, + "org_yaml_snakeyaml_2_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_yaml_snakeyaml_2_2", + "sha256": "1467931448a0817696ae2805b7b8b20bfb082652bf9c4efaed528930dc49389b", + "urls": [ + "https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar" + ], + "downloaded_file_path": "org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar" + } + }, + "org_glassfish_jersey_connectors_jersey_apache_connector_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_connectors_jersey_apache_connector_2_30_1", + "sha256": "28e87f2edc5284e293072941cea5e8ff462bb60f41c67b4ad7b906de2a7a8bd8", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/connectors/jersey-apache-connector/2.30.1/jersey-apache-connector-2.30.1.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/connectors/jersey-apache-connector/2.30.1/jersey-apache-connector-2.30.1.jar" + } + }, + "com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_15_2", + "sha256": "37795cc1e8cb94b18d860dc3abd2e593617ce402149ae45aa89ed8bfb881c851", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.2/jackson-dataformat-yaml-2.15.2.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.2/jackson-dataformat-yaml-2.15.2.jar" + } + }, + "org_redisson_redisson": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_redisson_redisson", + "generating_repository": "maven", + "target_name": "org_redisson_redisson" + } + }, + "org_glassfish_jersey_core_jersey_common_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_core_jersey_common_2_30_1", + "sha256": "273c3ea4e3ff9b960eb8dbb7c74e0127436678e486ccd94a351729f22a249830", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-common/2.30.1/jersey-common-2.30.1.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/core/jersey-common/2.30.1/jersey-common-2.30.1.jar" + } + }, + "org_xerial_sqlite_jdbc": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_xerial_sqlite_jdbc", + "generating_repository": "maven", + "target_name": "org_xerial_sqlite_jdbc" + } + }, + "com_amazonaws_aws_java_sdk_kms_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_kms_1_12_544", + "sha256": "a79a3768887ea675f2e7b617b361d5250b2128413dbd5d8fa43755a9ecc1b032", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-kms/1.12.544/aws-java-sdk-kms-1.12.544.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-kms/1.12.544/aws-java-sdk-kms-1.12.544.jar" + } + }, + "net_bytebuddy_byte_buddy_1_14_5": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_bytebuddy_byte_buddy_1_14_5", + "sha256": "e99761a526df0fefbbd3fe14436b0f953000cdfa5151dc63c0b18d37d9c46f1c", + "urls": [ + "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5.jar" + ], + "downloaded_file_path": "net/bytebuddy/byte-buddy/1.14.5/byte-buddy-1.14.5.jar" + } + }, + "junit_junit": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~junit_junit", + "generating_repository": "maven", + "target_name": "junit_junit" + } + }, + "com_google_auto_service_auto_service_annotations_jar_sources_1_0_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_auto_service_auto_service_annotations_jar_sources_1_0_1", + "sha256": "b013ca159b0fea3a0041d3d5fbb3b7e49a819da80a172a01fb17dd28fd98e72b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1-sources.jar" + ], + "downloaded_file_path": "com/google/auto/service/auto-service-annotations/1.0.1/auto-service-annotations-1.0.1-sources.jar" + } + }, + "com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_jar_sources_2_10_3": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_jaxrs_jackson_jaxrs_base_jar_sources_2_10_3", + "sha256": "6b979c532efa4f68686d85779d7d1f6d4c3de1fa53fbe6996132812b813b1349", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.10.3/jackson-jaxrs-base-2.10.3-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.10.3/jackson-jaxrs-base-2.10.3-sources.jar" + } + }, + "org_apache_commons_commons_pool2_2_11_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_pool2_2_11_1", + "sha256": "ea0505ee7515e58b1ac0e686e4d1a5d9f7d808e251a61bc371aa0595b9963f83", + "urls": [ + "https://repo1.maven.org/maven2/org/apache/commons/commons-pool2/2.11.1/commons-pool2-2.11.1.jar" + ], + "downloaded_file_path": "org/apache/commons/commons-pool2/2.11.1/commons-pool2-2.11.1.jar" + } + }, + "com_google_errorprone_error_prone_annotations_2_22_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_annotations_2_22_0", + "sha256": "82a027b86541f58d1f9ee020cdf6bebe82acc7a267d3c53a2ea5cd6335932bbd", + "urls": [ + "https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0.jar" + ], + "downloaded_file_path": "com/google/errorprone/error_prone_annotations/2.22.0/error_prone_annotations-2.22.0.jar" + } + }, + "io_netty_netty_codec_http": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_codec_http", + "generating_repository": "maven", + "target_name": "io_netty_netty_codec_http" + } + }, + "io_grpc_grpc_services": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_services", + "generating_repository": "maven", + "target_name": "io_grpc_grpc_services" + } + }, + "org_glassfish_jersey_core_jersey_client_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_core_jersey_client_2_30_1", + "sha256": "fe0aa736ce216e9efb6e17392142b87e704cf09e75a0cb6b3fd2d146937225c1", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-client/2.30.1/jersey-client-2.30.1.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/core/jersey-client/2.30.1/jersey-client-2.30.1.jar" + } + }, + "org_ow2_asm_asm_commons_jar_sources_9_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_ow2_asm_asm_commons_jar_sources_9_2", + "sha256": "6d98839136be45d5b1ffdca0fd2647eb8eaf92cff576648cbbf96f08afd3ed6d", + "urls": [ + "https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.2/asm-commons-9.2-sources.jar" + ], + "downloaded_file_path": "org/ow2/asm/asm-commons/9.2/asm-commons-9.2-sources.jar" + } + }, + "net_jcip_jcip_annotations": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_jcip_jcip_annotations", + "generating_repository": "maven", + "target_name": "net_jcip_jcip_annotations" + } + }, + "org_bouncycastle_bcprov_jdk18on_1_75": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_bouncycastle_bcprov_jdk18on_1_75", + "sha256": "7f24018e9212dbda61c69212f8d7b1524c28efb978f10df590df3b4ccac47bd5", + "urls": [ + "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk18on/1.75/bcprov-jdk18on-1.75.jar" + ], + "downloaded_file_path": "org/bouncycastle/bcprov-jdk18on/1.75/bcprov-jdk18on-1.75.jar" + } + }, + "org_apache_commons_commons_compress": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_compress", + "generating_repository": "maven", + "target_name": "org_apache_commons_commons_compress" + } + }, + "net_javacrumbs_future_converter_future_converter_java8_common_jar_sources_1_2_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~net_javacrumbs_future_converter_future_converter_java8_common_jar_sources_1_2_0", + "sha256": "8a0f6e7ead50cf9687ae7093bdd8e7f20cd26e42b848105206e18b245ebbc107", + "urls": [ + "https://repo1.maven.org/maven2/net/javacrumbs/future-converter/future-converter-java8-common/1.2.0/future-converter-java8-common-1.2.0-sources.jar" + ], + "downloaded_file_path": "net/javacrumbs/future-converter/future-converter-java8-common/1.2.0/future-converter-java8-common-1.2.0-sources.jar" + } + }, + "com_fasterxml_jackson_core_jackson_databind_jar_sources_2_15_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_fasterxml_jackson_core_jackson_databind_jar_sources_2_15_2", + "sha256": "6dafb34ba03f003c998dac3f786bcfd468dfcec39eaf465180bc433ce8566d30", + "urls": [ + "https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2-sources.jar" + ], + "downloaded_file_path": "com/fasterxml/jackson/core/jackson-databind/2.15.2/jackson-databind-2.15.2-sources.jar" + } + }, + "com_google_api_gax_grpc_2_28_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_api_gax_grpc_2_28_1", + "sha256": "e9e40d1d7354e8f857b05be2208c11722c1b97dc7aaa4b4b125fcf0457b45a03", + "urls": [ + "https://repo1.maven.org/maven2/com/google/api/gax-grpc/2.28.1/gax-grpc-2.28.1.jar", + "https://maven.google.com/com/google/api/gax-grpc/2.28.1/gax-grpc-2.28.1.jar" + ], + "downloaded_file_path": "com/google/api/gax-grpc/2.28.1/gax-grpc-2.28.1.jar" + } + }, + "com_github_oshi_oshi_core": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_oshi_oshi_core", + "generating_repository": "maven", + "target_name": "com_github_oshi_oshi_core" + } + }, + "com_google_errorprone_error_prone_core": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_errorprone_error_prone_core", + "generating_repository": "maven", + "target_name": "com_google_errorprone_error_prone_core" + } + }, + "com_amazonaws_aws_java_sdk_secretsmanager_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_secretsmanager_1_12_544", + "sha256": "b6a0953948949282b46769896c9d1eb1660ed77632c52137fdb72b8372fe685e", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-secretsmanager/1.12.544/aws-java-sdk-secretsmanager-1.12.544.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-secretsmanager/1.12.544/aws-java-sdk-secretsmanager-1.12.544.jar" + } + }, + "software_amazon_ion_ion_java_1_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~software_amazon_ion_ion_java_1_0_2", + "sha256": "0d127b205a1fce0abc2a3757a041748651bc66c15cf4c059bac5833b27d471a5", + "urls": [ + "https://repo1.maven.org/maven2/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar" + ], + "downloaded_file_path": "software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar" + } + }, + "com_amazonaws_aws_java_sdk_kms_jar_sources_1_12_544": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_amazonaws_aws_java_sdk_kms_jar_sources_1_12_544", + "sha256": "cc195a2be0a245eaee362cacd7c2f119522cea9c8f8b89db49f0634f05b15831", + "urls": [ + "https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-kms/1.12.544/aws-java-sdk-kms-1.12.544-sources.jar" + ], + "downloaded_file_path": "com/amazonaws/aws-java-sdk-kms/1.12.544/aws-java-sdk-kms-1.12.544-sources.jar" + } + }, + "org_yaml_snakeyaml_jar_sources_2_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_yaml_snakeyaml_jar_sources_2_2", + "sha256": "8f7cf911cf63db55fd980a926d155bd846317737351a2f48ef1c1088c414538a", + "urls": [ + "https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.2/snakeyaml-2.2-sources.jar" + ], + "downloaded_file_path": "org/yaml/snakeyaml/2.2/snakeyaml-2.2-sources.jar" + } + }, + "com_github_docker_java_docker_java": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_github_docker_java_docker_java", + "generating_repository": "maven", + "target_name": "com_github_docker_java_docker_java" + } + }, + "commons_codec_commons_codec_1_15": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~commons_codec_commons_codec_1_15", + "sha256": "b3e9f6d63a790109bf0d056611fbed1cf69055826defeb9894a71369d246ed63", + "urls": [ + "https://repo1.maven.org/maven2/commons-codec/commons-codec/1.15/commons-codec-1.15.jar" + ], + "downloaded_file_path": "commons-codec/commons-codec/1.15/commons-codec-1.15.jar" + } + }, + "io_grpc_grpc_googleapis_1_55_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_grpc_grpc_googleapis_1_55_1", + "sha256": "d77f33f3c78b99c0c604def7efe27f912b9cee49219698180101a064d67bd268", + "urls": [ + "https://repo1.maven.org/maven2/io/grpc/grpc-googleapis/1.55.1/grpc-googleapis-1.55.1.jar", + "https://maven.google.com/io/grpc/grpc-googleapis/1.55.1/grpc-googleapis-1.55.1.jar" + ], + "downloaded_file_path": "io/grpc/grpc-googleapis/1.55.1/grpc-googleapis-1.55.1.jar" + } + }, + "org_apache_commons_commons_lang3": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_apache_commons_commons_lang3", + "generating_repository": "maven", + "target_name": "org_apache_commons_commons_lang3" + } + }, + "com_google_guava_guava": { + "bzlFile": "@@rules_jvm_external~5.3//private:compat_repository.bzl", + "ruleClassName": "compat_repository", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_guava_guava", + "generating_repository": "maven", + "target_name": "com_google_guava_guava" + } + }, + "com_google_code_findbugs_jsr305_jar_sources_3_0_2": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~com_google_code_findbugs_jsr305_jar_sources_3_0_2", + "sha256": "1c9e85e272d0708c6a591dc74828c71603053b48cc75ae83cce56912a2aa063b", + "urls": [ + "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2-sources.jar" + ], + "downloaded_file_path": "com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2-sources.jar" + } + }, + "io_netty_netty_common_4_1_97_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_common_4_1_97_Final", + "sha256": "a8aca0c8e9347acc75c885ecc749195d9775369aa520b9276f2d1128210a6c17", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final.jar" + } + }, + "io_netty_netty_handler_4_1_86_Final": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~io_netty_netty_handler_4_1_86_Final", + "sha256": "e69b42292929b278dc522e25177ddf7c54025484b55879f8227349adfbe1c04d", + "urls": [ + "https://repo1.maven.org/maven2/io/netty/netty-handler/4.1.86.Final/netty-handler-4.1.86.Final.jar", + "https://maven.google.com/io/netty/netty-handler/4.1.86.Final/netty-handler-4.1.86.Final.jar" + ], + "downloaded_file_path": "io/netty/netty-handler/4.1.86.Final/netty-handler-4.1.86.Final.jar" + } + }, + "org_slf4j_slf4j_api_jar_sources_2_0_9": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_slf4j_slf4j_api_jar_sources_2_0_9", + "sha256": "0d83bc49452416dd121ee41cebf41cdc64b69e7f7fdc97c2762ec406336c7ad3", + "urls": [ + "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9-sources.jar" + ], + "downloaded_file_path": "org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9-sources.jar" + } + }, + "redis_clients_jedis_4_3_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~redis_clients_jedis_4_3_1", + "sha256": "597894244e42e1b3171470e9294781824dbf617949e77aa0230eaa3ec4772db4", + "urls": [ + "https://repo1.maven.org/maven2/redis/clients/jedis/4.3.1/jedis-4.3.1.jar" + ], + "downloaded_file_path": "redis/clients/jedis/4.3.1/jedis-4.3.1.jar" + } + }, + "org_glassfish_jersey_connectors_jersey_apache_connector_jar_sources_2_30_1": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_glassfish_jersey_connectors_jersey_apache_connector_jar_sources_2_30_1", + "sha256": "189accdc78e1ac392d6ae16d62d98b3567ca4fb836524d4f79e485c5455a9b93", + "urls": [ + "https://repo1.maven.org/maven2/org/glassfish/jersey/connectors/jersey-apache-connector/2.30.1/jersey-apache-connector-2.30.1-sources.jar" + ], + "downloaded_file_path": "org/glassfish/jersey/connectors/jersey-apache-connector/2.30.1/jersey-apache-connector-2.30.1-sources.jar" + } + }, + "org_xerial_sqlite_jdbc_jar_sources_3_34_0": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "name": "rules_jvm_external~5.3~maven~org_xerial_sqlite_jdbc_jar_sources_3_34_0", + "sha256": "e0c494fe9e7b719a0fe270bf19e63b26c821fce0a29c9066f5d1c39b9d38a6c0", + "urls": [ + "https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0-sources.jar" + ], + "downloaded_file_path": "org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0-sources.jar" + } + } + } + } + } + } +} diff --git a/deps.bzl b/deps.bzl index ff66198bc9..1e44e16094 100644 --- a/deps.bzl +++ b/deps.bzl @@ -5,26 +5,8 @@ buildfarm dependencies that can be imported into other WORKSPACE files load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file", "http_jar") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -RULES_JVM_EXTERNAL_TAG = "5.3" -RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac" - def archive_dependencies(third_party): return [ - { - "name": "platforms", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", - "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", - ], - "sha256": "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51", - }, - { - "name": "rules_jvm_external", - "strip_prefix": "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, - "sha256": RULES_JVM_EXTERNAL_SHA, - "url": "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), - }, - # Needed for "well-known protos" and @com_google_protobuf//:protoc. { "name": "com_google_protobuf", @@ -32,19 +14,13 @@ def archive_dependencies(third_party): "strip_prefix": "protobuf-25.0", "urls": ["https://github.com/protocolbuffers/protobuf/archive/v25.0.zip"], }, - { - "name": "com_github_bazelbuild_buildtools", - "sha256": "a02ba93b96a8151b5d8d3466580f6c1f7e77212c4eb181cba53eb2cae7752a23", - "strip_prefix": "buildtools-3.5.0", - "urls": ["https://github.com/bazelbuild/buildtools/archive/3.5.0.tar.gz"], - }, - # Needed for @grpc_java//compiler:grpc_java_plugin. { "name": "io_grpc_grpc_java", "sha256": "b8fb7ae4824fb5a5ae6e6fa26ffe2ad7ab48406fdeee54e8965a3b5948dd957e", "strip_prefix": "grpc-java-1.56.1", "urls": ["https://github.com/grpc/grpc-java/archive/v1.56.1.zip"], + # Bzlmod: Waiting for https://github.com/bazelbuild/bazel-central-registry/issues/353 }, { "name": "rules_pkg", @@ -53,14 +29,7 @@ def archive_dependencies(third_party): "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.0/rules_pkg-0.9.0.tar.gz", "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.0/rules_pkg-0.9.0.tar.gz", ], - }, - { - "name": "rules_license", - "sha256": "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", - "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", - ], + # Bzlmod : Waiting for >0.9.1 for https://github.com/bazelbuild/rules_pkg/pull/766 to be released }, # The APIs that we implement. @@ -82,12 +51,6 @@ def archive_dependencies(third_party): "strip_prefix": "remote-apis-636121a32fa7b9114311374e4786597d8e7a69f3", "url": "https://github.com/bazelbuild/remote-apis/archive/636121a32fa7b9114311374e4786597d8e7a69f3.zip", }, - { - "name": "rules_cc", - "sha256": "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", - "strip_prefix": "rules_cc-0.0.9", - "url": "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz", - }, # Used to format proto files { @@ -107,25 +70,6 @@ def archive_dependencies(third_party): "patch_args": ["-p0"], "patches": ["%s:docker_go_toolchain.patch" % third_party], }, - - # Updated versions of io_bazel_rules_docker dependencies for bazel compatibility - { - "name": "io_bazel_rules_go", - "sha256": "d6ab6b57e48c09523e93050f13698f708428cfd5e619252e369d377af6597707", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip", - ], - }, - { - "name": "bazel_gazelle", - "sha256": "b7387f72efb59f876e4daae42f1d3912d0d45563eac7cb23d1de0b094ab588cf", - "urls": [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.34.0/bazel-gazelle-v0.34.0.tar.gz", - ], - }, - # Bazel is referenced as a dependency so that buildfarm can access the linux-sandbox as a potential execution wrapper. { "name": "bazel", diff --git a/src/test/java/build/buildfarm/examples/ExampleConfigsTest.java b/src/test/java/build/buildfarm/examples/ExampleConfigsTest.java index 6033429f0e..ac1c605e80 100644 --- a/src/test/java/build/buildfarm/examples/ExampleConfigsTest.java +++ b/src/test/java/build/buildfarm/examples/ExampleConfigsTest.java @@ -35,16 +35,14 @@ public void skipWindows() { @Test public void shardWorkerConfig() throws IOException { Path configPath = - Paths.get( - System.getenv("TEST_SRCDIR"), "build_buildfarm", "examples", "config.minimal.yml"); + Paths.get(System.getenv("TEST_SRCDIR"), "_main", "examples", "config.minimal.yml"); BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); configs.loadConfigs(configPath); } @Test public void fullConfig() throws IOException { - Path configPath = - Paths.get(System.getenv("TEST_SRCDIR"), "build_buildfarm", "examples", "config.yml"); + Path configPath = Paths.get(System.getenv("TEST_SRCDIR"), "_main", "examples", "config.yml"); BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); configs.loadConfigs(configPath); } From 373cb215a757ca18cf1ee7fefaa83c0dbb693c44 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Tue, 9 Jan 2024 22:16:30 -0800 Subject: [PATCH 201/214] fix(coverage): coverage numbers are not accurate (#1609) The awk was pulling out the denominator of the metric, not the percent. Adjust the field. Before: ``` current line coverage: 1625% current function coverage: 340% ``` after: ``` current line coverage: 42% current function coverage: 51% ``` --- generate_coverage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_coverage.sh b/generate_coverage.sh index 7560334dbc..703ad93883 100755 --- a/generate_coverage.sh +++ b/generate_coverage.sh @@ -72,8 +72,8 @@ gate_lcov_results() { lcov_results=`$LCOV_TOOL --summary $traces 2>&1` # extract our percentage numbers - local line_percentage=$(echo "$lcov_results" | tr '\n' ' ' | awk '{print $8}' | sed 's/.$//') - local function_percentage=$(echo "$lcov_results" | tr '\n' ' ' | awk '{print $14}' | sed 's/.$//') + local line_percentage=$(echo "$lcov_results" | tr '\n' ' ' | awk '{print $5}' | sed 's/.$//') + local function_percentage=$(echo "$lcov_results" | tr '\n' ' ' | awk '{print $11}' | sed 's/.$//') line_percentage=${line_percentage%.*} function_percentage=${function_percentage%.*} From b40c14b051449382271ba7e221690d5e4867911a Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Wed, 10 Jan 2024 14:58:50 -0500 Subject: [PATCH 202/214] Add `helm lint` CI job. Split tag/release for the Helm chart from the entire repo with tags: `helm/X.Y.Z-b1` (#1602) * add helm chart linting stage, bundle chart on helm/* tags * fix triggers * try try again * always lint before bundling * extract the helm chart version from the git tag ref * fix name * tickle the beast * too much stack overflow * better names * that's output * gussy up readme * simplify * stage 0.2.2 * put extraVolumeMounts under .Values.shardWorker * omit defaults * leave out emacs gitignore * wrong example --- .../workflows/buildfarm-helm-chart-lint.yml | 24 ++++++++++++++ .../buildfarm-helm-chart-publish.yml | 31 ++++++++++++++----- README.md | 4 ++- kubernetes/helm-charts/buildfarm/Chart.yaml | 2 +- .../templates/shard-worker/statefulsets.yaml | 18 +++++------ kubernetes/helm-charts/buildfarm/values.yaml | 27 +++++++++------- 6 files changed, 76 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/buildfarm-helm-chart-lint.yml diff --git a/.github/workflows/buildfarm-helm-chart-lint.yml b/.github/workflows/buildfarm-helm-chart-lint.yml new file mode 100644 index 0000000000..c301732145 --- /dev/null +++ b/.github/workflows/buildfarm-helm-chart-lint.yml @@ -0,0 +1,24 @@ +--- +name: Lint Helm Chart + +on: + push: + paths: + - kubernetes/helm-charts/buildfarm/** + +env: + CHART_ROOT: kubernetes/helm-charts/buildfarm + +jobs: + lint: + name: Lint Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - id: helm-lint + name: Lint Helm Chart + run: |- + set -ex + helm dep up "${CHART_ROOT}" + helm lint "${CHART_ROOT}" diff --git a/.github/workflows/buildfarm-helm-chart-publish.yml b/.github/workflows/buildfarm-helm-chart-publish.yml index 0207d1593b..0c43525e8c 100644 --- a/.github/workflows/buildfarm-helm-chart-publish.yml +++ b/.github/workflows/buildfarm-helm-chart-publish.yml @@ -4,22 +4,39 @@ name: Package and Publish Helm Chart on: push: tags: - - '*' + - 'helm/*' env: GH_TOKEN: ${{ github.token }} + CHART_ROOT: kubernetes/helm-charts/buildfarm jobs: build: - if: github.repository == 'bazelbuild/bazel-buildfarm' - name: Package and Release BuildFarm Helm Chart + name: Lint, Package, and Release BuildFarm Helm Chart runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - - name: helm package + uses: actions/checkout@v4 + - id: get-chart-ver + name: Extracting Helm Chart Version from Tag + run: | + set -ex + echo "chart_ver=$(echo $GITHUB_REF | cut -d / -f 4)" >> $GITHUB_OUTPUT + - id: set-chart-yaml-version + name: Etching Helm Chart Version into Chart.yaml for Packaging + run: | + set -ex + echo setting Chart version to \ + "${{ steps.get-chart-ver.outputs.chart_ver }}" \ + in ${CHART_ROOT}/Chart.yaml + yq -i \ + '.version |= "${{ steps.get-chart-ver.outputs.chart_ver }}"' \ + ${CHART_ROOT}/Chart.yaml + - id: helm-lint-package-release + name: Helm Chart Lint, Package, and Release run: |- set -ex - helm dep up kubernetes/helm-charts/buildfarm - helm package kubernetes/helm-charts/buildfarm + helm dep up "${CHART_ROOT}" + helm lint "${CHART_ROOT}" + helm package "${CHART_ROOT}" gh release create "${{ github.ref_name }}" *.tgz diff --git a/README.md b/README.md index fa66df79c8..4aaeec6a49 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,11 @@ buildfarm_images() To install with helm: ```bash +# https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F0.2.2/buildfarm-0.2.2.tgz +CHART_VER="0.2.2" helm install \ -n bazel-buildfarm \ --create-namespace \ bazel-buildfarm \ - "https://github.com/bazelbuild/bazel-buildfarm/releases/download/${BUILDFARM_VERSION:-2.8.0}/buildfarm-${CHART_VERSION:-0.2.0}.tgz" + "https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F${CHART_VER}/buildfarm-${CHART_VER}.tgz" ``` diff --git a/kubernetes/helm-charts/buildfarm/Chart.yaml b/kubernetes/helm-charts/buildfarm/Chart.yaml index dc92b0f61b..593568d011 100644 --- a/kubernetes/helm-charts/buildfarm/Chart.yaml +++ b/kubernetes/helm-charts/buildfarm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml index 62706a61ac..ce5dbc9139 100644 --- a/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml @@ -74,20 +74,20 @@ spec: readOnly: true - mountPath: /tmp/worker name: {{ include "buildfarm.fullname" . }}-shard-worker-data - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} + {{- with .Values.shardWorker.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} + {{- with .Values.shardWorker.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 6 -}} {{- end }} + {{- with .Values.shardWorker.affinity }} - affinity: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 6 -}} {{- end }} + {{- with .Values.shardWorker.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 6 -}} {{- end }} volumes: - configMap: diff --git a/kubernetes/helm-charts/buildfarm/values.yaml b/kubernetes/helm-charts/buildfarm/values.yaml index f1e21a97c9..c18593a7e8 100644 --- a/kubernetes/helm-charts/buildfarm/values.yaml +++ b/kubernetes/helm-charts/buildfarm/values.yaml @@ -131,22 +131,25 @@ shardWorker: type: ClusterIP port: 8982 - nodeSelector: {} - tolerations: [] - affinity: {} - extraVolumes: [] - # - name: additionalSecret - # secret: - # secretName: my-secret - # defaultMode: 0600 + #nodeSelector: {} + #tolerations: [] + #affinity: {} + + #extraVolumes: + # - name: additionalSecret + # secret: + # secretName: my-secret + # defaultMode: 0600 + + #extraVolumeMounts: + # - name: customConfig + # mountPath: /mnt/config + # readOnly: true - extraVolumeMounts: [] - # - name: customConfig - # mountPath: /mnt/config - # readOnly: true extraEnv: - name: JAVABIN value: "/usr/bin/java" + serviceMonitor: ## If true, a ServiceMonitor CRD is created for a prometheus operator ## https://github.com/coreos/prometheus-operator From d155c0be466a59733a0fb06a66b9259c7457d90d Mon Sep 17 00:00:00 2001 From: amishra-u <119983081+amishra-u@users.noreply.github.com> Date: Fri, 12 Jan 2024 11:26:32 -0800 Subject: [PATCH 203/214] Publish storage worker and execute worker pool size in prometheus (#1606) * Publish storage worker and execute worker pool size in prometheus * run formatter * add doc --------- Co-authored-by: Yuriy Belenitsky --- _site/docs/metrics/metrics.md | 8 ++++++++ .../buildfarm/instance/shard/ServerInstance.java | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/_site/docs/metrics/metrics.md b/_site/docs/metrics/metrics.md index 6079b7e9b7..c0bfb4a75a 100644 --- a/_site/docs/metrics/metrics.md +++ b/_site/docs/metrics/metrics.md @@ -100,6 +100,14 @@ The number of dispatched operations that have been requeued Gauge of the number of workers available +**storage_worker_pool_size** + +Gauge of the number of storage workers available + +**execute_worker_pool_size** + +Gauge of the number of execute workers available. + **queue_size** Gauge of the size of the queue (using a queue_name label for each individual queue) diff --git a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java index 50c1de2f6f..5f7173150c 100644 --- a/src/main/java/build/buildfarm/instance/shard/ServerInstance.java +++ b/src/main/java/build/buildfarm/instance/shard/ServerInstance.java @@ -209,6 +209,16 @@ public class ServerInstance extends NodeInstance { // Other metrics from the backplane private static final Gauge workerPoolSize = Gauge.build().name("worker_pool_size").help("Active worker pool size.").register(); + private static final Gauge storageWorkerPoolSize = + Gauge.build() + .name("storage_worker_pool_size") + .help("Active storage worker pool size.") + .register(); + private static final Gauge executeWorkerPoolSize = + Gauge.build() + .name("execute_worker_pool_size") + .help("Active execute worker pool size.") + .register(); private static final Gauge queueSize = Gauge.build().name("queue_size").labelNames("queue_name").help("Queue size.").register(); @@ -511,6 +521,8 @@ public void run() { TimeUnit.SECONDS.sleep(30); BackplaneStatus backplaneStatus = backplaneStatus(); workerPoolSize.set(backplaneStatus.getActiveWorkersCount()); + executeWorkerPoolSize.set(backplaneStatus.getActiveExecuteWorkersCount()); + storageWorkerPoolSize.set(backplaneStatus.getActiveStorageWorkersCount()); dispatchedOperationsSize.set(backplaneStatus.getDispatchedSize()); preQueueSize.set(backplaneStatus.getPrequeue().getSize()); updateQueueSizes(backplaneStatus.getOperationQueue().getProvisionsList()); From 646d9565fa2edee877163f3b3358274347eb2e96 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 22 Jan 2024 06:41:30 -0800 Subject: [PATCH 204/214] bf-cat Output salt/platform, deindent command (#1615) --- src/main/java/build/buildfarm/tools/Cat.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/build/buildfarm/tools/Cat.java b/src/main/java/build/buildfarm/tools/Cat.java index bca404b3c1..f80e579f64 100644 --- a/src/main/java/build/buildfarm/tools/Cat.java +++ b/src/main/java/build/buildfarm/tools/Cat.java @@ -101,8 +101,7 @@ private static void printAction(ByteString actionBlob) { } private static void printAction(int level, Action action) { - indentOut( - level + 1, "Command Digest: Command " + DigestUtil.toString(action.getCommandDigest())); + indentOut(level, "Command Digest: Command " + DigestUtil.toString(action.getCommandDigest())); indentOut( level, "Input Root Digest: Directory " + DigestUtil.toString(action.getInputRootDigest())); indentOut(level, "DoNotCache: " + (action.getDoNotCache() ? "true" : "false")); @@ -113,6 +112,8 @@ private static void printAction(int level, Action action) { + (action.getTimeout().getSeconds() + action.getTimeout().getNanos() / 1e9) + "s"); } + indentOut(level, "Salt: " + action.getSalt()); + indentOut(level, "Platform: " + action.getPlatform()); } private static void printCommand(ByteString commandBlob) { From ea35e56c72287ca89fbf216d6ed2e177aa85cb26 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Mon, 22 Jan 2024 07:00:59 -0800 Subject: [PATCH 205/214] Provide hashedName in BackplaneStatus Queue Name (#1616) Avoid stripping the existingHash, used to calculate the slot with suffix modifiers for queue balancing. Client presentation may also move to presenting each balanced queue name, removing the coordinated calculation on the client. The name could only have been used by a client prior for name presentation or determination of queue names in redis from slot arrangement. --- .../build/buildfarm/common/redis/BalancedRedisQueue.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java b/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java index 9123f5eaf9..044a3b25ce 100644 --- a/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java +++ b/src/main/java/build/buildfarm/common/redis/BalancedRedisQueue.java @@ -330,7 +330,11 @@ public QueueStatus status(JedisCluster jedis) { } // build proto - return QueueStatus.newBuilder().setName(name).setSize(size).addAllInternalSizes(sizes).build(); + return QueueStatus.newBuilder() + .setName(RedisHashtags.hashedName(name, originalHashtag)) + .setSize(size) + .addAllInternalSizes(sizes) + .build(); } /** From fe2c51c3cb23898232677081948943b7f8026a10 Mon Sep 17 00:00:00 2001 From: coder1363691 <67998200+coder1363691@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:16:10 +0800 Subject: [PATCH 206/214] set expire and drop invocationId (#1589) * set expire and drop invocationId * fix format * patch configuration doc * fix typo * re-run ci use luxe's patch * set expire when every active operation insert * fix return code * fix ci if statement --------- Co-authored-by: wangpengfei.pfwang Co-authored-by: George Gensure --- _site/docs/configuration/configuration.md | 1 + examples/config.yml | 1 + src/main/java/build/buildfarm/common/config/Backplane.java | 1 + .../java/build/buildfarm/instance/shard/Operations.java | 6 +++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index 9e9d0ab0f9..ba85d4a6c5 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -206,6 +206,7 @@ server: | maxPreQueueDepth | Integer, _1000000_ | | | Maximum lengh that the arrival queue is allowed to reach to control load on the Redis cluster | | priorityQueue | boolean, _false_ | | | Priority queue type allows prioritizing operations based on Bazel's --remote_execution_priority= flag | | timeout | Integer, _10000_ | | | Default timeout | +| maxInvocationIdTimeout | Integer, _604800_ | | | Maximum TTL (Time-to-Live in second) of invocationId keys in RedisBackplane | | maxAttempts | Integer, _20_ | | | Maximum number of execution attempts | | cacheCas | boolean, _false_ | | | | diff --git a/examples/config.yml b/examples/config.yml index c02ff4cfcb..4e66e00bd8 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -79,6 +79,7 @@ backplane: priorityQueue: false priorityPollIntervalMillis: 100 timeout: 10000 + maxInvocationIdTimeout: 604800 maxAttempts: 20 cacheCas: false queues: diff --git a/src/main/java/build/buildfarm/common/config/Backplane.java b/src/main/java/build/buildfarm/common/config/Backplane.java index 16a90e9111..1693e378e6 100644 --- a/src/main/java/build/buildfarm/common/config/Backplane.java +++ b/src/main/java/build/buildfarm/common/config/Backplane.java @@ -40,6 +40,7 @@ public enum BACKPLANE_TYPE { private String operationChannelPrefix = "OperationChannel"; private String casPrefix = "ContentAddressableStorage"; private int casExpire = 604800; // 1 Week + private int maxInvocationIdTimeout = 604800; @Getter(AccessLevel.NONE) private boolean subscribeToBackplane = true; // deprecated diff --git a/src/main/java/build/buildfarm/instance/shard/Operations.java b/src/main/java/build/buildfarm/instance/shard/Operations.java index 0088bdf038..c114fe32ef 100644 --- a/src/main/java/build/buildfarm/instance/shard/Operations.java +++ b/src/main/java/build/buildfarm/instance/shard/Operations.java @@ -14,6 +14,7 @@ package build.buildfarm.instance.shard; +import build.buildfarm.common.config.BuildfarmConfigs; import build.buildfarm.common.redis.RedisMap; import java.util.Map; import java.util.Set; @@ -28,6 +29,7 @@ * information about the operations that ran. */ public class Operations { + private static BuildfarmConfigs configs = BuildfarmConfigs.getInstance(); /** * @field operationIds * @brief A mapping from operationID -> operation @@ -98,7 +100,9 @@ public void insert( // We also store a mapping from invocationID -> operationIDs // This is a common lookup that needs to be performant. - jedis.sadd(invocationId, operationId); + if (invocationId != "" && jedis.sadd(invocationId, operationId) == 1) { + jedis.expire(invocationId, configs.getBackplane().getMaxInvocationIdTimeout()); + } } /** From b7980a03e864a81920f0d5af3f8c2ade19c27909 Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 25 Jan 2024 09:16:30 -0800 Subject: [PATCH 207/214] Add OSSF scorecard (#1618) * feat: add OSSF Scorecards workflow Adding OSSF Scorecards workflow as github action. It runs periodially. Output goes into Code Scanning alerts of GitHub. * docs(README): add some badges - OSSF Scorecard - License (from GitHub) - latest Release (from GitHub) --- .github/workflows/scorecards.yml | 68 ++++++++++++++++++++++++++++++++ README.md | 4 ++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/scorecards.yml diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml new file mode 100644 index 0000000000..04f97ff17e --- /dev/null +++ b/.github/workflows/scorecards.yml @@ -0,0 +1,68 @@ +name: Scorecards supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: "23 2 * * 5" + push: + branches: ["main"] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecards analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecards on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 + with: + sarif_file: results.sarif diff --git a/README.md b/README.md index 4aaeec6a49..385d6e5e9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Bazel Buildfarm ![Build status](https://badge.buildkite.com/45f4fd4c0cfb95f7705156a4119641c6d5d6c310452d6e65a4.svg?branch=main) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/bazelbuild/bazel-buildfarm/badge)](https://securityscorecards.dev/viewer/?uri=github.com/bazelbuild/bazel-buildfarm) +![GitHub License](https://img.shields.io/github/license/bazelbuild/bazel-buildfarm) +![GitHub Release](https://img.shields.io/github/v/release/bazelbuild/bazel-buildfarm) + This repository hosts the [Bazel](https://bazel.build) remote caching and execution system. From 8a7873be179c1cb6809708a11d7ef04849695f8f Mon Sep 17 00:00:00 2001 From: Jason Schroeder Date: Thu, 25 Jan 2024 09:16:53 -0800 Subject: [PATCH 208/214] chore: remove rules_oss_audit (#1617) Remove rules_oss_audit and accompanying documentation --- .bazelci/presubmit.yml | 5 ++--- BUILD | 13 ------------- WORKSPACE | 8 -------- _site/docs/security/security.md | 21 --------------------- deps.bzl | 8 -------- third_party/rules_oss_audit_pyyaml.patch | 7 ------- 6 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 _site/docs/security/security.md delete mode 100644 third_party/rules_oss_audit_pyyaml.patch diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 43aeba5380..687ffc1781 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -63,8 +63,7 @@ tasks: USE_BAZEL_VERSION: 17be878292730359c9c90efdceabed26126df7ae build_flags: - "--cxxopt=-std=c++14" - # FIXME: remove audit subtraction when https://github.com/bazelbuild/bazel-buildfarm/issues/1595 fixed - - "--build_tag_filters=-container,-audit" + - "--build_tag_filters=-container" build_targets: - "..." test_flags: @@ -74,7 +73,7 @@ tasks: windows: name: "Unit Tests" build_flags: - - "--build_tag_filters=-container,-audit" + - "--build_tag_filters=-container" build_targets: - "..." test_flags: diff --git a/BUILD b/BUILD index d82be09f83..a749c0caa3 100644 --- a/BUILD +++ b/BUILD @@ -3,7 +3,6 @@ load("@io_bazel_rules_docker//java:image.bzl", "java_image") load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs") load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs") load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push") -load("@rules_oss_audit//oss_audit:java/oss_audit.bzl", "oss_audit") load("//:jvm_flags.bzl", "server_jvm_flags", "worker_jvm_flags") package(default_visibility = ["//visibility:public"]) @@ -137,12 +136,6 @@ java_image( ], ) -oss_audit( - name = "buildfarm-server-audit", - src = "//src/main/java/build/buildfarm:buildfarm-server", - tags = ["audit"], -) - # A worker image may need additional packages installed that are not in the base image. # We use download/install rules to extend an upstream image. # Download cgroup-tools so that the worker is able to restrict actions via control groups. @@ -190,12 +183,6 @@ java_image( ], ) -oss_audit( - name = "buildfarm-shard-worker-audit", - src = "//src/main/java/build/buildfarm:buildfarm-shard-worker", - tags = ["audit"], -) - # Below targets push public docker images to bazelbuild dockerhub. container_push( diff --git a/WORKSPACE b/WORKSPACE index 0d4b9462d5..3ce5827108 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,14 +8,6 @@ load(":defs.bzl", "buildfarm_init") buildfarm_init() -load("@rules_oss_audit//oss_audit:repositories.bzl", "rules_oss_audit_dependencies") - -rules_oss_audit_dependencies() - -load("@rules_oss_audit//oss_audit:setup.bzl", "rules_oss_audit_setup") - -rules_oss_audit_setup() - load("@maven//:compat.bzl", "compat_repositories") compat_repositories() diff --git a/_site/docs/security/security.md b/_site/docs/security/security.md deleted file mode 100644 index a476000546..0000000000 --- a/_site/docs/security/security.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: default -title: Security -has_children: false -nav_order: 6 ---- - -# Auditing Buildfarm Artifacts -The complexities of identifying and tracking open-source software (OSS) to comply with license requirements adds friction to the development and integration process. We solve this problem for buildfarm artifacts by creating an accurate "bill of materials" (BOM) containing OSS and third-party packages used to create our deployment. - -To audit buildfarm artifacts run the following: -``` -bazel build :buildfarm-server-audit :buildfarm-shard-worker-audit -``` - -To see the BOM file: -``` -cat bazel-bin/buildfarm-server.bom.yaml -``` - -The BOM file contains library names with corresponding license information. This currently only works for maven dependencies. diff --git a/deps.bzl b/deps.bzl index 1e44e16094..daa4a5ca17 100644 --- a/deps.bzl +++ b/deps.bzl @@ -88,14 +88,6 @@ def archive_dependencies(third_party): "strip_prefix": "TARDIS-f54fa4743e67763bb1ad77039b3d15be64e2e564", "url": "https://github.com/Unilang/TARDIS/archive/f54fa4743e67763bb1ad77039b3d15be64e2e564.zip", }, - { - "name": "rules_oss_audit", - "sha256": "8ee8376b05b5ddd2287b070e9a88ec85ef907d47f44e321ce5d4bc2b192eed4e", - "strip_prefix": "rules_oss_audit-167dab5b16abdb5996438f22364de544ff24693f", - "url": "https://github.com/vmware/rules_oss_audit/archive/167dab5b16abdb5996438f22364de544ff24693f.zip", - "patch_args": ["-p1"], - "patches": ["%s:rules_oss_audit_pyyaml.patch" % third_party], - }, ] def buildfarm_dependencies(repository_name = "build_buildfarm"): diff --git a/third_party/rules_oss_audit_pyyaml.patch b/third_party/rules_oss_audit_pyyaml.patch deleted file mode 100644 index d2297f018c..0000000000 --- a/third_party/rules_oss_audit_pyyaml.patch +++ /dev/null @@ -1,7 +0,0 @@ -diff --git a/oss_audit/tools/requirements.txt b/oss_audit/tools/requirements.txt -index 932bd69..be2b74d 100644 ---- a/oss_audit/tools/requirements.txt -+++ b/oss_audit/tools/requirements.txt -@@ -1 +1 @@ --PyYAML==5.4.1 -+PyYAML==6.0.1 From bb6019672cd6d91cf7a2bea936cdbfdf86d70e45 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 4 Feb 2024 13:02:29 -0800 Subject: [PATCH 209/214] Changes to upgrade to mockito 5.10.0 (#1623) --- defs.bzl | 2 +- .../java/build/buildfarm/cas/GrpcCASTest.java | 14 ++-- .../cas/MemoryWriteOutputStreamTest.java | 4 +- .../buildfarm/cas/cfc/CASFileCacheTest.java | 6 +- .../common/grpc/ByteStreamHelperTest.java | 6 +- .../grpc/StubWriteOutputStreamTest.java | 74 ++++++++----------- .../services/WriteStreamObserverTest.java | 6 +- .../instance/shard/DispatchedMonitorTest.java | 10 +-- .../instance/shard/ServerInstanceTest.java | 12 +-- .../buildfarm/instance/shard/UtilTest.java | 4 +- .../instance/stub/StubInstanceTest.java | 11 +-- 11 files changed, 71 insertions(+), 78 deletions(-) diff --git a/defs.bzl b/defs.bzl index 9ca4aec502..baa2f2de0d 100644 --- a/defs.bzl +++ b/defs.bzl @@ -103,7 +103,7 @@ def buildfarm_init(name = "buildfarm"): "me.dinowernli:java-grpc-prometheus:0.6.0", "org.apache.tomcat:annotations-api:6.0.53", "org.checkerframework:checker-qual:3.38.0", - "org.mockito:mockito-core:2.25.0", + "org.mockito:mockito-core:5.10.0", "org.openjdk.jmh:jmh-core:1.37", "org.openjdk.jmh:jmh-generator-annprocess:1.37", "org.redisson:redisson:3.23.4", diff --git a/src/test/java/build/buildfarm/cas/GrpcCASTest.java b/src/test/java/build/buildfarm/cas/GrpcCASTest.java index 6db6fd59aa..dfe0c60fd8 100644 --- a/src/test/java/build/buildfarm/cas/GrpcCASTest.java +++ b/src/test/java/build/buildfarm/cas/GrpcCASTest.java @@ -19,9 +19,11 @@ import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import build.bazel.remote.execution.v2.Compressor; import build.bazel.remote.execution.v2.ContentAddressableStorageGrpc.ContentAddressableStorageImplBase; @@ -162,7 +164,7 @@ public void putAddsExpiration() throws IOException, InterruptedException { verify(uploader, times(1)) .uploadBlob(eq(HashCode.fromString(digest.getHash())), any(Chunker.class)); assertThat(onExpirations.get(digest)).containsExactly(onExpiration); - verifyZeroInteractions(onExpiration); + verifyNoInteractions(onExpiration); } @Test @@ -220,11 +222,13 @@ public void findMissingBlobsSwallowsFilteredList() throws Exception { Channel channel = InProcessChannelBuilder.forName(fakeServerName).directExecutor().build(); Runnable onExpiration = mock(Runnable.class); GrpcCAS cas = new GrpcCAS("test", /* readonly=*/ false, channel, null, onExpirations); - ContentAddressableStorageImplBase casService = mock(ContentAddressableStorageImplBase.class); + ContentAddressableStorageImplBase casService = spy(ContentAddressableStorageImplBase.class); serviceRegistry.addService(casService); + // Mutable calls bindService, and clearInvocations is undesirable + verify(casService, times(1)).bindService(); Digest emptyDigest = Digest.getDefaultInstance(); assertThat(cas.findMissingBlobs(ImmutableList.of(emptyDigest))).isEmpty(); - verifyZeroInteractions(casService); - verifyZeroInteractions(onExpiration); + verifyNoMoreInteractions(casService); + verifyNoInteractions(onExpiration); } } diff --git a/src/test/java/build/buildfarm/cas/MemoryWriteOutputStreamTest.java b/src/test/java/build/buildfarm/cas/MemoryWriteOutputStreamTest.java index 2a979d346e..545b0d0d2f 100644 --- a/src/test/java/build/buildfarm/cas/MemoryWriteOutputStreamTest.java +++ b/src/test/java/build/buildfarm/cas/MemoryWriteOutputStreamTest.java @@ -16,7 +16,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import build.bazel.remote.execution.v2.Digest; import build.buildfarm.common.DigestUtil; @@ -45,6 +45,6 @@ public void asyncWriteCompletionIsComplete() throws IOException { writtenFuture.set(content); assertThat(write.isComplete()).isTrue(); assertThat(write.getCommittedSize()).isEqualTo(digest.getSizeBytes()); - verifyZeroInteractions(cas); + verifyNoInteractions(cas); } } diff --git a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java index caaab02b35..48a57ee8c7 100644 --- a/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java +++ b/src/test/java/build/buildfarm/cas/cfc/CASFileCacheTest.java @@ -32,7 +32,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import build.bazel.remote.execution.v2.Compressor; @@ -212,7 +212,7 @@ public void putEmptyFileThrowsIllegalStateException() throws IOException, Interr try { fileCache.put(blobDigest, false); } finally { - verifyZeroInteractions(mockInputStreamFactory); + verifyNoInteractions(mockInputStreamFactory); } } @@ -886,7 +886,7 @@ public void duplicateExpiredEntrySuppressesDigestExpiration() fileCache.put(new Blob(ByteString.copyFromUtf8("Hello, World"), DIGEST_UTIL)); - verifyZeroInteractions(onExpire); + verifyNoInteractions(onExpire); // assert expiration of non-executable digest String expiringKey = fileCache.getKey(expiringBlob.getDigest(), /* isExecutable=*/ false); assertThat(storage.containsKey(expiringKey)).isFalse(); diff --git a/src/test/java/build/buildfarm/common/grpc/ByteStreamHelperTest.java b/src/test/java/build/buildfarm/common/grpc/ByteStreamHelperTest.java index 14b4789ef3..6f456a5f31 100644 --- a/src/test/java/build/buildfarm/common/grpc/ByteStreamHelperTest.java +++ b/src/test/java/build/buildfarm/common/grpc/ByteStreamHelperTest.java @@ -20,7 +20,6 @@ import static org.mockito.Mockito.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -43,17 +42,20 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.mockito.MockitoAnnotations; +import org.mockito.Spy; @RunWith(JUnit4.class) public class ByteStreamHelperTest { @Rule public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); - private final ByteStreamImplBase serviceImpl = mock(ByteStreamImplBase.class); + @Spy private ByteStreamImplBase serviceImpl; private Channel channel; @Before public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); String serverName = InProcessServerBuilder.generateName(); grpcCleanup diff --git a/src/test/java/build/buildfarm/common/grpc/StubWriteOutputStreamTest.java b/src/test/java/build/buildfarm/common/grpc/StubWriteOutputStreamTest.java index 5219e9d39d..1c4c93c88a 100644 --- a/src/test/java/build/buildfarm/common/grpc/StubWriteOutputStreamTest.java +++ b/src/test/java/build/buildfarm/common/grpc/StubWriteOutputStreamTest.java @@ -17,10 +17,6 @@ import static com.google.common.truth.Truth.assertThat; import static java.util.concurrent.TimeUnit.MICROSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.mockito.AdditionalAnswers.delegatesTo; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -40,6 +36,7 @@ import io.grpc.inprocess.InProcessServerBuilder; import io.grpc.stub.StreamObserver; import io.grpc.testing.GrpcCleanupRule; +import io.grpc.util.MutableHandlerRegistry; import java.io.IOException; import java.io.OutputStream; import java.util.List; @@ -49,37 +46,27 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.mockito.ArgumentCaptor; +import org.mockito.MockitoAnnotations; @RunWith(JUnit4.class) public class StubWriteOutputStreamTest { @Rule public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); - @SuppressWarnings("unchecked") - private final StreamObserver writeObserver = mock(StreamObserver.class); - - private final ByteStreamImplBase serviceImpl = - mock( - ByteStreamImplBase.class, - delegatesTo( - new ByteStreamImplBase() { - @Override - public StreamObserver write( - StreamObserver responseObserver) { - return writeObserver; - } - })); + private final MutableHandlerRegistry serviceRegistry = new MutableHandlerRegistry(); private Channel channel; @Before public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + String serverName = InProcessServerBuilder.generateName(); grpcCleanup .register( InProcessServerBuilder.forName(serverName) + .fallbackHandlerRegistry(serviceRegistry) .directExecutor() - .addService(serviceImpl) .build()) .start(); @@ -91,28 +78,22 @@ public void setUp() throws Exception { @Test public void resetExceptionsAreInterpreted() { String unimplementedResourceName = "unimplemented-resource"; - QueryWriteStatusRequest unimplementedRequest = - QueryWriteStatusRequest.newBuilder().setResourceName(unimplementedResourceName).build(); - doAnswer( - invocation -> { - StreamObserver observer = invocation.getArgument(1); - observer.onError(Status.UNIMPLEMENTED.asException()); - return null; - }) - .when(serviceImpl) - .queryWriteStatus(eq(unimplementedRequest), any(StreamObserver.class)); - String notFoundResourceName = "not-found-resource"; - QueryWriteStatusRequest notFoundRequest = - QueryWriteStatusRequest.newBuilder().setResourceName(notFoundResourceName).build(); - doAnswer( - invocation -> { - StreamObserver observer = invocation.getArgument(1); - observer.onError(Status.NOT_FOUND.asException()); - return null; - }) - .when(serviceImpl) - .queryWriteStatus(eq(notFoundRequest), any(StreamObserver.class)); + serviceRegistry.addService( + new ByteStreamImplBase() { + @Override + public void queryWriteStatus( + QueryWriteStatusRequest request, + StreamObserver responseObserver) { + if (request.getResourceName().equals(unimplementedResourceName)) { + responseObserver.onError(Status.UNIMPLEMENTED.asException()); + } else if (request.getResourceName().equals(notFoundResourceName)) { + responseObserver.onError(Status.NOT_FOUND.asException()); + } else { + responseObserver.onError(Status.INVALID_ARGUMENT.asException()); + } + } + }); StubWriteOutputStream write = new StubWriteOutputStream( @@ -123,8 +104,6 @@ public void resetExceptionsAreInterpreted() { /* expectedSize=*/ StubWriteOutputStream.UNLIMITED_EXPECTED_SIZE, /* autoflush=*/ true); assertThat(write.getCommittedSize()).isEqualTo(0); - verify(serviceImpl, times(1)) - .queryWriteStatus(eq(unimplementedRequest), any(StreamObserver.class)); write = new StubWriteOutputStream( @@ -135,12 +114,20 @@ public void resetExceptionsAreInterpreted() { /* expectedSize=*/ StubWriteOutputStream.UNLIMITED_EXPECTED_SIZE, /* autoflush=*/ true); assertThat(write.getCommittedSize()).isEqualTo(0); - verify(serviceImpl, times(1)).queryWriteStatus(eq(notFoundRequest), any(StreamObserver.class)); } @SuppressWarnings("unchecked") @Test public void resetIsRespectedOnSubsequentWrite() throws IOException { + StreamObserver writeObserver = mock(StreamObserver.class); + serviceRegistry.addService( + new ByteStreamImplBase() { + @Override + public StreamObserver write( + StreamObserver responseObserver) { + return writeObserver; + } + }); String resourceName = "reset-resource"; StubWriteOutputStream write = new StubWriteOutputStream( @@ -156,7 +143,6 @@ public void resetIsRespectedOnSubsequentWrite() throws IOException { write.reset(); content.writeTo(out); } - verify(serviceImpl, times(1)).write(any(StreamObserver.class)); ArgumentCaptor writeRequestCaptor = ArgumentCaptor.forClass(WriteRequest.class); verify(writeObserver, times(3)).onNext(writeRequestCaptor.capture()); List requests = writeRequestCaptor.getAllValues(); diff --git a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java index b6d144a66b..165232ab05 100644 --- a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java +++ b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java @@ -8,7 +8,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import build.bazel.remote.execution.v2.Compressor; @@ -89,7 +89,7 @@ public void cancelledBeforeGetOutputIsSilent() throws Exception { any(RequestMetadata.class)); verify(write, times(1)).getOutput(any(Long.class), any(TimeUnit.class), any(Runnable.class)); verify(out, times(1)).close(); - verifyZeroInteractions(responseObserver); + verifyNoInteractions(responseObserver); } @Test @@ -136,6 +136,6 @@ public void noErrorWhenContextCancelled() throws Exception { eq(cancelledDigest), eq(uuid), any(RequestMetadata.class)); - verifyZeroInteractions(responseObserver); + verifyNoInteractions(responseObserver); } } diff --git a/src/test/java/build/buildfarm/instance/shard/DispatchedMonitorTest.java b/src/test/java/build/buildfarm/instance/shard/DispatchedMonitorTest.java index c1410739b6..3066570526 100644 --- a/src/test/java/build/buildfarm/instance/shard/DispatchedMonitorTest.java +++ b/src/test/java/build/buildfarm/instance/shard/DispatchedMonitorTest.java @@ -22,7 +22,7 @@ import static org.mockito.Mockito.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import build.buildfarm.backplane.Backplane; @@ -67,7 +67,7 @@ public void shouldStopWhenBackplanIsStopped() { dispatchedMonitor.run(); verify(backplane, atLeastOnce()).isStopped(); - verifyZeroInteractions(requeuer); + verifyNoInteractions(requeuer); } @Test @@ -78,7 +78,7 @@ public void shouldIgnoreOperationWithFutureRequeueAt() throws Exception { ImmutableList.of( DispatchedOperation.newBuilder().setRequeueAt(Long.MAX_VALUE).build())); dispatchedMonitor.iterate(); - verifyZeroInteractions(requeuer); + verifyNoInteractions(requeuer); } @Test @@ -123,7 +123,7 @@ public void shouldIgnoreOperationWithEarlyRequeueAtWhenBackplaneDisallowsQueuein .build())); when(requeuer.apply(eq(queueEntry), any(Duration.class))).thenReturn(immediateFuture(null)); dispatchedMonitor.iterate(); - verifyZeroInteractions(requeuer); + verifyNoInteractions(requeuer); } @Test @@ -132,7 +132,7 @@ public void shouldIgnoreBackplaneException() throws Exception { when(backplane.getDispatchedOperations()) .thenThrow(new IOException("transient error condition")); dispatchedMonitor.iterate(); - verifyZeroInteractions(requeuer); + verifyNoInteractions(requeuer); } @Test diff --git a/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java index d66a600dab..3fc6f30707 100644 --- a/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/shard/ServerInstanceTest.java @@ -32,6 +32,7 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.mockito.AdditionalAnswers.answer; import static org.mockito.ArgumentMatchers.anyIterable; +import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.Mockito.any; @@ -121,7 +122,6 @@ import org.junit.runners.JUnit4; import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatcher; -import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.stubbing.Answer; @@ -355,7 +355,7 @@ public void queueActionFailsQueueEligibility() throws Exception { .setSkipCacheLookup(true) .build(); - when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(false); + when(mockBackplane.propertiesEligibleForQueue(anyList())).thenReturn(false); when(mockBackplane.canQueue()).thenReturn(true); @@ -482,7 +482,7 @@ public void queueDirectoryMissingErrorsOperation() throws Exception { .setSkipCacheLookup(true) .build(); - when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true); + when(mockBackplane.propertiesEligibleForQueue(anyList())).thenReturn(true); when(mockBackplane.canQueue()).thenReturn(true); @@ -555,7 +555,7 @@ public void queueOperationPutFailureCancelsOperation() throws Exception { .setSkipCacheLookup(true) .build(); - when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true); + when(mockBackplane.propertiesEligibleForQueue(anyList())).thenReturn(true); when(mockBackplane.canQueue()).thenReturn(true); @@ -621,7 +621,7 @@ public void queueWithFailedCacheCheckContinues() throws Exception { .setActionDigest(actionKey.getDigest()) .build(); - when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true); + when(mockBackplane.propertiesEligibleForQueue(anyList())).thenReturn(true); when(mockBackplane.canQueue()).thenReturn(true); @@ -733,7 +733,7 @@ public void requeueFailsOnMissingDirectory() throws Exception { Digest missingDirectoryDigest = Digest.newBuilder().setHash("missing-directory").setSizeBytes(1).build(); - when(mockBackplane.propertiesEligibleForQueue(Matchers.anyList())).thenReturn(true); + when(mockBackplane.propertiesEligibleForQueue(anyList())).thenReturn(true); when(mockBackplane.getOperation(eq(operationName))) .thenReturn( diff --git a/src/test/java/build/buildfarm/instance/shard/UtilTest.java b/src/test/java/build/buildfarm/instance/shard/UtilTest.java index 01e8a017fc..e02dcedda6 100644 --- a/src/test/java/build/buildfarm/instance/shard/UtilTest.java +++ b/src/test/java/build/buildfarm/instance/shard/UtilTest.java @@ -25,7 +25,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import build.bazel.remote.execution.v2.Digest; @@ -135,7 +135,7 @@ public void correctMissingBlobFailsImmediatelyOnUnretriable() throws Interrupted } verify(instance, times(1)).findMissingBlobs(eq(digests), any(RequestMetadata.class)); assertThat(caughtException).isTrue(); - verifyZeroInteractions(backplane); + verifyNoInteractions(backplane); } @Test diff --git a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java index 526946af1e..da355098ad 100644 --- a/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java +++ b/src/test/java/build/buildfarm/instance/stub/StubInstanceTest.java @@ -20,7 +20,8 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import build.bazel.remote.execution.v2.Action; import build.bazel.remote.execution.v2.ActionCacheGrpc.ActionCacheImplBase; @@ -419,7 +420,7 @@ public void read(ReadRequest request, StreamObserver responseObser assertThat(ioException).isNotNull(); Status status = Status.fromThrowable(ioException); assertThat(status.getCode()).isEqualTo(Code.UNAVAILABLE); - verifyZeroInteractions(out); + verifyNoInteractions(out); instance.stop(); } @@ -491,7 +492,7 @@ public void read(ReadRequest request, StreamObserver responseObser assertThat(ioException).isNotNull(); Status status = Status.fromThrowable(ioException); assertThat(status.getCode()).isEqualTo(Code.DEADLINE_EXCEEDED); - verifyZeroInteractions(out); + verifyNoInteractions(out); instance.stop(); } @@ -510,7 +511,7 @@ public void readBlobInterchangeDoesNotRequestUntilStarted() { verify(mockBlobObserver, times(1)).setOnReadyHandler(onReadyCaptor.capture()); // call it onReadyCaptor.getValue().run(); - // verify zero interactions with mockRequestStream - verifyZeroInteractions(mockRequestStream); + // verify no more interactions with mockRequestStream + verifyNoMoreInteractions(mockRequestStream); } } From 8a3abb642fa80f2f02ecc4df20e6ef56309d727f Mon Sep 17 00:00:00 2001 From: George Gensure Date: Tue, 13 Feb 2024 18:52:52 -0500 Subject: [PATCH 210/214] Fix com_grail_bazel_toolchain fetch (#1630) --- deps.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.bzl b/deps.bzl index daa4a5ca17..358c20d938 100644 --- a/deps.bzl +++ b/deps.bzl @@ -55,8 +55,8 @@ def archive_dependencies(third_party): # Used to format proto files { "name": "com_grail_bazel_toolchain", - "sha256": "95f0bab6982c7e5a83447e08bf32fa7a47f210169da5e5ec62411fef0d8e7f59", - "strip_prefix": "bazel-toolchain-0.9", + "sha256": "b2d168315dd0785f170b2b306b86e577c36e812b8f8b05568f9403141f2c24dd", + "strip_prefix": "toolchains_llvm-0.9", "url": "https://github.com/grailbio/bazel-toolchain/archive/refs/tags/0.9.tar.gz", "patch_args": ["-p1"], "patches": ["%s:clang_toolchain.patch" % third_party], From 60b3890dbe4e330799ddab7738f498554cb12bf3 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Thu, 15 Feb 2024 15:29:16 +0100 Subject: [PATCH 211/214] fix template bugs with with (#1631) * fix template bugs with with * stage chart v0.2.3 --- README.md | 4 ++-- kubernetes/helm-charts/buildfarm/Chart.yaml | 2 +- .../buildfarm/templates/shard-worker/statefulsets.yaml | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 385d6e5e9b..84e2f75737 100644 --- a/README.md +++ b/README.md @@ -142,8 +142,8 @@ buildfarm_images() To install with helm: ```bash -# https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F0.2.2/buildfarm-0.2.2.tgz -CHART_VER="0.2.2" +# https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F0.2.3/buildfarm-0.2.3.tgz +CHART_VER="0.2.3" helm install \ -n bazel-buildfarm \ --create-namespace \ diff --git a/kubernetes/helm-charts/buildfarm/Chart.yaml b/kubernetes/helm-charts/buildfarm/Chart.yaml index 593568d011..909ed735d5 100644 --- a/kubernetes/helm-charts/buildfarm/Chart.yaml +++ b/kubernetes/helm-charts/buildfarm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.2 +version: 0.2.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml index ce5dbc9139..8582807d8e 100644 --- a/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml +++ b/kubernetes/helm-charts/buildfarm/templates/shard-worker/statefulsets.yaml @@ -79,15 +79,18 @@ spec: {{- end }} {{- with .Values.shardWorker.nodeSelector }} - {{- tpl (toYaml .) $ | nindent 6 -}} + nodeSelector: + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} {{- with .Values.shardWorker.affinity }} - {{- tpl (toYaml .) $ | nindent 6 -}} + affinity: + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} {{- with .Values.shardWorker.tolerations }} - {{- tpl (toYaml .) $ | nindent 6 -}} + tolerations: + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} volumes: - configMap: From 1eb0528ec71ae786daee82403cd0ee445466e9f3 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Thu, 15 Feb 2024 14:19:03 -0500 Subject: [PATCH 212/214] Update llvm-toolchains repo url (#1633) --- deps.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.bzl b/deps.bzl index 358c20d938..717def2de3 100644 --- a/deps.bzl +++ b/deps.bzl @@ -57,7 +57,7 @@ def archive_dependencies(third_party): "name": "com_grail_bazel_toolchain", "sha256": "b2d168315dd0785f170b2b306b86e577c36e812b8f8b05568f9403141f2c24dd", "strip_prefix": "toolchains_llvm-0.9", - "url": "https://github.com/grailbio/bazel-toolchain/archive/refs/tags/0.9.tar.gz", + "url": "https://github.com/bazel-contrib/toolchains_llvm/archive/refs/tags/0.9.tar.gz", "patch_args": ["-p1"], "patches": ["%s:clang_toolchain.patch" % third_party], }, From cab70f2d31dba3dfdccec8e84207c02c4178c7a5 Mon Sep 17 00:00:00 2001 From: George Gensure Date: Sun, 18 Feb 2024 15:37:31 -0500 Subject: [PATCH 213/214] Describe maxSizeBytes default and sentinel (#1636) --- _site/docs/configuration/configuration.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/_site/docs/configuration/configuration.md b/_site/docs/configuration/configuration.md index ba85d4a6c5..5ca58b303e 100644 --- a/_site/docs/configuration/configuration.md +++ b/_site/docs/configuration/configuration.md @@ -336,13 +336,13 @@ worker: Unless specified, options are only relevant for FILESYSTEM type | Configuration | Accepted and _Default_ Values | Description | -|------------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------| -| type | _FILESYSTEM_, GRPC | Type of CAS used | -| path | String, _cache_ | Local cache location relative to the 'root', or absolute | -| maxSizeBytes | Integer, _2147483648_ | Limit for contents of files retained from CAS in the cache | -| fileDirectoriesIndexInMemory | boolean, _false_ | Determines if the file directories bidirectional mapping should be stored in memory or in sqllite | -| skipLoad | boolean, _false_ | Determines if transient data on the worker should be loaded into CAS on worker startup (affects startup time) | -| target | String, _null_ | For GRPC CAS type, target for external CAS endpoint | +|------------------------------|-------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| type | _FILESYSTEM_, GRPC | Type of CAS used | +| path | String, _cache_ | Local cache location relative to the 'root', or absolute | +| maxSizeBytes | Integer, _0_ | Limit for contents of files retained from CAS in the cache, value of 0 means to auto-configure to 90% of _root_/_path_ underlying filesystem space | +| fileDirectoriesIndexInMemory | boolean, _false_ | Determines if the file directories bidirectional mapping should be stored in memory or in sqlite | +| skipLoad | boolean, _false_ | Determines if transient data on the worker should be loaded into CAS on worker startup (affects startup time) | +| target | String, _null_ | For GRPC CAS type, target for external CAS endpoint | Example: From 14810a42ec8ea1fd65009d1183dd37a8ace0a0e3 Mon Sep 17 00:00:00 2001 From: Andrew Rothstein Date: Mon, 19 Feb 2024 15:09:41 +0100 Subject: [PATCH 214/214] migrate dependency to Bitnami Redis helm chart (#1637) * rework for bitnami redis helm chart * still doesn't work tho less specified * disable redis pwd -- not for production use * chart/bitnami-redis:18.14.2 * and later * stage chart v0.3.0 --- README.md | 4 ++-- kubernetes/helm-charts/buildfarm/Chart.yaml | 6 +++--- .../buildfarm/templates/configmap.yaml | 2 +- kubernetes/helm-charts/buildfarm/values.yaml | 15 +++------------ 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 84e2f75737..67037a566c 100644 --- a/README.md +++ b/README.md @@ -142,8 +142,8 @@ buildfarm_images() To install with helm: ```bash -# https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F0.2.3/buildfarm-0.2.3.tgz -CHART_VER="0.2.3" +# https://github.com/bazelbuild/bazel-buildfarm/releases/download/helm%2F0.3.0/buildfarm-0.3.0.tgz +CHART_VER="0.3.0" helm install \ -n bazel-buildfarm \ --create-namespace \ diff --git a/kubernetes/helm-charts/buildfarm/Chart.yaml b/kubernetes/helm-charts/buildfarm/Chart.yaml index 909ed735d5..8e105c726e 100644 --- a/kubernetes/helm-charts/buildfarm/Chart.yaml +++ b/kubernetes/helm-charts/buildfarm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.3 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -26,5 +26,5 @@ appVersion: 2.8.0 dependencies: - condition: redis.enabled name: redis - repository: https://charts.helm.sh/stable - version: 10.5.7 + repository: oci://registry-1.docker.io/bitnamicharts + version: ~18.14.2 diff --git a/kubernetes/helm-charts/buildfarm/templates/configmap.yaml b/kubernetes/helm-charts/buildfarm/templates/configmap.yaml index 809d83e049..6b30f841a6 100644 --- a/kubernetes/helm-charts/buildfarm/templates/configmap.yaml +++ b/kubernetes/helm-charts/buildfarm/templates/configmap.yaml @@ -11,7 +11,7 @@ data: {{- end }} backplane: {{- if .Values.redis.enabled }} - redisUri: "{{ .Values.redis.scheme }}://{{ printf "%s-redis-master.%s" (include "redis.fullname" .) (.Release.Namespace) }}:{{ "6379" }}" + redisUri: '{{ printf "redis://%s-redis-master.%s:6379" .Release.Name .Release.Namespace }}' {{- else }} redisUri: "{{ .Values.externalRedis.uri }}" {{- end }} diff --git a/kubernetes/helm-charts/buildfarm/values.yaml b/kubernetes/helm-charts/buildfarm/values.yaml index c18593a7e8..ff3f0c7ae2 100644 --- a/kubernetes/helm-charts/buildfarm/values.yaml +++ b/kubernetes/helm-charts/buildfarm/values.yaml @@ -172,19 +172,10 @@ redis: ## - set to `false` if using `externalRedis.*` ## enabled: true - scheme: "redis" - ## See more redis configs: https://github.com/bitnami/charts/blob/main/bitnami/redis/README.md - usePassword: false - ## configs for redis cluster mode - ## - cluster: - ## if redis runs in cluster mode - ## + auth: enabled: false - - ## the number of redis slaves - ## - slaveCount: 1 + replica: + replicaCount: 1 externalRedis: uri: "redis://localhost:6379"