From 8b56203400d79336cd56ce55192705e86c5cfd56 Mon Sep 17 00:00:00 2001 From: Benjamin Ingberg Date: Sat, 22 Aug 2026 11:57:34 +0200 Subject: [PATCH 1/4] Consume the storage.MessageReader interface When fetching messages from the CAS, do it via the storage.MessageReader interface. This completely decouples the scheduler.InMemoryBuildQueue and builder.noopBuildExecutor from the blobstore.BlobAccess interface. --- cmd/bb_noop_worker/BUILD.bazel | 2 + cmd/bb_noop_worker/main.go | 8 +- cmd/bb_scheduler/BUILD.bazel | 1 + cmd/bb_scheduler/main.go | 7 +- cmd/bb_worker/BUILD.bazel | 1 + cmd/bb_worker/main.go | 3 +- internal/mock/BUILD.bazel | 13 ++ pkg/builder/BUILD.bazel | 1 + pkg/builder/local_build_executor.go | 10 +- pkg/builder/local_build_executor_test.go | 71 ++++---- pkg/builder/noop_build_executor.go | 17 +- pkg/builder/noop_build_executor_test.go | 22 ++- pkg/scheduler/BUILD.bazel | 3 +- pkg/scheduler/in_memory_build_queue.go | 13 +- pkg/scheduler/in_memory_build_queue_test.go | 170 +++++++++++--------- 15 files changed, 197 insertions(+), 145 deletions(-) diff --git a/cmd/bb_noop_worker/BUILD.bazel b/cmd/bb_noop_worker/BUILD.bazel index e672978b..22906554 100644 --- a/cmd/bb_noop_worker/BUILD.bazel +++ b/cmd/bb_noop_worker/BUILD.bazel @@ -12,6 +12,8 @@ go_library( "//pkg/filesystem/pool", "//pkg/proto/configuration/bb_noop_worker", "//pkg/proto/remoteworker", + "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", + "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/configuration", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", diff --git a/cmd/bb_noop_worker/main.go b/cmd/bb_noop_worker/main.go index 8ecaba90..d389a208 100644 --- a/cmd/bb_noop_worker/main.go +++ b/cmd/bb_noop_worker/main.go @@ -5,11 +5,13 @@ import ( "net/url" "os" + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore" "github.com/buildbarn/bb-remote-execution/pkg/builder" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_noop_worker" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" + "github.com/buildbarn/bb-storage/pkg/blobstore" blobstore_configuration "github.com/buildbarn/bb-storage/pkg/blobstore/configuration" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" @@ -78,8 +80,10 @@ func main() { buildClient := builder.NewBuildClient( schedulerClient, builder.NewNoopBuildExecutor( - contentAddressableStorage, - int(configuration.MaximumMessageSizeBytes), + blobstore.NewBlobAccessMessageReader[*remoteexecution.Command]( + contentAddressableStorage, + int(configuration.MaximumMessageSizeBytes), + ), browserURL, ), pool.EmptyFilePool, diff --git a/cmd/bb_scheduler/BUILD.bazel b/cmd/bb_scheduler/BUILD.bazel index c312f827..30be9a50 100644 --- a/cmd/bb_scheduler/BUILD.bazel +++ b/cmd/bb_scheduler/BUILD.bazel @@ -39,6 +39,7 @@ go_library( "//pkg/util", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth/configuration", + "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/configuration", "@com_github_buildbarn_bb_storage//pkg/capabilities", "@com_github_buildbarn_bb_storage//pkg/clock", diff --git a/cmd/bb_scheduler/main.go b/cmd/bb_scheduler/main.go index 6dcac26f..028fabba 100644 --- a/cmd/bb_scheduler/main.go +++ b/cmd/bb_scheduler/main.go @@ -17,6 +17,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/initialsizeclass" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/routing" auth_configuration "github.com/buildbarn/bb-storage/pkg/auth/configuration" + "github.com/buildbarn/bb-storage/pkg/blobstore" blobstore_configuration "github.com/buildbarn/bb-storage/pkg/blobstore/configuration" "github.com/buildbarn/bb-storage/pkg/capabilities" "github.com/buildbarn/bb-storage/pkg/clock" @@ -132,7 +133,10 @@ func main() { // TODO: Make timeouts configurable. generator := random.NewFastSingleThreadedGenerator() buildQueue := scheduler.NewInMemoryBuildQueue( - contentAddressableStorage, + blobstore.NewBlobAccessMessageReader[*remoteexecution.Action]( + contentAddressableStorage, + int(configuration.MaximumMessageSizeBytes), + ), clock.SystemClock, uuid.NewRandom, &scheduler.InMemoryBuildQueueConfiguration{ @@ -149,7 +153,6 @@ func main() { WorkerTaskRetryCount: 9, WorkerWithNoSynchronizationsTimeout: time.Minute, }, - int(configuration.MaximumMessageSizeBytes), actionRouter, executeAuthorizer, modifyDrainsAuthorizer, diff --git a/cmd/bb_worker/BUILD.bazel b/cmd/bb_worker/BUILD.bazel index c243ead6..3dddb1e1 100644 --- a/cmd/bb_worker/BUILD.bazel +++ b/cmd/bb_worker/BUILD.bazel @@ -23,6 +23,7 @@ go_library( "//pkg/proto/configuration/bb_worker", "//pkg/proto/remoteworker", "//pkg/proto/runner", + "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/configuration", "@com_github_buildbarn_bb_storage//pkg/clock", diff --git a/cmd/bb_worker/main.go b/cmd/bb_worker/main.go index f9666890..89b8a630 100644 --- a/cmd/bb_worker/main.go +++ b/cmd/bb_worker/main.go @@ -14,6 +14,7 @@ import ( "sync/atomic" "time" + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore" "github.com/buildbarn/bb-remote-execution/pkg/builder" "github.com/buildbarn/bb-remote-execution/pkg/cas" @@ -462,12 +463,12 @@ func main() { buildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorageWriter, + blobstore.NewBlobAccessMessageReader[*remoteexecution.Command](contentAddressableStorageWriter, int(configuration.MaximumMessageSizeBytes)), buildDirectoryCreator, runnerClient, executionTimeoutClock, maximumWritableFileUploadDelay, inputRootCharacterDevices, - int(configuration.MaximumMessageSizeBytes), runnerConfiguration.EnvironmentVariables, configuration.ForceUploadTreesAndDirectories, ) diff --git a/internal/mock/BUILD.bazel b/internal/mock/BUILD.bazel index 3d045bbe..9252a1c9 100644 --- a/internal/mock/BUILD.bazel +++ b/internal/mock/BUILD.bazel @@ -376,6 +376,16 @@ gomock( package = "mock", ) +gomock( + name = "storage", + out = "storage.go", + interfaces = ["MessageReader"], + library = "@com_github_buildbarn_bb_storage//pkg/storage", + mockgen_tool = "@org_uber_go_mock//mockgen", + package = "mock", + source = "@com_github_buildbarn_bb_storage//pkg/storage:message_reader.go", +) + gomock( name = "storage_builder", out = "storage_builder.go", @@ -457,6 +467,7 @@ go_library( ":routing.go", ":runner.go", ":runner_pb.go", + ":storage.go", ":storage_builder.go", ":storage_util.go", ":sync.go", @@ -506,6 +517,7 @@ go_library( "@com_github_buildbarn_bb_storage//pkg/filesystem", "@com_github_buildbarn_bb_storage//pkg/filesystem/path", "@com_github_buildbarn_bb_storage//pkg/proto/iscc", + "@com_github_buildbarn_bb_storage//pkg/storage", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_google_uuid//:uuid", "@com_google_cloud_go_longrunning//autogen/longrunningpb", @@ -515,6 +527,7 @@ go_library( "@io_opentelemetry_go_otel_trace//embedded", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//metadata", + "@org_golang_google_protobuf//proto", "@org_golang_google_protobuf//types/known/anypb:go_default_library", "@org_golang_google_protobuf//types/known/emptypb:go_default_library", "@org_uber_go_mock//gomock", diff --git a/pkg/builder/BUILD.bazel b/pkg/builder/BUILD.bazel index a7de4111..81fce1a8 100644 --- a/pkg/builder/BUILD.bazel +++ b/pkg/builder/BUILD.bazel @@ -56,6 +56,7 @@ go_library( "@com_github_buildbarn_bb_storage//pkg/program", "@com_github_buildbarn_bb_storage//pkg/proto/fsac", "@com_github_buildbarn_bb_storage//pkg/random", + "@com_github_buildbarn_bb_storage//pkg/storage", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_google_uuid//:uuid", "@com_github_kballard_go_shellquote//:go-shellquote", diff --git a/pkg/builder/local_build_executor.go b/pkg/builder/local_build_executor.go index a1b8ee07..f8ffe03c 100644 --- a/pkg/builder/local_build_executor.go +++ b/pkg/builder/local_build_executor.go @@ -17,6 +17,7 @@ import ( "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" + "github.com/buildbarn/bb-storage/pkg/storage" "github.com/buildbarn/bb-storage/pkg/util" "google.golang.org/grpc/codes" @@ -66,27 +67,27 @@ func (el *capturingErrorLogger) GetError() error { type localBuildExecutor struct { contentAddressableStorage blobstore.BlobAccess + commandReader storage.MessageReader[*remoteexecution.Command] buildDirectoryCreator BuildDirectoryCreator runner runner_pb.RunnerClient clock clock.Clock maximumWritableFileUploadDelay time.Duration inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber - maximumMessageSizeBytes int environmentVariables map[string]string forceUploadTreesAndDirectories bool } // NewLocalBuildExecutor returns a BuildExecutor that executes build // steps on the local system. -func NewLocalBuildExecutor(contentAddressableStorage blobstore.BlobAccess, buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, maximumMessageSizeBytes int, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { +func NewLocalBuildExecutor(contentAddressableStorage blobstore.BlobAccess, commandReader storage.MessageReader[*remoteexecution.Command], buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { return &localBuildExecutor{ contentAddressableStorage: contentAddressableStorage, + commandReader: commandReader, buildDirectoryCreator: buildDirectoryCreator, runner: runner, clock: clock, maximumWritableFileUploadDelay: maximumWritableFileUploadDelay, inputRootCharacterDevices: inputRootCharacterDevices, - maximumMessageSizeBytes: maximumMessageSizeBytes, environmentVariables: environmentVariables, forceUploadTreesAndDirectories: forceUploadTreesAndDirectories, } @@ -231,12 +232,11 @@ func (be *localBuildExecutor) Execute(ctx context.Context, filePool pool.FilePoo attachErrorToExecuteResponse(response, util.StatusWrap(err, "Failed to extract digest for command")) return response } - commandMessage, err := be.contentAddressableStorage.Get(ctx, commandDigest).ToProto(&remoteexecution.Command{}, be.maximumMessageSizeBytes) + command, err := be.commandReader.ReadMessage(ctx, commandDigest, &remoteexecution.Command{}) if err != nil { attachErrorToExecuteResponse(response, util.StatusWrap(err, "Failed to obtain command")) return response } - command := commandMessage.(*remoteexecution.Command) outputHierarchy, err := NewOutputHierarchy(command) if err != nil { attachErrorToExecuteResponse(response, err) diff --git a/pkg/builder/local_build_executor_test.go b/pkg/builder/local_build_executor_test.go index 29255ea1..e14f2910 100644 --- a/pkg/builder/local_build_executor_test.go +++ b/pkg/builder/local_build_executor_test.go @@ -35,17 +35,18 @@ func TestLocalBuildExecutorInvalidActionDigest(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -85,17 +86,18 @@ func TestLocalBuildExecutorMissingAction(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -128,6 +130,7 @@ func TestLocalBuildExecutorBuildDirectoryCreatorFailedFailed(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) buildDirectoryCreator.EXPECT().GetBuildDirectory(ctx, &actionDigest). @@ -136,12 +139,12 @@ func TestLocalBuildExecutorBuildDirectoryCreatorFailedFailed(t *testing.T) { clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -181,6 +184,7 @@ func TestLocalBuildExecutorInputRootPopulationFailed(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) buildDirectory := mock.NewMockBuildDirectory(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) @@ -204,12 +208,12 @@ func TestLocalBuildExecutorInputRootPopulationFailed(t *testing.T) { clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -247,16 +251,18 @@ func TestLocalBuildExecutorOutputDirectoryCreationFailure(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("fedora", remoteexecution.DigestFunction_SHA256, "6666666666666666666666666666666666666666666666666666666666666666", 234), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + gomock.Any(), + ).Return(&remoteexecution.Command{ Arguments: []string{"touch", "foo"}, EnvironmentVariables: []*remoteexecution.Command_EnvironmentVariable{ {Name: "PATH", Value: "/bin:/usr/bin"}, }, OutputPaths: []string{"foo/bar/baz"}, - }, buffer.UserProvided)) + }, nil) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) buildDirectory := mock.NewMockBuildDirectory(ctrl) actionDigest := digest.MustNewDigest("fedora", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) @@ -281,12 +287,12 @@ func TestLocalBuildExecutorOutputDirectoryCreationFailure(t *testing.T) { clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -328,6 +334,7 @@ func TestLocalBuildExecutorMissingCommand(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) buildDirectory := mock.NewMockBuildDirectory(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) @@ -351,12 +358,12 @@ func TestLocalBuildExecutorMissingCommand(t *testing.T) { clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -394,16 +401,18 @@ func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "6666666666666666666666666666666666666666666666666666666666666666", 234), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + gomock.Any(), + ).Return(&remoteexecution.Command{ Arguments: []string{"touch", "foo"}, EnvironmentVariables: []*remoteexecution.Command_EnvironmentVariable{ {Name: "PATH", Value: "/bin:/usr/bin"}, }, OutputPaths: []string{"foo"}, - }, buffer.UserProvided)) + }, nil) buildDirectory := mock.NewMockBuildDirectory(ctrl) buildDirectory.EXPECT().UploadFile(ctx, path.MustNewComponent("stdout"), gomock.Any(), gomock.Any()).Return( digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000005", 567), @@ -481,12 +490,12 @@ func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { }) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -590,10 +599,12 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { // Read operations against the Content Addressable Storage. contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("ubuntu1804", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000002", 234), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + gomock.Any(), + ).Return(&remoteexecution.Command{ Arguments: []string{ "/usr/local/bin/clang", "-MD", @@ -621,7 +632,7 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { }, }, }, - }, buffer.UserProvided)) + }, nil) // Write operations against the Content Addressable Storage. buildDirectory := mock.NewMockBuildDirectory(ctrl) @@ -714,6 +725,7 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { }) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, @@ -721,7 +733,6 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { /* inputRootCharacterDevices = */ map[path.Component]filesystem.DeviceNumber{ path.MustNewComponent("null"): filesystem.NewDeviceNumberFromMajorMinor(1, 3), }, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{ "TEST_VAR": "123", "PWD": "dont-overwrite", @@ -798,17 +809,18 @@ func TestLocalBuildExecutorCachingInvalidTimeout(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -849,12 +861,14 @@ func TestLocalBuildExecutorInputRootIOFailureDuringExecution(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("ubuntu1804", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000002", 234), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + gomock.Any(), + ).Return(&remoteexecution.Command{ Arguments: []string{"clang"}, - }, buffer.UserProvided)) + }, nil) buildDirectory.EXPECT().UploadFile(ctx, path.MustNewComponent("stdout"), gomock.Any(), gomock.Any()).Return( digest.MustNewDigest("ubuntu1804", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000005", 567), nil, @@ -925,12 +939,12 @@ func TestLocalBuildExecutorInputRootIOFailureDuringExecution(t *testing.T) { }) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -984,12 +998,14 @@ func TestLocalBuildExecutorTimeoutDuringExecution(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("ubuntu1804", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000002", 234), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + gomock.Any(), + ).Return(&remoteexecution.Command{ Arguments: []string{"clang"}, - }, buffer.UserProvided)) + }, nil) buildDirectory.EXPECT().UploadFile(ctx, path.MustNewComponent("stdout"), gomock.Any(), gomock.Any()).Return( digest.MustNewDigest("ubuntu1804", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000005", 567), nil, @@ -1061,12 +1077,12 @@ func TestLocalBuildExecutorTimeoutDuringExecution(t *testing.T) { }) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, /* maximumWritableFileUploadDelay = */ 10*time.Second, /* inputRootCharacterDevices = */ nil, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) @@ -1126,6 +1142,7 @@ func TestLocalBuildExecutorCharacterDeviceNodeCreationFailed(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) // Build environment. buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) @@ -1161,6 +1178,7 @@ func TestLocalBuildExecutorCharacterDeviceNodeCreationFailed(t *testing.T) { clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, + commandReader, buildDirectoryCreator, runner, clock, @@ -1168,7 +1186,6 @@ func TestLocalBuildExecutorCharacterDeviceNodeCreationFailed(t *testing.T) { /* inputRootCharacterDevices = */ map[path.Component]filesystem.DeviceNumber{ path.MustNewComponent("null"): filesystem.NewDeviceNumberFromMajorMinor(1, 3), }, - /* maximumMessageSizeBytes = */ 10000, /* environmentVariables = */ map[string]string{}, /* forceUploadTreesAndDirectories = */ false, ) diff --git a/pkg/builder/noop_build_executor.go b/pkg/builder/noop_build_executor.go index 70dd1240..d9d2a9bb 100644 --- a/pkg/builder/noop_build_executor.go +++ b/pkg/builder/noop_build_executor.go @@ -11,8 +11,8 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" re_util "github.com/buildbarn/bb-remote-execution/pkg/util" - "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/storage" "github.com/buildbarn/bb-storage/pkg/util" "google.golang.org/grpc/codes" @@ -20,9 +20,8 @@ import ( ) type noopBuildExecutor struct { - contentAddressableStorage blobstore.BlobAccess - maximumMessageSizeBytes int - browserURL *url.URL + commandReader storage.MessageReader[*remoteexecution.Command] + browserURL *url.URL } // NewNoopBuildExecutor creates a BuildExecutor that always returns an @@ -32,11 +31,10 @@ type noopBuildExecutor struct { // to upload the input root of an action into the Content Addressable // Storage (CAS) without causing it to be executed afterwards. This may // be useful when attempting to debug actions. -func NewNoopBuildExecutor(contentAddressableStorage blobstore.BlobAccess, maximumMessageSizeBytes int, browserURL *url.URL) BuildExecutor { +func NewNoopBuildExecutor(commandReader storage.MessageReader[*remoteexecution.Command], browserURL *url.URL) BuildExecutor { return &noopBuildExecutor{ - contentAddressableStorage: contentAddressableStorage, - maximumMessageSizeBytes: maximumMessageSizeBytes, - browserURL: browserURL, + commandReader: commandReader, + browserURL: browserURL, } } @@ -69,12 +67,11 @@ func (be *noopBuildExecutor) Execute(ctx context.Context, filePool pool.FilePool attachErrorToExecuteResponse(response, util.StatusWrap(err, "Failed to extract digest for command")) return response } - commandMessage, err := be.contentAddressableStorage.Get(ctx, commandDigest).ToProto(&remoteexecution.Command{}, be.maximumMessageSizeBytes) + command, err := be.commandReader.ReadMessage(ctx, commandDigest, &remoteexecution.Command{}) if err != nil { attachErrorToExecuteResponse(response, util.StatusWrap(err, "Failed to obtain command")) return response } - command := commandMessage.(*remoteexecution.Command) errorMessageTemplate := defaultNoopErrorMessageTemplate for _, environmentVariable := range command.EnvironmentVariables { diff --git a/pkg/builder/noop_build_executor_test.go b/pkg/builder/noop_build_executor_test.go index 06500dea..09fa0133 100644 --- a/pkg/builder/noop_build_executor_test.go +++ b/pkg/builder/noop_build_executor_test.go @@ -9,7 +9,6 @@ import ( "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/testutil" @@ -22,10 +21,9 @@ import ( func TestNoopBuildExecutor(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) buildExecutor := builder.NewNoopBuildExecutor( - contentAddressableStorage, - /* maximumMessageSizeBytes = */ 10000, + commandReader, &url.URL{ Scheme: "http", Host: "example.com", @@ -93,15 +91,15 @@ func TestNoopBuildExecutor(t *testing.T) { t.Run("InvalidTemplate", func(t *testing.T) { // If an invalid template is provided in the // environment, parsing it should fail. - contentAddressableStorage.EXPECT().Get(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "7f53aed4b5489c487be514dd88d3314d966e19b84bc766a972d82246ee6f494f", 150)). - Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + commandReader.EXPECT().ReadMessage(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "7f53aed4b5489c487be514dd88d3314d966e19b84bc766a972d82246ee6f494f", 150), gomock.Any()). + Return(&remoteexecution.Command{ EnvironmentVariables: []*remoteexecution.Command_EnvironmentVariable{ { Name: "NOOP_WORKER_ERROR_MESSAGE_TEMPLATE", Value: "{{ foobarbaz }}", }, }, - }, buffer.UserProvided)) + }, nil) filePool := mock.NewMockFilePool(ctrl) monitor := mock.NewMockUnreadDirectoryMonitor(ctrl) testutil.RequireEqualProto( @@ -137,8 +135,8 @@ func TestNoopBuildExecutor(t *testing.T) { t.Run("SuccessDefaultTemplate", func(t *testing.T) { // If no template is provided in the environment // variables, then a default template should be used. - contentAddressableStorage.EXPECT().Get(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "d134371fd7573f7ef77c90e907c8bfaf95f34b82ac8503dbed5e062fb6fe4702", 200)). - Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{}, buffer.UserProvided)) + commandReader.EXPECT().ReadMessage(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "d134371fd7573f7ef77c90e907c8bfaf95f34b82ac8503dbed5e062fb6fe4702", 200), gomock.Any()). + Return(&remoteexecution.Command{}, nil) filePool := mock.NewMockFilePool(ctrl) monitor := mock.NewMockUnreadDirectoryMonitor(ctrl) testutil.RequireEqualProto( @@ -174,8 +172,8 @@ func TestNoopBuildExecutor(t *testing.T) { t.Run("SuccessCustomTemplate", func(t *testing.T) { // If a custom template is provided in the environment, // it should be preferred over the default template. - contentAddressableStorage.EXPECT().Get(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "9da17cb226048f5bb3e6a20311b551e73ce8ac0d408e69e737d28a8f3179d0ce", 300)). - Return(buffer.NewProtoBufferFromProto(&remoteexecution.Command{ + commandReader.EXPECT().ReadMessage(ctx, digest.MustNewDigest("build", remoteexecution.DigestFunction_SHA256, "9da17cb226048f5bb3e6a20311b551e73ce8ac0d408e69e737d28a8f3179d0ce", 300), gomock.Any()). + Return(&remoteexecution.Command{ EnvironmentVariables: []*remoteexecution.Command_EnvironmentVariable{ { Name: "PATH", @@ -186,7 +184,7 @@ func TestNoopBuildExecutor(t *testing.T) { Value: "Please visit {{ .ActionURL }} to inspect the action", }, }, - }, buffer.UserProvided)) + }, nil) filePool := mock.NewMockFilePool(ctrl) monitor := mock.NewMockUnreadDirectoryMonitor(ctrl) testutil.RequireEqualProto( diff --git a/pkg/scheduler/BUILD.bazel b/pkg/scheduler/BUILD.bazel index 2c1592b0..8c21c21b 100644 --- a/pkg/scheduler/BUILD.bazel +++ b/pkg/scheduler/BUILD.bazel @@ -16,12 +16,12 @@ go_library( "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@bazel_remote_apis//build/bazel/semver:semver_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth", - "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/builder", "@com_github_buildbarn_bb_storage//pkg/capabilities", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/otel", + "@com_github_buildbarn_bb_storage//pkg/storage", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_google_uuid//:uuid", "@com_github_prometheus_client_golang//prometheus", @@ -56,7 +56,6 @@ go_test( "//pkg/scheduler/platform", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth", - "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", "@com_github_buildbarn_bb_storage//pkg/builder", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", diff --git a/pkg/scheduler/in_memory_build_queue.go b/pkg/scheduler/in_memory_build_queue.go index 7240add6..1aee52f1 100644 --- a/pkg/scheduler/in_memory_build_queue.go +++ b/pkg/scheduler/in_memory_build_queue.go @@ -21,12 +21,12 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/platform" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/routing" "github.com/buildbarn/bb-storage/pkg/auth" - "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/builder" "github.com/buildbarn/bb-storage/pkg/capabilities" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/otel" + "github.com/buildbarn/bb-storage/pkg/storage" "github.com/buildbarn/bb-storage/pkg/util" "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus" @@ -236,12 +236,11 @@ type InMemoryBuildQueueConfiguration struct { type InMemoryBuildQueue struct { capabilities.Provider - contentAddressableStorage blobstore.BlobAccess + actionReader storage.MessageReader[*remoteexecution.Action] clock clock.Clock uuidGenerator util.UUIDGenerator configuration *InMemoryBuildQueueConfiguration platformQueueAbsenceHardFailureTime time.Time - maximumMessageSizeBytes int actionRouter routing.ActionRouter lock sync.Mutex @@ -316,7 +315,7 @@ var inMemoryBuildQueueCapabilitiesProvider = capabilities.NewStaticProvider(&rem // NewInMemoryBuildQueue creates a new InMemoryBuildQueue that is in the // initial state. It does not have any queues, workers or queued // execution requests. All of these are created by sending it RPCs. -func NewInMemoryBuildQueue(contentAddressableStorage blobstore.BlobAccess, clock clock.Clock, uuidGenerator util.UUIDGenerator, configuration *InMemoryBuildQueueConfiguration, maximumMessageSizeBytes int, actionRouter routing.ActionRouter, executeAuthorizer, modifyDrainsAuthorizer, killOperationsAuthorizer, synchronizeAuthorizer auth.Authorizer) *InMemoryBuildQueue { +func NewInMemoryBuildQueue(actionReader storage.MessageReader[*remoteexecution.Action], clock clock.Clock, uuidGenerator util.UUIDGenerator, configuration *InMemoryBuildQueueConfiguration, actionRouter routing.ActionRouter, executeAuthorizer, modifyDrainsAuthorizer, killOperationsAuthorizer, synchronizeAuthorizer auth.Authorizer) *InMemoryBuildQueue { inMemoryBuildQueuePrometheusMetrics.Do(func() { prometheus.MustRegister(inMemoryBuildQueueInFlightDeduplicationsTotal) @@ -341,12 +340,11 @@ func NewInMemoryBuildQueue(contentAddressableStorage blobstore.BlobAccess, clock return &InMemoryBuildQueue{ Provider: capabilities.NewAuthorizingProvider(inMemoryBuildQueueCapabilitiesProvider, executeAuthorizer), - contentAddressableStorage: contentAddressableStorage, + actionReader: actionReader, clock: clock, uuidGenerator: uuidGenerator, configuration: configuration, platformQueueAbsenceHardFailureTime: clock.Now().Add(configuration.PlatformQueueWithNoWorkersTimeout), - maximumMessageSizeBytes: maximumMessageSizeBytes, actionRouter: actionRouter, platformQueuesTrie: platform.NewTrie(), sizeClassQueues: map[sizeClassKey]*sizeClassQueue{}, @@ -450,11 +448,10 @@ func (bq *InMemoryBuildQueue) Execute(in *remoteexecution.ExecuteRequest, out re if err != nil { return util.StatusWrap(err, "Failed to extract digest for action") } - actionMessage, err := bq.contentAddressableStorage.Get(ctx, actionDigest).ToProto(&remoteexecution.Action{}, bq.maximumMessageSizeBytes) + action, err := bq.actionReader.ReadMessage(ctx, actionDigest, &remoteexecution.Action{}) if err != nil { return util.StatusWrap(err, "Failed to obtain action") } - action := actionMessage.(*remoteexecution.Action) platformKey, err := platform.NewKey(instanceName, action.Platform) if err != nil { return err diff --git a/pkg/scheduler/in_memory_build_queue_test.go b/pkg/scheduler/in_memory_build_queue_test.go index 455c40f5..23754d45 100644 --- a/pkg/scheduler/in_memory_build_queue_test.go +++ b/pkg/scheduler/in_memory_build_queue_test.go @@ -16,7 +16,6 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/invocation" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/platform" "github.com/buildbarn/bb-storage/pkg/auth" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/builder" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" @@ -88,12 +87,12 @@ func getExecutionClient(t *testing.T, buildQueue builder.BuildQueue) remoteexecu func TestInMemoryBuildQueueExecuteBadRequest(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // ExecuteRequest contains an invalid action digest. @@ -111,10 +110,11 @@ func TestInMemoryBuildQueueExecuteBadRequest(t *testing.T) { // Action cannot be found in the Content Addressable Storage (CAS). t.Run("MissingAction", func(t *testing.T) { - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewBufferFromError(status.Error(codes.FailedPrecondition, "Blob not found"))) + gomock.Any(), + ).Return(nil, status.Error(codes.FailedPrecondition, "Blob not found")) stream, err := executionClient.Execute(ctx, &remoteexecution.ExecuteRequest{ InstanceName: "main", @@ -139,10 +139,11 @@ func TestInMemoryBuildQueueExecuteBadRequest(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil).Return(action, platform.MustNewKey("main", platformForTesting), nil, initialSizeClassSelector, nil) initialSizeClassSelector.EXPECT().Abandoned() @@ -170,10 +171,11 @@ func TestInMemoryBuildQueueExecuteBadRequest(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil).Return(action, platform.MustNewKey("main", platformForTesting), nil, initialSizeClassSelector, nil) initialSizeClassSelector.EXPECT().Abandoned() @@ -195,24 +197,25 @@ func TestInMemoryBuildQueueExecuteBadRequest(t *testing.T) { func TestInMemoryBuildQueuePurgeStaleWorkersAndQueues(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) actionRouter := mock.NewMockActionRouter(ctrl) for i := 0; i < 10; i++ { - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Action{ + gomock.Any(), + ).Return(&remoteexecution.Action{ CommandDigest: &remoteexecution.Digest{ Hash: "61c585c297d00409bd477b6b80759c94ec545ab4", SizeBytes: 456, }, DoNotCache: true, - }, buffer.UserProvided)) + }, nil) } clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -498,18 +501,19 @@ func TestInMemoryBuildQueuePurgeStaleOperations(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) for i := 0; i < 2; i++ { - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) } clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -742,22 +746,23 @@ func TestInMemoryBuildQueuePurgeStaleOperations(t *testing.T) { func TestInMemoryBuildQueueCrashLoopingWorker(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) action := &remoteexecution.Action{ CommandDigest: &remoteexecution.Digest{ Hash: "61c585c297d00409bd477b6b80759c94ec545ab4", SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main/suffix", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -968,16 +973,17 @@ func TestInMemoryBuildQueueKillOperationsOperationName(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -1186,16 +1192,17 @@ func TestInMemoryBuildQueueKillOperationsSizeClassQueueWithoutWorkers(t *testing SizeBytes: 456, }, } - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // If the scheduler is in the initial state, the size class @@ -1354,12 +1361,12 @@ func TestInMemoryBuildQueueKillOperationsSizeClassQueueWithoutWorkers(t *testing func TestInMemoryBuildQueueIdleWorkerSynchronizationTimeout(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) // When no work appears, workers should still be woken up // periodically to resynchronize. This ensures that workers that @@ -1409,16 +1416,17 @@ func TestInMemoryBuildQueueDrainedWorker(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Get( + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -1712,12 +1720,12 @@ func TestInMemoryBuildQueueDrainedWorker(t *testing.T) { func TestInMemoryBuildQueueInvocationFairness(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -1797,10 +1805,11 @@ func TestInMemoryBuildQueueInvocationFairness(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_MD5, p.actionHash, 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) requestMetadata := &remoteexecution.RequestMetadata{ ToolInvocationId: p.invocationID, @@ -2109,12 +2118,12 @@ func TestInMemoryBuildQueueInvocationFairness(t *testing.T) { func TestInMemoryBuildQueueInFlightDeduplicationAbandonQueued(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -2178,10 +2187,11 @@ func TestInMemoryBuildQueueInFlightDeduplicationAbandonQueued(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA256, "fc96ea0eee854b45950d3a7448332445730886691b992cb7917da0853664f7c2", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) requestMetadata := &remoteexecution.RequestMetadata{ @@ -2305,12 +2315,12 @@ func TestInMemoryBuildQueueInFlightDeduplicationAbandonQueued(t *testing.T) { func TestInMemoryBuildQueueInFlightDeduplicationAbandonExecuting(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -2375,10 +2385,11 @@ func TestInMemoryBuildQueueInFlightDeduplicationAbandonExecuting(t *testing.T) { }, Platform: platformForTesting, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA256, "fc96ea0eee854b45950d3a7448332445730886691b992cb7917da0853664f7c2", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) requestMetadata := &remoteexecution.RequestMetadata{ @@ -2545,12 +2556,12 @@ func TestInMemoryBuildQueueInFlightDeduplicationAbandonExecuting(t *testing.T) { func TestInMemoryBuildQueuePreferBeingIdle(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Announce a new worker, which creates a queue for operations. @@ -2586,10 +2597,11 @@ func TestInMemoryBuildQueuePreferBeingIdle(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil).Return(action, platform.MustNewKey("main", platformForTesting), nil, initialSizeClassSelector, nil) initialSizeClassLearner := mock.NewMockLearner(ctrl) @@ -2767,12 +2779,12 @@ func TestInMemoryBuildQueuePreferBeingIdle(t *testing.T) { func TestInMemoryBuildQueueMultipleSizeClasses(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Register a platform queue that allows workers up to size @@ -2850,10 +2862,11 @@ func TestInMemoryBuildQueueMultipleSizeClasses(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil).Return(action, platform.MustNewKey("main", platformForTesting), nil, initialSizeClassSelector, nil) initialSizeClassLearner1 := mock.NewMockLearner(ctrl) @@ -3144,12 +3157,12 @@ func TestInMemoryBuildQueueMultipleSizeClasses(t *testing.T) { func TestInMemoryBuildQueueBackgroundRun(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Register a platform queue that allows workers up to size @@ -3206,10 +3219,11 @@ func TestInMemoryBuildQueueBackgroundRun(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("main", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil).Return(action, platform.MustNewKey("main", platformForTesting), nil, initialSizeClassSelector, nil) initialSizeClassLearner1 := mock.NewMockLearner(ctrl) @@ -3468,12 +3482,12 @@ func TestInMemoryBuildQueueBackgroundRun(t *testing.T) { func TestInMemoryBuildQueueIdleSynchronizingWorkers(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) mockClock := mock.NewMockClock(ctrl) mockClock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, mockClock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, mockClock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Common values used by steps below. @@ -3531,10 +3545,11 @@ func TestInMemoryBuildQueueIdleSynchronizingWorkers(t *testing.T) { }) require.NoError(t, err) - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("", remoteexecution.DigestFunction_SHA1, "da39a3ee5e6b4b0d3255bfef95601890afd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)).AnyTimes() + gomock.Any(), + ).Return(action, nil).AnyTimes() // Create a worker that does a blocking Synchronize() call // against the scheduler. @@ -3891,12 +3906,12 @@ func TestInMemoryBuildQueueIdleSynchronizingWorkers(t *testing.T) { func TestInMemoryBuildQueueWorkerInvocationStickinessLimit(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) // Register a platform queue that has a small amount of worker @@ -3943,10 +3958,11 @@ func TestInMemoryBuildQueueWorkerInvocationStickinessLimit(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("", remoteexecution.DigestFunction_SHA1, "0474d2f48968a56da4de20718d8ac23aafd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) requestMetadata := &remoteexecution.RequestMetadata{ ToolInvocationId: p.toolInvocationID, } @@ -4121,13 +4137,13 @@ func TestInMemoryBuildQueueWorkerInvocationStickinessLimit(t *testing.T) { func TestInMemoryBuildQueueAuthorization(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) clock := mock.NewMockClock(ctrl) clock.EXPECT().Now().Return(time.Unix(0, 0)).AnyTimes() uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) authorizer := mock.NewMockAuthorizer(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, authorizer, authorizer, authorizer, authorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, clock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, authorizer, authorizer, authorizer, authorizer) beepboop := util.Must(digest.NewInstanceName("beepboop")) t.Run("GetCapabilities-NotAuthorized", func(t *testing.T) { @@ -4188,10 +4204,11 @@ func TestInMemoryBuildQueueAuthorization(t *testing.T) { Platform: &remoteexecution.Platform{}, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("beepboop", remoteexecution.DigestFunction_SHA1, "61c585c297d00409bd477b6b80759c94ec545ab4", 456), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) initialSizeClassSelector := mock.NewMockSelector(ctrl) actionRouter.EXPECT().RouteAction(gomock.Any(), gomock.Any(), testutil.EqProto(t, action), nil). @@ -4245,12 +4262,12 @@ func TestInMemoryBuildQueueAuthorization(t *testing.T) { func TestInMemoryBuildQueueNestedInvocationsSynchronization(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + actionReader := mock.NewMockMessageReader[*remoteexecution.Action](ctrl) mockClock := mock.NewMockClock(ctrl) mockClock.EXPECT().Now().Return(time.Unix(0, 0)) uuidGenerator := mock.NewMockUUIDGenerator(ctrl) actionRouter := mock.NewMockActionRouter(ctrl) - buildQueue := scheduler.NewInMemoryBuildQueue(contentAddressableStorage, mockClock, uuidGenerator.Call, &buildQueueConfigurationForTesting, 10000, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) + buildQueue := scheduler.NewInMemoryBuildQueue(actionReader, mockClock, uuidGenerator.Call, &buildQueueConfigurationForTesting, actionRouter, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer, allowAllAuthorizer) executionClient := getExecutionClient(t, buildQueue) mockClock.EXPECT().Now().Return(time.Unix(1000, 0)) @@ -4293,10 +4310,11 @@ func TestInMemoryBuildQueueNestedInvocationsSynchronization(t *testing.T) { SizeBytes: 456, }, } - contentAddressableStorage.EXPECT().Get( + actionReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("", remoteexecution.DigestFunction_SHA1, "0474d2f48968a56da4de20718d8ac23aafd80709", 123), - ).Return(buffer.NewProtoBufferFromProto(action, buffer.UserProvided)) + gomock.Any(), + ).Return(action, nil) toolInvocationID := &remoteexecution.RequestMetadata{ ToolInvocationId: p.toolInvocationID, } From 0b9b7e54467547ebaf5e200664e1b90f518d3bf7 Mon Sep 17 00:00:00 2001 From: Benjamin Ingberg Date: Fri, 14 Aug 2026 16:25:14 +0200 Subject: [PATCH 2/4] Update to bb-storage without a CAS blobAccess This commit updates to bb-storage that doesn't export the Content Addressable Storage (CAS) as a blobstore.BlobAccess. The CAS is instead built from two low level storage primitives. The Chunk Storage (CS) which contains raw chunks of data and the Chunk List Storage (CLS) which contains lists that describes which chunks make up a blob in the CAS. This had a fairly large impact on bb-remote-execution as many components assumed that it would interact with the CAS via a blobstore.BlobAccess but this has now been replaced with a cdc.ContentAddressableStorage. --- .gitignore | 2 + MODULE.bazel.lock | 158 ++ cmd/bb_noop_worker/BUILD.bazel | 3 +- cmd/bb_noop_worker/main.go | 17 +- cmd/bb_scheduler/BUILD.bazel | 1 + cmd/bb_scheduler/main.go | 16 +- cmd/bb_worker/BUILD.bazel | 1 - cmd/bb_worker/main.go | 56 +- internal/mock/BUILD.bazel | 14 + pkg/blobstore/BUILD.bazel | 10 - .../existence_precondition_blob_access.go | 71 - ...existence_precondition_blob_access_test.go | 154 -- pkg/blobstore/suspending_blob_access.go | 80 - pkg/blobstore/suspending_blob_access_test.go | 122 - pkg/builder/BUILD.bazel | 3 + pkg/builder/caching_build_executor.go | 7 +- pkg/builder/caching_build_executor_test.go | 68 +- pkg/builder/local_build_executor.go | 11 +- pkg/builder/local_build_executor_test.go | 57 +- pkg/builder/naive_build_directory.go | 37 +- pkg/builder/naive_build_directory_test.go | 54 +- pkg/builder/output_hierarchy.go | 12 +- pkg/builder/output_hierarchy_test.go | 60 +- pkg/builder/prefetching_build_executor.go | 9 +- .../prefetching_build_executor_test.go | 11 +- pkg/builder/virtual_build_directory.go | 16 +- pkg/cas/BUILD.bazel | 30 +- pkg/cas/batching_blob_uploader.go | 134 + pkg/cas/batching_blob_uploader_test.go | 169 ++ pkg/cas/blob.go | 104 + pkg/cas/blob_access_directory_fetcher.go | 168 -- pkg/cas/blob_uploader.go | 12 + pkg/cas/cas_directory_fetcher.go | 155 ++ ..._test.go => cas_directory_fetcher_test.go} | 156 +- ...ss_file_fetcher.go => cas_file_fetcher.go} | 14 +- pkg/cas/cas_message_reader.go | 33 + ...recondition_content_addressable_storage.go | 68 + ...dition_content_addressable_storage_test.go | 176 ++ pkg/cas/put_blob.go | 34 + pkg/cas/put_blob_test.go | 101 + .../suspending_content_addressable_storage.go | 70 + pkg/filesystem/virtual/BUILD.bazel | 5 +- .../virtual/blob_access_cas_file_factory.go | 8 +- .../blob_access_cas_file_factory_test.go | 8 +- pkg/filesystem/virtual/node.go | 10 +- .../virtual/pool_backed_file_allocator.go | 13 +- .../pool_backed_file_allocator_test.go | 52 +- .../bazel_output_service.pb.go | 1251 --------- .../bazel_output_service_grpc.pb.go | 309 --- .../rev2/bazel_output_service_rev2.pb.go | 254 -- .../buildqueuestate/buildqueuestate.pb.go | 2448 ----------------- .../buildqueuestate_grpc.pb.go | 500 ---- pkg/proto/cas/cas.pb.go | 136 - .../completed_action_logger.pb.go | 163 -- .../completed_action_logger_grpc.pb.go | 114 - .../bb_noop_worker/bb_noop_worker.pb.go | 217 -- .../bb_noop_worker/bb_noop_worker.proto | 4 +- .../configuration/bb_runner/bb_runner.pb.go | 250 -- .../bb_scheduler/bb_scheduler.pb.go | 407 --- .../bb_scheduler/bb_scheduler.proto | 2 +- .../bb_virtual_tmp/bb_virtual_tmp.pb.go | 160 -- .../configuration/bb_worker/bb_worker.pb.go | 956 ------- pkg/proto/configuration/cas/cas.pb.go | 145 - .../credentials/credentials.pb.go | 142 - .../configuration/filesystem/filesystem.pb.go | 153 -- .../filesystem/virtual/virtual.pb.go | 683 ----- .../configuration/scheduler/scheduler.pb.go | 877 ------ .../outputpathpersistency.pb.go | 324 --- .../remoteactionrouter.pb.go | 222 -- .../remoteactionrouter_grpc.pb.go | 119 - pkg/proto/remoteworker/remoteworker.pb.go | 708 ----- .../remoteworker/remoteworker_grpc.pb.go | 119 - pkg/proto/resourceusage/resourceusage.pb.go | 534 ---- pkg/proto/runner/runner.pb.go | 308 --- pkg/proto/runner/runner_grpc.pb.go | 158 -- pkg/proto/tmp_installer/tmp_installer.pb.go | 133 - .../tmp_installer/tmp_installer_grpc.pb.go | 158 -- pkg/scheduler/platform/BUILD.bazel | 2 +- pkg/scheduler/platform/configuration.go | 4 +- pkg/scheduler/routing/BUILD.bazel | 2 +- pkg/scheduler/routing/configuration.go | 4 +- 81 files changed, 1611 insertions(+), 12925 deletions(-) delete mode 100644 pkg/blobstore/existence_precondition_blob_access.go delete mode 100644 pkg/blobstore/existence_precondition_blob_access_test.go delete mode 100644 pkg/blobstore/suspending_blob_access.go delete mode 100644 pkg/blobstore/suspending_blob_access_test.go create mode 100644 pkg/cas/batching_blob_uploader.go create mode 100644 pkg/cas/batching_blob_uploader_test.go create mode 100644 pkg/cas/blob.go delete mode 100644 pkg/cas/blob_access_directory_fetcher.go create mode 100644 pkg/cas/blob_uploader.go create mode 100644 pkg/cas/cas_directory_fetcher.go rename pkg/cas/{blob_access_directory_fetcher_test.go => cas_directory_fetcher_test.go} (61%) rename pkg/cas/{blob_access_file_fetcher.go => cas_file_fetcher.go} (66%) create mode 100644 pkg/cas/cas_message_reader.go create mode 100644 pkg/cas/existence_precondition_content_addressable_storage.go create mode 100644 pkg/cas/existence_precondition_content_addressable_storage_test.go create mode 100644 pkg/cas/put_blob.go create mode 100644 pkg/cas/put_blob_test.go create mode 100644 pkg/cas/suspending_content_addressable_storage.go delete mode 100644 pkg/proto/bazeloutputservice/bazel_output_service.pb.go delete mode 100644 pkg/proto/bazeloutputservice/bazel_output_service_grpc.pb.go delete mode 100644 pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.pb.go delete mode 100644 pkg/proto/buildqueuestate/buildqueuestate.pb.go delete mode 100644 pkg/proto/buildqueuestate/buildqueuestate_grpc.pb.go delete mode 100644 pkg/proto/cas/cas.pb.go delete mode 100644 pkg/proto/completedactionlogger/completed_action_logger.pb.go delete mode 100644 pkg/proto/completedactionlogger/completed_action_logger_grpc.pb.go delete mode 100644 pkg/proto/configuration/bb_noop_worker/bb_noop_worker.pb.go delete mode 100644 pkg/proto/configuration/bb_runner/bb_runner.pb.go delete mode 100644 pkg/proto/configuration/bb_scheduler/bb_scheduler.pb.go delete mode 100644 pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.pb.go delete mode 100644 pkg/proto/configuration/bb_worker/bb_worker.pb.go delete mode 100644 pkg/proto/configuration/cas/cas.pb.go delete mode 100644 pkg/proto/configuration/credentials/credentials.pb.go delete mode 100644 pkg/proto/configuration/filesystem/filesystem.pb.go delete mode 100644 pkg/proto/configuration/filesystem/virtual/virtual.pb.go delete mode 100644 pkg/proto/configuration/scheduler/scheduler.pb.go delete mode 100644 pkg/proto/outputpathpersistency/outputpathpersistency.pb.go delete mode 100644 pkg/proto/remoteactionrouter/remoteactionrouter.pb.go delete mode 100644 pkg/proto/remoteactionrouter/remoteactionrouter_grpc.pb.go delete mode 100644 pkg/proto/remoteworker/remoteworker.pb.go delete mode 100644 pkg/proto/remoteworker/remoteworker_grpc.pb.go delete mode 100644 pkg/proto/resourceusage/resourceusage.pb.go delete mode 100644 pkg/proto/runner/runner.pb.go delete mode 100644 pkg/proto/runner/runner_grpc.pb.go delete mode 100644 pkg/proto/tmp_installer/tmp_installer.pb.go delete mode 100644 pkg/proto/tmp_installer/tmp_installer_grpc.pb.go diff --git a/.gitignore b/.gitignore index dd6c3d9f..d46c57d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .*.swp /bazel-* /node_modules +go.work +go.work.sum diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index aa49235c..ebe7ddc2 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -5409,6 +5409,164 @@ "go1.26.6.windows-arm64.zip", "06dbe785743d534ef8a469dad88adf7f1b2b438507ccfef9b98e7cf8c97b4b68" ] + }, + "1.26.6": { + "aix_ppc64": [ + "go1.26.6.aix-ppc64.tar.gz", + "982571d7beb65d66bc18bab3a72383275df0b418b586e77e8d84ce28ae2d4074" + ], + "darwin_amd64": [ + "go1.26.6.darwin-amd64.tar.gz", + "08b65a63f244115121ced6c3b55ad38d801a7442acad5c949a17aad84ae6d684" + ], + "darwin_arm64": [ + "go1.26.6.darwin-arm64.tar.gz", + "2dc95ce4675829f2df0e86b28bcef3283635902062a5f0580ca659bf570f3204" + ], + "dragonfly_amd64": [ + "go1.26.6.dragonfly-amd64.tar.gz", + "7ed0537a740803fb3c6979fe45ad757b48d8899aa50589345eafcca41c294e37" + ], + "freebsd_386": [ + "go1.26.6.freebsd-386.tar.gz", + "300d6751c189d3c7c6acfaa6e1f4feb17187c63c36cc8ed6e59f247a948a5ab4" + ], + "freebsd_amd64": [ + "go1.26.6.freebsd-amd64.tar.gz", + "9c805b762d9cd33c04c0dd414c1f4e86065a6ddce06e97e194e9bc806b120fc7" + ], + "freebsd_arm": [ + "go1.26.6.freebsd-arm.tar.gz", + "b21a3487c8fd121ecadb5d51f137dba83d5b14624a2c7e22d8864ac0ff4d8142" + ], + "freebsd_arm64": [ + "go1.26.6.freebsd-arm64.tar.gz", + "577a874da5171c0a31ceafe10d75faddcf6a17baad99c2c471062bde2c9ec49b" + ], + "illumos_amd64": [ + "go1.26.6.illumos-amd64.tar.gz", + "d8b8a5c43bf40449a9843c40c64ca4ffe4b3d6b605550622633977d2db17462a" + ], + "linux_386": [ + "go1.26.6.linux-386.tar.gz", + "f09a71029fc5cd2940fbe36b0eb1fb2d8f3407cd6adb6b7b4de3eaf04007f8c4" + ], + "linux_amd64": [ + "go1.26.6.linux-amd64.tar.gz", + "708effb774be8237570d0add163225abbdfaf4fca28b2611df167beba4feef89" + ], + "linux_arm64": [ + "go1.26.6.linux-arm64.tar.gz", + "d0507e9e9d7fe012aae570108cbd76c15de879e17130ab8cb90d4d7445cb1f2e" + ], + "linux_armv6l": [ + "go1.26.6.linux-armv6l.tar.gz", + "e1379a2fe77bd30fa29833074388247e7c65416e09279f746f20de2d5cf4dfea" + ], + "linux_loong64": [ + "go1.26.6.linux-loong64.tar.gz", + "dc7143e4da3e993956e09e19ae72b3330ccea9ceb1cc1fb8e27ea225ac8f8477" + ], + "linux_mips": [ + "go1.26.6.linux-mips.tar.gz", + "7ffdac8d508a633858896371f9e17821a0f2077fc14d0c83ef58fed3b7458b29" + ], + "linux_mips64": [ + "go1.26.6.linux-mips64.tar.gz", + "6914449089104f396001dbcc59c60094c7f3f29c3c3c9d718721afa4411487d1" + ], + "linux_mips64le": [ + "go1.26.6.linux-mips64le.tar.gz", + "b9b67669e57eaee94e0e49f814e057fdc7511f887e75d43cfeb761c58cf0f0c3" + ], + "linux_mipsle": [ + "go1.26.6.linux-mipsle.tar.gz", + "437cfa985eece5670983fb57582b4b2fe2776d3c3e6c873a50d6ba9efb57222f" + ], + "linux_ppc64": [ + "go1.26.6.linux-ppc64.tar.gz", + "0ca571bc19f3a6636e46358ab6f2395cb6da5c82ec03f14af01dd264451086a1" + ], + "linux_ppc64le": [ + "go1.26.6.linux-ppc64le.tar.gz", + "232b65543a42eda95df6a63f76235c1795bb535eba5c74e509faec71bc648388" + ], + "linux_riscv64": [ + "go1.26.6.linux-riscv64.tar.gz", + "7b3b526099181b40f5122c8ebf5c851486c7c92977e1f7f39dba9456c6ce42ff" + ], + "linux_s390x": [ + "go1.26.6.linux-s390x.tar.gz", + "958757933d38172dd544085d253c8738cf09793d24c8bc0422e5e1e1fffa4fde" + ], + "netbsd_386": [ + "go1.26.6.netbsd-386.tar.gz", + "a0721c869ecab78ae9ff6f75b6d8ad5d667bb4ed8c6d9c08bd7bc738244646fd" + ], + "netbsd_amd64": [ + "go1.26.6.netbsd-amd64.tar.gz", + "f37d9e86d24d04a83ef241d8467cae2d14e134e1c51c954b3ec860517135a5a2" + ], + "netbsd_arm": [ + "go1.26.6.netbsd-arm.tar.gz", + "d968690e8f5fc067749ed37872a77e249019b63665323db9bd0769a1db15b8a1" + ], + "netbsd_arm64": [ + "go1.26.6.netbsd-arm64.tar.gz", + "107b867e10807c6c4384ad6ed2b9bd4937e2d8c065b0821bc20e712d9c38f0ba" + ], + "openbsd_386": [ + "go1.26.6.openbsd-386.tar.gz", + "bc65e8b7fd818267f4b151a82713e9981d9af8c60108dfff7107a06ed54dbf26" + ], + "openbsd_amd64": [ + "go1.26.6.openbsd-amd64.tar.gz", + "1fe83868b4d2f8263bfb0a46d83ad82701cbb9ef11f8eb8c23d3fe001f5027c0" + ], + "openbsd_arm": [ + "go1.26.6.openbsd-arm.tar.gz", + "0b3e67b301c89033e3c37dffb8aa9cbf0d23b5710fee4093df7d76712bb288d6" + ], + "openbsd_arm64": [ + "go1.26.6.openbsd-arm64.tar.gz", + "a032ab9370e64e5df6ff6691acdbddeb0c1dd81ae6581191d9c67b652415ef8a" + ], + "openbsd_ppc64": [ + "go1.26.6.openbsd-ppc64.tar.gz", + "ed4e0cc786564f2d42989a739d62a734bfb3b1f56d61fedbb46edfbe6f13d2f3" + ], + "openbsd_riscv64": [ + "go1.26.6.openbsd-riscv64.tar.gz", + "634e99a7883e09749cf9c9ed8530b4fa96fc9625f750f125ea4984196cfc09d0" + ], + "plan9_386": [ + "go1.26.6.plan9-386.tar.gz", + "b2dd25b0a09d26a1f3b5c9ffc86c5bbd44e3a986c145304176897f2ca276f6f8" + ], + "plan9_amd64": [ + "go1.26.6.plan9-amd64.tar.gz", + "a05fec45f6d53692836329bb2112465583f8bfa1dee6ab9ae1cab2d0aa1e2b43" + ], + "plan9_arm": [ + "go1.26.6.plan9-arm.tar.gz", + "56d584473fa9f7c0e5a7ba64306b653541d0ea62565d172c31a158691f85c841" + ], + "solaris_amd64": [ + "go1.26.6.solaris-amd64.tar.gz", + "111cb1bb13e0502e7dad2455af3d800a10e6a695d8ad7420c9499866eb35f665" + ], + "windows_386": [ + "go1.26.6.windows-386.zip", + "1e352f0a2488a880b76f26d5f82479cbd3b286ef360cbbdf53e26df5f623f82f" + ], + "windows_amd64": [ + "go1.26.6.windows-amd64.zip", + "5b6c5b556525810463b5c897b50dc7a82d6a3dc0bfaf55d990a7e9f31d6b2318" + ], + "windows_arm64": [ + "go1.26.6.windows-arm64.zip", + "06dbe785743d534ef8a469dad88adf7f1b2b438507ccfef9b98e7cf8c97b4b68" + ] } } } diff --git a/cmd/bb_noop_worker/BUILD.bazel b/cmd/bb_noop_worker/BUILD.bazel index 22906554..da9f3168 100644 --- a/cmd/bb_noop_worker/BUILD.bazel +++ b/cmd/bb_noop_worker/BUILD.bazel @@ -7,13 +7,12 @@ go_library( importpath = "github.com/buildbarn/bb-remote-execution/cmd/bb_noop_worker", visibility = ["//visibility:private"], deps = [ - "//pkg/blobstore", "//pkg/builder", + "//pkg/cas", "//pkg/filesystem/pool", "//pkg/proto/configuration/bb_noop_worker", "//pkg/proto/remoteworker", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/configuration", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", diff --git a/cmd/bb_noop_worker/main.go b/cmd/bb_noop_worker/main.go index d389a208..b5a9f6ca 100644 --- a/cmd/bb_noop_worker/main.go +++ b/cmd/bb_noop_worker/main.go @@ -6,12 +6,11 @@ import ( "os" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore" "github.com/buildbarn/bb-remote-execution/pkg/builder" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_noop_worker" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" - "github.com/buildbarn/bb-storage/pkg/blobstore" blobstore_configuration "github.com/buildbarn/bb-storage/pkg/blobstore/configuration" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" @@ -47,19 +46,17 @@ func main() { // Content Addressable Storage (CAS), as those may contain error // message templates that this worker respects. zstdPool := zstd.NewPoolFromConfiguration(configuration.ZstdPool) - info, err := blobstore_configuration.NewBlobAccessFromConfiguration( + contentAddressableStorage, _, _, _, _, err := blobstore_configuration.NewCASFromConfiguration( dependenciesGroup, configuration.ContentAddressableStorage, - blobstore_configuration.NewCASBlobAccessCreator( - grpcClientFactory, - int(configuration.MaximumMessageSizeBytes), - zstdPool, - ), + grpcClientFactory, + int(configuration.MaximumMessageSizeBytes), + zstdPool, ) if err != nil { return util.StatusWrap(err, "Failed to create Content Adddressable Storage") } - contentAddressableStorage := re_blobstore.NewExistencePreconditionBlobAccess(info.BlobAccess) + contentAddressableStorage = cas.NewExistencePreconditionContentAddressableStorage(contentAddressableStorage) browserURL, err := url.Parse(configuration.BrowserUrl) if err != nil { @@ -80,7 +77,7 @@ func main() { buildClient := builder.NewBuildClient( schedulerClient, builder.NewNoopBuildExecutor( - blobstore.NewBlobAccessMessageReader[*remoteexecution.Command]( + cas.NewCASMessageReader[*remoteexecution.Command]( contentAddressableStorage, int(configuration.MaximumMessageSizeBytes), ), diff --git a/cmd/bb_scheduler/BUILD.bazel b/cmd/bb_scheduler/BUILD.bazel index 30be9a50..2ab6cf61 100644 --- a/cmd/bb_scheduler/BUILD.bazel +++ b/cmd/bb_scheduler/BUILD.bazel @@ -30,6 +30,7 @@ go_library( visibility = ["//visibility:private"], deps = [ "//pkg/blobstore", + "//pkg/cas", "//pkg/proto/buildqueuestate", "//pkg/proto/configuration/bb_scheduler", "//pkg/proto/remoteworker", diff --git a/cmd/bb_scheduler/main.go b/cmd/bb_scheduler/main.go index 028fabba..4bff3a1f 100644 --- a/cmd/bb_scheduler/main.go +++ b/cmd/bb_scheduler/main.go @@ -10,6 +10,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestate" "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_scheduler" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" @@ -17,7 +18,6 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/initialsizeclass" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/routing" auth_configuration "github.com/buildbarn/bb-storage/pkg/auth/configuration" - "github.com/buildbarn/bb-storage/pkg/blobstore" blobstore_configuration "github.com/buildbarn/bb-storage/pkg/blobstore/configuration" "github.com/buildbarn/bb-storage/pkg/capabilities" "github.com/buildbarn/bb-storage/pkg/clock" @@ -61,19 +61,17 @@ func main() { // and Command messages stored in the CAS to obtain platform // properties. zstdPool := zstd.NewPoolFromConfiguration(configuration.ZstdPool) - info, err := blobstore_configuration.NewBlobAccessFromConfiguration( + contentAddressableStorage, _, _, _, _, err := blobstore_configuration.NewCASFromConfiguration( dependenciesGroup, configuration.ContentAddressableStorage, - blobstore_configuration.NewCASBlobAccessCreator( - grpcClientFactory, - int(configuration.MaximumMessageSizeBytes), - zstdPool, - ), + grpcClientFactory, + int(configuration.MaximumMessageSizeBytes), + zstdPool, ) if err != nil { return util.StatusWrap(err, "Failed to create Content Adddressable Storage") } - contentAddressableStorage := re_blobstore.NewExistencePreconditionBlobAccess(info.BlobAccess) + contentAddressableStorage = cas.NewExistencePreconditionContentAddressableStorage(contentAddressableStorage) // Optional: Initial Size Class Cache (ISCC) access. This data // store is only used if one or more parts of the ActionRouter @@ -133,7 +131,7 @@ func main() { // TODO: Make timeouts configurable. generator := random.NewFastSingleThreadedGenerator() buildQueue := scheduler.NewInMemoryBuildQueue( - blobstore.NewBlobAccessMessageReader[*remoteexecution.Action]( + cas.NewCASMessageReader[*remoteexecution.Action]( contentAddressableStorage, int(configuration.MaximumMessageSizeBytes), ), diff --git a/cmd/bb_worker/BUILD.bazel b/cmd/bb_worker/BUILD.bazel index 3dddb1e1..d5a241b4 100644 --- a/cmd/bb_worker/BUILD.bazel +++ b/cmd/bb_worker/BUILD.bazel @@ -11,7 +11,6 @@ go_library( importpath = "github.com/buildbarn/bb-remote-execution/cmd/bb_worker", visibility = ["//visibility:private"], deps = [ - "//pkg/blobstore", "//pkg/builder", "//pkg/cas", "//pkg/cleaner", diff --git a/cmd/bb_worker/main.go b/cmd/bb_worker/main.go index 89b8a630..94b16252 100644 --- a/cmd/bb_worker/main.go +++ b/cmd/bb_worker/main.go @@ -15,7 +15,6 @@ import ( "time" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore" "github.com/buildbarn/bb-remote-execution/pkg/builder" "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/cleaner" @@ -87,7 +86,7 @@ func main() { // Storage access. zstdPool := zstd.NewPoolFromConfiguration(configuration.ZstdPool) - globalContentAddressableStorage, actionCache, err := blobstore_configuration.NewCASAndACBlobAccessFromConfiguration( + globalContentAddressableStorage, actionCache, err := blobstore_configuration.NewCASAndACFromConfiguration( dependenciesGroup, configuration.Blobstore, grpcClientFactory, @@ -97,7 +96,7 @@ func main() { if err != nil { return err } - globalContentAddressableStorage = re_blobstore.NewExistencePreconditionBlobAccess(globalContentAddressableStorage) + globalContentAddressableStorage = cas.NewExistencePreconditionContentAddressableStorage(globalContentAddressableStorage) var fileSystemAccessCache blobstore.BlobAccess prefetchingConfiguration := configuration.Prefetching @@ -122,9 +121,9 @@ func main() { // Tree objects. directoryFetcher, err := cas.NewCachingDirectoryFetcherFromConfiguration( configuration.DirectoryCache, - cas.NewBlobAccessDirectoryFetcher( + cas.NewCASDirectoryFetcher( globalContentAddressableStorage, - /* maximumDirectorySizeBytes = */ int(configuration.MaximumMessageSizeBytes), + /* maximumDirectorySizeBytes = */ configuration.MaximumMessageSizeBytes, /* maximumTreeSizeBytes = */ 0, ), ) @@ -303,7 +302,7 @@ func main() { return util.StatusWrap(err, "Failed to create eviction set for cache directory") } fileFetcher = cas.NewHardlinkingFileFetcher( - cas.NewBlobAccessFileFetcher(globalContentAddressableStorage), + cas.NewCASFileFetcher(globalContentAddressableStorage), cacheDirectory, int(nativeConfiguration.MaximumCacheFileCount), nativeConfiguration.MaximumCacheSizeBytes, @@ -369,22 +368,6 @@ func main() { runnerClient := runner_pb.NewRunnerClient(runnerConnection) for threadID := uint64(0); threadID < runnerConfiguration.Concurrency; threadID++ { - // Per-worker separate writer of the Content - // Addressable Storage that batches writes after - // completing the build action. - contentAddressableStorageWriter, contentAddressableStorageFlusher := re_blobstore.NewBatchedStoreBlobAccess( - globalContentAddressableStorage, - digest.KeyWithoutInstance, - uploadBatchSize, - outputUploadConcurrencySemaphore, - ) - contentAddressableStorageWriter = blobstore.NewMetricsBlobAccess( - contentAddressableStorageWriter, - clock.SystemClock, - "cas", - "batched_store", - ) - // Features like the virtual file system // and HTTP execution timeout // compensators require us to use a @@ -401,6 +384,20 @@ func main() { executionTimeoutClock = suspendableClock } + localContentAddressableStorage := globalContentAddressableStorage + if virtualBuildDirectory != nil { + localContentAddressableStorage = cas.NewSuspendingContentAddressableStorage(localContentAddressableStorage, suspendableClock) + } + + // Per-worker separate writer of the Content + // Addressable Storage that batches writes after + // completing the build action. + blobUploader, blobUploaderFlusher := cas.NewBatchingBlobUploader( + localContentAddressableStorage, + uploadBatchSize, + outputUploadConcurrencySemaphore, + ) + // When the virtual file system is // enabled, we can lazily load the input // root, as opposed to explicitly @@ -413,10 +410,8 @@ func main() { directoryFetcher, suspendableClock, ), - re_blobstore.NewSuspendingBlobAccess( - contentAddressableStorageWriter, - suspendableClock, - ), + localContentAddressableStorage, + blobUploader, symlinkFactory, characterDeviceFactory, handleAllocator, @@ -429,7 +424,7 @@ func main() { directoryFetcher, fileFetcher, inputDownloadConcurrencySemaphore, - contentAddressableStorageWriter, + blobUploader, ) } @@ -462,8 +457,9 @@ func main() { } buildExecutor := builder.NewLocalBuildExecutor( - contentAddressableStorageWriter, - blobstore.NewBlobAccessMessageReader[*remoteexecution.Command](contentAddressableStorageWriter, int(configuration.MaximumMessageSizeBytes)), + localContentAddressableStorage, + cas.NewCASMessageReader[*remoteexecution.Command](localContentAddressableStorage, int(configuration.MaximumMessageSizeBytes)), + blobUploader, buildDirectoryCreator, runnerClient, executionTimeoutClock, @@ -491,7 +487,7 @@ func main() { builder.NewTimestampedBuildExecutor( builder.NewStorageFlushingBuildExecutor( buildExecutor, - contentAddressableStorageFlusher, + blobUploaderFlusher, ), clock.SystemClock, string(workerName), diff --git a/internal/mock/BUILD.bazel b/internal/mock/BUILD.bazel index 9252a1c9..e817b1fc 100644 --- a/internal/mock/BUILD.bazel +++ b/internal/mock/BUILD.bazel @@ -85,6 +85,7 @@ gomock( "DirectoryFetcher", "DirectoryWalker", "FileFetcher", + "BlobUploader", ], library = "//pkg/cas", mockgen_model_library = "@org_uber_go_mock//mockgen/model", @@ -92,6 +93,16 @@ gomock( package = "mock", ) +gomock( + name = "cdc", + out = "cdc.go", + interfaces = ["ContentAddressableStorage"], + library = "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + mockgen_model_library = "@org_uber_go_mock//mockgen/model", + mockgen_tool = "@org_uber_go_mock//mockgen", + package = "mock", +) + gomock( name = "cleaner", out = "cleaner.go", @@ -448,6 +459,7 @@ go_library( ":blockdevice.go", ":builder.go", ":cas.go", + ":cdc.go", ":cleaner.go", ":clock.go", ":clock_re.go", @@ -511,6 +523,8 @@ go_library( "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/blobstore/chunklist", "@com_github_buildbarn_bb_storage//pkg/builder", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", diff --git a/pkg/blobstore/BUILD.bazel b/pkg/blobstore/BUILD.bazel index fcb4e313..11a60560 100644 --- a/pkg/blobstore/BUILD.bazel +++ b/pkg/blobstore/BUILD.bazel @@ -5,22 +5,16 @@ go_library( srcs = [ "batched_store_blob_access.go", "blob_access_mutable_proto_store.go", - "existence_precondition_blob_access.go", "mutable_proto_store.go", - "suspending_blob_access.go", ], importpath = "github.com/buildbarn/bb-remote-execution/pkg/blobstore", visibility = ["//visibility:public"], deps = [ - "//pkg/clock", - "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", - "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_prometheus_client_golang//prometheus", - "@org_golang_google_genproto_googleapis_rpc//errdetails", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//proto", @@ -34,8 +28,6 @@ go_test( srcs = [ "batched_store_blob_access_test.go", "blob_access_mutable_proto_store_test.go", - "existence_precondition_blob_access_test.go", - "suspending_blob_access_test.go", ], deps = [ ":blobstore", @@ -45,9 +37,7 @@ go_test( "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/proto/iscc", "@com_github_buildbarn_bb_storage//pkg/testutil", - "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_stretchr_testify//require", - "@org_golang_google_genproto_googleapis_rpc//errdetails", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//types/known/timestamppb", diff --git a/pkg/blobstore/existence_precondition_blob_access.go b/pkg/blobstore/existence_precondition_blob_access.go deleted file mode 100644 index 6c125791..00000000 --- a/pkg/blobstore/existence_precondition_blob_access.go +++ /dev/null @@ -1,71 +0,0 @@ -package blobstore - -import ( - "context" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/slicing" - "github.com/buildbarn/bb-storage/pkg/digest" - - "google.golang.org/genproto/googleapis/rpc/errdetails" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type existencePreconditionBlobAccess struct { - blobstore.BlobAccess -} - -// NewExistencePreconditionBlobAccess wraps a BlobAccess into a version -// that returns GRPC status code "FAILED_PRECONDITION" instead of -// "NOT_FOUND" for Get() operations. This is used by worker processes to -// make Execution::Execute() comply to the protocol. -func NewExistencePreconditionBlobAccess(blobAccess blobstore.BlobAccess) blobstore.BlobAccess { - return &existencePreconditionBlobAccess{ - BlobAccess: blobAccess, - } -} - -func (ba *existencePreconditionBlobAccess) Get(ctx context.Context, digest digest.Digest) buffer.Buffer { - return buffer.WithErrorHandler( - ba.BlobAccess.Get(ctx, digest), - existencePreconditionErrorHandler{digest: digest}, - ) -} - -func (ba *existencePreconditionBlobAccess) GetFromComposite(ctx context.Context, parentDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - return buffer.WithErrorHandler( - ba.BlobAccess.GetFromComposite(ctx, parentDigest, childDigest, slicer), - existencePreconditionErrorHandler{digest: parentDigest}, - ) -} - -type existencePreconditionErrorHandler struct { - digest digest.Digest -} - -func (eh existencePreconditionErrorHandler) OnError(observedErr error) (buffer.Buffer, error) { - if s := status.Convert(observedErr); s.Code() == codes.NotFound { - s, err := status.New(codes.FailedPrecondition, s.Message()).WithDetails( - &errdetails.PreconditionFailure{ - Violations: []*errdetails.PreconditionFailure_Violation{ - { - Type: "MISSING", - Subject: digest.NewInstanceNamePatcher(eh.digest.GetInstanceName(), digest.EmptyInstanceName). - PatchDigest(eh.digest). - GetByteStreamReadPath(remoteexecution.Compressor_IDENTITY), - }, - }, - }, - ) - if err != nil { - return nil, err - } - return nil, s.Err() - } - return nil, observedErr -} - -func (existencePreconditionErrorHandler) Done() {} diff --git a/pkg/blobstore/existence_precondition_blob_access_test.go b/pkg/blobstore/existence_precondition_blob_access_test.go deleted file mode 100644 index 539ecb79..00000000 --- a/pkg/blobstore/existence_precondition_blob_access_test.go +++ /dev/null @@ -1,154 +0,0 @@ -package blobstore_test - -import ( - "context" - "testing" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/internal/mock" - "github.com/buildbarn/bb-remote-execution/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/testutil" - "github.com/stretchr/testify/require" - - "google.golang.org/genproto/googleapis/rpc/errdetails" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "go.uber.org/mock/gomock" -) - -func TestExistencePreconditionBlobAccessGetSuccess(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - // Let Get() return a reader from which we can read successfully. - bottomBlobAccess := mock.NewMockBlobAccess(ctrl) - bottomBlobAccess.EXPECT().Get( - ctx, - digest.MustNewDigest("debian8", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5), - ).Return(buffer.NewValidatedBufferFromByteSlice([]byte("Hello"))) - - // Validate that the reader can still be read properly. - data, err := blobstore.NewExistencePreconditionBlobAccess(bottomBlobAccess).Get( - ctx, - digest.MustNewDigest("debian8", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5), - ).ToByteSlice(100) - require.NoError(t, err) - require.Equal(t, []byte("Hello"), data) -} - -func TestExistencePreconditionBlobAccessGetResourceExhausted(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - // Let Get() return ResourceExhausted. - bottomBlobAccess := mock.NewMockBlobAccess(ctrl) - bottomBlobAccess.EXPECT().Get( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA1, "c916e71d733d06cb77a4775de5f77fd0b480a7e8", 8), - ).Return(buffer.NewBufferFromError(status.Error(codes.ResourceExhausted, "Out of luck!"))) - - // The error should be passed through unmodified. - _, err := blobstore.NewExistencePreconditionBlobAccess(bottomBlobAccess).Get( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA1, "c916e71d733d06cb77a4775de5f77fd0b480a7e8", 8), - ).ToByteSlice(100) - testutil.RequireEqualStatus(t, status.Error(codes.ResourceExhausted, "Out of luck!"), err) -} - -func TestExistencePreconditionBlobAccessGetNotFound(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - // Let Get() return NotFound. - bottomBlobAccess := mock.NewMockBlobAccess(ctrl) - bottomBlobAccess.EXPECT().Get( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4", 7), - ).Return(buffer.NewBufferFromError(status.Error(codes.NotFound, "Blob doesn't exist!"))) - - // The error should be translated to FailedPrecondition. - _, gotErr := blobstore.NewExistencePreconditionBlobAccess(bottomBlobAccess).Get( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4", 7), - ).ToByteSlice(100) - - wantErr, err := status.New(codes.FailedPrecondition, "Blob doesn't exist!").WithDetails(&errdetails.PreconditionFailure{ - Violations: []*errdetails.PreconditionFailure_Violation{ - { - Type: "MISSING", - Subject: "blobs/c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4/7", - }, - }, - }) - require.NoError(t, err) - - testutil.RequireEqualStatus(t, wantErr.Err(), gotErr) -} - -func TestExistencePreconditionBlobAccessGetFromCompositeNotFound(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - // Let GetFromComposite() return NotFound. - bottomBlobAccess := mock.NewMockBlobAccess(ctrl) - blobSlicer := mock.NewMockBlobSlicer(ctrl) - bottomBlobAccess.EXPECT().GetFromComposite( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4", 7), - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "f91881078baff10d91f796347efa85304240db6a162d46edcdd56154e91e1d8a", 3), - blobSlicer, - ).Return(buffer.NewBufferFromError(status.Error(codes.NotFound, "Blob doesn't exist!"))) - - // The error should be translated to FailedPrecondition. The - // digest of the parent is the one that should be attached to - // the error, as that's the one that needs to be reuploaded to - // satisfy the request. - _, gotErr := blobstore.NewExistencePreconditionBlobAccess(bottomBlobAccess).GetFromComposite( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4", 7), - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA256, "f91881078baff10d91f796347efa85304240db6a162d46edcdd56154e91e1d8a", 3), - blobSlicer, - ).ToByteSlice(100) - - wantErr, err := status.New(codes.FailedPrecondition, "Blob doesn't exist!").WithDetails(&errdetails.PreconditionFailure{ - Violations: []*errdetails.PreconditionFailure_Violation{ - { - Type: "MISSING", - Subject: "blobs/c015ad6ddaf8bb50689d2d7cbf1539dff6dd84473582a08ed1d15d841f4254f4/7", - }, - }, - }) - require.NoError(t, err) - - testutil.RequireEqualStatus(t, wantErr.Err(), gotErr) -} - -func TestExistencePreconditionBlobAccessPutNotFound(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - // Let Put() return NotFound. - bottomBlobAccess := mock.NewMockBlobAccess(ctrl) - bottomBlobAccess.EXPECT().Put( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_MD5, "89d5739baabbbe65be35cbe61c88e06d", 6), - gomock.Any(), - ).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(100) - require.NoError(t, err) - require.Equal(t, []byte("Foobar"), data) - return status.Error(codes.NotFound, "Storage backend not found") - }, - ) - - // Unlike for Get(), the error should be passed through - // unmodified. This adapter should only alter the results of - // Get() calls. - err := blobstore.NewExistencePreconditionBlobAccess(bottomBlobAccess).Put( - ctx, - digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_MD5, "89d5739baabbbe65be35cbe61c88e06d", 6), - buffer.NewValidatedBufferFromByteSlice([]byte("Foobar")), - ) - s := status.Convert(err) - require.Equal(t, codes.NotFound, s.Code()) - require.Equal(t, "Storage backend not found", s.Message()) -} diff --git a/pkg/blobstore/suspending_blob_access.go b/pkg/blobstore/suspending_blob_access.go deleted file mode 100644 index b2ad05e7..00000000 --- a/pkg/blobstore/suspending_blob_access.go +++ /dev/null @@ -1,80 +0,0 @@ -package blobstore - -import ( - "context" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/pkg/clock" - "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/slicing" - "github.com/buildbarn/bb-storage/pkg/digest" -) - -type suspendingBlobAccess struct { - base blobstore.BlobAccess - suspendable clock.Suspendable -} - -// NewSuspendingBlobAccess is a decorator for BlobAccess that simply -// forwards all methods. Before and after each call, it suspends and -// resumes a clock.Suspendable object, respectively. -// -// This decorator is used in combination with SuspendableClock, allowing -// FUSE-based workers to compensate the execution timeout of build -// actions for any time spent downloading the input root. -func NewSuspendingBlobAccess(base blobstore.BlobAccess, suspendable clock.Suspendable) blobstore.BlobAccess { - return &suspendingBlobAccess{ - base: base, - suspendable: suspendable, - } -} - -func (ba *suspendingBlobAccess) Get(ctx context.Context, digest digest.Digest) buffer.Buffer { - ba.suspendable.Suspend() - return buffer.WithErrorHandler( - ba.base.Get(ctx, digest), - &resumingErrorHandler{suspendable: ba.suspendable}, - ) -} - -func (ba *suspendingBlobAccess) GetFromComposite(ctx context.Context, parentDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - ba.suspendable.Suspend() - return buffer.WithErrorHandler( - ba.base.GetFromComposite(ctx, parentDigest, childDigest, slicer), - &resumingErrorHandler{suspendable: ba.suspendable}, - ) -} - -func (ba *suspendingBlobAccess) Put(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - ba.suspendable.Suspend() - defer ba.suspendable.Resume() - - return ba.base.Put(ctx, digest, b) -} - -func (ba *suspendingBlobAccess) FindMissing(ctx context.Context, digests digest.Set) (digest.Set, error) { - ba.suspendable.Suspend() - defer ba.suspendable.Resume() - - return ba.base.FindMissing(ctx, digests) -} - -func (ba *suspendingBlobAccess) GetCapabilities(ctx context.Context, instanceName digest.InstanceName) (*remoteexecution.ServerCapabilities, error) { - ba.suspendable.Suspend() - defer ba.suspendable.Resume() - - return ba.base.GetCapabilities(ctx, instanceName) -} - -type resumingErrorHandler struct { - suspendable clock.Suspendable -} - -func (resumingErrorHandler) OnError(err error) (buffer.Buffer, error) { - return nil, err -} - -func (eh *resumingErrorHandler) Done() { - eh.suspendable.Resume() -} diff --git a/pkg/blobstore/suspending_blob_access_test.go b/pkg/blobstore/suspending_blob_access_test.go deleted file mode 100644 index 3ce3a418..00000000 --- a/pkg/blobstore/suspending_blob_access_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package blobstore_test - -import ( - "context" - "io" - "testing" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/internal/mock" - "github.com/buildbarn/bb-remote-execution/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/testutil" - "github.com/buildbarn/bb-storage/pkg/util" - "github.com/stretchr/testify/require" - - "go.uber.org/mock/gomock" -) - -func TestSuspendingBlobAccess(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - baseBlobAccess := mock.NewMockBlobAccess(ctrl) - suspendable := mock.NewMockSuspendable(ctrl) - blobAccess := blobstore.NewSuspendingBlobAccess(baseBlobAccess, suspendable) - - exampleDigest := digest.MustNewDigest("hello", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) - exampleInstanceName := util.Must(digest.NewInstanceName("hello")) - - t.Run("Get", func(t *testing.T) { - r := mock.NewMockReadCloser(ctrl) - gomock.InOrder( - suspendable.EXPECT().Suspend(), - baseBlobAccess.EXPECT().Get(ctx, exampleDigest). - Return(buffer.NewCASBufferFromReader(exampleDigest, r, buffer.UserProvided)), - ) - - b := blobAccess.Get(ctx, exampleDigest) - - gomock.InOrder( - r.EXPECT().Read(gomock.Any()).DoAndReturn(func(p []byte) (int, error) { - return copy(p, "Hello"), io.EOF - }), - r.EXPECT().Close(), - suspendable.EXPECT().Resume(), - ) - - data, err := b.ToByteSlice(1000) - require.NoError(t, err) - require.Equal(t, []byte("Hello"), data) - }) - - t.Run("GetFromComposite", func(t *testing.T) { - llDigest := digest.MustNewDigest("hello", remoteexecution.DigestFunction_MD5, "5b54c0a045f179bcbbbc9abcb8b5cd4c", 2) - blobSlicer := mock.NewMockBlobSlicer(ctrl) - r := mock.NewMockReadCloser(ctrl) - gomock.InOrder( - suspendable.EXPECT().Suspend(), - baseBlobAccess.EXPECT().GetFromComposite(ctx, exampleDigest, llDigest, blobSlicer). - Return(buffer.NewCASBufferFromReader(llDigest, r, buffer.UserProvided)), - ) - - b := blobAccess.GetFromComposite(ctx, exampleDigest, llDigest, blobSlicer) - - gomock.InOrder( - r.EXPECT().Read(gomock.Any()).DoAndReturn(func(p []byte) (int, error) { - return copy(p, "ll"), io.EOF - }), - r.EXPECT().Close(), - suspendable.EXPECT().Resume(), - ) - - data, err := b.ToByteSlice(1000) - require.NoError(t, err) - require.Equal(t, []byte("ll"), data) - }) - - t.Run("Put", func(t *testing.T) { - gomock.InOrder( - suspendable.EXPECT().Suspend(), - baseBlobAccess.EXPECT().Put(ctx, exampleDigest, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(1000) - require.NoError(t, err) - require.Equal(t, []byte("Hello"), data) - return nil - }, - ), - suspendable.EXPECT().Resume(), - ) - - require.NoError(t, blobAccess.Put(ctx, exampleDigest, buffer.NewValidatedBufferFromByteSlice([]byte("Hello")))) - }) - - t.Run("FindMissing", func(t *testing.T) { - gomock.InOrder( - suspendable.EXPECT().Suspend(), - baseBlobAccess.EXPECT().FindMissing(ctx, digest.EmptySet).Return(digest.EmptySet, nil), - suspendable.EXPECT().Resume(), - ) - - missing, err := blobAccess.FindMissing(ctx, digest.EmptySet) - require.NoError(t, err) - require.Equal(t, digest.EmptySet, missing) - }) - - t.Run("GetCapabilities", func(t *testing.T) { - gomock.InOrder( - suspendable.EXPECT().Suspend(), - baseBlobAccess.EXPECT().GetCapabilities(ctx, exampleInstanceName).Return(&remoteexecution.ServerCapabilities{ - CacheCapabilities: &remoteexecution.CacheCapabilities{}, - }, nil), - suspendable.EXPECT().Resume(), - ) - - serverCapabilities, err := blobAccess.GetCapabilities(ctx, exampleInstanceName) - require.NoError(t, err) - testutil.RequireEqualProto(t, &remoteexecution.ServerCapabilities{ - CacheCapabilities: &remoteexecution.CacheCapabilities{}, - }, serverCapabilities) - }) -} diff --git a/pkg/builder/BUILD.bazel b/pkg/builder/BUILD.bazel index 81fce1a8..374df7ee 100644 --- a/pkg/builder/BUILD.bazel +++ b/pkg/builder/BUILD.bazel @@ -48,6 +48,7 @@ go_library( "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", @@ -103,6 +104,7 @@ go_test( deps = [ ":builder", "//internal/mock", + "//pkg/cas", "//pkg/cleaner", "//pkg/clock", "//pkg/filesystem/access", @@ -114,6 +116,7 @@ go_test( "//pkg/proto/runner", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", "@com_github_buildbarn_bb_storage//pkg/filesystem/path", diff --git a/pkg/builder/caching_build_executor.go b/pkg/builder/caching_build_executor.go index 997519cc..13dcd2bb 100644 --- a/pkg/builder/caching_build_executor.go +++ b/pkg/builder/caching_build_executor.go @@ -12,6 +12,7 @@ import ( re_util "github.com/buildbarn/bb-remote-execution/pkg/util" "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/util" @@ -21,7 +22,7 @@ import ( type cachingBuildExecutor struct { BuildExecutor - contentAddressableStorage blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage actionCache blobstore.BlobAccess browserURL *url.URL } @@ -33,7 +34,7 @@ type cachingBuildExecutor struct { // // In both cases, a link to bb_browser is added to the ExecuteResponse, // so that the user may inspect the Action and ActionResult in detail. -func NewCachingBuildExecutor(base BuildExecutor, contentAddressableStorage, actionCache blobstore.BlobAccess, browserURL *url.URL) BuildExecutor { +func NewCachingBuildExecutor(base BuildExecutor, contentAddressableStorage cdc.ContentAddressableStorage, actionCache blobstore.BlobAccess, browserURL *url.URL) BuildExecutor { return &cachingBuildExecutor{ BuildExecutor: base, contentAddressableStorage: contentAddressableStorage, @@ -59,7 +60,7 @@ func (be *cachingBuildExecutor) Execute(ctx context.Context, filePool pool.FileP // Extension: store the result in the Content // Addressable Storage, so the user can at least inspect // it through bb_browser. - if historicalExecuteResponseDigest, err := blobstore.CASPutProto( + if historicalExecuteResponseDigest, err := cdc.PutProto( ctx, be.contentAddressableStorage, &cas_proto.HistoricalExecuteResponse{ diff --git a/pkg/builder/caching_build_executor_test.go b/pkg/builder/caching_build_executor_test.go index b2839b7a..ca78c9b2 100644 --- a/pkg/builder/caching_build_executor_test.go +++ b/pkg/builder/caching_build_executor_test.go @@ -11,6 +11,7 @@ import ( cas_proto "github.com/buildbarn/bb-remote-execution/pkg/proto/cas" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/testutil" "github.com/stretchr/testify/require" @@ -45,7 +46,7 @@ func TestCachingBuildExecutorCachedSuccess(t *testing.T) { StdoutRaw: []byte("Hello, world!"), }, }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) actionCache := mock.NewMockBlobAccess(ctrl) actionCache.EXPECT().Put( ctx, @@ -99,7 +100,7 @@ func TestCachingBuildExecutorCachedSuccessExplicitOK(t *testing.T) { }, Status: &status_pb.Status{Message: "This is not an error, because it has code zero"}, }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) actionCache := mock.NewMockBlobAccess(ctrl) actionCache.EXPECT().Put( ctx, @@ -159,15 +160,18 @@ func TestCachingBuildExecutorCachedSuccessNonZeroExitCode(t *testing.T) { StderrRaw: []byte("Compiler error!"), }, }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put( + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + contentAddressableStorage.EXPECT().PutChunk( ctx, digest.MustNewDigest("freebsd12", remoteexecution.DigestFunction_SHA256, "bb1107706f3aa379d68aa61062f56d99d24a667ec18d5756fb6df1ba9baa1fdc", 93), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - historicalExecuteResponse, err := b.ToProto(&cas_proto.HistoricalExecuteResponse{}, 10000) - require.NoError(t, err) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { + historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -222,7 +226,7 @@ func TestCachingBuildExecutorCachedStorageFailure(t *testing.T) { StdoutRaw: []byte("Hello, world!"), }, }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) actionCache := mock.NewMockBlobAccess(ctrl) actionCache.EXPECT().Put( ctx, @@ -275,15 +279,19 @@ func TestCachingBuildExecutorUncachedDoNotCache(t *testing.T) { StdoutRaw: []byte("Hello, world!"), }, }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put( - ctx, - digest.MustNewDigest("freebsd12", remoteexecution.DigestFunction_SHA256, "5ed2d5720b99f5575542bb4f89e84b5e00e34ab652292974fdb814ab7dc3c92e", 89), - gomock.Any(), - ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - historicalExecuteResponse, err := b.ToProto(&cas_proto.HistoricalExecuteResponse{}, 10000) - require.NoError(t, err) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + contentAddressableStorage.EXPECT(). + PutChunk( + ctx, + digest.MustNewDigest("freebsd12", remoteexecution.DigestFunction_SHA256, "5ed2d5720b99f5575542bb4f89e84b5e00e34ab652292974fdb814ab7dc3c92e", 89), + gomock.Any(), + ). + DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { + historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -337,15 +345,18 @@ func TestCachingBuildExecutorUncachedError(t *testing.T) { }, Status: status.New(codes.DeadlineExceeded, "Build took more than ten seconds").Proto(), }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put( + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + contentAddressableStorage.EXPECT().PutChunk( ctx, digest.MustNewDigest("freebsd12", remoteexecution.DigestFunction_SHA256, "a6e4f00dd21540b0b653dcd195b3d54ea4c0b3ca679cf6a69eb7b0dbd378c2cc", 126), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - historicalExecuteResponse, err := b.ToProto(&cas_proto.HistoricalExecuteResponse{}, 10000) - require.NoError(t, err) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { + historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -401,15 +412,18 @@ func TestCachingBuildExecutorUncachedStorageFailure(t *testing.T) { }, Status: status.New(codes.DeadlineExceeded, "Build took more than ten seconds").Proto(), }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put( + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + contentAddressableStorage.EXPECT().PutChunk( ctx, digest.MustNewDigest("freebsd12", remoteexecution.DigestFunction_SHA256, "a6e4f00dd21540b0b653dcd195b3d54ea4c0b3ca679cf6a69eb7b0dbd378c2cc", 126), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - historicalExecuteResponse, err := b.ToProto(&cas_proto.HistoricalExecuteResponse{}, 10000) - require.NoError(t, err) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { + historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", diff --git a/pkg/builder/local_build_executor.go b/pkg/builder/local_build_executor.go index f8ffe03c..00d253e7 100644 --- a/pkg/builder/local_build_executor.go +++ b/pkg/builder/local_build_executor.go @@ -7,12 +7,13 @@ import ( "time" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/pkg/cas" re_clock "github.com/buildbarn/bb-remote-execution/pkg/clock" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" runner_pb "github.com/buildbarn/bb-remote-execution/pkg/proto/runner" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" @@ -66,8 +67,9 @@ func (el *capturingErrorLogger) GetError() error { } type localBuildExecutor struct { - contentAddressableStorage blobstore.BlobAccess commandReader storage.MessageReader[*remoteexecution.Command] + blobUploader cas.BlobUploader + contentAddressableStorage cdc.ContentAddressableStorage buildDirectoryCreator BuildDirectoryCreator runner runner_pb.RunnerClient clock clock.Clock @@ -79,8 +81,9 @@ type localBuildExecutor struct { // NewLocalBuildExecutor returns a BuildExecutor that executes build // steps on the local system. -func NewLocalBuildExecutor(contentAddressableStorage blobstore.BlobAccess, commandReader storage.MessageReader[*remoteexecution.Command], buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { +func NewLocalBuildExecutor(contentAddressableStorage cdc.ContentAddressableStorage, commandReader storage.MessageReader[*remoteexecution.Command], blobUploader cas.BlobUploader, buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { return &localBuildExecutor{ + blobUploader: blobUploader, contentAddressableStorage: contentAddressableStorage, commandReader: commandReader, buildDirectoryCreator: buildDirectoryCreator, @@ -343,7 +346,7 @@ func (be *localBuildExecutor) Execute(ctx context.Context, filePool pool.FilePoo } else if stderrDigest.GetSizeBytes() > 0 { response.Result.StderrDigest = stderrDigest.GetProto() } - if err := outputHierarchy.UploadOutputs(ctx, inputRootDirectory, be.contentAddressableStorage, digestFunction, writableFileUploadDelayChan, response.Result, be.forceUploadTreesAndDirectories); err != nil { + if err := outputHierarchy.UploadOutputs(ctx, inputRootDirectory, be.blobUploader, digestFunction, writableFileUploadDelayChan, response.Result, be.forceUploadTreesAndDirectories); err != nil { attachErrorToExecuteResponse(response, err) } diff --git a/pkg/builder/local_build_executor_test.go b/pkg/builder/local_build_executor_test.go index e14f2910..01d3f1a3 100644 --- a/pkg/builder/local_build_executor_test.go +++ b/pkg/builder/local_build_executor_test.go @@ -9,11 +9,11 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" + "github.com/buildbarn/bb-remote-execution/pkg/cas" re_clock "github.com/buildbarn/bb-remote-execution/pkg/clock" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" runner_pb "github.com/buildbarn/bb-remote-execution/pkg/proto/runner" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -34,14 +34,16 @@ import ( func TestLocalBuildExecutorInvalidActionDigest(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -85,14 +87,16 @@ func TestLocalBuildExecutorInvalidActionDigest(t *testing.T) { func TestLocalBuildExecutorMissingAction(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -129,8 +133,9 @@ func TestLocalBuildExecutorMissingAction(t *testing.T) { func TestLocalBuildExecutorBuildDirectoryCreatorFailedFailed(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) buildDirectoryCreator.EXPECT().GetBuildDirectory(ctx, &actionDigest). @@ -140,6 +145,7 @@ func TestLocalBuildExecutorBuildDirectoryCreatorFailedFailed(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -183,8 +189,9 @@ func TestLocalBuildExecutorBuildDirectoryCreatorFailedFailed(t *testing.T) { func TestLocalBuildExecutorInputRootPopulationFailed(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) buildDirectory := mock.NewMockBuildDirectory(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) @@ -209,6 +216,7 @@ func TestLocalBuildExecutorInputRootPopulationFailed(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -250,8 +258,9 @@ func TestLocalBuildExecutorInputRootPopulationFailed(t *testing.T) { func TestLocalBuildExecutorOutputDirectoryCreationFailure(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) commandReader.EXPECT().ReadMessage( gomock.Any(), digest.MustNewDigest("fedora", remoteexecution.DigestFunction_SHA256, "6666666666666666666666666666666666666666666666666666666666666666", 234), @@ -288,6 +297,7 @@ func TestLocalBuildExecutorOutputDirectoryCreationFailure(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -333,8 +343,9 @@ func TestLocalBuildExecutorOutputDirectoryCreationFailure(t *testing.T) { func TestLocalBuildExecutorMissingCommand(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) buildDirectory := mock.NewMockBuildDirectory(ctrl) actionDigest := digest.MustNewDigest("netbsd", remoteexecution.DigestFunction_SHA256, "5555555555555555555555555555555555555555555555555555555555555555", 7) @@ -359,6 +370,7 @@ func TestLocalBuildExecutorMissingCommand(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -400,7 +412,7 @@ func TestLocalBuildExecutorMissingCommand(t *testing.T) { func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) commandReader.EXPECT().ReadMessage( gomock.Any(), @@ -422,14 +434,16 @@ func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "0000000000000000000000000000000000000000000000000000000000000006", 678), nil, ) - contentAddressableStorage.EXPECT().Put( + blobUploader := mock.NewMockBlobUploader(ctrl) + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "102b51b9765a56a3e899f7cf0ee38e5251f9c503b357b330a49183eb7b155604", 2), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Tree{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + data, err := b.ToByteSlice() require.NoError(t, err) + m := testutil.MustUnmarshal(t, data, &remoteexecution.Tree{}) testutil.RequireEqualProto(t, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, }, m) @@ -491,6 +505,7 @@ func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -598,7 +613,7 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { helloUploadableDirectory.EXPECT().Close() // Read operations against the Content Addressable Storage. - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) commandReader.EXPECT().ReadMessage( gomock.Any(), @@ -723,9 +738,11 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { clock.EXPECT().NewContextWithTimeout(gomock.Any(), 10*time.Second).DoAndReturn(func(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { return parent, func() {} }) + blobUploader := mock.NewMockBlobUploader(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -808,14 +825,16 @@ func TestLocalBuildExecutorSuccess(t *testing.T) { func TestLocalBuildExecutorCachingInvalidTimeout(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) runner := mock.NewMockRunnerClient(ctrl) clock := mock.NewMockClock(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -860,7 +879,7 @@ func TestLocalBuildExecutorInputRootIOFailureDuringExecution(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) commandReader.EXPECT().ReadMessage( gomock.Any(), @@ -937,9 +956,11 @@ func TestLocalBuildExecutorInputRootIOFailureDuringExecution(t *testing.T) { clock.EXPECT().NewContextWithTimeout(gomock.Any(), 10*time.Second).DoAndReturn(func(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { return parent, func() {} }) + blobUploader := mock.NewMockBlobUploader(ctrl) localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -997,7 +1018,8 @@ func TestLocalBuildExecutorTimeoutDuringExecution(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) commandReader.EXPECT().ReadMessage( gomock.Any(), @@ -1078,6 +1100,7 @@ func TestLocalBuildExecutorTimeoutDuringExecution(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, @@ -1141,8 +1164,9 @@ func TestLocalBuildExecutorCharacterDeviceNodeCreationFailed(t *testing.T) { // Build directory. buildDirectory := mock.NewMockBuildDirectory(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) commandReader := mock.NewMockMessageReader[*remoteexecution.Command](ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) // Build environment. buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) @@ -1179,6 +1203,7 @@ func TestLocalBuildExecutorCharacterDeviceNodeCreationFailed(t *testing.T) { localBuildExecutor := builder.NewLocalBuildExecutor( contentAddressableStorage, commandReader, + blobUploader, buildDirectoryCreator, runner, clock, diff --git a/pkg/builder/naive_build_directory.go b/pkg/builder/naive_build_directory.go index 0481a910..f9b745a8 100644 --- a/pkg/builder/naive_build_directory.go +++ b/pkg/builder/naive_build_directory.go @@ -7,7 +7,6 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" - "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" @@ -21,10 +20,11 @@ import ( ) type naiveBuildDirectoryOptions struct { - directoryFetcher cas.DirectoryFetcher - fileFetcher cas.FileFetcher - fileFetcherSemaphore *semaphore.Weighted - contentAddressableStorage blobstore.BlobAccess + directoryFetcher cas.DirectoryFetcher + fileFetcher cas.FileFetcher + fileFetcherSemaphore *semaphore.Weighted + // contentAddressableStorage cdc.ContentAddressableStorage + blobUploader cas.BlobUploader } type naiveBuildDirectory struct { @@ -42,14 +42,14 @@ type naiveBuildDirectory struct { // regular local file systems. The downside of such file systems is that // we cannot populate them on demand. All of the input files must be // present before invoking the build action. -func NewNaiveBuildDirectory(directory filesystem.DirectoryCloser, directoryFetcher cas.DirectoryFetcher, fileFetcher cas.FileFetcher, fileFetcherSemaphore *semaphore.Weighted, contentAddressableStorage blobstore.BlobAccess) BuildDirectory { +func NewNaiveBuildDirectory(directory filesystem.DirectoryCloser, directoryFetcher cas.DirectoryFetcher, fileFetcher cas.FileFetcher, fileFetcherSemaphore *semaphore.Weighted, blobUploader cas.BlobUploader) BuildDirectory { return &naiveBuildDirectory{ DirectoryCloser: directory, options: &naiveBuildDirectoryOptions{ - directoryFetcher: directoryFetcher, - fileFetcher: fileFetcher, - fileFetcherSemaphore: fileFetcherSemaphore, - contentAddressableStorage: contentAddressableStorage, + directoryFetcher: directoryFetcher, + fileFetcher: fileFetcher, + fileFetcherSemaphore: fileFetcherSemaphore, + blobUploader: blobUploader, }, } } @@ -188,13 +188,12 @@ func (d *naiveBuildDirectory) UploadFile(ctx context.Context, name path.Componen // used to compute the digest. This ensures uploads succeed, // even if more data gets appended in the meantime. This is not // uncommon, especially for stdout and stderr logs. - if err := d.options.contentAddressableStorage.Put( + if err := d.options.blobUploader.UploadBlob( ctx, blobDigest, - buffer.NewCASBufferFromReader( - blobDigest, - newSectionReadCloser(file, 0, sizeBytes), - buffer.UserProvided, + cas.NewBlobFromReaderAt( + newSectionReadAtCloser(file, 0, sizeBytes), + sizeBytes, ), ); err != nil { return digest.BadDigest, util.StatusWrap(err, "Failed to upload file") @@ -202,11 +201,11 @@ func (d *naiveBuildDirectory) UploadFile(ctx context.Context, name path.Componen return blobDigest, nil } -// newSectionReadCloser returns an io.ReadCloser that reads from r at a -// given offset, but stops with EOF after n bytes. This function is +// newSectionReadAtCloser returns an io.ReadCloser that reads from r at +// a given offset, but stops with EOF after n bytes. This function is // identical to io.NewSectionReader(), except that it provides an -// io.ReadCloser instead of an io.Reader. -func newSectionReadCloser(r filesystem.FileReader, off, n int64) io.ReadCloser { +// buffer.ReadAtCloser instead of an io.ReaderAt. +func newSectionReadAtCloser(r filesystem.FileReader, off, n int64) buffer.ReadAtCloser { return &struct { io.SectionReader io.Closer diff --git a/pkg/builder/naive_build_directory_test.go b/pkg/builder/naive_build_directory_test.go index 1061a26d..f6f2a81c 100644 --- a/pkg/builder/naive_build_directory_test.go +++ b/pkg/builder/naive_build_directory_test.go @@ -10,7 +10,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem/path" "github.com/buildbarn/bb-storage/pkg/testutil" @@ -108,8 +108,8 @@ func TestNaiveBuildDirectorySuccess(t *testing.T) { require.NoError(t, path.Resolve(targetParser, scopeWalker)) require.Equal(t, "executable", targetPath.GetUNIXString()) }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -131,8 +131,8 @@ func TestNaiveBuildDirectoryInputRootNotInStorage(t *testing.T) { errorLogger := mock.NewMockErrorLogger(ctrl) buildDirectory := mock.NewMockDirectoryCloser(ctrl) fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -178,8 +178,8 @@ func TestNaiveBuildDirectoryMissingInputDirectoryDigest(t *testing.T) { buildDirectory.EXPECT().EnterDirectory(path.MustNewComponent("Hello")).Return(helloDirectory, nil) helloDirectory.EXPECT().Close() fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -230,8 +230,8 @@ func TestNaiveBuildDirectoryDirectoryCreationFailure(t *testing.T) { helloDirectory.EXPECT().Mkdir(path.MustNewComponent("World"), os.FileMode(0o777)).Return(status.Error(codes.DataLoss, "Disk on fire")) helloDirectory.EXPECT().Close() fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -283,8 +283,8 @@ func TestNaiveBuildDirectoryDirectoryEnterDirectoryFailure(t *testing.T) { helloDirectory.EXPECT().EnterDirectory(path.MustNewComponent("World")).Return(nil, status.Error(codes.PermissionDenied, "Thou shalt not pass!")) helloDirectory.EXPECT().Close() fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -330,8 +330,8 @@ func TestNaiveBuildDirectoryMissingInputFileDigest(t *testing.T) { buildDirectory.EXPECT().EnterDirectory(path.MustNewComponent("Hello")).Return(helloDirectory, nil) helloDirectory.EXPECT().Close() fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -388,8 +388,8 @@ func TestNaiveBuildDirectoryFileCreationFailure(t *testing.T) { false, ).Return(status.Error(codes.DataLoss, "Disk on fire")) helloDirectory.EXPECT().Close() - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -443,8 +443,8 @@ func TestNaiveBuildDirectorySymlinkCreationFailure(t *testing.T) { }) helloDirectory.EXPECT().Close() fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), contentAddressableStorage) + blobUploader := mock.NewMockBlobUploader(ctrl) + inputRootPopulator := builder.NewNaiveBuildDirectory(buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), blobUploader) err := inputRootPopulator.MergeDirectoryContents( ctx, @@ -461,13 +461,13 @@ func TestNaiveBuildDirectoryUploadFile(t *testing.T) { buildDirectory := mock.NewMockDirectoryCloser(ctrl) directoryFetcher := mock.NewMockDirectoryFetcher(ctrl) fileFetcher := mock.NewMockFileFetcher(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) inputRootPopulator := builder.NewNaiveBuildDirectory( buildDirectory, directoryFetcher, fileFetcher, semaphore.NewWeighted(1), - contentAddressableStorage, + blobUploader, ) helloWorldDigest := digest.MustNewDigest("default-scheduler", remoteexecution.DigestFunction_MD5, "3e25960a79dbc69b674cd4ec67a72c62", 11) @@ -521,16 +521,16 @@ func TestNaiveBuildDirectoryUploadFile(t *testing.T) { ), file.EXPECT().Close().Return(nil), ) - contentAddressableStorage.EXPECT().Put(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - _, err := b.ToByteSlice(100) - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Buffer is 9 bytes in size, while 11 bytes were expected"), err) + blobUploader.EXPECT().UploadBlob(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + _, err := b.ToByteSlice() + testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Stream was 9 bytes in size, while 11 bytes were expected"), err) return err }, ) _, err := inputRootPopulator.UploadFile(ctx, path.MustNewComponent("hello"), digestFunction, writableFileUploadDelay) - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Failed to upload file: Buffer is 9 bytes in size, while 11 bytes were expected"), err) + testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Failed to upload file: Stream was 9 bytes in size, while 11 bytes were expected"), err) }) t.Run("SuccessFileGrownDuringUpload", func(t *testing.T) { @@ -559,9 +559,9 @@ func TestNaiveBuildDirectoryUploadFile(t *testing.T) { ), file.EXPECT().Close().Return(nil), ) - contentAddressableStorage.EXPECT().Put(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(100) + blobUploader.EXPECT().UploadBlob(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + data, err := b.ToByteSlice() require.NoError(t, err) require.Equal(t, []byte("Hello world"), data) return nil diff --git a/pkg/builder/output_hierarchy.go b/pkg/builder/output_hierarchy.go index a35df033..9ea3d619 100644 --- a/pkg/builder/output_hierarchy.go +++ b/pkg/builder/output_hierarchy.go @@ -6,8 +6,8 @@ import ( "sort" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -123,7 +123,7 @@ func (on *outputNode) uploadOutputs(s *uploadOutputsState, d UploadableDirectory // track common parameters during recursion. type uploadOutputsState struct { context context.Context - contentAddressableStorage blobstore.BlobAccess + blobUploader cas.BlobUploader digestFunction digest.Function writableFileUploadDelay <-chan struct{} actionResult *remoteexecution.ActionResult @@ -187,7 +187,7 @@ func (s *uploadOutputsState) uploadOutputDirectoryEntered(d UploadableDirectory, // depends on it to work efficiently. successfullyUploaded := true treeDigest := s.computeDigest(treeData) - if err := s.contentAddressableStorage.Put(s.context, treeDigest, buffer.NewValidatedBufferFromByteSlice(treeData)); err != nil { + if err := s.blobUploader.UploadBlob(s.context, treeDigest, cas.NewBlobFromByteslice(treeData)); err != nil { s.saveError(util.StatusWrapf(err, "Failed to store output directory %#v", dPath.GetUNIXString())) successfullyUploaded = false } @@ -199,7 +199,7 @@ func (s *uploadOutputsState) uploadOutputDirectoryEntered(d UploadableDirectory, if s.uploadTreesAndDirectories { rootDirectoryDigestProto = rootDirectoryDigest.GetProto() for directoryDigest, directory := range dState.directoriesSeen { - if err := s.contentAddressableStorage.Put(s.context, directoryDigest, buffer.NewValidatedBufferFromByteSlice(directory)); err != nil { + if err := s.blobUploader.UploadBlob(s.context, directoryDigest, cas.NewBlobFromByteslice(directory)); err != nil { s.saveError(util.StatusWrapf(err, "Failed to store output directory %#v", dPath.GetUNIXString())) successfullyUploaded = false } @@ -478,10 +478,10 @@ func (oh *OutputHierarchy) CreateParentDirectories(d ParentPopulatableDirectory) // UploadOutputs uploads outputs of the build action into the CAS. This // function is called after executing the build action. -func (oh *OutputHierarchy) UploadOutputs(ctx context.Context, d UploadableDirectory, contentAddressableStorage blobstore.BlobAccess, digestFunction digest.Function, writableFileUploadDelay <-chan struct{}, actionResult *remoteexecution.ActionResult, forceUploadTreesAndDirectories bool) error { +func (oh *OutputHierarchy) UploadOutputs(ctx context.Context, d UploadableDirectory, blobUploader cas.BlobUploader, digestFunction digest.Function, writableFileUploadDelay <-chan struct{}, actionResult *remoteexecution.ActionResult, forceUploadTreesAndDirectories bool) error { s := uploadOutputsState{ context: ctx, - contentAddressableStorage: contentAddressableStorage, + blobUploader: blobUploader, digestFunction: digestFunction, writableFileUploadDelay: writableFileUploadDelay, actionResult: actionResult, diff --git a/pkg/builder/output_hierarchy_test.go b/pkg/builder/output_hierarchy_test.go index 337a238d..24fdb26f 100644 --- a/pkg/builder/output_hierarchy_test.go +++ b/pkg/builder/output_hierarchy_test.go @@ -9,7 +9,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -169,7 +169,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) root := mock.NewMockUploadableDirectory(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) digestFunction := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5).GetDigestFunction() writableFileUploadDelay := make(chan struct{}) @@ -186,7 +186,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { oh.UploadOutputs( ctx, root, - contentAddressableStorage, + blobUploader, digestFunction, writableFileUploadDelay, &actionResult, @@ -253,14 +253,15 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { Return(digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "af37d08ae228a87dc6b265fd1019c97d", 7), nil) directoryDirectory.EXPECT().Readlink(path.MustNewComponent("symlink")).Return(path.UNIXFormat.NewParser("symlink-target"), nil) directoryDirectory.EXPECT().Close() - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "55aed4acf40a28132fb2d2de2b5962f0", 184), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Tree{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) testutil.RequireEqualProto(t, &remoteexecution.Tree{ Root: &remoteexecution.Directory{ Files: []*remoteexecution.FileNode{ @@ -308,13 +309,15 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { foo.EXPECT().EnterUploadableDirectory(path.MustNewComponent("path-directory")).Return(pathDirectory, nil) pathDirectory.EXPECT().ReadDir().Return(nil, nil) pathDirectory.EXPECT().Close() - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Tree{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() + require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) require.NoError(t, err) testutil.RequireEqualProto(t, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, @@ -360,7 +363,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { oh.UploadOutputs( ctx, root, - contentAddressableStorage, + blobUploader, digestFunction, writableFileUploadDelay, &actionResult, @@ -497,14 +500,15 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { // It is permitted to add the root directory as an // output path. root.EXPECT().ReadDir().Return(nil, nil) - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Tree{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) testutil.RequireEqualProto(t, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, }, m) @@ -522,7 +526,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { oh.UploadOutputs( ctx, root, - contentAddressableStorage, + blobUploader, digestFunction, writableFileUploadDelay, &actionResult, @@ -560,7 +564,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { oh.UploadOutputs( ctx, root, - contentAddressableStorage, + blobUploader, digestFunction, writableFileUploadDelay, &actionResult, @@ -628,13 +632,15 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { }}, } - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "aa5a55cc8d4d32abd00adf5dd1ed93b5", 193), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Tree{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() + require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) require.NoError(t, err) testutil.RequireEqualProto(t, &remoteexecution.Tree{ Root: rootDirectory, @@ -644,24 +650,28 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { }, m) return nil }) - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f782fc2043b00886534aee47de8c522a", 120), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Directory{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() + require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Directory{}) require.NoError(t, err) testutil.RequireEqualProto(t, rootDirectory, m) return nil }) - contentAddressableStorage.EXPECT().Put( + blobUploader.EXPECT().UploadBlob( ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "460270223db29e8867bad29c658c1395", 69), gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - m, err := b.ToProto(&remoteexecution.Directory{}, 10000) + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + bytes, err := b.ToByteSlice() + require.NoError(t, err) + m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Directory{}) require.NoError(t, err) testutil.RequireEqualProto(t, directory1Directory, m) return nil @@ -678,7 +688,7 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { oh.UploadOutputs( ctx, root, - contentAddressableStorage, + blobUploader, digestFunction, writableFileUploadDelay, &actionResult, diff --git a/pkg/builder/prefetching_build_executor.go b/pkg/builder/prefetching_build_executor.go index f93378f6..da00bdd1 100644 --- a/pkg/builder/prefetching_build_executor.go +++ b/pkg/builder/prefetching_build_executor.go @@ -12,6 +12,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem/path" "github.com/buildbarn/bb-storage/pkg/proto/fsac" @@ -27,7 +28,7 @@ import ( type prefetchingBuildExecutor struct { BuildExecutor - contentAddressableStorage blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage directoryFetcher cas.DirectoryFetcher fileReadSemaphore *semaphore.Weighted fileSystemAccessCache blobstore.BlobAccess @@ -53,7 +54,7 @@ type prefetchingBuildExecutor struct { // directory (FUSE, NFSv4). On workers that use native build // directories, the monitor is ignored, leading to empty Bloom filters // being stored. -func NewPrefetchingBuildExecutor(buildExecutor BuildExecutor, contentAddressableStorage blobstore.BlobAccess, directoryFetcher cas.DirectoryFetcher, fileReadSemaphore *semaphore.Weighted, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes, bloomFilterBitsPerElement, bloomFilterMaximumSizeBytes int) BuildExecutor { +func NewPrefetchingBuildExecutor(buildExecutor BuildExecutor, contentAddressableStorage cdc.ContentAddressableStorage, directoryFetcher cas.DirectoryFetcher, fileReadSemaphore *semaphore.Weighted, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes, bloomFilterBitsPerElement, bloomFilterMaximumSizeBytes int) BuildExecutor { be := &prefetchingBuildExecutor{ BuildExecutor: buildExecutor, contentAddressableStorage: contentAddressableStorage, @@ -192,7 +193,7 @@ type directoryPrefetcher struct { group *errgroup.Group bloomFilter *access.BloomFilterReader digestFunction digest.Function - contentAddressableStorage blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage directoryFetcher cas.DirectoryFetcher fileReadSemaphore *semaphore.Weighted } @@ -245,7 +246,7 @@ func (dp *directoryPrefetcher) prefetchRecursively(pathTrace *path.Trace, direct } dp.group.Go(func() error { var b [1]byte - _, err := dp.contentAddressableStorage.Get(dp.context, fileDigest).ReadAt(b[:], 0) + _, err := cdc.ReadBlobAt(dp.context, dp.contentAddressableStorage, fileDigest, b[:], 0) dp.fileReadSemaphore.Release(1) if err != nil && err != io.EOF && status.Code(err) != codes.Canceled { return util.StatusWrapf(err, "Failed to prefetch file %#v", childPathTrace.GetUNIXString()) diff --git a/pkg/builder/prefetching_build_executor_test.go b/pkg/builder/prefetching_build_executor_test.go index d6ed0c88..b4616a21 100644 --- a/pkg/builder/prefetching_build_executor_test.go +++ b/pkg/builder/prefetching_build_executor_test.go @@ -12,6 +12,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" "github.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/proto/fsac" "github.com/buildbarn/bb-storage/pkg/testutil" @@ -29,7 +30,7 @@ func TestPrefetchingBuildExecutor(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) baseBuildExecutor := mock.NewMockBuildExecutor(ctrl) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) directoryFetcher := mock.NewMockDirectoryFetcher(ctrl) fileReadSemaphore := semaphore.NewWeighted(1) fileSystemAccessCache := mock.NewMockBlobAccess(ctrl) @@ -309,8 +310,12 @@ func TestPrefetchingBuildExecutor(t *testing.T) { }, }, }, nil) - contentAddressableStorage.EXPECT().Get(gomock.Any(), digest.MustNewDigest("hello", remoteexecution.DigestFunction_MD5, "3ffe1ce0624ece24e5d9b31c2342a6d4", 200)). - Return(buffer.NewBufferFromError(status.Error(codes.Internal, "Storage offline"))) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + contentAddressableStorage.EXPECT().FetchChunk(gomock.Any(), digest.MustNewDigest("hello", remoteexecution.DigestFunction_MD5, "3ffe1ce0624ece24e5d9b31c2342a6d4", 200)). + Return(nil, status.Error(codes.Internal, "Storage offline")) testutil.RequireEqualProto( t, diff --git a/pkg/builder/virtual_build_directory.go b/pkg/builder/virtual_build_directory.go index 8d3ef7d8..f61c0ab7 100644 --- a/pkg/builder/virtual_build_directory.go +++ b/pkg/builder/virtual_build_directory.go @@ -9,7 +9,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/virtual" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" @@ -22,7 +22,8 @@ import ( type virtualBuildDirectoryOptions struct { directoryFetcher cas.DirectoryFetcher - contentAddressableStorage blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage + blobUploader cas.BlobUploader symlinkFactory virtual.SymlinkFactory characterDeviceFactory virtual.CharacterDeviceFactory handleAllocator virtual.StatefulHandleAllocator @@ -40,12 +41,13 @@ type virtualBuildDirectory struct { // input root explicitly, it calls PrepopulatedDirectory.CreateChildren // to add special file and directory nodes whose contents are read on // demand. -func NewVirtualBuildDirectory(directory virtual.PrepopulatedDirectory, directoryFetcher cas.DirectoryFetcher, contentAddressableStorage blobstore.BlobAccess, symlinkFactory virtual.SymlinkFactory, characterDeviceFactory virtual.CharacterDeviceFactory, handleAllocator virtual.StatefulHandleAllocator, defaultAttributesSetter virtual.DefaultAttributesSetter, clock clock.Clock) BuildDirectory { +func NewVirtualBuildDirectory(directory virtual.PrepopulatedDirectory, directoryFetcher cas.DirectoryFetcher, contentAddressableStorage cdc.ContentAddressableStorage, blobUploader cas.BlobUploader, symlinkFactory virtual.SymlinkFactory, characterDeviceFactory virtual.CharacterDeviceFactory, handleAllocator virtual.StatefulHandleAllocator, defaultAttributesSetter virtual.DefaultAttributesSetter, clock clock.Clock) BuildDirectory { return &virtualBuildDirectory{ PrepopulatedDirectory: directory, options: &virtualBuildDirectoryOptions{ directoryFetcher: directoryFetcher, contentAddressableStorage: contentAddressableStorage, + blobUploader: blobUploader, symlinkFactory: symlinkFactory, characterDeviceFactory: characterDeviceFactory, handleAllocator: handleAllocator, @@ -149,10 +151,10 @@ func (d *virtualBuildDirectory) UploadFile(ctx context.Context, name path.Compon } if _, leaf := child.GetPair(); leaf != nil { p := virtual.ApplyUploadFile{ - Context: ctx, - ContentAddressableStorage: d.options.contentAddressableStorage, - DigestFunction: digestFunction, - WritableFileUploadDelay: writableFileUploadDelay, + Context: ctx, + BlobUploader: d.options.blobUploader, + DigestFunction: digestFunction, + WritableFileUploadDelay: writableFileUploadDelay, } if !child.GetNode().VirtualApply(&p) { panic("build directory contains leaves that don't handle ApplyUploadFile") diff --git a/pkg/cas/BUILD.bazel b/pkg/cas/BUILD.bazel index cbfe29b8..b307ec6d 100644 --- a/pkg/cas/BUILD.bazel +++ b/pkg/cas/BUILD.bazel @@ -3,15 +3,22 @@ load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "cas", srcs = [ - "blob_access_directory_fetcher.go", - "blob_access_file_fetcher.go", + "batching_blob_uploader.go", + "blob.go", + "blob_uploader.go", "caching_directory_fetcher.go", + "cas_directory_fetcher.go", + "cas_file_fetcher.go", + "cas_message_reader.go", "configuration.go", "decomposed_directory_walker.go", "directory_fetcher.go", "directory_walker.go", + "existence_precondition_content_addressable_storage.go", "file_fetcher.go", "hardlinking_file_fetcher.go", + "put_blob.go", + "suspending_content_addressable_storage.go", "suspending_directory_fetcher.go", ], importpath = "github.com/buildbarn/bb-remote-execution/pkg/cas", @@ -22,40 +29,51 @@ go_library( "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", - "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/blobstore/chunklist", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/eviction", "@com_github_buildbarn_bb_storage//pkg/filesystem", "@com_github_buildbarn_bb_storage//pkg/filesystem/path", + "@com_github_buildbarn_bb_storage//pkg/storage", "@com_github_buildbarn_bb_storage//pkg/util", + "@org_golang_google_genproto_googleapis_rpc//errdetails", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//encoding/protowire", "@org_golang_google_protobuf//proto", + "@org_golang_x_sync//errgroup", + "@org_golang_x_sync//semaphore", ], ) go_test( name = "cas_test", srcs = [ - "blob_access_directory_fetcher_test.go", + "batching_blob_uploader_test.go", "caching_directory_fetcher_test.go", + "cas_directory_fetcher_test.go", "decomposed_directory_walker_test.go", + "existence_precondition_content_addressable_storage_test.go", "hardlinking_file_fetcher_test.go", + "put_blob_test.go", ], deps = [ ":cas", "//internal/mock", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", - "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/blobstore/chunklist", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/eviction", "@com_github_buildbarn_bb_storage//pkg/filesystem/path", "@com_github_buildbarn_bb_storage//pkg/testutil", + "@com_github_golang_protobuf//proto", "@com_github_stretchr_testify//require", + "@org_golang_google_genproto_googleapis_rpc//errdetails", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", + "@org_golang_x_sync//semaphore", "@org_uber_go_mock//gomock", ], ) diff --git a/pkg/cas/batching_blob_uploader.go b/pkg/cas/batching_blob_uploader.go new file mode 100644 index 00000000..93095f50 --- /dev/null +++ b/pkg/cas/batching_blob_uploader.go @@ -0,0 +1,134 @@ +package cas + +import ( + "context" + "sync" + + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/util" + + "golang.org/x/sync/errgroup" + "golang.org/x/sync/semaphore" +) + +type pendingUploadOperation struct { + digest digest.Digest + blob Blob +} + +type batchingBlobUploader struct { + contentAddressableStorage cdc.ContentAddressableStorage + digestKeyFormat digest.KeyFormat + batchSize int + uploadConcurrencySemaphore *semaphore.Weighted + + lock sync.Mutex + pendingUploadOperations map[string]pendingUploadOperation + flushError error +} + +// NewBatchingBlobUploader returns a BlobUploader that batches uploads +// to the Content Addressable Storage (CAS) into batches of the +// specified size while still respecting an upload concurrency. +func NewBatchingBlobUploader(contentAddressableStorage cdc.ContentAddressableStorage, batchSize int, uploadConcurrencySemaphore *semaphore.Weighted) (BlobUploader, func(context.Context) error) { + bu := &batchingBlobUploader{ + contentAddressableStorage: contentAddressableStorage, + digestKeyFormat: contentAddressableStorage.GetDigestKeyFormat(), + batchSize: batchSize, + uploadConcurrencySemaphore: uploadConcurrencySemaphore, + pendingUploadOperations: map[string]pendingUploadOperation{}, + } + return bu, func(ctx context.Context) error { + bu.lock.Lock() + defer bu.lock.Unlock() + + // Flush last batch of blobs. Return any errors that occurred. + bu.flushLocked(ctx) + err := bu.flushError + bu.flushError = nil + return err + } +} + +func (bu *batchingBlobUploader) flushLocked(ctx context.Context) { + // Ensure that all pending blobs are closed upon termination. + defer func() { + for _, pending := range bu.pendingUploadOperations { + pending.blob.Discard() + } + bu.pendingUploadOperations = map[string]pendingUploadOperation{} + }() + + if len(bu.pendingUploadOperations) == 0 { + return + } + + // Determine which blobs are missing. + digests := digest.NewSetBuilder(len(bu.pendingUploadOperations)) + for _, pending := range bu.pendingUploadOperations { + digests.Add(pending.digest) + } + + missing, err := bu.contentAddressableStorage.FindMissing(ctx, digests.Build()) + if err != nil { + bu.flushError = util.StatusWrap(err, "Failed to determine existence of previous batch of blobs") + return + } + + // Upload the missing ones. + if !missing.Empty() { + group, groupCtx := errgroup.WithContext(ctx) + group.Go(func() error { + for _, d := range missing.Items() { + key := d.GetKey(bu.digestKeyFormat) + if pending, ok := bu.pendingUploadOperations[key]; ok { + // Mirroring batchedStoreBlobAccess: Acquire semaphore before spinning up the goroutine. + if err := util.AcquireSemaphore(groupCtx, bu.uploadConcurrencySemaphore, 1); err != nil { + return err + } + delete(bu.pendingUploadOperations, key) + group.Go(func() error { + err := PutBlob(groupCtx, bu.contentAddressableStorage, pending.digest, pending.blob) + bu.uploadConcurrencySemaphore.Release(1) + if err != nil { + return util.StatusWrapf(err, "Failed to store previous blob %s", pending.digest) + } + return nil + }) + } + } + return nil + }) + if err := group.Wait(); err != nil { + bu.flushError = err + } + } +} + +func (bu *batchingBlobUploader) UploadBlob(ctx context.Context, d digest.Digest, blob Blob) error { + bu.lock.Lock() + defer bu.lock.Unlock() + + // Discard duplicate writes. + key := d.GetKey(bu.digestKeyFormat) + if _, ok := bu.pendingUploadOperations[key]; ok { + blob.Discard() + return nil + } + + // Flush the existing blobs if there are too many pending. + if len(bu.pendingUploadOperations) >= bu.batchSize { + bu.flushLocked(ctx) + } + if err := bu.flushError; err != nil { + blob.Discard() + return err + } + + bu.pendingUploadOperations[key] = pendingUploadOperation{ + digest: d, + blob: blob, + } + return nil +} diff --git a/pkg/cas/batching_blob_uploader_test.go b/pkg/cas/batching_blob_uploader_test.go new file mode 100644 index 00000000..fddc2134 --- /dev/null +++ b/pkg/cas/batching_blob_uploader_test.go @@ -0,0 +1,169 @@ +package cas_test + +import ( + "context" + "testing" + + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/internal/mock" + "github.com/buildbarn/bb-remote-execution/pkg/cas" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" + "golang.org/x/sync/semaphore" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestBatchingBlobUploadSuccess(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT().GetDigestKeyFormat().Return(digest.KeyWithoutInstance) + uploadConcurrencySemaphore := semaphore.NewWeighted(10) + + blobUploader, flush := cas.NewBatchingBlobUploader(contentAddressableStorage, 2, uploadConcurrencySemaphore) + + // We should be able to enqueue requests for up to two blobs + // without generating any calls on the storage backend. + digestEmpty := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "d41d8cd98f00b204e9800998ecf8427e", 0) + for i := 0; i < 10; i++ { + require.NoError(t, blobUploader.UploadBlob(ctx, digestEmpty, cas.NewBlobFromByteslice(nil))) + } + digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) + for i := 0; i < 10; i++ { + require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromByteslice([]byte("Hello")))) + } + + // Attempting to store a third blob should cause the first two blobs + // to be flushed, but only digestHello is missing and needs to be + // uploaded. + contentAddressableStorage.EXPECT().FetchCDCParameters(gomock.Any(), gomock.Any()).Return(cdc.Parameters{ + MinChunkSizeBytes: 256 << 10, + HorizonSizeBytes: 8 * 256 << 10, + }, nil) + contentAddressableStorage.EXPECT(). + FindMissing(gomock.Any(), digest.NewSetBuilder(2).Add(digestHello).Add(digestEmpty).Build()). + Return(digest.NewSetBuilder(1).Add(digestHello).Build(), nil) + contentAddressableStorage.EXPECT().PutChunk(gomock.Any(), digestHello, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, data []byte) error { + require.Equal(t, []byte("Hello"), data) + return nil + }, + ) + + digestGoodbye := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "6fc422233a40a75a1f028e11c3cd1140", 7) + require.NoError(t, blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye")))) + + // The third blob is enqueued and should be written when flushed. + contentAddressableStorage.EXPECT().FetchCDCParameters(gomock.Any(), gomock.Any()).Return(cdc.Parameters{ + MinChunkSizeBytes: 256 << 10, + HorizonSizeBytes: 8 * 256 << 10, + }, nil) + contentAddressableStorage.EXPECT(). + FindMissing(gomock.Any(), digestGoodbye.ToSingletonSet()). + Return(digestGoodbye.ToSingletonSet(), nil) + contentAddressableStorage.EXPECT().PutChunk(gomock.Any(), digestGoodbye, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, data []byte) error { + require.Equal(t, []byte("Goodbye"), data) + return nil + }, + ) + + require.NoError(t, flush(ctx)) + // Redundant flushing should cause no operations. + require.NoError(t, flush(ctx)) +} + +func TestBatchingBlobUploaderFailure(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT().GetDigestKeyFormat().Return(digest.KeyWithoutInstance) + uploadConcurrencySemaphore := semaphore.NewWeighted(1) + blobUploader, flush := cas.NewBatchingBlobUploader(contentAddressableStorage, 2, uploadConcurrencySemaphore) + + // We should be able to enqueue requests for up to two blobs + // without generating any calls on the storage backend. + digestEmpty := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "d41d8cd98f00b204e9800998ecf8427e", 0) + for i := 0; i < 10; i++ { + require.NoError(t, blobUploader.UploadBlob(ctx, digestEmpty, cas.NewBlobFromByteslice(nil))) + } + digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) + for i := 0; i < 10; i++ { + require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromByteslice([]byte("Hello")))) + } + + // Attempting to store a third blob should cause the first two blobs + // to be flushed. Due to an I/O failure, we should switch to an + // error state in which we no longer perform I/O until flushed. + contentAddressableStorage.EXPECT().FetchCDCParameters(gomock.Any(), gomock.Any()).Return(cdc.Parameters{ + MinChunkSizeBytes: 256 << 10, + HorizonSizeBytes: 8 * 256 << 10, + }, nil) + contentAddressableStorage.EXPECT(). + FindMissing(gomock.Any(), digest.NewSetBuilder(2).Add(digestHello).Add(digestEmpty).Build()). + Return(digest.NewSetBuilder(1).Add(digestHello).Build(), nil) + contentAddressableStorage.EXPECT().PutChunk(gomock.Any(), digestHello, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, data []byte) error { + require.Equal(t, []byte("Hello"), data) + return status.Error(codes.Internal, "Storage backend on fire") + }, + ) + + digestGoodbye := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "6fc422233a40a75a1f028e11c3cd1140", 7) + testutil.RequireEqualStatus( + t, + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), + blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye"))), + ) + + // Future requests to store blobs should be discarded + // immediately, returning same error. + testutil.RequireEqualStatus( + t, + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), + blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye"))), + ) + + // Flushing should not cause any requests on the backend, due to + // it being in the error state. It should return the error that + // caused it to go into the error state. + testutil.RequireEqualStatus( + t, + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), + flush(ctx), + ) + + // Successive stores and flushes should be functional once again. + require.NoError(t, blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye")))) + contentAddressableStorage.EXPECT().FindMissing(ctx, digest.NewSetBuilder(1).Add(digestGoodbye).Build()).Return(digest.EmptySet, nil) + require.NoError(t, flush(ctx)) +} + +func TestBatchingBlobUploaderCanceledWhileWaitingOnSemaphore(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT().GetDigestKeyFormat().Return(digest.KeyWithoutInstance) + uploadConcurrencySemaphore := semaphore.NewWeighted(0) + blobUploader, flush := cas.NewBatchingBlobUploader(contentAddressableStorage, 2, uploadConcurrencySemaphore) + + // Enqueue a blob for writing. + digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) + reader := mock.NewMockFileReader(ctrl) + require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromReaderAt(reader, 5))) + + // Flushing it should attempt to write it. Because the semaphore + // is set to zero, there is no capacity to do this. As we're + // using a context that is canceled, this should not cause + // flushing to block. + ctxCanceled, cancel := context.WithCancel(ctx) + cancel() + contentAddressableStorage.EXPECT().FindMissing(ctxCanceled, digestHello.ToSingletonSet()).Return(digestHello.ToSingletonSet(), nil) + reader.EXPECT().Close() + + testutil.RequireEqualStatus(t, status.Error(codes.Canceled, "context canceled"), flush(ctxCanceled)) +} diff --git a/pkg/cas/blob.go b/pkg/cas/blob.go new file mode 100644 index 00000000..13e1acad --- /dev/null +++ b/pkg/cas/blob.go @@ -0,0 +1,104 @@ +package cas + +import ( + "bytes" + "io" + + "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Blob is an abstraction interface over a set amount of data to be +// uploaded. Calling any of its methods will consume the blob. +type Blob interface { + ToReaderAt() buffer.ReadAtCloser + ToByteSlice() ([]byte, error) + Discard() error +} + +type readerAtBlob struct { + r buffer.ReadAtCloser + sizeBytes int64 +} + +func NewBlobFromReaderAt(r buffer.ReadAtCloser, sizeBytes int64) Blob { + return &readerAtBlob{ + sizeBytes: sizeBytes, + r: r, + } +} + +func (b *readerAtBlob) ToReaderAt() buffer.ReadAtCloser { + ret := b.r + b.r = nil + return ret +} + +func (b *readerAtBlob) ToByteSlice() (data []byte, err error) { + if b.r == nil { + return nil, status.Error(codes.FailedPrecondition, "Blob has already been consumed") + } + + defer func() { + closeErr := b.r.Close() + b.r = nil + if err == nil && closeErr != nil { + err = closeErr + } + }() + + data = make([]byte, b.sizeBytes) + + if n, readErr := b.r.ReadAt(data, 0); readErr != nil { + if readErr == io.EOF { + if n == len(data) { + return data, nil + } + return nil, status.Errorf(codes.InvalidArgument, "Stream was %d bytes in size, while %d bytes were expected", n, b.sizeBytes) + } + return nil, readErr + } + + return data, nil +} + +func (b *readerAtBlob) Discard() error { + if b.r == nil { + return status.Error(codes.FailedPrecondition, "Blob has already been consumed") + } + err := b.r.Close() + b.r = nil + return err +} + +type bytesliceBlob struct { + data []byte +} + +func NewBlobFromByteslice(data []byte) Blob { + return &bytesliceBlob{data: data} +} + +func (bytesliceBlob) Discard() error { + return nil +} + +func (b *bytesliceBlob) ToByteSlice() ([]byte, error) { + return b.data, nil +} + +func (b *bytesliceBlob) ToReaderAt() buffer.ReadAtCloser { + return bytesliceReadAtCloser{ + Reader: bytes.NewReader(b.data), + } +} + +type bytesliceReadAtCloser struct { + *bytes.Reader +} + +func (bytesliceReadAtCloser) Close() error { + return nil +} diff --git a/pkg/cas/blob_access_directory_fetcher.go b/pkg/cas/blob_access_directory_fetcher.go deleted file mode 100644 index 1d4ef453..00000000 --- a/pkg/cas/blob_access_directory_fetcher.go +++ /dev/null @@ -1,168 +0,0 @@ -package cas - -import ( - "context" - "io" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/slicing" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/util" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protowire" -) - -type blobAccessDirectoryFetcher struct { - blobAccess blobstore.BlobAccess - slicer treeBlobSlicer - maximumTreeSizeBytes int64 -} - -// NewBlobAccessDirectoryFetcher creates a DirectoryFetcher that reads -// Directory objects from a BlobAccess based store. -func NewBlobAccessDirectoryFetcher(blobAccess blobstore.BlobAccess, maximumDirectorySizeBytes int, maximumTreeSizeBytes int64) DirectoryFetcher { - return &blobAccessDirectoryFetcher{ - blobAccess: blobAccess, - slicer: treeBlobSlicer{ - maximumDirectorySizeBytes: maximumDirectorySizeBytes, - }, - maximumTreeSizeBytes: maximumTreeSizeBytes, - } -} - -func (df *blobAccessDirectoryFetcher) GetDirectory(ctx context.Context, directoryDigest digest.Digest) (*remoteexecution.Directory, error) { - m, err := df.blobAccess.Get(ctx, directoryDigest).ToProto(&remoteexecution.Directory{}, df.slicer.maximumDirectorySizeBytes) - if err != nil { - return nil, err - } - return m.(*remoteexecution.Directory), nil -} - -func (df *blobAccessDirectoryFetcher) GetTreeRootDirectory(ctx context.Context, treeDigest digest.Digest) (*remoteexecution.Directory, error) { - if treeDigest.GetSizeBytes() > df.maximumTreeSizeBytes { - return nil, status.Errorf(codes.InvalidArgument, "Tree exceeds the maximum permitted size of %d bytes", df.maximumTreeSizeBytes) - } - - r := df.blobAccess.Get(ctx, treeDigest).ToReader() - defer r.Close() - - var rootDirectory *remoteexecution.Directory - if err := util.VisitProtoBytesFields(r, func(fieldNumber protowire.Number, offsetBytes, sizeBytes int64, fieldReader io.Reader) error { - if fieldNumber == blobstore.TreeRootFieldNumber { - if rootDirectory != nil { - return status.Error(codes.InvalidArgument, "Tree contains multiple root directories") - } - m, err := buffer.NewProtoBufferFromReader( - &remoteexecution.Directory{}, - io.NopCloser(fieldReader), - buffer.UserProvided, - ).ToProto(&remoteexecution.Directory{}, df.slicer.maximumDirectorySizeBytes) - if err != nil { - return err - } - rootDirectory = m.(*remoteexecution.Directory) - } - return nil - }); err != nil { - if _, copyErr := io.Copy(io.Discard, r); copyErr != nil { - err = copyErr - } - return nil, err - } - if rootDirectory == nil { - return nil, status.Error(codes.InvalidArgument, "Tree does not contain a root directory") - } - return rootDirectory, nil -} - -func (df *blobAccessDirectoryFetcher) GetTreeChildDirectory(ctx context.Context, treeDigest, childDigest digest.Digest) (*remoteexecution.Directory, error) { - if treeDigest.GetSizeBytes() > df.maximumTreeSizeBytes { - return nil, status.Errorf(codes.InvalidArgument, "Tree exceeds the maximum permitted size of %d bytes", df.maximumTreeSizeBytes) - } - - m, err := df.blobAccess.GetFromComposite(ctx, treeDigest, childDigest, &df.slicer).ToProto(&remoteexecution.Directory{}, df.slicer.maximumDirectorySizeBytes) - if err != nil { - return nil, err - } - return m.(*remoteexecution.Directory), nil -} - -// treeBlobSlicer is capable of unpacking an REv2 Tree object stored in -// the Content Addressable Storage (CAS) into separate Directory -// objects. This allows implementations of BlobAccess to store the -// contents of the Tree just once, but to create entries in its index -// that refer to each of the Directories contained within. -type treeBlobSlicer struct { - maximumDirectorySizeBytes int -} - -func (bs *treeBlobSlicer) Slice(b buffer.Buffer, requestedChildDigest digest.Digest) (buffer.Buffer, []slicing.BlobSlice) { - r := b.ToReader() - defer r.Close() - - requestedSizeBytes := requestedChildDigest.GetSizeBytes() - digestFunction := requestedChildDigest.GetDigestFunction() - var slices []slicing.BlobSlice - var bRequested buffer.Buffer - if err := util.VisitProtoBytesFields(r, func(fieldNumber protowire.Number, offsetBytes, sizeBytes int64, fieldReader io.Reader) error { - if fieldNumber == blobstore.TreeRootFieldNumber || fieldNumber == blobstore.TreeChildrenFieldNumber { - var childDigest digest.Digest - if bRequested == nil && sizeBytes == requestedSizeBytes { - // This directory has the same size as - // the one that is requested, so we may - // need to return it. Duplicate it. - b1, b2 := buffer.NewProtoBufferFromReader( - &remoteexecution.Directory{}, - io.NopCloser(fieldReader), - buffer.UserProvided, - ).CloneCopy(bs.maximumDirectorySizeBytes) - - childDigestGenerator := digestFunction.NewGenerator(sizeBytes) - if err := b1.IntoWriter(childDigestGenerator); err != nil { - b2.Discard() - return err - } - childDigest = childDigestGenerator.Sum() - - if childDigest == requestedChildDigest { - // Found the directory that was - // requested. Return it. - bRequested = b2 - } else { - b2.Discard() - } - } else { - // The directory's size doesn't match, - // so we can compute its checksum - // without unmarshaling it. - childDigestGenerator := digestFunction.NewGenerator(sizeBytes) - if _, err := io.Copy(childDigestGenerator, fieldReader); err != nil { - return err - } - childDigest = childDigestGenerator.Sum() - } - slices = append(slices, slicing.BlobSlice{ - Digest: childDigest, - OffsetBytes: offsetBytes, - SizeBytes: sizeBytes, - }) - } - return nil - }); err != nil { - if bRequested != nil { - bRequested.Discard() - } - if _, copyErr := io.Copy(io.Discard, r); copyErr != nil { - err = copyErr - } - return buffer.NewBufferFromError(err), nil - } - if bRequested == nil { - bRequested = buffer.NewBufferFromError(status.Error(codes.InvalidArgument, "Requested child directory is not contained in the tree")) - } - return bRequested, slices -} diff --git a/pkg/cas/blob_uploader.go b/pkg/cas/blob_uploader.go new file mode 100644 index 00000000..dda21ab1 --- /dev/null +++ b/pkg/cas/blob_uploader.go @@ -0,0 +1,12 @@ +package cas + +import ( + "context" + + "github.com/buildbarn/bb-storage/pkg/digest" +) + +// BlobUploader is an interface for uploading an arbitrary blob. +type BlobUploader interface { + UploadBlob(ctx context.Context, d digest.Digest, blob Blob) error +} diff --git a/pkg/cas/cas_directory_fetcher.go b/pkg/cas/cas_directory_fetcher.go new file mode 100644 index 00000000..3f037bb1 --- /dev/null +++ b/pkg/cas/cas_directory_fetcher.go @@ -0,0 +1,155 @@ +package cas + +import ( + "context" + "errors" + "io" + + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/util" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" +) + +// errTargetFound is a sentinel error used to cleanly abort the protobuf +// field iteration once we've found the target directory we are looking +// for. +var errTargetFound = errors.New("target directory found") + +type casDirectoryFetcher struct { + contentAddressableStorage cdc.ContentAddressableStorage + maximumTreeSizeBytes int64 + maximumDirectorySizeBytes int64 +} + +// NewCASDirectoryFetcher creates a DirectoryFetcher that reads Directory +// objects from a CAS. +func NewCASDirectoryFetcher(contentAddressableStorage cdc.ContentAddressableStorage, maximumDirectorySizeBytes, maximumTreeSizeBytes int64) DirectoryFetcher { + return &casDirectoryFetcher{ + contentAddressableStorage: contentAddressableStorage, + maximumDirectorySizeBytes: maximumDirectorySizeBytes, + maximumTreeSizeBytes: maximumTreeSizeBytes, + } +} + +func (df *casDirectoryFetcher) GetDirectory(ctx context.Context, directoryDigest digest.Digest) (*remoteexecution.Directory, error) { + if directoryDigest.GetSizeBytes() > df.maximumDirectorySizeBytes { + return nil, status.Errorf(codes.InvalidArgument, "Directory exceeds the maximum permitted size of %d bytes", df.maximumDirectorySizeBytes) + } + + m, err := cdc.GetProto(ctx, df.contentAddressableStorage, directoryDigest, &remoteexecution.Directory{}) + if err != nil { + return nil, err + } + + return m, nil +} + +// streamTree handles the common boilerplate of opening a tree stream +// from the CAS, checking limits, parsing its fields, and ensuring +// proper teardown. It intercepts errTargetFound to allow callers to +// short-circuit cleanly. +func (df *casDirectoryFetcher) streamTree(ctx context.Context, treeDigest digest.Digest, visitor func(protowire.Number, int64, int64, io.Reader) error) error { + if treeDigest.GetSizeBytes() > df.maximumTreeSizeBytes { + return status.Errorf(codes.InvalidArgument, "Tree exceeds the maximum permitted size of %d bytes", df.maximumTreeSizeBytes) + } + + r, err := cdc.GetReadCloser(ctx, df.contentAddressableStorage, treeDigest) + if err != nil { + return err + } + defer r.Close() + + return util.VisitProtoBytesFields(r, visitor) +} + +func (df *casDirectoryFetcher) GetTreeRootDirectory(ctx context.Context, treeDigest digest.Digest) (*remoteexecution.Directory, error) { + var rootDirectory *remoteexecution.Directory + + err := df.streamTree(ctx, treeDigest, func(fieldNumber protowire.Number, offsetBytes, sizeBytes int64, fieldReader io.Reader) error { + if fieldNumber != blobstore.TreeRootFieldNumber { + return nil + } + if sizeBytes > df.maximumDirectorySizeBytes { + return status.Errorf(codes.InvalidArgument, "Root directory exceeds the maximum permitted size of %d bytes", df.maximumDirectorySizeBytes) + } + + dirBytes := make([]byte, sizeBytes) + if _, err := io.ReadFull(fieldReader, dirBytes); err != nil { + return err + } + + var dir remoteexecution.Directory + if err := proto.Unmarshal(dirBytes, &dir); err != nil { + return util.StatusWrap(err, "Failed to unmarshal root directory") + } + + rootDirectory = &dir + return errTargetFound + }) + + if rootDirectory == nil { + if err != nil { + return nil, err + } + return nil, status.Error(codes.InvalidArgument, "Tree does not contain a root directory") + } + + return rootDirectory, nil +} + +func (df *casDirectoryFetcher) GetTreeChildDirectory(ctx context.Context, treeDigest, childDigest digest.Digest) (*remoteexecution.Directory, error) { + directorySizeBytes := childDigest.GetSizeBytes() + if directorySizeBytes > df.maximumDirectorySizeBytes { + return nil, status.Errorf(codes.InvalidArgument, "Requested child directory exceeds the maximum permitted size of %d bytes", df.maximumDirectorySizeBytes) + } + + var foundDirectory *remoteexecution.Directory + digestFunction := childDigest.GetDigestFunction() + + err := df.streamTree(ctx, treeDigest, func(fieldNumber protowire.Number, offsetBytes, sizeBytes int64, fieldReader io.Reader) error { + if fieldNumber != blobstore.TreeRootFieldNumber && fieldNumber != blobstore.TreeChildrenFieldNumber { + return nil + } + if sizeBytes != directorySizeBytes { + return nil + } + + dirBytes := make([]byte, sizeBytes) + if _, err := io.ReadFull(fieldReader, dirBytes); err != nil { + return err + } + + generator := digestFunction.NewGenerator(sizeBytes) + if _, err := generator.Write(dirBytes); err != nil { + return err + } + + if generator.Sum() != childDigest { + return nil + } + + var dir remoteexecution.Directory + if err := proto.Unmarshal(dirBytes, &dir); err != nil { + return util.StatusWrap(err, "Failed to unmarshal child directory") + } + + foundDirectory = &dir + return errTargetFound + }) + + if foundDirectory == nil { + if err != nil { + return nil, err + } + return nil, status.Error(codes.InvalidArgument, "Requested child directory is not contained in the tree") + } + + return foundDirectory, nil +} diff --git a/pkg/cas/blob_access_directory_fetcher_test.go b/pkg/cas/cas_directory_fetcher_test.go similarity index 61% rename from pkg/cas/blob_access_directory_fetcher_test.go rename to pkg/cas/cas_directory_fetcher_test.go index 76397f7b..508a6a7a 100644 --- a/pkg/cas/blob_access_directory_fetcher_test.go +++ b/pkg/cas/cas_directory_fetcher_test.go @@ -1,18 +1,16 @@ package cas_test import ( - "bytes" "context" - "io" "testing" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/cas" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/slicing" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -21,20 +19,22 @@ import ( "go.uber.org/mock/gomock" ) -func TestBlobAccessDirectoryFetcherGetDirectory(t *testing.T) { +func TestCASDirectoryFetcherGetDirectory(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - blobAccess := mock.NewMockBlobAccess(ctrl) - directoryFetcher := cas.NewBlobAccessDirectoryFetcher(blobAccess, 1000, 10000) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + directoryFetcher := cas.NewCASDirectoryFetcher(contentAddressableStorage, 1000, 10000) t.Run("IOError", func(t *testing.T) { // Failures reading the Directory object should be propagated. directoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "756b15c8f94b519e96135dcfde0e58c5", 50) - - r := mock.NewMockFileReader(ctrl) - r.EXPECT().ReadAt(gomock.Any(), gomock.Any()).Return(0, status.Error(codes.Internal, "I/O error")) - r.EXPECT().Close() - blobAccess.EXPECT().Get(ctx, directoryDigest).Return(buffer.NewValidatedBufferFromReaderAt(r, 100)) + contentAddressableStorage.EXPECT(). + FetchChunk(ctx, directoryDigest). + Return(nil, status.Error(codes.Internal, "I/O error")) _, err := directoryFetcher.GetDirectory(ctx, directoryDigest) testutil.RequireEqualStatus(t, status.Error(codes.Internal, "I/O error"), err) @@ -45,7 +45,9 @@ func TestBlobAccessDirectoryFetcherGetDirectory(t *testing.T) { // REv2 Directory object. directoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "764b0da73352b970cfbfc488a0f54934", 30) - blobAccess.EXPECT().Get(ctx, directoryDigest).Return(buffer.NewValidatedBufferFromByteSlice([]byte("This is not a Directory object"))) + contentAddressableStorage.EXPECT(). + FetchChunk(ctx, directoryDigest). + Return([]byte("This is not a Directory object"), nil) _, err := directoryFetcher.GetDirectory(ctx, directoryDigest) testutil.RequirePrefixedStatus(t, status.Error(codes.InvalidArgument, "Failed to unmarshal message: "), err) @@ -65,7 +67,12 @@ func TestBlobAccessDirectoryFetcherGetDirectory(t *testing.T) { }, } - blobAccess.EXPECT().Get(ctx, directoryDigest).Return(buffer.NewProtoBufferFromProto(exampleDirectory, buffer.UserProvided)) + dirBytes, err := proto.Marshal(exampleDirectory) + require.NoError(t, err) + + contentAddressableStorage.EXPECT(). + FetchChunk(ctx, directoryDigest). + Return(dirBytes, nil) directory, err := directoryFetcher.GetDirectory(ctx, directoryDigest) require.NoError(t, err) @@ -76,8 +83,12 @@ func TestBlobAccessDirectoryFetcherGetDirectory(t *testing.T) { func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - blobAccess := mock.NewMockBlobAccess(ctrl) - directoryFetcher := cas.NewBlobAccessDirectoryFetcher(blobAccess, 1000, 10000) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + directoryFetcher := cas.NewCASDirectoryFetcher(contentAddressableStorage, 1000, 10000) t.Run("TooBig", func(t *testing.T) { _, err := directoryFetcher.GetTreeRootDirectory(ctx, digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f5f634611dd11ccba54c7b9d9607c3c2", 100000)) @@ -88,10 +99,7 @@ func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { // Failures reading the Tree object should be propagated. treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "756b15c8f94b519e96135dcfde0e58c5", 50) - r := mock.NewMockFileReader(ctrl) - r.EXPECT().ReadAt(gomock.Any(), gomock.Any()).Return(0, status.Error(codes.Internal, "I/O error")).AnyTimes() - r.EXPECT().Close() - blobAccess.EXPECT().Get(ctx, treeDigest).Return(buffer.NewValidatedBufferFromReaderAt(r, 100)) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(nil, status.Error(codes.Internal, "I/O error")) _, err := directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) testutil.RequireEqualStatus(t, status.Error(codes.Internal, "I/O error"), err) @@ -102,7 +110,7 @@ func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { // against an REv2 Tree object. treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "3478477ca0af085e8d676f9a53b095cb", 25) - blobAccess.EXPECT().Get(ctx, treeDigest).Return(buffer.NewValidatedBufferFromByteSlice([]byte("This is not a Tree object"))) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return([]byte("This is not a Tree object"), nil) _, err := directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Field with number 10 at offset 0 has type 4, while 2 was expected"), err) @@ -112,25 +120,14 @@ func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { // Malformed Tree objects may not have a root directory. treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f5f634611dd11ccba54c7b9d9607c3c2", 100) - blobAccess.EXPECT().Get(ctx, treeDigest).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Tree{}, buffer.UserProvided)) + treeBytes, err := proto.Marshal(&remoteexecution.Tree{}) + require.NoError(t, err) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) - _, err := directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) + _, err = directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Tree does not contain a root directory"), err) }) - t.Run("ChecksumMismatch", func(t *testing.T) { - // If an REv2 Tree object cannot be parsed, it must be - // read in its entirety to ensure this isn't caused by a - // checksum mismatch. - treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "ceb78ab91c6d580aceea6618dd6fc5cc", 10000) - - blobAccess.EXPECT().Get(ctx, treeDigest). - Return(buffer.NewCASBufferFromReader(treeDigest, io.NopCloser(bytes.NewBuffer(make([]byte, 10000))), buffer.UserProvided)) - - _, err := directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Buffer has checksum b85d6fb9ef4260dcf1ce0a1b0bff80d3, while ceb78ab91c6d580aceea6618dd6fc5cc was expected"), err) - }) - t.Run("Success", func(t *testing.T) { treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f5f634611dd11ccba54c7b9d9607c3c2", 100) exampleDirectory := &remoteexecution.Directory{ @@ -145,9 +142,9 @@ func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { }, } - blobAccess.EXPECT().Get(ctx, treeDigest).Return(buffer.NewProtoBufferFromProto(&remoteexecution.Tree{ - Root: exampleDirectory, - }, buffer.UserProvided)) + treeBytes, err := proto.Marshal(&remoteexecution.Tree{Root: exampleDirectory}) + require.NoError(t, err) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) directory, err := directoryFetcher.GetTreeRootDirectory(ctx, treeDigest) require.NoError(t, err) @@ -158,8 +155,12 @@ func TestBlobAccessDirectoryFetcherGetTreeRootDirectory(t *testing.T) { func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - blobAccess := mock.NewMockBlobAccess(ctrl) - directoryFetcher := cas.NewBlobAccessDirectoryFetcher(blobAccess, 1000, 10000) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT(). + FetchCDCParameters(gomock.Any(), gomock.Any()). + Return(cdc.Parameters{MinChunkSizeBytes: 256 << 10, HorizonSizeBytes: 8 * 256 << 10}, nil). + AnyTimes() + directoryFetcher := cas.NewCASDirectoryFetcher(contentAddressableStorage, 1000, 10000) t.Run("TooBig", func(t *testing.T) { _, err := directoryFetcher.GetTreeChildDirectory( @@ -175,16 +176,7 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "40d8f0c70941162ee9dfacf8863d23f5", 100) directoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "756b15c8f94b519e96135dcfde0e58c5", 50) - r := mock.NewMockFileReader(ctrl) - r.EXPECT().ReadAt(gomock.Any(), gomock.Any()).Return(0, status.Error(codes.Internal, "I/O error")).AnyTimes() - r.EXPECT().Close() - blobAccess.EXPECT().GetFromComposite(ctx, treeDigest, directoryDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, treeDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - b, slices := slicer.Slice(buffer.NewValidatedBufferFromReaderAt(r, 100), childDigest) - require.Empty(t, slices) - return b - }). - AnyTimes() + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(nil, status.Error(codes.Internal, "I/O error")) _, err := directoryFetcher.GetTreeChildDirectory( ctx, @@ -200,13 +192,7 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "3478477ca0af085e8d676f9a53b095cb", 25) directoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f297d724d679d79d577d46c79fd4d712", 10) - blobAccess.EXPECT().GetFromComposite(ctx, treeDigest, directoryDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, treeDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - b, slices := slicer.Slice(buffer.NewValidatedBufferFromByteSlice([]byte("This is not a Tree object")), childDigest) - require.Empty(t, slices) - return b - }). - AnyTimes() + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return([]byte("This is not a Tree object"), nil) _, err := directoryFetcher.GetTreeChildDirectory( ctx, @@ -216,28 +202,6 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Field with number 10 at offset 0 has type 4, while 2 was expected"), err) }) - t.Run("ChecksumMismatch", func(t *testing.T) { - // If an REv2 Tree object cannot be parsed, it must be - // read in its entirety to ensure this isn't caused by a - // checksum mismatch. - treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "ceb78ab91c6d580aceea6618dd6fc5cc", 10000) - directoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "138f65a6fb46dc6d97618a24b4490c19", 10) - - blobAccess.EXPECT().GetFromComposite(ctx, treeDigest, directoryDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, treeDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - b, slices := slicer.Slice(buffer.NewCASBufferFromReader(treeDigest, io.NopCloser(bytes.NewBuffer(make([]byte, 10000))), buffer.UserProvided), childDigest) - require.Empty(t, slices) - return b - }) - - _, err := directoryFetcher.GetTreeChildDirectory( - ctx, - treeDigest, - directoryDigest, - ) - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Buffer has checksum b85d6fb9ef4260dcf1ce0a1b0bff80d3, while ceb78ab91c6d580aceea6618dd6fc5cc was expected"), err) - }) - t.Run("ValidTree", func(t *testing.T) { // Call GetTreeChildDirectory() against a valid Tree // object. The provided BlobSlicer should be capable of @@ -282,37 +246,14 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { childDirectory2, }, } + treeBytes, err := proto.Marshal(tree) + require.NoError(t, err) treeDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "ed56cd683c99acdff14b77db249819fc", 162) rootDirectoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "49aec856854ce5d7626c7153f143030c", 51) childDirectory1Digest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "5eede3f7e2a1a66c06ffd3906115a55b", 54) childDirectory2Digest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "a7536a0ebdeefa48280e135ea77755f0", 51) - blobAccess.EXPECT().GetFromComposite(ctx, treeDigest, gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, treeDigest, childDigest digest.Digest, slicer slicing.BlobSlicer) buffer.Buffer { - // Call into the slicer to extract - // Directory objects from the Tree. - b, slices := slicer.Slice(buffer.NewProtoBufferFromProto(tree, buffer.UserProvided), childDigest) - require.Equal(t, []slicing.BlobSlice{ - { - Digest: rootDirectoryDigest, - OffsetBytes: 2, - SizeBytes: 51, - }, - { - Digest: childDirectory1Digest, - OffsetBytes: 55, - SizeBytes: 54, - }, - { - Digest: childDirectory2Digest, - OffsetBytes: 111, - SizeBytes: 51, - }, - }, slices) - return b - }). - AnyTimes() - + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) fetchedDirectory, err := directoryFetcher.GetTreeChildDirectory( ctx, treeDigest, @@ -321,6 +262,7 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { require.NoError(t, err) testutil.RequireEqualProto(t, rootDirectory, fetchedDirectory) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) fetchedDirectory, err = directoryFetcher.GetTreeChildDirectory( ctx, treeDigest, @@ -329,6 +271,7 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { require.NoError(t, err) testutil.RequireEqualProto(t, childDirectory1, fetchedDirectory) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) fetchedDirectory, err = directoryFetcher.GetTreeChildDirectory( ctx, treeDigest, @@ -337,6 +280,7 @@ func TestBlobAccessDirectoryFetcherGetTreeChildDirectory(t *testing.T) { require.NoError(t, err) testutil.RequireEqualProto(t, childDirectory2, fetchedDirectory) + contentAddressableStorage.EXPECT().FetchChunk(ctx, treeDigest).Return(treeBytes, nil) _, err = directoryFetcher.GetTreeChildDirectory( ctx, treeDigest, diff --git a/pkg/cas/blob_access_file_fetcher.go b/pkg/cas/cas_file_fetcher.go similarity index 66% rename from pkg/cas/blob_access_file_fetcher.go rename to pkg/cas/cas_file_fetcher.go index 8ffbf346..924e789e 100644 --- a/pkg/cas/blob_access_file_fetcher.go +++ b/pkg/cas/cas_file_fetcher.go @@ -4,21 +4,21 @@ import ( "context" "os" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" ) type blobAccessFileFetcher struct { - blobAccess blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage } -// NewBlobAccessFileFetcher creates a FileFetcher that reads files fom a -// BlobAccess based store. -func NewBlobAccessFileFetcher(blobAccess blobstore.BlobAccess) FileFetcher { +// NewCASFileFetcher creates a FileFetcher that reads files fom a +// Content Addressable Storage (CAS). +func NewCASFileFetcher(contentAddressableStorage cdc.ContentAddressableStorage) FileFetcher { return &blobAccessFileFetcher{ - blobAccess: blobAccess, + contentAddressableStorage: contentAddressableStorage, } } @@ -34,7 +34,7 @@ func (ff *blobAccessFileFetcher) GetFile(ctx context.Context, digest digest.Dige } defer w.Close() - if err := ff.blobAccess.Get(ctx, digest).IntoWriter(w); err != nil { + if err := cdc.IntoWriter(ctx, ff.contentAddressableStorage, digest, 0, w); err != nil { // Ensure no traces are left behind upon failure. directory.Remove(name) return err diff --git a/pkg/cas/cas_message_reader.go b/pkg/cas/cas_message_reader.go new file mode 100644 index 00000000..a1f5c7eb --- /dev/null +++ b/pkg/cas/cas_message_reader.go @@ -0,0 +1,33 @@ +package cas + +import ( + "context" + + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/storage" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +type casMessageReader[T proto.Message] struct { + contentAddressableStorage cdc.ContentAddressableStorage + maximumMessageSizeBytes int +} + +func NewCASMessageReader[T proto.Message](contentAddressableStorage cdc.ContentAddressableStorage, maximumMessageSizeBytes int) storage.MessageReader[T] { + return &casMessageReader[T]{ + contentAddressableStorage: contentAddressableStorage, + maximumMessageSizeBytes: maximumMessageSizeBytes, + } +} + +func (r *casMessageReader[T]) ReadMessage(ctx context.Context, d digest.Digest, message T) (T, error) { + var zero T + if d.GetSizeBytes() > int64(r.maximumMessageSizeBytes) { + return zero, status.Errorf(codes.InvalidArgument, "Message size %d exceeds maximum allowed size %d", d.GetSizeBytes(), r.maximumMessageSizeBytes) + } + return cdc.GetProto(ctx, r.contentAddressableStorage, d, message) +} diff --git a/pkg/cas/existence_precondition_content_addressable_storage.go b/pkg/cas/existence_precondition_content_addressable_storage.go new file mode 100644 index 00000000..8d0c8437 --- /dev/null +++ b/pkg/cas/existence_precondition_content_addressable_storage.go @@ -0,0 +1,68 @@ +package cas + +import ( + "context" + + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/blobstore/chunklist" + "github.com/buildbarn/bb-storage/pkg/digest" + + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type existencePreconditionContentAddressableStorage struct { + cdc.ContentAddressableStorage +} + +// NewExistencePreconditionContentAddressableStorage wraps a +// ContentAddressableStorage into a version that returns GRPC status +// code "FAILED_PRECONDITION" instead of "NOT_FOUND" for Get() style +// operations. This is used by worker processes to make +// Execution::Execute() comply to the protocol. +func NewExistencePreconditionContentAddressableStorage(contentAddressableStorage cdc.ContentAddressableStorage) cdc.ContentAddressableStorage { + return &existencePreconditionContentAddressableStorage{ + ContentAddressableStorage: contentAddressableStorage, + } +} + +func (cas *existencePreconditionContentAddressableStorage) FetchChunk(ctx context.Context, d digest.Digest) ([]byte, error) { + data, err := cas.ContentAddressableStorage.FetchChunk(ctx, d) + if err != nil { + return nil, toFailedPrecondition(d, err) + } + return data, nil +} + +func (cas *existencePreconditionContentAddressableStorage) GetManifest(ctx context.Context, d digest.Digest) (chunklist.ChunkList, error) { + manifest, err := cas.ContentAddressableStorage.GetManifest(ctx, d) + if err != nil { + return nil, toFailedPrecondition(d, err) + } + return manifest, nil +} + +func toFailedPrecondition(d digest.Digest, observedErr error) error { + s := status.Convert(observedErr) + if s.Code() != codes.NotFound { + return observedErr + } + s, err := status.New(codes.FailedPrecondition, s.Message()).WithDetails( + &errdetails.PreconditionFailure{ + Violations: []*errdetails.PreconditionFailure_Violation{ + { + Type: "MISSING", + Subject: digest.NewInstanceNamePatcher(d.GetInstanceName(), digest.EmptyInstanceName). + PatchDigest(d). + GetByteStreamReadPath(remoteexecution.Compressor_IDENTITY), + }, + }, + }, + ) + if err != nil { + return err + } + return s.Err() +} diff --git a/pkg/cas/existence_precondition_content_addressable_storage_test.go b/pkg/cas/existence_precondition_content_addressable_storage_test.go new file mode 100644 index 00000000..0b4700da --- /dev/null +++ b/pkg/cas/existence_precondition_content_addressable_storage_test.go @@ -0,0 +1,176 @@ +package cas_test + +import ( + "context" + "testing" + + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/internal/mock" + "github.com/buildbarn/bb-remote-execution/pkg/cas" + "github.com/buildbarn/bb-storage/pkg/blobstore/chunklist" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/stretchr/testify/require" + + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "go.uber.org/mock/gomock" +) + +func TestExistencePreconditionContentAddressableStorageFetchChunkSuccess(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + // Let FetchChunk succeed. + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().FetchChunk( + ctx, + digest.MustNewDigest("debian8", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5), + ).Return([]byte("Hello"), nil) + + // Result should not be modified. + cas := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + data, err := cas.FetchChunk(ctx, digest.MustNewDigest("debian8", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5)) + require.NoError(t, err) + require.Equal(t, []byte("Hello"), data) +} + +func TestExistencePreconditionContentAddressableStorageFetchChunkOtherError(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + // Let FetchChunk return ResourceExhausted. + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().FetchChunk( + ctx, + digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA1, "c916e71d733d06cb77a4775de5f77fd0b480a7e8", 8), + ).Return(nil, status.Error(codes.ResourceExhausted, "Out of luck!")) + + // The error should be passed through unmodified. + cas := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + _, err := cas.FetchChunk(ctx, digest.MustNewDigest("ubuntu1604", remoteexecution.DigestFunction_SHA1, "c916e71d733d06cb77a4775de5f77fd0b480a7e8", 8)) + testutil.RequireEqualStatus(t, status.Error(codes.ResourceExhausted, "Out of luck!"), err) +} + +func TestExistencePreconditionContentAddressableStorageFetchChunkNotFound(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + // Let FetchChunk retun NotFound + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().FetchChunk( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + ).Return(nil, status.Error(codes.NotFound, "The chunk doesn't exist")) + + // The error should have been translated to FailedPrecondition. + cas := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + _, gotErr := cas.FetchChunk(ctx, digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42)) + + wantErr, err := status.New(codes.FailedPrecondition, "The chunk doesn't exist").WithDetails(&errdetails.PreconditionFailure{ + Violations: []*errdetails.PreconditionFailure_Violation{ + { + Type: "MISSING", + Subject: "blobs/b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559/42", + }, + }, + }) + require.NoError(t, err) + + testutil.RequireEqualStatus(t, wantErr.Err(), gotErr) +} + +func TestExistencePreconditionContentAddressableStorageGetManifestNotFound(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + // Let GetManifest return NotFound + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().GetManifest( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + ).Return(nil, status.Error(codes.NotFound, "No chunk list")) + + // The error should have been translated to FailedPrecondition. + cas := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + _, gotErr := cas.GetManifest(ctx, digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42)) + + wantErr, err := status.New(codes.FailedPrecondition, "No chunk list").WithDetails(&errdetails.PreconditionFailure{ + Violations: []*errdetails.PreconditionFailure_Violation{ + { + Type: "MISSING", + Subject: "blobs/b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559/42", + }, + }, + }) + require.NoError(t, err) + + testutil.RequireEqualStatus(t, wantErr.Err(), gotErr) +} + +func TestExistencePreconditionContentAddressableStorageGetManifestSuccess(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + manifest := chunklist.ChunkList{ + {Offset: 0, Digest: digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42)}, + } + + // Let GetManifest return success. + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + blobDigest := digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "af2cc201a4f9e0e216e83bb550deeb27dd75ff25e6e4e7b0e5c9f3099f6bbf1e", 42) + bottomCAS.EXPECT().GetManifest(ctx, blobDigest).Return(manifest, nil) + + // Result should not have been modified. + cas := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + got, err := cas.GetManifest(ctx, blobDigest) + require.NoError(t, err) + require.Equal(t, manifest, got) +} + +func TestExistencePreconditionContentAddressableStoragePutChunkNotFound(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + // Let PutChunk return NotFound. + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().PutChunk( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + []byte("chunk data"), + ).Return(status.Error(codes.NotFound, "Underlying storage not found")) + + // For write operations, the error should NOT be translated to + // FailedPrecondition. + casStore := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + gotErr := casStore.PutChunk( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + []byte("chunk data"), + ) + + testutil.RequireEqualStatus(t, status.Error(codes.NotFound, "Underlying storage not found"), gotErr) +} + +func TestExistencePreconditionContentAddressableStoragePutManifestNotFound(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + manifest := chunklist.ChunkList{ + {Offset: 0, Digest: digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42)}, + } + + // Let PutManifest return NotFound. + bottomCAS := mock.NewMockContentAddressableStorage(ctrl) + bottomCAS.EXPECT().PutManifest( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + manifest, + ).Return(status.Error(codes.NotFound, "Underlying storage not found")) + + // For write operations, the error should NOT be translated to + // FailedPrecondition. + casStore := cas.NewExistencePreconditionContentAddressableStorage(bottomCAS) + gotErr := casStore.PutManifest( + ctx, + digest.MustNewDigest("gentoo", remoteexecution.DigestFunction_SHA256, "b5c12f3689d12ddc51a4a21cc7d649037c125645ed81f3ec32cb69b3997b7559", 42), + manifest, + ) + + testutil.RequireEqualStatus(t, status.Error(codes.NotFound, "Underlying storage not found"), gotErr) +} diff --git a/pkg/cas/put_blob.go b/pkg/cas/put_blob.go new file mode 100644 index 00000000..260ee3c4 --- /dev/null +++ b/pkg/cas/put_blob.go @@ -0,0 +1,34 @@ +package cas + +import ( + "context" + "io" + + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/util" +) + +func PutBlob(ctx context.Context, cas cdc.ContentAddressableStorage, d digest.Digest, blob Blob) error { + params, err := cas.FetchCDCParameters(ctx, d.GetInstanceName()) + if err != nil { + blob.Discard() + return util.StatusWrap(err, "Could not fetch CDC parameters") + } + + // For small blobs, extracting the full byte slice is most optimal and hooks natively + // into PutChunk without the overhead of initializing the chunker stream inside PutReader. + if cdc.IsSingleChunk(params, d) { + data, err := blob.ToByteSlice() + if err != nil { + return err + } + return cas.PutChunk(ctx, d, data) + } + + // For larger blobs, we rely on the single-threaded chunker implementation in PutReader + // to process the stream without loading it completely into memory. + r := blob.ToReaderAt() + defer r.Close() + return cdc.PutReader(ctx, cas, d, io.NewSectionReader(r, 0, d.GetSizeBytes())) +} diff --git a/pkg/cas/put_blob_test.go b/pkg/cas/put_blob_test.go new file mode 100644 index 00000000..0d5eae2b --- /dev/null +++ b/pkg/cas/put_blob_test.go @@ -0,0 +1,101 @@ +package cas_test + +import ( + "context" + "testing" + + remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/internal/mock" + "github.com/buildbarn/bb-remote-execution/pkg/cas" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/stretchr/testify/require" + + "go.uber.org/mock/gomock" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestPutBlob(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + casBackend := mock.NewMockContentAddressableStorage(ctrl) + + d := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) + + t.Run("FetchCDCParametersFailure", func(t *testing.T) { + // Verify that a failure to fetch CDC parameters correctly halts + // execution and propagates the error, inherently relying on + // PutBlob to discard the blob. + blob := cas.NewBlobFromByteslice([]byte("Hello")) + + casBackend.EXPECT().FetchCDCParameters(ctx, d.GetInstanceName()). + Return(cdc.Parameters{}, status.Error(codes.Internal, "Backend offline")) + + err := cas.PutBlob(ctx, casBackend, d, blob) + testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Could not fetch CDC parameters: Backend offline"), err) + }) + + t.Run("SingleChunkUpload", func(t *testing.T) { + // Verify that a blob smaller than the single chunk threshold is + // successfully extracted via ToByteSlice and inserted directly + // into PutChunk. + blob := cas.NewBlobFromByteslice([]byte("Hello")) + + casBackend.EXPECT().FetchCDCParameters(ctx, d.GetInstanceName()). + Return(cdc.Parameters{ + MinChunkSizeBytes: 256 << 10, // 256 KB + }, nil) + + casBackend.EXPECT().PutChunk(ctx, d, []byte("Hello")).Return(nil) + + err := cas.PutBlob(ctx, casBackend, d, blob) + require.NoError(t, err) + }) + + t.Run("MultiChunkStreamSuccess", func(t *testing.T) { + // Verify that a blob larger than the single chunk threshold + // triggers the upload of all its chunk and its chunk list. + largeDigest := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "fbaf48ec981a5eecdb57b929fdd426e8", 200) + blob := cas.NewBlobFromByteslice(make([]byte, 200)) + + casBackend.EXPECT().FetchCDCParameters(ctx, largeDigest.GetInstanceName()). + Return(cdc.Parameters{ + MinChunkSizeBytes: 64, + HorizonSizeBytes: 128, + }, nil).Times(2) + + casBackend.EXPECT().PutChunk(ctx, gomock.Any(), gomock.Any()). + Return(nil).Times(3) + + casBackend.EXPECT().PutManifest(gomock.Any(), gomock.Any(), gomock.Any()). + Return(nil) + + err := cas.PutBlob(ctx, casBackend, largeDigest, blob) + require.NoError(t, err) + }) + + t.Run("MultiChunkStreamFailure", func(t *testing.T) { + // Verify that a blob larger than the single chunk threshold + // triggers the ToReaderAt streaming path (which eventually + // delegates to cdc.PutReader). We simulate a chunk upload + // failure to ensure the stream correctly surfaces it. + largeDigest := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "fbaf48ec981a5eecdb57b929fdd426e8", 200) + blob := cas.NewBlobFromByteslice(make([]byte, 200)) + + casBackend.EXPECT().FetchCDCParameters(ctx, largeDigest.GetInstanceName()). + Return(cdc.Parameters{ + MinChunkSizeBytes: 64, + HorizonSizeBytes: 128, + }, nil).Times(2) + + // We mock the first PutChunk to fail, verifying the error + // bubbles up safely. + casBackend.EXPECT().PutChunk(ctx, gomock.Any(), gomock.Any()). + Return(status.Error(codes.Internal, "Server on fire")) + + err := cas.PutBlob(ctx, casBackend, largeDigest, blob) + testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Failed to save chunk: Server on fire"), err) + }) +} diff --git a/pkg/cas/suspending_content_addressable_storage.go b/pkg/cas/suspending_content_addressable_storage.go new file mode 100644 index 00000000..bf4ac382 --- /dev/null +++ b/pkg/cas/suspending_content_addressable_storage.go @@ -0,0 +1,70 @@ +package cas + +import ( + "context" + + "github.com/buildbarn/bb-remote-execution/pkg/clock" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/blobstore/chunklist" + "github.com/buildbarn/bb-storage/pkg/digest" +) + +type suspendingContentAddressableStorage struct { + base cdc.ContentAddressableStorage + suspendable clock.Suspendable +} + +// NewSuspendingContentAddressableStorage is a decorator for a +// ContentAddressableStorage that simply forwards all methods. Before +// and after each call, it suspends and resumes a clock.Suspendable +// object, respectively. +// +// This decorator is used in combination with SuspendableClock, allowing +// VFS-based workers to compensate the execution timeout of build +// actions for any time spent downloading the input root. +func NewSuspendingContentAddressableStorage(base cdc.ContentAddressableStorage, suspendable clock.Suspendable) cdc.ContentAddressableStorage { + return &suspendingContentAddressableStorage{ + base: base, + suspendable: suspendable, + } +} + +func (cas suspendingContentAddressableStorage) FetchCDCParameters(ctx context.Context, instanceName digest.InstanceName) (cdc.Parameters, error) { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.FetchCDCParameters(ctx, instanceName) +} + +func (cas suspendingContentAddressableStorage) GetDigestKeyFormat() digest.KeyFormat { + return cas.base.GetDigestKeyFormat() +} + +func (cas suspendingContentAddressableStorage) FindMissing(ctx context.Context, digests digest.Set) (digest.Set, error) { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.FindMissing(ctx, digests) +} + +func (cas suspendingContentAddressableStorage) FetchChunk(ctx context.Context, d digest.Digest) ([]byte, error) { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.FetchChunk(ctx, d) +} + +func (cas suspendingContentAddressableStorage) PutChunk(ctx context.Context, d digest.Digest, data []byte) error { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.PutChunk(ctx, d, data) +} + +func (cas suspendingContentAddressableStorage) GetManifest(ctx context.Context, d digest.Digest) (chunklist.ChunkList, error) { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.GetManifest(ctx, d) +} + +func (cas suspendingContentAddressableStorage) PutManifest(ctx context.Context, d digest.Digest, manifest chunklist.ChunkList) error { + cas.suspendable.Suspend() + defer cas.suspendable.Resume() + return cas.base.PutManifest(ctx, d, manifest) +} diff --git a/pkg/filesystem/virtual/BUILD.bazel b/pkg/filesystem/virtual/BUILD.bazel index a446fa5d..28722f89 100644 --- a/pkg/filesystem/virtual/BUILD.bazel +++ b/pkg/filesystem/virtual/BUILD.bazel @@ -57,8 +57,7 @@ go_library( "//pkg/sync", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth", - "@com_github_buildbarn_bb_storage//pkg/blobstore", - "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", @@ -93,6 +92,7 @@ go_test( deps = [ ":virtual", "//internal/mock", + "//pkg/cas", "//pkg/filesystem/pool", "//pkg/proto/bazeloutputservice", "//pkg/proto/bazeloutputservice/rev2", @@ -100,7 +100,6 @@ go_test( "//pkg/proto/tmp_installer", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth", - "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", diff --git a/pkg/filesystem/virtual/blob_access_cas_file_factory.go b/pkg/filesystem/virtual/blob_access_cas_file_factory.go index 7455de88..ea7a5240 100644 --- a/pkg/filesystem/virtual/blob_access_cas_file_factory.go +++ b/pkg/filesystem/virtual/blob_access_cas_file_factory.go @@ -6,7 +6,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" bazeloutputservicerev2 "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/util" @@ -18,7 +18,7 @@ import ( type blobAccessCASFileFactory struct { context context.Context - contentAddressableStorage blobstore.BlobAccess + contentAddressableStorage cdc.ContentAddressableStorage errorLogger util.ErrorLogger } @@ -26,7 +26,7 @@ type blobAccessCASFileFactory struct { // to create FUSE files that are directly backed by BlobAccess. Files // created by this factory are entirely immutable; it is only possible // to read their contents. -func NewBlobAccessCASFileFactory(ctx context.Context, contentAddressableStorage blobstore.BlobAccess, errorLogger util.ErrorLogger) CASFileFactory { +func NewBlobAccessCASFileFactory(ctx context.Context, contentAddressableStorage cdc.ContentAddressableStorage, errorLogger util.ErrorLogger) CASFileFactory { return &blobAccessCASFileFactory{ context: ctx, contentAddressableStorage: contentAddressableStorage, @@ -136,7 +136,7 @@ func (f *blobAccessCASFile) VirtualRead(ctx context.Context, buf []byte, off uin size := uint64(f.digest.GetSizeBytes()) buf, eof := BoundReadToFileSize(buf, off, size) if len(buf) > 0 { - if n, err := f.factory.contentAddressableStorage.Get(f.factory.context, f.digest).ReadAt(buf, int64(off)); n != len(buf) { + if n, err := cdc.ReadBlobAt(f.factory.context, f.factory.contentAddressableStorage, f.digest, buf, int64(off)); n != len(buf) { f.factory.errorLogger.Log(util.StatusWrapf(err, "Failed to read from %s at offset %d", f.digest, off)) return 0, false, StatusErrIO } diff --git a/pkg/filesystem/virtual/blob_access_cas_file_factory_test.go b/pkg/filesystem/virtual/blob_access_cas_file_factory_test.go index d604c212..9bba3dca 100644 --- a/pkg/filesystem/virtual/blob_access_cas_file_factory_test.go +++ b/pkg/filesystem/virtual/blob_access_cas_file_factory_test.go @@ -31,7 +31,7 @@ const blobAccessCASFileFactoryAttributesMask = virtual.AttributesMaskChangeID | func TestBlobAccessCASFileFactoryVirtualSeek(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) errorLogger := mock.NewMockErrorLogger(ctrl) casFileFactory := virtual.NewBlobAccessCASFileFactory( ctx, @@ -85,7 +85,7 @@ func TestBlobAccessCASFileFactoryVirtualSeek(t *testing.T) { func TestBlobAccessCASFileFactoryGetContainingDigests(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) errorLogger := mock.NewMockErrorLogger(ctrl) casFileFactory := virtual.NewBlobAccessCASFileFactory( ctx, @@ -117,7 +117,7 @@ func TestBlobAccessCASFileFactoryGetContainingDigests(t *testing.T) { func TestBlobAccessCASFileFactoryGetBazelOutputServiceStat(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) errorLogger := mock.NewMockErrorLogger(ctrl) casFileFactory := virtual.NewBlobAccessCASFileFactory( ctx, @@ -169,7 +169,7 @@ func TestBlobAccessCASFileFactoryGetBazelOutputServiceStat(t *testing.T) { func TestBlobAccessCASFileFactoryAppendOutputPathPersistencyDirectoryNode(t *testing.T) { ctrl, ctx := gomock.WithContext(context.Background(), t) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) errorLogger := mock.NewMockErrorLogger(ctrl) casFileFactory := virtual.NewBlobAccessCASFileFactory( ctx, diff --git a/pkg/filesystem/virtual/node.go b/pkg/filesystem/virtual/node.go index c2259df0..44755ee3 100644 --- a/pkg/filesystem/virtual/node.go +++ b/pkg/filesystem/virtual/node.go @@ -3,9 +3,9 @@ package virtual import ( "context" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" "github.com/buildbarn/bb-remote-execution/pkg/proto/outputpathpersistency" - "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -45,10 +45,10 @@ func GetFileInfo(name path.Component, node Node) filesystem.FileInfo { // the resulting object's digest. type ApplyUploadFile struct { // Inputs. - Context context.Context - ContentAddressableStorage blobstore.BlobAccess - DigestFunction digest.Function - WritableFileUploadDelay <-chan struct{} + Context context.Context + BlobUploader cas.BlobUploader + DigestFunction digest.Function + WritableFileUploadDelay <-chan struct{} // Outputs. Digest digest.Digest diff --git a/pkg/filesystem/virtual/pool_backed_file_allocator.go b/pkg/filesystem/virtual/pool_backed_file_allocator.go index d617c6b1..1e6edbd1 100644 --- a/pkg/filesystem/virtual/pool_backed_file_allocator.go +++ b/pkg/filesystem/virtual/pool_backed_file_allocator.go @@ -7,11 +7,10 @@ import ( "time" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" bazeloutputservicerev2 "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2" - "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/util" @@ -242,7 +241,7 @@ func (f *fileBackedFile) updateCachedDigest(digestFunction digest.Function, froz return newDigest, nil } -func (f *fileBackedFile) uploadFile(ctx context.Context, contentAddressableStorage blobstore.BlobAccess, digestFunction digest.Function, writableFileUploadDelay <-chan struct{}) (digest.Digest, error) { +func (f *fileBackedFile) uploadFile(ctx context.Context, blobUploader cas.BlobUploader, digestFunction digest.Function, writableFileUploadDelay <-chan struct{}) (digest.Digest, error) { frozenFile, success := f.waitAndOpenReadFrozen(writableFileUploadDelay) if !success { return digest.BadDigest, status.Error(codes.NotFound, "File was unlinked before uploading could start") @@ -254,11 +253,7 @@ func (f *fileBackedFile) uploadFile(ctx context.Context, contentAddressableStora return digest.BadDigest, err } - if err := contentAddressableStorage.Put( - ctx, - blobDigest, - buffer.NewValidatedBufferFromReaderAt(frozenFile, blobDigest.GetSizeBytes()), - ); err != nil { + if err := blobUploader.UploadBlob(ctx, blobDigest, cas.NewBlobFromReaderAt(frozenFile, blobDigest.GetSizeBytes())); err != nil { return digest.BadDigest, util.StatusWrap(err, "Failed to upload file") } return blobDigest, nil @@ -351,7 +346,7 @@ func (f *fileBackedFile) VirtualGetAttributes(ctx context.Context, requested Att func (f *fileBackedFile) VirtualApply(data any) bool { switch p := data.(type) { case *ApplyUploadFile: - p.Digest, p.Err = f.uploadFile(p.Context, p.ContentAddressableStorage, p.DigestFunction, p.WritableFileUploadDelay) + p.Digest, p.Err = f.uploadFile(p.Context, p.BlobUploader, p.DigestFunction, p.WritableFileUploadDelay) case *ApplyGetBazelOutputServiceStat: p.Stat, p.Err = f.getBazelOutputServiceStat(p.DigestFunction) case *ApplyAppendOutputPathPersistencyDirectoryNode: diff --git a/pkg/filesystem/virtual/pool_backed_file_allocator_test.go b/pkg/filesystem/virtual/pool_backed_file_allocator_test.go index c9176748..272668b5 100644 --- a/pkg/filesystem/virtual/pool_backed_file_allocator_test.go +++ b/pkg/filesystem/virtual/pool_backed_file_allocator_test.go @@ -8,12 +8,12 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" + "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/virtual" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" bazeloutputservicerev2 "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2" "github.com/buildbarn/bb-remote-execution/pkg/proto/outputpathpersistency" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -482,13 +482,13 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { t.Run("DigestComputationIOFailure", func(t *testing.T) { underlyingFile.EXPECT().ReadAt(gomock.Any(), int64(0)).Return(0, syscall.EIO) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) p := virtual.ApplyUploadFile{ - Context: ctx, - ContentAddressableStorage: contentAddressableStorage, - DigestFunction: digestFunction, - WritableFileUploadDelay: writableFileUploadDelay, + Context: ctx, + BlobUploader: blobUploader, + DigestFunction: digestFunction, + WritableFileUploadDelay: writableFileUploadDelay, } require.True(t, f.VirtualApply(&p)) testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Failed to compute file digest: input/output error"), p.Err) @@ -499,18 +499,18 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { copy(p, "Hello") return 5, io.EOF }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put(ctx, fileDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { + blobUploader := mock.NewMockBlobUploader(ctrl) + blobUploader.EXPECT().UploadBlob(ctx, fileDigest, gomock.Any()). + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { b.Discard() return status.Error(codes.Internal, "Server on fire") }) p := virtual.ApplyUploadFile{ - Context: ctx, - ContentAddressableStorage: contentAddressableStorage, - DigestFunction: digestFunction, - WritableFileUploadDelay: writableFileUploadDelay, + Context: ctx, + BlobUploader: blobUploader, + DigestFunction: digestFunction, + WritableFileUploadDelay: writableFileUploadDelay, } require.True(t, f.VirtualApply(&p)) testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Failed to upload file: Server on fire"), p.Err) @@ -521,9 +521,9 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { copy(p, "Hello") return 5, io.EOF }) - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) - contentAddressableStorage.EXPECT().Put(ctx, fileDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { + blobUploader := mock.NewMockBlobUploader(ctrl) + blobUploader.EXPECT().UploadBlob(ctx, fileDigest, gomock.Any()). + DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { // As long as we haven't completely read // the file, any operation that modifies // the file's contents should block. @@ -584,7 +584,7 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { underlyingFile.EXPECT().WriteAt([]byte("Foo"), int64(120)).Return(3, nil) // Complete reading the file. - data, err := b.ToByteSlice(10) + data, err := b.ToByteSlice() require.NoError(t, err) require.Equal(t, []byte("Hello"), data) @@ -598,10 +598,10 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { }) p := virtual.ApplyUploadFile{ - Context: ctx, - ContentAddressableStorage: contentAddressableStorage, - DigestFunction: digestFunction, - WritableFileUploadDelay: writableFileUploadDelay, + Context: ctx, + BlobUploader: blobUploader, + DigestFunction: digestFunction, + WritableFileUploadDelay: writableFileUploadDelay, } require.True(t, f.VirtualApply(&p)) require.NoError(t, p.Err) @@ -613,16 +613,16 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { f.Unlink() t.Run("Stale", func(t *testing.T) { - contentAddressableStorage := mock.NewMockBlobAccess(ctrl) + blobUploader := mock.NewMockBlobUploader(ctrl) // Uploading a file that has already been released // should fail. It should not cause accidental access to // the closed file handle. p := virtual.ApplyUploadFile{ - Context: ctx, - ContentAddressableStorage: contentAddressableStorage, - DigestFunction: digestFunction, - WritableFileUploadDelay: writableFileUploadDelay, + Context: ctx, + BlobUploader: blobUploader, + DigestFunction: digestFunction, + WritableFileUploadDelay: writableFileUploadDelay, } require.True(t, f.VirtualApply(&p)) testutil.RequireEqualStatus(t, status.Error(codes.NotFound, "File was unlinked before uploading could start"), p.Err) diff --git a/pkg/proto/bazeloutputservice/bazel_output_service.pb.go b/pkg/proto/bazeloutputservice/bazel_output_service.pb.go deleted file mode 100644 index c0b4758a..00000000 --- a/pkg/proto/bazeloutputservice/bazel_output_service.pb.go +++ /dev/null @@ -1,1251 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/bazel_output_service.proto - -package bazeloutputservice - -import ( - status "google.golang.org/genproto/googleapis/rpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CleanRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - OutputBaseId string `protobuf:"bytes,1,opt,name=output_base_id,json=outputBaseId,proto3" json:"output_base_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CleanRequest) Reset() { - *x = CleanRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CleanRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanRequest) ProtoMessage() {} - -func (x *CleanRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CleanRequest.ProtoReflect.Descriptor instead. -func (*CleanRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{0} -} - -func (x *CleanRequest) GetOutputBaseId() string { - if x != nil { - return x.OutputBaseId - } - return "" -} - -type CleanResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CleanResponse) Reset() { - *x = CleanResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CleanResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanResponse) ProtoMessage() {} - -func (x *CleanResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CleanResponse.ProtoReflect.Descriptor instead. -func (*CleanResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{1} -} - -type StartBuildRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - OutputBaseId string `protobuf:"bytes,2,opt,name=output_base_id,json=outputBaseId,proto3" json:"output_base_id,omitempty"` - BuildId string `protobuf:"bytes,3,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - Args *anypb.Any `protobuf:"bytes,4,opt,name=args,proto3" json:"args,omitempty"` - OutputPathPrefix string `protobuf:"bytes,5,opt,name=output_path_prefix,json=outputPathPrefix,proto3" json:"output_path_prefix,omitempty"` - OutputPathAliases map[string]string `protobuf:"bytes,6,rep,name=output_path_aliases,json=outputPathAliases,proto3" json:"output_path_aliases,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartBuildRequest) Reset() { - *x = StartBuildRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartBuildRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartBuildRequest) ProtoMessage() {} - -func (x *StartBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartBuildRequest.ProtoReflect.Descriptor instead. -func (*StartBuildRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{2} -} - -func (x *StartBuildRequest) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *StartBuildRequest) GetOutputBaseId() string { - if x != nil { - return x.OutputBaseId - } - return "" -} - -func (x *StartBuildRequest) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *StartBuildRequest) GetArgs() *anypb.Any { - if x != nil { - return x.Args - } - return nil -} - -func (x *StartBuildRequest) GetOutputPathPrefix() string { - if x != nil { - return x.OutputPathPrefix - } - return "" -} - -func (x *StartBuildRequest) GetOutputPathAliases() map[string]string { - if x != nil { - return x.OutputPathAliases - } - return nil -} - -type StartBuildResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - InitialOutputPathContents *InitialOutputPathContents `protobuf:"bytes,1,opt,name=initial_output_path_contents,json=initialOutputPathContents,proto3" json:"initial_output_path_contents,omitempty"` - OutputPathSuffix string `protobuf:"bytes,2,opt,name=output_path_suffix,json=outputPathSuffix,proto3" json:"output_path_suffix,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartBuildResponse) Reset() { - *x = StartBuildResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartBuildResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartBuildResponse) ProtoMessage() {} - -func (x *StartBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartBuildResponse.ProtoReflect.Descriptor instead. -func (*StartBuildResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{3} -} - -func (x *StartBuildResponse) GetInitialOutputPathContents() *InitialOutputPathContents { - if x != nil { - return x.InitialOutputPathContents - } - return nil -} - -func (x *StartBuildResponse) GetOutputPathSuffix() string { - if x != nil { - return x.OutputPathSuffix - } - return "" -} - -type InitialOutputPathContents struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - ModifiedPathPrefixes []string `protobuf:"bytes,2,rep,name=modified_path_prefixes,json=modifiedPathPrefixes,proto3" json:"modified_path_prefixes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InitialOutputPathContents) Reset() { - *x = InitialOutputPathContents{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InitialOutputPathContents) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitialOutputPathContents) ProtoMessage() {} - -func (x *InitialOutputPathContents) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitialOutputPathContents.ProtoReflect.Descriptor instead. -func (*InitialOutputPathContents) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{4} -} - -func (x *InitialOutputPathContents) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *InitialOutputPathContents) GetModifiedPathPrefixes() []string { - if x != nil { - return x.ModifiedPathPrefixes - } - return nil -} - -type StageArtifactsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - Artifacts []*StageArtifactsRequest_Artifact `protobuf:"bytes,2,rep,name=artifacts,proto3" json:"artifacts,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StageArtifactsRequest) Reset() { - *x = StageArtifactsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StageArtifactsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StageArtifactsRequest) ProtoMessage() {} - -func (x *StageArtifactsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StageArtifactsRequest.ProtoReflect.Descriptor instead. -func (*StageArtifactsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{5} -} - -func (x *StageArtifactsRequest) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *StageArtifactsRequest) GetArtifacts() []*StageArtifactsRequest_Artifact { - if x != nil { - return x.Artifacts - } - return nil -} - -type StageArtifactsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Responses []*StageArtifactsResponse_Response `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StageArtifactsResponse) Reset() { - *x = StageArtifactsResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StageArtifactsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StageArtifactsResponse) ProtoMessage() {} - -func (x *StageArtifactsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StageArtifactsResponse.ProtoReflect.Descriptor instead. -func (*StageArtifactsResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{6} -} - -func (x *StageArtifactsResponse) GetResponses() []*StageArtifactsResponse_Response { - if x != nil { - return x.Responses - } - return nil -} - -type FinalizeArtifactsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - Artifacts []*FinalizeArtifactsRequest_Artifact `protobuf:"bytes,2,rep,name=artifacts,proto3" json:"artifacts,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeArtifactsRequest) Reset() { - *x = FinalizeArtifactsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeArtifactsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeArtifactsRequest) ProtoMessage() {} - -func (x *FinalizeArtifactsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeArtifactsRequest.ProtoReflect.Descriptor instead. -func (*FinalizeArtifactsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{7} -} - -func (x *FinalizeArtifactsRequest) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *FinalizeArtifactsRequest) GetArtifacts() []*FinalizeArtifactsRequest_Artifact { - if x != nil { - return x.Artifacts - } - return nil -} - -type FinalizeArtifactsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeArtifactsResponse) Reset() { - *x = FinalizeArtifactsResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeArtifactsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeArtifactsResponse) ProtoMessage() {} - -func (x *FinalizeArtifactsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeArtifactsResponse.ProtoReflect.Descriptor instead. -func (*FinalizeArtifactsResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{8} -} - -type FinalizeBuildRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - BuildSuccessful bool `protobuf:"varint,2,opt,name=build_successful,json=buildSuccessful,proto3" json:"build_successful,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeBuildRequest) Reset() { - *x = FinalizeBuildRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeBuildRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeBuildRequest) ProtoMessage() {} - -func (x *FinalizeBuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeBuildRequest.ProtoReflect.Descriptor instead. -func (*FinalizeBuildRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{9} -} - -func (x *FinalizeBuildRequest) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *FinalizeBuildRequest) GetBuildSuccessful() bool { - if x != nil { - return x.BuildSuccessful - } - return false -} - -type FinalizeBuildResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeBuildResponse) Reset() { - *x = FinalizeBuildResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeBuildResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeBuildResponse) ProtoMessage() {} - -func (x *FinalizeBuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeBuildResponse.ProtoReflect.Descriptor instead. -func (*FinalizeBuildResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{10} -} - -type BatchStatRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - Paths []string `protobuf:"bytes,2,rep,name=paths,proto3" json:"paths,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatRequest) Reset() { - *x = BatchStatRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatRequest) ProtoMessage() {} - -func (x *BatchStatRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatRequest.ProtoReflect.Descriptor instead. -func (*BatchStatRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{11} -} - -func (x *BatchStatRequest) GetBuildId() string { - if x != nil { - return x.BuildId - } - return "" -} - -func (x *BatchStatRequest) GetPaths() []string { - if x != nil { - return x.Paths - } - return nil -} - -type BatchStatResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Responses []*BatchStatResponse_StatResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse) Reset() { - *x = BatchStatResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse) ProtoMessage() {} - -func (x *BatchStatResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse.ProtoReflect.Descriptor instead. -func (*BatchStatResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12} -} - -func (x *BatchStatResponse) GetResponses() []*BatchStatResponse_StatResponse { - if x != nil { - return x.Responses - } - return nil -} - -type StageArtifactsRequest_Artifact struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Locator *anypb.Any `protobuf:"bytes,2,opt,name=locator,proto3" json:"locator,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StageArtifactsRequest_Artifact) Reset() { - *x = StageArtifactsRequest_Artifact{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StageArtifactsRequest_Artifact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StageArtifactsRequest_Artifact) ProtoMessage() {} - -func (x *StageArtifactsRequest_Artifact) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StageArtifactsRequest_Artifact.ProtoReflect.Descriptor instead. -func (*StageArtifactsRequest_Artifact) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *StageArtifactsRequest_Artifact) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *StageArtifactsRequest_Artifact) GetLocator() *anypb.Any { - if x != nil { - return x.Locator - } - return nil -} - -type StageArtifactsResponse_Response struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StageArtifactsResponse_Response) Reset() { - *x = StageArtifactsResponse_Response{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StageArtifactsResponse_Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StageArtifactsResponse_Response) ProtoMessage() {} - -func (x *StageArtifactsResponse_Response) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StageArtifactsResponse_Response.ProtoReflect.Descriptor instead. -func (*StageArtifactsResponse_Response) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *StageArtifactsResponse_Response) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -type FinalizeArtifactsRequest_Artifact struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Locator *anypb.Any `protobuf:"bytes,2,opt,name=locator,proto3" json:"locator,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeArtifactsRequest_Artifact) Reset() { - *x = FinalizeArtifactsRequest_Artifact{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeArtifactsRequest_Artifact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeArtifactsRequest_Artifact) ProtoMessage() {} - -func (x *FinalizeArtifactsRequest_Artifact) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeArtifactsRequest_Artifact.ProtoReflect.Descriptor instead. -func (*FinalizeArtifactsRequest_Artifact) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *FinalizeArtifactsRequest_Artifact) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *FinalizeArtifactsRequest_Artifact) GetLocator() *anypb.Any { - if x != nil { - return x.Locator - } - return nil -} - -type BatchStatResponse_StatResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Stat *BatchStatResponse_Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse_StatResponse) Reset() { - *x = BatchStatResponse_StatResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse_StatResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse_StatResponse) ProtoMessage() {} - -func (x *BatchStatResponse_StatResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse_StatResponse.ProtoReflect.Descriptor instead. -func (*BatchStatResponse_StatResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12, 0} -} - -func (x *BatchStatResponse_StatResponse) GetStat() *BatchStatResponse_Stat { - if x != nil { - return x.Stat - } - return nil -} - -type BatchStatResponse_Stat struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Type: - // - // *BatchStatResponse_Stat_File_ - // *BatchStatResponse_Stat_Symlink_ - // *BatchStatResponse_Stat_Directory_ - Type isBatchStatResponse_Stat_Type `protobuf_oneof:"type"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse_Stat) Reset() { - *x = BatchStatResponse_Stat{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse_Stat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse_Stat) ProtoMessage() {} - -func (x *BatchStatResponse_Stat) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse_Stat.ProtoReflect.Descriptor instead. -func (*BatchStatResponse_Stat) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12, 1} -} - -func (x *BatchStatResponse_Stat) GetType() isBatchStatResponse_Stat_Type { - if x != nil { - return x.Type - } - return nil -} - -func (x *BatchStatResponse_Stat) GetFile() *BatchStatResponse_Stat_File { - if x != nil { - if x, ok := x.Type.(*BatchStatResponse_Stat_File_); ok { - return x.File - } - } - return nil -} - -func (x *BatchStatResponse_Stat) GetSymlink() *BatchStatResponse_Stat_Symlink { - if x != nil { - if x, ok := x.Type.(*BatchStatResponse_Stat_Symlink_); ok { - return x.Symlink - } - } - return nil -} - -func (x *BatchStatResponse_Stat) GetDirectory() *BatchStatResponse_Stat_Directory { - if x != nil { - if x, ok := x.Type.(*BatchStatResponse_Stat_Directory_); ok { - return x.Directory - } - } - return nil -} - -type isBatchStatResponse_Stat_Type interface { - isBatchStatResponse_Stat_Type() -} - -type BatchStatResponse_Stat_File_ struct { - File *BatchStatResponse_Stat_File `protobuf:"bytes,1,opt,name=file,proto3,oneof"` -} - -type BatchStatResponse_Stat_Symlink_ struct { - Symlink *BatchStatResponse_Stat_Symlink `protobuf:"bytes,2,opt,name=symlink,proto3,oneof"` -} - -type BatchStatResponse_Stat_Directory_ struct { - Directory *BatchStatResponse_Stat_Directory `protobuf:"bytes,3,opt,name=directory,proto3,oneof"` -} - -func (*BatchStatResponse_Stat_File_) isBatchStatResponse_Stat_Type() {} - -func (*BatchStatResponse_Stat_Symlink_) isBatchStatResponse_Stat_Type() {} - -func (*BatchStatResponse_Stat_Directory_) isBatchStatResponse_Stat_Type() {} - -type BatchStatResponse_Stat_File struct { - state protoimpl.MessageState `protogen:"open.v1"` - Locator *anypb.Any `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse_Stat_File) Reset() { - *x = BatchStatResponse_Stat_File{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse_Stat_File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse_Stat_File) ProtoMessage() {} - -func (x *BatchStatResponse_Stat_File) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse_Stat_File.ProtoReflect.Descriptor instead. -func (*BatchStatResponse_Stat_File) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12, 1, 0} -} - -func (x *BatchStatResponse_Stat_File) GetLocator() *anypb.Any { - if x != nil { - return x.Locator - } - return nil -} - -type BatchStatResponse_Stat_Symlink struct { - state protoimpl.MessageState `protogen:"open.v1"` - Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse_Stat_Symlink) Reset() { - *x = BatchStatResponse_Stat_Symlink{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse_Stat_Symlink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse_Stat_Symlink) ProtoMessage() {} - -func (x *BatchStatResponse_Stat_Symlink) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse_Stat_Symlink.ProtoReflect.Descriptor instead. -func (*BatchStatResponse_Stat_Symlink) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12, 1, 1} -} - -func (x *BatchStatResponse_Stat_Symlink) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -type BatchStatResponse_Stat_Directory struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BatchStatResponse_Stat_Directory) Reset() { - *x = BatchStatResponse_Stat_Directory{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BatchStatResponse_Stat_Directory) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BatchStatResponse_Stat_Directory) ProtoMessage() {} - -func (x *BatchStatResponse_Stat_Directory) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BatchStatResponse_Stat_Directory.ProtoReflect.Descriptor instead. -func (*BatchStatResponse_Stat_Directory) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP(), []int{12, 1, 2} -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDesc = "" + - "\n" + - "`github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/bazel_output_service.proto\x12\x14bazel_output_service\x1a\x19google/protobuf/any.proto\x1a\x17google/rpc/status.proto\"4\n" + - "\fCleanRequest\x12$\n" + - "\x0eoutput_base_id\x18\x01 \x01(\tR\foutputBaseId\"\x0f\n" + - "\rCleanResponse\"\xfc\x02\n" + - "\x11StartBuildRequest\x12\x18\n" + - "\aversion\x18\x01 \x01(\x05R\aversion\x12$\n" + - "\x0eoutput_base_id\x18\x02 \x01(\tR\foutputBaseId\x12\x19\n" + - "\bbuild_id\x18\x03 \x01(\tR\abuildId\x12(\n" + - "\x04args\x18\x04 \x01(\v2\x14.google.protobuf.AnyR\x04args\x12,\n" + - "\x12output_path_prefix\x18\x05 \x01(\tR\x10outputPathPrefix\x12n\n" + - "\x13output_path_aliases\x18\x06 \x03(\v2>.bazel_output_service.StartBuildRequest.OutputPathAliasesEntryR\x11outputPathAliases\x1aD\n" + - "\x16OutputPathAliasesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xb4\x01\n" + - "\x12StartBuildResponse\x12p\n" + - "\x1cinitial_output_path_contents\x18\x01 \x01(\v2/.bazel_output_service.InitialOutputPathContentsR\x19initialOutputPathContents\x12,\n" + - "\x12output_path_suffix\x18\x02 \x01(\tR\x10outputPathSuffix\"l\n" + - "\x19InitialOutputPathContents\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x124\n" + - "\x16modified_path_prefixes\x18\x02 \x03(\tR\x14modifiedPathPrefixes\"\xd6\x01\n" + - "\x15StageArtifactsRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12R\n" + - "\tartifacts\x18\x02 \x03(\v24.bazel_output_service.StageArtifactsRequest.ArtifactR\tartifacts\x1aN\n" + - "\bArtifact\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12.\n" + - "\alocator\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\alocator\"\xa5\x01\n" + - "\x16StageArtifactsResponse\x12S\n" + - "\tresponses\x18\x01 \x03(\v25.bazel_output_service.StageArtifactsResponse.ResponseR\tresponses\x1a6\n" + - "\bResponse\x12*\n" + - "\x06status\x18\x01 \x01(\v2\x12.google.rpc.StatusR\x06status\"\xdc\x01\n" + - "\x18FinalizeArtifactsRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12U\n" + - "\tartifacts\x18\x02 \x03(\v27.bazel_output_service.FinalizeArtifactsRequest.ArtifactR\tartifacts\x1aN\n" + - "\bArtifact\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12.\n" + - "\alocator\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\alocator\"\x1b\n" + - "\x19FinalizeArtifactsResponse\"\\\n" + - "\x14FinalizeBuildRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12)\n" + - "\x10build_successful\x18\x02 \x01(\bR\x0fbuildSuccessful\"\x17\n" + - "\x15FinalizeBuildResponse\"C\n" + - "\x10BatchStatRequest\x12\x19\n" + - "\bbuild_id\x18\x01 \x01(\tR\abuildId\x12\x14\n" + - "\x05paths\x18\x02 \x03(\tR\x05paths\"\xa5\x04\n" + - "\x11BatchStatResponse\x12R\n" + - "\tresponses\x18\x01 \x03(\v24.bazel_output_service.BatchStatResponse.StatResponseR\tresponses\x1aP\n" + - "\fStatResponse\x12@\n" + - "\x04stat\x18\x01 \x01(\v2,.bazel_output_service.BatchStatResponse.StatR\x04stat\x1a\xe9\x02\n" + - "\x04Stat\x12G\n" + - "\x04file\x18\x01 \x01(\v21.bazel_output_service.BatchStatResponse.Stat.FileH\x00R\x04file\x12P\n" + - "\asymlink\x18\x02 \x01(\v24.bazel_output_service.BatchStatResponse.Stat.SymlinkH\x00R\asymlink\x12V\n" + - "\tdirectory\x18\x03 \x01(\v26.bazel_output_service.BatchStatResponse.Stat.DirectoryH\x00R\tdirectory\x1a6\n" + - "\x04File\x12.\n" + - "\alocator\x18\x01 \x01(\v2\x14.google.protobuf.AnyR\alocator\x1a!\n" + - "\aSymlink\x12\x16\n" + - "\x06target\x18\x01 \x01(\tR\x06target\x1a\v\n" + - "\tDirectoryB\x06\n" + - "\x04type2\xf2\x04\n" + - "\x12BazelOutputService\x12P\n" + - "\x05Clean\x12\".bazel_output_service.CleanRequest\x1a#.bazel_output_service.CleanResponse\x12_\n" + - "\n" + - "StartBuild\x12'.bazel_output_service.StartBuildRequest\x1a(.bazel_output_service.StartBuildResponse\x12k\n" + - "\x0eStageArtifacts\x12+.bazel_output_service.StageArtifactsRequest\x1a,.bazel_output_service.StageArtifactsResponse\x12t\n" + - "\x11FinalizeArtifacts\x12..bazel_output_service.FinalizeArtifactsRequest\x1a/.bazel_output_service.FinalizeArtifactsResponse\x12h\n" + - "\rFinalizeBuild\x12*.bazel_output_service.FinalizeBuildRequest\x1a+.bazel_output_service.FinalizeBuildResponse\x12\\\n" + - "\tBatchStat\x12&.bazel_output_service.BatchStatRequest\x1a'.bazel_output_service.BatchStatResponseBS\n" + - "$com.google.devtools.build.lib.remoteB\x17BazelOutputServiceProtoZ\x12bazeloutputserviceb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes = make([]protoimpl.MessageInfo, 22) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_goTypes = []any{ - (*CleanRequest)(nil), // 0: bazel_output_service.CleanRequest - (*CleanResponse)(nil), // 1: bazel_output_service.CleanResponse - (*StartBuildRequest)(nil), // 2: bazel_output_service.StartBuildRequest - (*StartBuildResponse)(nil), // 3: bazel_output_service.StartBuildResponse - (*InitialOutputPathContents)(nil), // 4: bazel_output_service.InitialOutputPathContents - (*StageArtifactsRequest)(nil), // 5: bazel_output_service.StageArtifactsRequest - (*StageArtifactsResponse)(nil), // 6: bazel_output_service.StageArtifactsResponse - (*FinalizeArtifactsRequest)(nil), // 7: bazel_output_service.FinalizeArtifactsRequest - (*FinalizeArtifactsResponse)(nil), // 8: bazel_output_service.FinalizeArtifactsResponse - (*FinalizeBuildRequest)(nil), // 9: bazel_output_service.FinalizeBuildRequest - (*FinalizeBuildResponse)(nil), // 10: bazel_output_service.FinalizeBuildResponse - (*BatchStatRequest)(nil), // 11: bazel_output_service.BatchStatRequest - (*BatchStatResponse)(nil), // 12: bazel_output_service.BatchStatResponse - nil, // 13: bazel_output_service.StartBuildRequest.OutputPathAliasesEntry - (*StageArtifactsRequest_Artifact)(nil), // 14: bazel_output_service.StageArtifactsRequest.Artifact - (*StageArtifactsResponse_Response)(nil), // 15: bazel_output_service.StageArtifactsResponse.Response - (*FinalizeArtifactsRequest_Artifact)(nil), // 16: bazel_output_service.FinalizeArtifactsRequest.Artifact - (*BatchStatResponse_StatResponse)(nil), // 17: bazel_output_service.BatchStatResponse.StatResponse - (*BatchStatResponse_Stat)(nil), // 18: bazel_output_service.BatchStatResponse.Stat - (*BatchStatResponse_Stat_File)(nil), // 19: bazel_output_service.BatchStatResponse.Stat.File - (*BatchStatResponse_Stat_Symlink)(nil), // 20: bazel_output_service.BatchStatResponse.Stat.Symlink - (*BatchStatResponse_Stat_Directory)(nil), // 21: bazel_output_service.BatchStatResponse.Stat.Directory - (*anypb.Any)(nil), // 22: google.protobuf.Any - (*status.Status)(nil), // 23: google.rpc.Status -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_depIdxs = []int32{ - 22, // 0: bazel_output_service.StartBuildRequest.args:type_name -> google.protobuf.Any - 13, // 1: bazel_output_service.StartBuildRequest.output_path_aliases:type_name -> bazel_output_service.StartBuildRequest.OutputPathAliasesEntry - 4, // 2: bazel_output_service.StartBuildResponse.initial_output_path_contents:type_name -> bazel_output_service.InitialOutputPathContents - 14, // 3: bazel_output_service.StageArtifactsRequest.artifacts:type_name -> bazel_output_service.StageArtifactsRequest.Artifact - 15, // 4: bazel_output_service.StageArtifactsResponse.responses:type_name -> bazel_output_service.StageArtifactsResponse.Response - 16, // 5: bazel_output_service.FinalizeArtifactsRequest.artifacts:type_name -> bazel_output_service.FinalizeArtifactsRequest.Artifact - 17, // 6: bazel_output_service.BatchStatResponse.responses:type_name -> bazel_output_service.BatchStatResponse.StatResponse - 22, // 7: bazel_output_service.StageArtifactsRequest.Artifact.locator:type_name -> google.protobuf.Any - 23, // 8: bazel_output_service.StageArtifactsResponse.Response.status:type_name -> google.rpc.Status - 22, // 9: bazel_output_service.FinalizeArtifactsRequest.Artifact.locator:type_name -> google.protobuf.Any - 18, // 10: bazel_output_service.BatchStatResponse.StatResponse.stat:type_name -> bazel_output_service.BatchStatResponse.Stat - 19, // 11: bazel_output_service.BatchStatResponse.Stat.file:type_name -> bazel_output_service.BatchStatResponse.Stat.File - 20, // 12: bazel_output_service.BatchStatResponse.Stat.symlink:type_name -> bazel_output_service.BatchStatResponse.Stat.Symlink - 21, // 13: bazel_output_service.BatchStatResponse.Stat.directory:type_name -> bazel_output_service.BatchStatResponse.Stat.Directory - 22, // 14: bazel_output_service.BatchStatResponse.Stat.File.locator:type_name -> google.protobuf.Any - 0, // 15: bazel_output_service.BazelOutputService.Clean:input_type -> bazel_output_service.CleanRequest - 2, // 16: bazel_output_service.BazelOutputService.StartBuild:input_type -> bazel_output_service.StartBuildRequest - 5, // 17: bazel_output_service.BazelOutputService.StageArtifacts:input_type -> bazel_output_service.StageArtifactsRequest - 7, // 18: bazel_output_service.BazelOutputService.FinalizeArtifacts:input_type -> bazel_output_service.FinalizeArtifactsRequest - 9, // 19: bazel_output_service.BazelOutputService.FinalizeBuild:input_type -> bazel_output_service.FinalizeBuildRequest - 11, // 20: bazel_output_service.BazelOutputService.BatchStat:input_type -> bazel_output_service.BatchStatRequest - 1, // 21: bazel_output_service.BazelOutputService.Clean:output_type -> bazel_output_service.CleanResponse - 3, // 22: bazel_output_service.BazelOutputService.StartBuild:output_type -> bazel_output_service.StartBuildResponse - 6, // 23: bazel_output_service.BazelOutputService.StageArtifacts:output_type -> bazel_output_service.StageArtifactsResponse - 8, // 24: bazel_output_service.BazelOutputService.FinalizeArtifacts:output_type -> bazel_output_service.FinalizeArtifactsResponse - 10, // 25: bazel_output_service.BazelOutputService.FinalizeBuild:output_type -> bazel_output_service.FinalizeBuildResponse - 12, // 26: bazel_output_service.BazelOutputService.BatchStat:output_type -> bazel_output_service.BatchStatResponse - 21, // [21:27] is the sub-list for method output_type - 15, // [15:21] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes[18].OneofWrappers = []any{ - (*BatchStatResponse_Stat_File_)(nil), - (*BatchStatResponse_Stat_Symlink_)(nil), - (*BatchStatResponse_Stat_Directory_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_rawDesc)), - NumEnums: 0, - NumMessages: 22, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_bazel_output_service_proto_depIdxs = nil -} diff --git a/pkg/proto/bazeloutputservice/bazel_output_service_grpc.pb.go b/pkg/proto/bazeloutputservice/bazel_output_service_grpc.pb.go deleted file mode 100644 index 9594e9a9..00000000 --- a/pkg/proto/bazeloutputservice/bazel_output_service_grpc.pb.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/bazel_output_service.proto - -package bazeloutputservice - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - BazelOutputService_Clean_FullMethodName = "/bazel_output_service.BazelOutputService/Clean" - BazelOutputService_StartBuild_FullMethodName = "/bazel_output_service.BazelOutputService/StartBuild" - BazelOutputService_StageArtifacts_FullMethodName = "/bazel_output_service.BazelOutputService/StageArtifacts" - BazelOutputService_FinalizeArtifacts_FullMethodName = "/bazel_output_service.BazelOutputService/FinalizeArtifacts" - BazelOutputService_FinalizeBuild_FullMethodName = "/bazel_output_service.BazelOutputService/FinalizeBuild" - BazelOutputService_BatchStat_FullMethodName = "/bazel_output_service.BazelOutputService/BatchStat" -) - -// BazelOutputServiceClient is the client API for BazelOutputService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BazelOutputServiceClient interface { - Clean(ctx context.Context, in *CleanRequest, opts ...grpc.CallOption) (*CleanResponse, error) - StartBuild(ctx context.Context, in *StartBuildRequest, opts ...grpc.CallOption) (*StartBuildResponse, error) - StageArtifacts(ctx context.Context, in *StageArtifactsRequest, opts ...grpc.CallOption) (*StageArtifactsResponse, error) - FinalizeArtifacts(ctx context.Context, in *FinalizeArtifactsRequest, opts ...grpc.CallOption) (*FinalizeArtifactsResponse, error) - FinalizeBuild(ctx context.Context, in *FinalizeBuildRequest, opts ...grpc.CallOption) (*FinalizeBuildResponse, error) - BatchStat(ctx context.Context, in *BatchStatRequest, opts ...grpc.CallOption) (*BatchStatResponse, error) -} - -type bazelOutputServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBazelOutputServiceClient(cc grpc.ClientConnInterface) BazelOutputServiceClient { - return &bazelOutputServiceClient{cc} -} - -func (c *bazelOutputServiceClient) Clean(ctx context.Context, in *CleanRequest, opts ...grpc.CallOption) (*CleanResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CleanResponse) - err := c.cc.Invoke(ctx, BazelOutputService_Clean_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bazelOutputServiceClient) StartBuild(ctx context.Context, in *StartBuildRequest, opts ...grpc.CallOption) (*StartBuildResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StartBuildResponse) - err := c.cc.Invoke(ctx, BazelOutputService_StartBuild_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bazelOutputServiceClient) StageArtifacts(ctx context.Context, in *StageArtifactsRequest, opts ...grpc.CallOption) (*StageArtifactsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StageArtifactsResponse) - err := c.cc.Invoke(ctx, BazelOutputService_StageArtifacts_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bazelOutputServiceClient) FinalizeArtifacts(ctx context.Context, in *FinalizeArtifactsRequest, opts ...grpc.CallOption) (*FinalizeArtifactsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(FinalizeArtifactsResponse) - err := c.cc.Invoke(ctx, BazelOutputService_FinalizeArtifacts_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bazelOutputServiceClient) FinalizeBuild(ctx context.Context, in *FinalizeBuildRequest, opts ...grpc.CallOption) (*FinalizeBuildResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(FinalizeBuildResponse) - err := c.cc.Invoke(ctx, BazelOutputService_FinalizeBuild_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bazelOutputServiceClient) BatchStat(ctx context.Context, in *BatchStatRequest, opts ...grpc.CallOption) (*BatchStatResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(BatchStatResponse) - err := c.cc.Invoke(ctx, BazelOutputService_BatchStat_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BazelOutputServiceServer is the server API for BazelOutputService service. -// All implementations should embed UnimplementedBazelOutputServiceServer -// for forward compatibility. -type BazelOutputServiceServer interface { - Clean(context.Context, *CleanRequest) (*CleanResponse, error) - StartBuild(context.Context, *StartBuildRequest) (*StartBuildResponse, error) - StageArtifacts(context.Context, *StageArtifactsRequest) (*StageArtifactsResponse, error) - FinalizeArtifacts(context.Context, *FinalizeArtifactsRequest) (*FinalizeArtifactsResponse, error) - FinalizeBuild(context.Context, *FinalizeBuildRequest) (*FinalizeBuildResponse, error) - BatchStat(context.Context, *BatchStatRequest) (*BatchStatResponse, error) -} - -// UnimplementedBazelOutputServiceServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBazelOutputServiceServer struct{} - -func (UnimplementedBazelOutputServiceServer) Clean(context.Context, *CleanRequest) (*CleanResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Clean not implemented") -} -func (UnimplementedBazelOutputServiceServer) StartBuild(context.Context, *StartBuildRequest) (*StartBuildResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StartBuild not implemented") -} -func (UnimplementedBazelOutputServiceServer) StageArtifacts(context.Context, *StageArtifactsRequest) (*StageArtifactsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method StageArtifacts not implemented") -} -func (UnimplementedBazelOutputServiceServer) FinalizeArtifacts(context.Context, *FinalizeArtifactsRequest) (*FinalizeArtifactsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizeArtifacts not implemented") -} -func (UnimplementedBazelOutputServiceServer) FinalizeBuild(context.Context, *FinalizeBuildRequest) (*FinalizeBuildResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizeBuild not implemented") -} -func (UnimplementedBazelOutputServiceServer) BatchStat(context.Context, *BatchStatRequest) (*BatchStatResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BatchStat not implemented") -} -func (UnimplementedBazelOutputServiceServer) testEmbeddedByValue() {} - -// UnsafeBazelOutputServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BazelOutputServiceServer will -// result in compilation errors. -type UnsafeBazelOutputServiceServer interface { - mustEmbedUnimplementedBazelOutputServiceServer() -} - -func RegisterBazelOutputServiceServer(s grpc.ServiceRegistrar, srv BazelOutputServiceServer) { - // If the following call pancis, it indicates UnimplementedBazelOutputServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BazelOutputService_ServiceDesc, srv) -} - -func _BazelOutputService_Clean_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CleanRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).Clean(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_Clean_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).Clean(ctx, req.(*CleanRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BazelOutputService_StartBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartBuildRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).StartBuild(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_StartBuild_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).StartBuild(ctx, req.(*StartBuildRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BazelOutputService_StageArtifacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StageArtifactsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).StageArtifacts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_StageArtifacts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).StageArtifacts(ctx, req.(*StageArtifactsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BazelOutputService_FinalizeArtifacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FinalizeArtifactsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).FinalizeArtifacts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_FinalizeArtifacts_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).FinalizeArtifacts(ctx, req.(*FinalizeArtifactsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BazelOutputService_FinalizeBuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FinalizeBuildRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).FinalizeBuild(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_FinalizeBuild_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).FinalizeBuild(ctx, req.(*FinalizeBuildRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BazelOutputService_BatchStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BatchStatRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BazelOutputServiceServer).BatchStat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BazelOutputService_BatchStat_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BazelOutputServiceServer).BatchStat(ctx, req.(*BatchStatRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BazelOutputService_ServiceDesc is the grpc.ServiceDesc for BazelOutputService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BazelOutputService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "bazel_output_service.BazelOutputService", - HandlerType: (*BazelOutputServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Clean", - Handler: _BazelOutputService_Clean_Handler, - }, - { - MethodName: "StartBuild", - Handler: _BazelOutputService_StartBuild_Handler, - }, - { - MethodName: "StageArtifacts", - Handler: _BazelOutputService_StageArtifacts_Handler, - }, - { - MethodName: "FinalizeArtifacts", - Handler: _BazelOutputService_FinalizeArtifacts_Handler, - }, - { - MethodName: "FinalizeBuild", - Handler: _BazelOutputService_FinalizeBuild_Handler, - }, - { - MethodName: "BatchStat", - Handler: _BazelOutputService_BatchStat_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/bazel_output_service.proto", -} diff --git a/pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.pb.go b/pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.pb.go deleted file mode 100644 index 729b966d..00000000 --- a/pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.pb.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.proto - -package bazeloutputservicerev2 - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type StartBuildArgs struct { - state protoimpl.MessageState `protogen:"open.v1"` - RemoteCache string `protobuf:"bytes,1,opt,name=remote_cache,json=remoteCache,proto3" json:"remote_cache,omitempty"` - InstanceName string `protobuf:"bytes,2,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - DigestFunction v2.DigestFunction_Value `protobuf:"varint,3,opt,name=digest_function,json=digestFunction,proto3,enum=build.bazel.remote.execution.v2.DigestFunction_Value" json:"digest_function,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StartBuildArgs) Reset() { - *x = StartBuildArgs{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StartBuildArgs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartBuildArgs) ProtoMessage() {} - -func (x *StartBuildArgs) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartBuildArgs.ProtoReflect.Descriptor instead. -func (*StartBuildArgs) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescGZIP(), []int{0} -} - -func (x *StartBuildArgs) GetRemoteCache() string { - if x != nil { - return x.RemoteCache - } - return "" -} - -func (x *StartBuildArgs) GetInstanceName() string { - if x != nil { - return x.InstanceName - } - return "" -} - -func (x *StartBuildArgs) GetDigestFunction() v2.DigestFunction_Value { - if x != nil { - return x.DigestFunction - } - return v2.DigestFunction_Value(0) -} - -type FileArtifactLocator struct { - state protoimpl.MessageState `protogen:"open.v1"` - Digest *v2.Digest `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FileArtifactLocator) Reset() { - *x = FileArtifactLocator{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FileArtifactLocator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileArtifactLocator) ProtoMessage() {} - -func (x *FileArtifactLocator) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileArtifactLocator.ProtoReflect.Descriptor instead. -func (*FileArtifactLocator) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescGZIP(), []int{1} -} - -func (x *FileArtifactLocator) GetDigest() *v2.Digest { - if x != nil { - return x.Digest - } - return nil -} - -type TreeArtifactLocator struct { - state protoimpl.MessageState `protogen:"open.v1"` - TreeDigest *v2.Digest `protobuf:"bytes,1,opt,name=tree_digest,json=treeDigest,proto3" json:"tree_digest,omitempty"` - RootDirectoryDigest *v2.Digest `protobuf:"bytes,2,opt,name=root_directory_digest,json=rootDirectoryDigest,proto3" json:"root_directory_digest,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TreeArtifactLocator) Reset() { - *x = TreeArtifactLocator{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TreeArtifactLocator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TreeArtifactLocator) ProtoMessage() {} - -func (x *TreeArtifactLocator) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TreeArtifactLocator.ProtoReflect.Descriptor instead. -func (*TreeArtifactLocator) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescGZIP(), []int{2} -} - -func (x *TreeArtifactLocator) GetTreeDigest() *v2.Digest { - if x != nil { - return x.TreeDigest - } - return nil -} - -func (x *TreeArtifactLocator) GetRootDirectoryDigest() *v2.Digest { - if x != nil { - return x.RootDirectoryDigest - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDesc = "" + - "\n" + - "jgithub.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2/bazel_output_service_rev2.proto\x12\x19bazel_output_service_rev2\x1a6build/bazel/remote/execution/v2/remote_execution.proto\"\xb8\x01\n" + - "\x0eStartBuildArgs\x12!\n" + - "\fremote_cache\x18\x01 \x01(\tR\vremoteCache\x12#\n" + - "\rinstance_name\x18\x02 \x01(\tR\finstanceName\x12^\n" + - "\x0fdigest_function\x18\x03 \x01(\x0e25.build.bazel.remote.execution.v2.DigestFunction.ValueR\x0edigestFunction\"V\n" + - "\x13FileArtifactLocator\x12?\n" + - "\x06digest\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\x06digest\"\xbc\x01\n" + - "\x13TreeArtifactLocator\x12H\n" + - "\vtree_digest\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\n" + - "treeDigest\x12[\n" + - "\x15root_directory_digest\x18\x02 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\x13rootDirectoryDigestB[\n" + - "$com.google.devtools.build.lib.remoteB\x1bBazelOutputServiceREv2ProtoZ\x16bazeloutputservicerev2b\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_goTypes = []any{ - (*StartBuildArgs)(nil), // 0: bazel_output_service_rev2.StartBuildArgs - (*FileArtifactLocator)(nil), // 1: bazel_output_service_rev2.FileArtifactLocator - (*TreeArtifactLocator)(nil), // 2: bazel_output_service_rev2.TreeArtifactLocator - (v2.DigestFunction_Value)(0), // 3: build.bazel.remote.execution.v2.DigestFunction.Value - (*v2.Digest)(nil), // 4: build.bazel.remote.execution.v2.Digest -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_depIdxs = []int32{ - 3, // 0: bazel_output_service_rev2.StartBuildArgs.digest_function:type_name -> build.bazel.remote.execution.v2.DigestFunction.Value - 4, // 1: bazel_output_service_rev2.FileArtifactLocator.digest:type_name -> build.bazel.remote.execution.v2.Digest - 4, // 2: bazel_output_service_rev2.TreeArtifactLocator.tree_digest:type_name -> build.bazel.remote.execution.v2.Digest - 4, // 3: bazel_output_service_rev2.TreeArtifactLocator.root_directory_digest:type_name -> build.bazel.remote.execution.v2.Digest - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_bazeloutputservice_rev2_bazel_output_service_rev2_proto_depIdxs = nil -} diff --git a/pkg/proto/buildqueuestate/buildqueuestate.pb.go b/pkg/proto/buildqueuestate/buildqueuestate.pb.go deleted file mode 100644 index 39d484af..00000000 --- a/pkg/proto/buildqueuestate/buildqueuestate.pb.go +++ /dev/null @@ -1,2448 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestate/buildqueuestate.proto - -package buildqueuestate - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - status "google.golang.org/genproto/googleapis/rpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - durationpb "google.golang.org/protobuf/types/known/durationpb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ListInvocationChildrenRequest_Filter int32 - -const ( - ListInvocationChildrenRequest_ALL ListInvocationChildrenRequest_Filter = 0 - ListInvocationChildrenRequest_ACTIVE ListInvocationChildrenRequest_Filter = 1 - ListInvocationChildrenRequest_QUEUED ListInvocationChildrenRequest_Filter = 2 -) - -// Enum value maps for ListInvocationChildrenRequest_Filter. -var ( - ListInvocationChildrenRequest_Filter_name = map[int32]string{ - 0: "ALL", - 1: "ACTIVE", - 2: "QUEUED", - } - ListInvocationChildrenRequest_Filter_value = map[string]int32{ - "ALL": 0, - "ACTIVE": 1, - "QUEUED": 2, - } -) - -func (x ListInvocationChildrenRequest_Filter) Enum() *ListInvocationChildrenRequest_Filter { - p := new(ListInvocationChildrenRequest_Filter) - *p = x - return p -} - -func (x ListInvocationChildrenRequest_Filter) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ListInvocationChildrenRequest_Filter) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_enumTypes[0].Descriptor() -} - -func (ListInvocationChildrenRequest_Filter) Type() protoreflect.EnumType { - return &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_enumTypes[0] -} - -func (x ListInvocationChildrenRequest_Filter) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ListInvocationChildrenRequest_Filter.Descriptor instead. -func (ListInvocationChildrenRequest_Filter) EnumDescriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{17, 0} -} - -type PaginationInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - StartIndex uint32 `protobuf:"varint,1,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"` - TotalEntries uint32 `protobuf:"varint,2,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaginationInfo) Reset() { - *x = PaginationInfo{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaginationInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaginationInfo) ProtoMessage() {} - -func (x *PaginationInfo) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PaginationInfo.ProtoReflect.Descriptor instead. -func (*PaginationInfo) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{0} -} - -func (x *PaginationInfo) GetStartIndex() uint32 { - if x != nil { - return x.StartIndex - } - return 0 -} - -func (x *PaginationInfo) GetTotalEntries() uint32 { - if x != nil { - return x.TotalEntries - } - return 0 -} - -type PlatformQueueName struct { - state protoimpl.MessageState `protogen:"open.v1"` - InstanceNamePrefix string `protobuf:"bytes,1,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PlatformQueueName) Reset() { - *x = PlatformQueueName{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PlatformQueueName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformQueueName) ProtoMessage() {} - -func (x *PlatformQueueName) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformQueueName.ProtoReflect.Descriptor instead. -func (*PlatformQueueName) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{1} -} - -func (x *PlatformQueueName) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *PlatformQueueName) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -type SizeClassQueueName struct { - state protoimpl.MessageState `protogen:"open.v1"` - PlatformQueueName *PlatformQueueName `protobuf:"bytes,1,opt,name=platform_queue_name,json=platformQueueName,proto3" json:"platform_queue_name,omitempty"` - SizeClass uint32 `protobuf:"varint,2,opt,name=size_class,json=sizeClass,proto3" json:"size_class,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SizeClassQueueName) Reset() { - *x = SizeClassQueueName{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SizeClassQueueName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SizeClassQueueName) ProtoMessage() {} - -func (x *SizeClassQueueName) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SizeClassQueueName.ProtoReflect.Descriptor instead. -func (*SizeClassQueueName) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{2} -} - -func (x *SizeClassQueueName) GetPlatformQueueName() *PlatformQueueName { - if x != nil { - return x.PlatformQueueName - } - return nil -} - -func (x *SizeClassQueueName) GetSizeClass() uint32 { - if x != nil { - return x.SizeClass - } - return 0 -} - -type InvocationName struct { - state protoimpl.MessageState `protogen:"open.v1"` - SizeClassQueueName *SizeClassQueueName `protobuf:"bytes,1,opt,name=size_class_queue_name,json=sizeClassQueueName,proto3" json:"size_class_queue_name,omitempty"` - Ids []*anypb.Any `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InvocationName) Reset() { - *x = InvocationName{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InvocationName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvocationName) ProtoMessage() {} - -func (x *InvocationName) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvocationName.ProtoReflect.Descriptor instead. -func (*InvocationName) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{3} -} - -func (x *InvocationName) GetSizeClassQueueName() *SizeClassQueueName { - if x != nil { - return x.SizeClassQueueName - } - return nil -} - -func (x *InvocationName) GetIds() []*anypb.Any { - if x != nil { - return x.Ids - } - return nil -} - -type OperationState struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - InvocationName *InvocationName `protobuf:"bytes,2,opt,name=invocation_name,json=invocationName,proto3" json:"invocation_name,omitempty"` - ExpectedDuration *durationpb.Duration `protobuf:"bytes,14,opt,name=expected_duration,json=expectedDuration,proto3" json:"expected_duration,omitempty"` - QueuedTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=queued_timestamp,json=queuedTimestamp,proto3" json:"queued_timestamp,omitempty"` - ActionDigest *v2.Digest `protobuf:"bytes,5,opt,name=action_digest,json=actionDigest,proto3" json:"action_digest,omitempty"` - Timeout *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Types that are valid to be assigned to Stage: - // - // *OperationState_Queued - // *OperationState_Executing - // *OperationState_Completed - Stage isOperationState_Stage `protobuf_oneof:"stage"` - TargetId string `protobuf:"bytes,11,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` - Priority int32 `protobuf:"varint,12,opt,name=priority,proto3" json:"priority,omitempty"` - InstanceNameSuffix string `protobuf:"bytes,13,opt,name=instance_name_suffix,json=instanceNameSuffix,proto3" json:"instance_name_suffix,omitempty"` - DigestFunction v2.DigestFunction_Value `protobuf:"varint,15,opt,name=digest_function,json=digestFunction,proto3,enum=build.bazel.remote.execution.v2.DigestFunction_Value" json:"digest_function,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *OperationState) Reset() { - *x = OperationState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OperationState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationState) ProtoMessage() {} - -func (x *OperationState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationState.ProtoReflect.Descriptor instead. -func (*OperationState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{4} -} - -func (x *OperationState) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *OperationState) GetInvocationName() *InvocationName { - if x != nil { - return x.InvocationName - } - return nil -} - -func (x *OperationState) GetExpectedDuration() *durationpb.Duration { - if x != nil { - return x.ExpectedDuration - } - return nil -} - -func (x *OperationState) GetQueuedTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.QueuedTimestamp - } - return nil -} - -func (x *OperationState) GetActionDigest() *v2.Digest { - if x != nil { - return x.ActionDigest - } - return nil -} - -func (x *OperationState) GetTimeout() *timestamppb.Timestamp { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *OperationState) GetStage() isOperationState_Stage { - if x != nil { - return x.Stage - } - return nil -} - -func (x *OperationState) GetQueued() *emptypb.Empty { - if x != nil { - if x, ok := x.Stage.(*OperationState_Queued); ok { - return x.Queued - } - } - return nil -} - -func (x *OperationState) GetExecuting() *emptypb.Empty { - if x != nil { - if x, ok := x.Stage.(*OperationState_Executing); ok { - return x.Executing - } - } - return nil -} - -func (x *OperationState) GetCompleted() *v2.ExecuteResponse { - if x != nil { - if x, ok := x.Stage.(*OperationState_Completed); ok { - return x.Completed - } - } - return nil -} - -func (x *OperationState) GetTargetId() string { - if x != nil { - return x.TargetId - } - return "" -} - -func (x *OperationState) GetPriority() int32 { - if x != nil { - return x.Priority - } - return 0 -} - -func (x *OperationState) GetInstanceNameSuffix() string { - if x != nil { - return x.InstanceNameSuffix - } - return "" -} - -func (x *OperationState) GetDigestFunction() v2.DigestFunction_Value { - if x != nil { - return x.DigestFunction - } - return v2.DigestFunction_Value(0) -} - -type isOperationState_Stage interface { - isOperationState_Stage() -} - -type OperationState_Queued struct { - Queued *emptypb.Empty `protobuf:"bytes,8,opt,name=queued,proto3,oneof"` -} - -type OperationState_Executing struct { - Executing *emptypb.Empty `protobuf:"bytes,9,opt,name=executing,proto3,oneof"` -} - -type OperationState_Completed struct { - Completed *v2.ExecuteResponse `protobuf:"bytes,10,opt,name=completed,proto3,oneof"` -} - -func (*OperationState_Queued) isOperationState_Stage() {} - -func (*OperationState_Executing) isOperationState_Stage() {} - -func (*OperationState_Completed) isOperationState_Stage() {} - -type SizeClassQueueState struct { - state protoimpl.MessageState `protogen:"open.v1"` - SizeClass uint32 `protobuf:"varint,1,opt,name=size_class,json=sizeClass,proto3" json:"size_class,omitempty"` - Timeout *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` - WorkersCount uint32 `protobuf:"varint,5,opt,name=workers_count,json=workersCount,proto3" json:"workers_count,omitempty"` - DrainsCount uint32 `protobuf:"varint,7,opt,name=drains_count,json=drainsCount,proto3" json:"drains_count,omitempty"` - RootInvocation *InvocationState `protobuf:"bytes,9,opt,name=root_invocation,json=rootInvocation,proto3" json:"root_invocation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SizeClassQueueState) Reset() { - *x = SizeClassQueueState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SizeClassQueueState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SizeClassQueueState) ProtoMessage() {} - -func (x *SizeClassQueueState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SizeClassQueueState.ProtoReflect.Descriptor instead. -func (*SizeClassQueueState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{5} -} - -func (x *SizeClassQueueState) GetSizeClass() uint32 { - if x != nil { - return x.SizeClass - } - return 0 -} - -func (x *SizeClassQueueState) GetTimeout() *timestamppb.Timestamp { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *SizeClassQueueState) GetWorkersCount() uint32 { - if x != nil { - return x.WorkersCount - } - return 0 -} - -func (x *SizeClassQueueState) GetDrainsCount() uint32 { - if x != nil { - return x.DrainsCount - } - return 0 -} - -func (x *SizeClassQueueState) GetRootInvocation() *InvocationState { - if x != nil { - return x.RootInvocation - } - return nil -} - -type PlatformQueueState struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name *PlatformQueueName `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - SizeClassQueues []*SizeClassQueueState `protobuf:"bytes,2,rep,name=size_class_queues,json=sizeClassQueues,proto3" json:"size_class_queues,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PlatformQueueState) Reset() { - *x = PlatformQueueState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PlatformQueueState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformQueueState) ProtoMessage() {} - -func (x *PlatformQueueState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformQueueState.ProtoReflect.Descriptor instead. -func (*PlatformQueueState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{6} -} - -func (x *PlatformQueueState) GetName() *PlatformQueueName { - if x != nil { - return x.Name - } - return nil -} - -func (x *PlatformQueueState) GetSizeClassQueues() []*SizeClassQueueState { - if x != nil { - return x.SizeClassQueues - } - return nil -} - -type InvocationState struct { - state protoimpl.MessageState `protogen:"open.v1"` - QueuedOperationsCount *InvocationState_InvocationObjectCount `protobuf:"bytes,2,opt,name=queued_operations_count,json=queuedOperationsCount,proto3" json:"queued_operations_count,omitempty"` - ExecutingWorkersCount uint32 `protobuf:"varint,4,opt,name=executing_workers_count,json=executingWorkersCount,proto3" json:"executing_workers_count,omitempty"` - IdleWorkersCount uint32 `protobuf:"varint,5,opt,name=idle_workers_count,json=idleWorkersCount,proto3" json:"idle_workers_count,omitempty"` - IdleSynchronizingWorkersCount uint32 `protobuf:"varint,6,opt,name=idle_synchronizing_workers_count,json=idleSynchronizingWorkersCount,proto3" json:"idle_synchronizing_workers_count,omitempty"` - ChildrenCount uint32 `protobuf:"varint,7,opt,name=children_count,json=childrenCount,proto3" json:"children_count,omitempty"` - ActiveChildrenCount uint32 `protobuf:"varint,8,opt,name=active_children_count,json=activeChildrenCount,proto3" json:"active_children_count,omitempty"` - QueuedChildrenCount uint32 `protobuf:"varint,9,opt,name=queued_children_count,json=queuedChildrenCount,proto3" json:"queued_children_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InvocationState) Reset() { - *x = InvocationState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InvocationState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvocationState) ProtoMessage() {} - -func (x *InvocationState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvocationState.ProtoReflect.Descriptor instead. -func (*InvocationState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{7} -} - -func (x *InvocationState) GetQueuedOperationsCount() *InvocationState_InvocationObjectCount { - if x != nil { - return x.QueuedOperationsCount - } - return nil -} - -func (x *InvocationState) GetExecutingWorkersCount() uint32 { - if x != nil { - return x.ExecutingWorkersCount - } - return 0 -} - -func (x *InvocationState) GetIdleWorkersCount() uint32 { - if x != nil { - return x.IdleWorkersCount - } - return 0 -} - -func (x *InvocationState) GetIdleSynchronizingWorkersCount() uint32 { - if x != nil { - return x.IdleSynchronizingWorkersCount - } - return 0 -} - -func (x *InvocationState) GetChildrenCount() uint32 { - if x != nil { - return x.ChildrenCount - } - return 0 -} - -func (x *InvocationState) GetActiveChildrenCount() uint32 { - if x != nil { - return x.ActiveChildrenCount - } - return 0 -} - -func (x *InvocationState) GetQueuedChildrenCount() uint32 { - if x != nil { - return x.QueuedChildrenCount - } - return 0 -} - -type InvocationChildState struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *anypb.Any `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - State *InvocationState `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InvocationChildState) Reset() { - *x = InvocationChildState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InvocationChildState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvocationChildState) ProtoMessage() {} - -func (x *InvocationChildState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvocationChildState.ProtoReflect.Descriptor instead. -func (*InvocationChildState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{8} -} - -func (x *InvocationChildState) GetId() *anypb.Any { - if x != nil { - return x.Id - } - return nil -} - -func (x *InvocationChildState) GetState() *InvocationState { - if x != nil { - return x.State - } - return nil -} - -type WorkerState struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id map[string]string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Timeout *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` - CurrentOperation *OperationState `protobuf:"bytes,3,opt,name=current_operation,json=currentOperation,proto3" json:"current_operation,omitempty"` - Drained bool `protobuf:"varint,4,opt,name=drained,proto3" json:"drained,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WorkerState) Reset() { - *x = WorkerState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WorkerState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WorkerState) ProtoMessage() {} - -func (x *WorkerState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WorkerState.ProtoReflect.Descriptor instead. -func (*WorkerState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{9} -} - -func (x *WorkerState) GetId() map[string]string { - if x != nil { - return x.Id - } - return nil -} - -func (x *WorkerState) GetTimeout() *timestamppb.Timestamp { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *WorkerState) GetCurrentOperation() *OperationState { - if x != nil { - return x.CurrentOperation - } - return nil -} - -func (x *WorkerState) GetDrained() bool { - if x != nil { - return x.Drained - } - return false -} - -type DrainState struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkerIdPattern map[string]string `protobuf:"bytes,1,rep,name=worker_id_pattern,json=workerIdPattern,proto3" json:"worker_id_pattern,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - CreatedTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_timestamp,json=createdTimestamp,proto3" json:"created_timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DrainState) Reset() { - *x = DrainState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DrainState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DrainState) ProtoMessage() {} - -func (x *DrainState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DrainState.ProtoReflect.Descriptor instead. -func (*DrainState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{10} -} - -func (x *DrainState) GetWorkerIdPattern() map[string]string { - if x != nil { - return x.WorkerIdPattern - } - return nil -} - -func (x *DrainState) GetCreatedTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.CreatedTimestamp - } - return nil -} - -type GetOperationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - OperationName string `protobuf:"bytes,1,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetOperationRequest) Reset() { - *x = GetOperationRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetOperationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOperationRequest) ProtoMessage() {} - -func (x *GetOperationRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOperationRequest.ProtoReflect.Descriptor instead. -func (*GetOperationRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{11} -} - -func (x *GetOperationRequest) GetOperationName() string { - if x != nil { - return x.OperationName - } - return "" -} - -type GetOperationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Operation *OperationState `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetOperationResponse) Reset() { - *x = GetOperationResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetOperationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOperationResponse) ProtoMessage() {} - -func (x *GetOperationResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOperationResponse.ProtoReflect.Descriptor instead. -func (*GetOperationResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{12} -} - -func (x *GetOperationResponse) GetOperation() *OperationState { - if x != nil { - return x.Operation - } - return nil -} - -type ListOperationsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - StartAfter *ListOperationsRequest_StartAfter `protobuf:"bytes,2,opt,name=start_after,json=startAfter,proto3" json:"start_after,omitempty"` - FilterInvocationId *anypb.Any `protobuf:"bytes,3,opt,name=filter_invocation_id,json=filterInvocationId,proto3" json:"filter_invocation_id,omitempty"` - FilterStage v2.ExecutionStage_Value `protobuf:"varint,4,opt,name=filter_stage,json=filterStage,proto3,enum=build.bazel.remote.execution.v2.ExecutionStage_Value" json:"filter_stage,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListOperationsRequest) Reset() { - *x = ListOperationsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListOperationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOperationsRequest) ProtoMessage() {} - -func (x *ListOperationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOperationsRequest.ProtoReflect.Descriptor instead. -func (*ListOperationsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{13} -} - -func (x *ListOperationsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListOperationsRequest) GetStartAfter() *ListOperationsRequest_StartAfter { - if x != nil { - return x.StartAfter - } - return nil -} - -func (x *ListOperationsRequest) GetFilterInvocationId() *anypb.Any { - if x != nil { - return x.FilterInvocationId - } - return nil -} - -func (x *ListOperationsRequest) GetFilterStage() v2.ExecutionStage_Value { - if x != nil { - return x.FilterStage - } - return v2.ExecutionStage_Value(0) -} - -type ListOperationsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Operations []*OperationState `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` - PaginationInfo *PaginationInfo `protobuf:"bytes,2,opt,name=pagination_info,json=paginationInfo,proto3" json:"pagination_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListOperationsResponse) Reset() { - *x = ListOperationsResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListOperationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOperationsResponse) ProtoMessage() {} - -func (x *ListOperationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOperationsResponse.ProtoReflect.Descriptor instead. -func (*ListOperationsResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{14} -} - -func (x *ListOperationsResponse) GetOperations() []*OperationState { - if x != nil { - return x.Operations - } - return nil -} - -func (x *ListOperationsResponse) GetPaginationInfo() *PaginationInfo { - if x != nil { - return x.PaginationInfo - } - return nil -} - -type KillOperationsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Filter *KillOperationsRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` - Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *KillOperationsRequest) Reset() { - *x = KillOperationsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *KillOperationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillOperationsRequest) ProtoMessage() {} - -func (x *KillOperationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillOperationsRequest.ProtoReflect.Descriptor instead. -func (*KillOperationsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{15} -} - -func (x *KillOperationsRequest) GetFilter() *KillOperationsRequest_Filter { - if x != nil { - return x.Filter - } - return nil -} - -func (x *KillOperationsRequest) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -type ListPlatformQueuesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - PlatformQueues []*PlatformQueueState `protobuf:"bytes,1,rep,name=platform_queues,json=platformQueues,proto3" json:"platform_queues,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListPlatformQueuesResponse) Reset() { - *x = ListPlatformQueuesResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListPlatformQueuesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPlatformQueuesResponse) ProtoMessage() {} - -func (x *ListPlatformQueuesResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPlatformQueuesResponse.ProtoReflect.Descriptor instead. -func (*ListPlatformQueuesResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{16} -} - -func (x *ListPlatformQueuesResponse) GetPlatformQueues() []*PlatformQueueState { - if x != nil { - return x.PlatformQueues - } - return nil -} - -type ListInvocationChildrenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - InvocationName *InvocationName `protobuf:"bytes,1,opt,name=invocation_name,json=invocationName,proto3" json:"invocation_name,omitempty"` - Filter ListInvocationChildrenRequest_Filter `protobuf:"varint,2,opt,name=filter,proto3,enum=buildbarn.buildqueuestate.ListInvocationChildrenRequest_Filter" json:"filter,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListInvocationChildrenRequest) Reset() { - *x = ListInvocationChildrenRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListInvocationChildrenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListInvocationChildrenRequest) ProtoMessage() {} - -func (x *ListInvocationChildrenRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListInvocationChildrenRequest.ProtoReflect.Descriptor instead. -func (*ListInvocationChildrenRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{17} -} - -func (x *ListInvocationChildrenRequest) GetInvocationName() *InvocationName { - if x != nil { - return x.InvocationName - } - return nil -} - -func (x *ListInvocationChildrenRequest) GetFilter() ListInvocationChildrenRequest_Filter { - if x != nil { - return x.Filter - } - return ListInvocationChildrenRequest_ALL -} - -type ListInvocationChildrenResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Children []*InvocationChildState `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListInvocationChildrenResponse) Reset() { - *x = ListInvocationChildrenResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListInvocationChildrenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListInvocationChildrenResponse) ProtoMessage() {} - -func (x *ListInvocationChildrenResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListInvocationChildrenResponse.ProtoReflect.Descriptor instead. -func (*ListInvocationChildrenResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{18} -} - -func (x *ListInvocationChildrenResponse) GetChildren() []*InvocationChildState { - if x != nil { - return x.Children - } - return nil -} - -type ListQueuedOperationsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - InvocationName *InvocationName `protobuf:"bytes,1,opt,name=invocation_name,json=invocationName,proto3" json:"invocation_name,omitempty"` - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - StartAfter *ListQueuedOperationsRequest_StartAfter `protobuf:"bytes,4,opt,name=start_after,json=startAfter,proto3" json:"start_after,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListQueuedOperationsRequest) Reset() { - *x = ListQueuedOperationsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListQueuedOperationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListQueuedOperationsRequest) ProtoMessage() {} - -func (x *ListQueuedOperationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListQueuedOperationsRequest.ProtoReflect.Descriptor instead. -func (*ListQueuedOperationsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{19} -} - -func (x *ListQueuedOperationsRequest) GetInvocationName() *InvocationName { - if x != nil { - return x.InvocationName - } - return nil -} - -func (x *ListQueuedOperationsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListQueuedOperationsRequest) GetStartAfter() *ListQueuedOperationsRequest_StartAfter { - if x != nil { - return x.StartAfter - } - return nil -} - -type ListQueuedOperationsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - QueuedOperations []*OperationState `protobuf:"bytes,1,rep,name=queued_operations,json=queuedOperations,proto3" json:"queued_operations,omitempty"` - PaginationInfo *PaginationInfo `protobuf:"bytes,2,opt,name=pagination_info,json=paginationInfo,proto3" json:"pagination_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListQueuedOperationsResponse) Reset() { - *x = ListQueuedOperationsResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListQueuedOperationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListQueuedOperationsResponse) ProtoMessage() {} - -func (x *ListQueuedOperationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListQueuedOperationsResponse.ProtoReflect.Descriptor instead. -func (*ListQueuedOperationsResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{20} -} - -func (x *ListQueuedOperationsResponse) GetQueuedOperations() []*OperationState { - if x != nil { - return x.QueuedOperations - } - return nil -} - -func (x *ListQueuedOperationsResponse) GetPaginationInfo() *PaginationInfo { - if x != nil { - return x.PaginationInfo - } - return nil -} - -type ListWorkersRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Filter *ListWorkersRequest_Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - StartAfter *ListWorkersRequest_StartAfter `protobuf:"bytes,4,opt,name=start_after,json=startAfter,proto3" json:"start_after,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListWorkersRequest) Reset() { - *x = ListWorkersRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListWorkersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWorkersRequest) ProtoMessage() {} - -func (x *ListWorkersRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWorkersRequest.ProtoReflect.Descriptor instead. -func (*ListWorkersRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{21} -} - -func (x *ListWorkersRequest) GetFilter() *ListWorkersRequest_Filter { - if x != nil { - return x.Filter - } - return nil -} - -func (x *ListWorkersRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListWorkersRequest) GetStartAfter() *ListWorkersRequest_StartAfter { - if x != nil { - return x.StartAfter - } - return nil -} - -type ListWorkersResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Workers []*WorkerState `protobuf:"bytes,1,rep,name=workers,proto3" json:"workers,omitempty"` - PaginationInfo *PaginationInfo `protobuf:"bytes,2,opt,name=pagination_info,json=paginationInfo,proto3" json:"pagination_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListWorkersResponse) Reset() { - *x = ListWorkersResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListWorkersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWorkersResponse) ProtoMessage() {} - -func (x *ListWorkersResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWorkersResponse.ProtoReflect.Descriptor instead. -func (*ListWorkersResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{22} -} - -func (x *ListWorkersResponse) GetWorkers() []*WorkerState { - if x != nil { - return x.Workers - } - return nil -} - -func (x *ListWorkersResponse) GetPaginationInfo() *PaginationInfo { - if x != nil { - return x.PaginationInfo - } - return nil -} - -type TerminateWorkersRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkerIdPattern map[string]string `protobuf:"bytes,1,rep,name=worker_id_pattern,json=workerIdPattern,proto3" json:"worker_id_pattern,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TerminateWorkersRequest) Reset() { - *x = TerminateWorkersRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TerminateWorkersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TerminateWorkersRequest) ProtoMessage() {} - -func (x *TerminateWorkersRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TerminateWorkersRequest.ProtoReflect.Descriptor instead. -func (*TerminateWorkersRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{23} -} - -func (x *TerminateWorkersRequest) GetWorkerIdPattern() map[string]string { - if x != nil { - return x.WorkerIdPattern - } - return nil -} - -type ListDrainsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SizeClassQueueName *SizeClassQueueName `protobuf:"bytes,1,opt,name=size_class_queue_name,json=sizeClassQueueName,proto3" json:"size_class_queue_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListDrainsRequest) Reset() { - *x = ListDrainsRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListDrainsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDrainsRequest) ProtoMessage() {} - -func (x *ListDrainsRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDrainsRequest.ProtoReflect.Descriptor instead. -func (*ListDrainsRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{24} -} - -func (x *ListDrainsRequest) GetSizeClassQueueName() *SizeClassQueueName { - if x != nil { - return x.SizeClassQueueName - } - return nil -} - -type ListDrainsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Drains []*DrainState `protobuf:"bytes,1,rep,name=drains,proto3" json:"drains,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListDrainsResponse) Reset() { - *x = ListDrainsResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListDrainsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListDrainsResponse) ProtoMessage() {} - -func (x *ListDrainsResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListDrainsResponse.ProtoReflect.Descriptor instead. -func (*ListDrainsResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{25} -} - -func (x *ListDrainsResponse) GetDrains() []*DrainState { - if x != nil { - return x.Drains - } - return nil -} - -type AddOrRemoveDrainRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SizeClassQueueName *SizeClassQueueName `protobuf:"bytes,1,opt,name=size_class_queue_name,json=sizeClassQueueName,proto3" json:"size_class_queue_name,omitempty"` - WorkerIdPattern map[string]string `protobuf:"bytes,2,rep,name=worker_id_pattern,json=workerIdPattern,proto3" json:"worker_id_pattern,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddOrRemoveDrainRequest) Reset() { - *x = AddOrRemoveDrainRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddOrRemoveDrainRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOrRemoveDrainRequest) ProtoMessage() {} - -func (x *AddOrRemoveDrainRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOrRemoveDrainRequest.ProtoReflect.Descriptor instead. -func (*AddOrRemoveDrainRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{26} -} - -func (x *AddOrRemoveDrainRequest) GetSizeClassQueueName() *SizeClassQueueName { - if x != nil { - return x.SizeClassQueueName - } - return nil -} - -func (x *AddOrRemoveDrainRequest) GetWorkerIdPattern() map[string]string { - if x != nil { - return x.WorkerIdPattern - } - return nil -} - -type BackgroundLearning struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackgroundLearning) Reset() { - *x = BackgroundLearning{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackgroundLearning) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackgroundLearning) ProtoMessage() {} - -func (x *BackgroundLearning) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[27] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackgroundLearning.ProtoReflect.Descriptor instead. -func (*BackgroundLearning) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{27} -} - -type InvocationState_InvocationObjectCount struct { - state protoimpl.MessageState `protogen:"open.v1"` - Direct uint32 `protobuf:"varint,1,opt,name=direct,proto3" json:"direct,omitempty"` - Indirect uint32 `protobuf:"varint,2,opt,name=indirect,proto3" json:"indirect,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InvocationState_InvocationObjectCount) Reset() { - *x = InvocationState_InvocationObjectCount{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InvocationState_InvocationObjectCount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvocationState_InvocationObjectCount) ProtoMessage() {} - -func (x *InvocationState_InvocationObjectCount) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[28] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvocationState_InvocationObjectCount.ProtoReflect.Descriptor instead. -func (*InvocationState_InvocationObjectCount) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *InvocationState_InvocationObjectCount) GetDirect() uint32 { - if x != nil { - return x.Direct - } - return 0 -} - -func (x *InvocationState_InvocationObjectCount) GetIndirect() uint32 { - if x != nil { - return x.Indirect - } - return 0 -} - -type ListOperationsRequest_StartAfter struct { - state protoimpl.MessageState `protogen:"open.v1"` - OperationName string `protobuf:"bytes,1,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListOperationsRequest_StartAfter) Reset() { - *x = ListOperationsRequest_StartAfter{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListOperationsRequest_StartAfter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOperationsRequest_StartAfter) ProtoMessage() {} - -func (x *ListOperationsRequest_StartAfter) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[31] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOperationsRequest_StartAfter.ProtoReflect.Descriptor instead. -func (*ListOperationsRequest_StartAfter) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *ListOperationsRequest_StartAfter) GetOperationName() string { - if x != nil { - return x.OperationName - } - return "" -} - -type KillOperationsRequest_Filter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Type: - // - // *KillOperationsRequest_Filter_OperationName - // *KillOperationsRequest_Filter_SizeClassQueueWithoutWorkers - Type isKillOperationsRequest_Filter_Type `protobuf_oneof:"type"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *KillOperationsRequest_Filter) Reset() { - *x = KillOperationsRequest_Filter{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *KillOperationsRequest_Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillOperationsRequest_Filter) ProtoMessage() {} - -func (x *KillOperationsRequest_Filter) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[32] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillOperationsRequest_Filter.ProtoReflect.Descriptor instead. -func (*KillOperationsRequest_Filter) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *KillOperationsRequest_Filter) GetType() isKillOperationsRequest_Filter_Type { - if x != nil { - return x.Type - } - return nil -} - -func (x *KillOperationsRequest_Filter) GetOperationName() string { - if x != nil { - if x, ok := x.Type.(*KillOperationsRequest_Filter_OperationName); ok { - return x.OperationName - } - } - return "" -} - -func (x *KillOperationsRequest_Filter) GetSizeClassQueueWithoutWorkers() *SizeClassQueueName { - if x != nil { - if x, ok := x.Type.(*KillOperationsRequest_Filter_SizeClassQueueWithoutWorkers); ok { - return x.SizeClassQueueWithoutWorkers - } - } - return nil -} - -type isKillOperationsRequest_Filter_Type interface { - isKillOperationsRequest_Filter_Type() -} - -type KillOperationsRequest_Filter_OperationName struct { - OperationName string `protobuf:"bytes,1,opt,name=operation_name,json=operationName,proto3,oneof"` -} - -type KillOperationsRequest_Filter_SizeClassQueueWithoutWorkers struct { - SizeClassQueueWithoutWorkers *SizeClassQueueName `protobuf:"bytes,2,opt,name=size_class_queue_without_workers,json=sizeClassQueueWithoutWorkers,proto3,oneof"` -} - -func (*KillOperationsRequest_Filter_OperationName) isKillOperationsRequest_Filter_Type() {} - -func (*KillOperationsRequest_Filter_SizeClassQueueWithoutWorkers) isKillOperationsRequest_Filter_Type() { -} - -type ListQueuedOperationsRequest_StartAfter struct { - state protoimpl.MessageState `protogen:"open.v1"` - Priority int32 `protobuf:"varint,1,opt,name=priority,proto3" json:"priority,omitempty"` - ExpectedDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=expected_duration,json=expectedDuration,proto3" json:"expected_duration,omitempty"` - QueuedTimestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=queued_timestamp,json=queuedTimestamp,proto3" json:"queued_timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListQueuedOperationsRequest_StartAfter) Reset() { - *x = ListQueuedOperationsRequest_StartAfter{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListQueuedOperationsRequest_StartAfter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListQueuedOperationsRequest_StartAfter) ProtoMessage() {} - -func (x *ListQueuedOperationsRequest_StartAfter) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[33] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListQueuedOperationsRequest_StartAfter.ProtoReflect.Descriptor instead. -func (*ListQueuedOperationsRequest_StartAfter) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{19, 0} -} - -func (x *ListQueuedOperationsRequest_StartAfter) GetPriority() int32 { - if x != nil { - return x.Priority - } - return 0 -} - -func (x *ListQueuedOperationsRequest_StartAfter) GetExpectedDuration() *durationpb.Duration { - if x != nil { - return x.ExpectedDuration - } - return nil -} - -func (x *ListQueuedOperationsRequest_StartAfter) GetQueuedTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.QueuedTimestamp - } - return nil -} - -type ListWorkersRequest_Filter struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Type: - // - // *ListWorkersRequest_Filter_All - // *ListWorkersRequest_Filter_Executing - // *ListWorkersRequest_Filter_IdleSynchronizing - Type isListWorkersRequest_Filter_Type `protobuf_oneof:"type"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListWorkersRequest_Filter) Reset() { - *x = ListWorkersRequest_Filter{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListWorkersRequest_Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWorkersRequest_Filter) ProtoMessage() {} - -func (x *ListWorkersRequest_Filter) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[34] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWorkersRequest_Filter.ProtoReflect.Descriptor instead. -func (*ListWorkersRequest_Filter) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{21, 0} -} - -func (x *ListWorkersRequest_Filter) GetType() isListWorkersRequest_Filter_Type { - if x != nil { - return x.Type - } - return nil -} - -func (x *ListWorkersRequest_Filter) GetAll() *SizeClassQueueName { - if x != nil { - if x, ok := x.Type.(*ListWorkersRequest_Filter_All); ok { - return x.All - } - } - return nil -} - -func (x *ListWorkersRequest_Filter) GetExecuting() *InvocationName { - if x != nil { - if x, ok := x.Type.(*ListWorkersRequest_Filter_Executing); ok { - return x.Executing - } - } - return nil -} - -func (x *ListWorkersRequest_Filter) GetIdleSynchronizing() *InvocationName { - if x != nil { - if x, ok := x.Type.(*ListWorkersRequest_Filter_IdleSynchronizing); ok { - return x.IdleSynchronizing - } - } - return nil -} - -type isListWorkersRequest_Filter_Type interface { - isListWorkersRequest_Filter_Type() -} - -type ListWorkersRequest_Filter_All struct { - All *SizeClassQueueName `protobuf:"bytes,1,opt,name=all,proto3,oneof"` -} - -type ListWorkersRequest_Filter_Executing struct { - Executing *InvocationName `protobuf:"bytes,2,opt,name=executing,proto3,oneof"` -} - -type ListWorkersRequest_Filter_IdleSynchronizing struct { - IdleSynchronizing *InvocationName `protobuf:"bytes,3,opt,name=idle_synchronizing,json=idleSynchronizing,proto3,oneof"` -} - -func (*ListWorkersRequest_Filter_All) isListWorkersRequest_Filter_Type() {} - -func (*ListWorkersRequest_Filter_Executing) isListWorkersRequest_Filter_Type() {} - -func (*ListWorkersRequest_Filter_IdleSynchronizing) isListWorkersRequest_Filter_Type() {} - -type ListWorkersRequest_StartAfter struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkerId map[string]string `protobuf:"bytes,1,rep,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListWorkersRequest_StartAfter) Reset() { - *x = ListWorkersRequest_StartAfter{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListWorkersRequest_StartAfter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWorkersRequest_StartAfter) ProtoMessage() {} - -func (x *ListWorkersRequest_StartAfter) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[35] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWorkersRequest_StartAfter.ProtoReflect.Descriptor instead. -func (*ListWorkersRequest_StartAfter) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP(), []int{21, 1} -} - -func (x *ListWorkersRequest_StartAfter) GetWorkerId() map[string]string { - if x != nil { - return x.WorkerId - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc = "" + - "\n" + - "Xgithub.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestate/buildqueuestate.proto\x12\x19buildbarn.buildqueuestate\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"V\n" + - "\x0ePaginationInfo\x12\x1f\n" + - "\vstart_index\x18\x01 \x01(\rR\n" + - "startIndex\x12#\n" + - "\rtotal_entries\x18\x02 \x01(\rR\ftotalEntries\"\x8c\x01\n" + - "\x11PlatformQueueName\x120\n" + - "\x14instance_name_prefix\x18\x01 \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x02 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\"\x91\x01\n" + - "\x12SizeClassQueueName\x12\\\n" + - "\x13platform_queue_name\x18\x01 \x01(\v2,.buildbarn.buildqueuestate.PlatformQueueNameR\x11platformQueueName\x12\x1d\n" + - "\n" + - "size_class\x18\x02 \x01(\rR\tsizeClass\"\x9a\x01\n" + - "\x0eInvocationName\x12`\n" + - "\x15size_class_queue_name\x18\x01 \x01(\v2-.buildbarn.buildqueuestate.SizeClassQueueNameR\x12sizeClassQueueName\x12&\n" + - "\x03ids\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\x03ids\"\xa7\x06\n" + - "\x0eOperationState\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12R\n" + - "\x0finvocation_name\x18\x02 \x01(\v2).buildbarn.buildqueuestate.InvocationNameR\x0einvocationName\x12F\n" + - "\x11expected_duration\x18\x0e \x01(\v2\x19.google.protobuf.DurationR\x10expectedDuration\x12E\n" + - "\x10queued_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x0fqueuedTimestamp\x12L\n" + - "\raction_digest\x18\x05 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\factionDigest\x124\n" + - "\atimeout\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\atimeout\x120\n" + - "\x06queued\x18\b \x01(\v2\x16.google.protobuf.EmptyH\x00R\x06queued\x126\n" + - "\texecuting\x18\t \x01(\v2\x16.google.protobuf.EmptyH\x00R\texecuting\x12P\n" + - "\tcompleted\x18\n" + - " \x01(\v20.build.bazel.remote.execution.v2.ExecuteResponseH\x00R\tcompleted\x12\x1b\n" + - "\ttarget_id\x18\v \x01(\tR\btargetId\x12\x1a\n" + - "\bpriority\x18\f \x01(\x05R\bpriority\x120\n" + - "\x14instance_name_suffix\x18\r \x01(\tR\x12instanceNameSuffix\x12^\n" + - "\x0fdigest_function\x18\x0f \x01(\x0e25.build.bazel.remote.execution.v2.DigestFunction.ValueR\x0edigestFunctionB\a\n" + - "\x05stageJ\x04\b\x03\x10\x04J\x04\b\x06\x10\a\"\x9f\x02\n" + - "\x13SizeClassQueueState\x12\x1d\n" + - "\n" + - "size_class\x18\x01 \x01(\rR\tsizeClass\x124\n" + - "\atimeout\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\atimeout\x12#\n" + - "\rworkers_count\x18\x05 \x01(\rR\fworkersCount\x12!\n" + - "\fdrains_count\x18\a \x01(\rR\vdrainsCount\x12S\n" + - "\x0froot_invocation\x18\t \x01(\v2*.buildbarn.buildqueuestate.InvocationStateR\x0erootInvocationJ\x04\b\x03\x10\x04J\x04\b\x04\x10\x05J\x04\b\x06\x10\aJ\x04\b\b\x10\t\"\xb2\x01\n" + - "\x12PlatformQueueState\x12@\n" + - "\x04name\x18\x01 \x01(\v2,.buildbarn.buildqueuestate.PlatformQueueNameR\x04name\x12Z\n" + - "\x11size_class_queues\x18\x02 \x03(\v2..buildbarn.buildqueuestate.SizeClassQueueStateR\x0fsizeClassQueues\"\xa2\x04\n" + - "\x0fInvocationState\x12x\n" + - "\x17queued_operations_count\x18\x02 \x01(\v2@.buildbarn.buildqueuestate.InvocationState.InvocationObjectCountR\x15queuedOperationsCount\x126\n" + - "\x17executing_workers_count\x18\x04 \x01(\rR\x15executingWorkersCount\x12,\n" + - "\x12idle_workers_count\x18\x05 \x01(\rR\x10idleWorkersCount\x12G\n" + - " idle_synchronizing_workers_count\x18\x06 \x01(\rR\x1didleSynchronizingWorkersCount\x12%\n" + - "\x0echildren_count\x18\a \x01(\rR\rchildrenCount\x122\n" + - "\x15active_children_count\x18\b \x01(\rR\x13activeChildrenCount\x122\n" + - "\x15queued_children_count\x18\t \x01(\rR\x13queuedChildrenCount\x1aK\n" + - "\x15InvocationObjectCount\x12\x16\n" + - "\x06direct\x18\x01 \x01(\rR\x06direct\x12\x1a\n" + - "\bindirect\x18\x02 \x01(\rR\bindirectJ\x04\b\x01\x10\x02J\x04\b\x03\x10\x04\"~\n" + - "\x14InvocationChildState\x12$\n" + - "\x02id\x18\x01 \x01(\v2\x14.google.protobuf.AnyR\x02id\x12@\n" + - "\x05state\x18\x02 \x01(\v2*.buildbarn.buildqueuestate.InvocationStateR\x05state\"\xac\x02\n" + - "\vWorkerState\x12>\n" + - "\x02id\x18\x01 \x03(\v2..buildbarn.buildqueuestate.WorkerState.IdEntryR\x02id\x124\n" + - "\atimeout\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\atimeout\x12V\n" + - "\x11current_operation\x18\x03 \x01(\v2).buildbarn.buildqueuestate.OperationStateR\x10currentOperation\x12\x18\n" + - "\adrained\x18\x04 \x01(\bR\adrained\x1a5\n" + - "\aIdEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x81\x02\n" + - "\n" + - "DrainState\x12f\n" + - "\x11worker_id_pattern\x18\x01 \x03(\v2:.buildbarn.buildqueuestate.DrainState.WorkerIdPatternEntryR\x0fworkerIdPattern\x12G\n" + - "\x11created_timestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x10createdTimestamp\x1aB\n" + - "\x14WorkerIdPatternEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"<\n" + - "\x13GetOperationRequest\x12%\n" + - "\x0eoperation_name\x18\x01 \x01(\tR\roperationName\"_\n" + - "\x14GetOperationResponse\x12G\n" + - "\toperation\x18\x01 \x01(\v2).buildbarn.buildqueuestate.OperationStateR\toperation\"\xe9\x02\n" + - "\x15ListOperationsRequest\x12\x1b\n" + - "\tpage_size\x18\x01 \x01(\rR\bpageSize\x12\\\n" + - "\vstart_after\x18\x02 \x01(\v2;.buildbarn.buildqueuestate.ListOperationsRequest.StartAfterR\n" + - "startAfter\x12F\n" + - "\x14filter_invocation_id\x18\x03 \x01(\v2\x14.google.protobuf.AnyR\x12filterInvocationId\x12X\n" + - "\ffilter_stage\x18\x04 \x01(\x0e25.build.bazel.remote.execution.v2.ExecutionStage.ValueR\vfilterStage\x1a3\n" + - "\n" + - "StartAfter\x12%\n" + - "\x0eoperation_name\x18\x01 \x01(\tR\roperationName\"\xb7\x01\n" + - "\x16ListOperationsResponse\x12I\n" + - "\n" + - "operations\x18\x01 \x03(\v2).buildbarn.buildqueuestate.OperationStateR\n" + - "operations\x12R\n" + - "\x0fpagination_info\x18\x02 \x01(\v2).buildbarn.buildqueuestate.PaginationInfoR\x0epaginationInfo\"\xc9\x02\n" + - "\x15KillOperationsRequest\x12O\n" + - "\x06filter\x18\x01 \x01(\v27.buildbarn.buildqueuestate.KillOperationsRequest.FilterR\x06filter\x12*\n" + - "\x06status\x18\x02 \x01(\v2\x12.google.rpc.StatusR\x06status\x1a\xb2\x01\n" + - "\x06Filter\x12'\n" + - "\x0eoperation_name\x18\x01 \x01(\tH\x00R\roperationName\x12w\n" + - " size_class_queue_without_workers\x18\x02 \x01(\v2-.buildbarn.buildqueuestate.SizeClassQueueNameH\x00R\x1csizeClassQueueWithoutWorkersB\x06\n" + - "\x04type\"t\n" + - "\x1aListPlatformQueuesResponse\x12V\n" + - "\x0fplatform_queues\x18\x01 \x03(\v2-.buildbarn.buildqueuestate.PlatformQueueStateR\x0eplatformQueues\"\xf7\x01\n" + - "\x1dListInvocationChildrenRequest\x12R\n" + - "\x0finvocation_name\x18\x01 \x01(\v2).buildbarn.buildqueuestate.InvocationNameR\x0einvocationName\x12W\n" + - "\x06filter\x18\x02 \x01(\x0e2?.buildbarn.buildqueuestate.ListInvocationChildrenRequest.FilterR\x06filter\")\n" + - "\x06Filter\x12\a\n" + - "\x03ALL\x10\x00\x12\n" + - "\n" + - "\x06ACTIVE\x10\x01\x12\n" + - "\n" + - "\x06QUEUED\x10\x02\"m\n" + - "\x1eListInvocationChildrenResponse\x12K\n" + - "\bchildren\x18\x01 \x03(\v2/.buildbarn.buildqueuestate.InvocationChildStateR\bchildren\"\xb2\x03\n" + - "\x1bListQueuedOperationsRequest\x12R\n" + - "\x0finvocation_name\x18\x01 \x01(\v2).buildbarn.buildqueuestate.InvocationNameR\x0einvocationName\x12\x1b\n" + - "\tpage_size\x18\x03 \x01(\rR\bpageSize\x12b\n" + - "\vstart_after\x18\x04 \x01(\v2A.buildbarn.buildqueuestate.ListQueuedOperationsRequest.StartAfterR\n" + - "startAfter\x1a\xb7\x01\n" + - "\n" + - "StartAfter\x12\x1a\n" + - "\bpriority\x18\x01 \x01(\x05R\bpriority\x12F\n" + - "\x11expected_duration\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x10expectedDuration\x12E\n" + - "\x10queued_timestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x0fqueuedTimestampJ\x04\b\x02\x10\x03\"\xca\x01\n" + - "\x1cListQueuedOperationsResponse\x12V\n" + - "\x11queued_operations\x18\x01 \x03(\v2).buildbarn.buildqueuestate.OperationStateR\x10queuedOperations\x12R\n" + - "\x0fpagination_info\x18\x02 \x01(\v2).buildbarn.buildqueuestate.PaginationInfoR\x0epaginationInfo\"\x88\x05\n" + - "\x12ListWorkersRequest\x12L\n" + - "\x06filter\x18\x01 \x01(\v24.buildbarn.buildqueuestate.ListWorkersRequest.FilterR\x06filter\x12\x1b\n" + - "\tpage_size\x18\x03 \x01(\rR\bpageSize\x12Y\n" + - "\vstart_after\x18\x04 \x01(\v28.buildbarn.buildqueuestate.ListWorkersRequest.StartAfterR\n" + - "startAfter\x1a\xfa\x01\n" + - "\x06Filter\x12A\n" + - "\x03all\x18\x01 \x01(\v2-.buildbarn.buildqueuestate.SizeClassQueueNameH\x00R\x03all\x12I\n" + - "\texecuting\x18\x02 \x01(\v2).buildbarn.buildqueuestate.InvocationNameH\x00R\texecuting\x12Z\n" + - "\x12idle_synchronizing\x18\x03 \x01(\v2).buildbarn.buildqueuestate.InvocationNameH\x00R\x11idleSynchronizingB\x06\n" + - "\x04type\x1a\xae\x01\n" + - "\n" + - "StartAfter\x12c\n" + - "\tworker_id\x18\x01 \x03(\v2F.buildbarn.buildqueuestate.ListWorkersRequest.StartAfter.WorkerIdEntryR\bworkerId\x1a;\n" + - "\rWorkerIdEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xab\x01\n" + - "\x13ListWorkersResponse\x12@\n" + - "\aworkers\x18\x01 \x03(\v2&.buildbarn.buildqueuestate.WorkerStateR\aworkers\x12R\n" + - "\x0fpagination_info\x18\x02 \x01(\v2).buildbarn.buildqueuestate.PaginationInfoR\x0epaginationInfo\"\xd2\x01\n" + - "\x17TerminateWorkersRequest\x12s\n" + - "\x11worker_id_pattern\x18\x01 \x03(\v2G.buildbarn.buildqueuestate.TerminateWorkersRequest.WorkerIdPatternEntryR\x0fworkerIdPattern\x1aB\n" + - "\x14WorkerIdPatternEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"u\n" + - "\x11ListDrainsRequest\x12`\n" + - "\x15size_class_queue_name\x18\x01 \x01(\v2-.buildbarn.buildqueuestate.SizeClassQueueNameR\x12sizeClassQueueName\"S\n" + - "\x12ListDrainsResponse\x12=\n" + - "\x06drains\x18\x01 \x03(\v2%.buildbarn.buildqueuestate.DrainStateR\x06drains\"\xb4\x02\n" + - "\x17AddOrRemoveDrainRequest\x12`\n" + - "\x15size_class_queue_name\x18\x01 \x01(\v2-.buildbarn.buildqueuestate.SizeClassQueueNameR\x12sizeClassQueueName\x12s\n" + - "\x11worker_id_pattern\x18\x02 \x03(\v2G.buildbarn.buildqueuestate.AddOrRemoveDrainRequest.WorkerIdPatternEntryR\x0fworkerIdPattern\x1aB\n" + - "\x14WorkerIdPatternEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x14\n" + - "\x12BackgroundLearning2\xc0\t\n" + - "\x0fBuildQueueState\x12o\n" + - "\fGetOperation\x12..buildbarn.buildqueuestate.GetOperationRequest\x1a/.buildbarn.buildqueuestate.GetOperationResponse\x12u\n" + - "\x0eListOperations\x120.buildbarn.buildqueuestate.ListOperationsRequest\x1a1.buildbarn.buildqueuestate.ListOperationsResponse\x12Z\n" + - "\x0eKillOperations\x120.buildbarn.buildqueuestate.KillOperationsRequest\x1a\x16.google.protobuf.Empty\x12c\n" + - "\x12ListPlatformQueues\x12\x16.google.protobuf.Empty\x1a5.buildbarn.buildqueuestate.ListPlatformQueuesResponse\x12\x8d\x01\n" + - "\x16ListInvocationChildren\x128.buildbarn.buildqueuestate.ListInvocationChildrenRequest\x1a9.buildbarn.buildqueuestate.ListInvocationChildrenResponse\x12\x87\x01\n" + - "\x14ListQueuedOperations\x126.buildbarn.buildqueuestate.ListQueuedOperationsRequest\x1a7.buildbarn.buildqueuestate.ListQueuedOperationsResponse\x12l\n" + - "\vListWorkers\x12-.buildbarn.buildqueuestate.ListWorkersRequest\x1a..buildbarn.buildqueuestate.ListWorkersResponse\x12^\n" + - "\x10TerminateWorkers\x122.buildbarn.buildqueuestate.TerminateWorkersRequest\x1a\x16.google.protobuf.Empty\x12i\n" + - "\n" + - "ListDrains\x12,.buildbarn.buildqueuestate.ListDrainsRequest\x1a-.buildbarn.buildqueuestate.ListDrainsResponse\x12V\n" + - "\bAddDrain\x122.buildbarn.buildqueuestate.AddOrRemoveDrainRequest\x1a\x16.google.protobuf.Empty\x12Y\n" + - "\vRemoveDrain\x122.buildbarn.buildqueuestate.AddOrRemoveDrainRequest\x1a\x16.google.protobuf.EmptyBDZBgithub.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestateb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes = make([]protoimpl.MessageInfo, 39) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_goTypes = []any{ - (ListInvocationChildrenRequest_Filter)(0), // 0: buildbarn.buildqueuestate.ListInvocationChildrenRequest.Filter - (*PaginationInfo)(nil), // 1: buildbarn.buildqueuestate.PaginationInfo - (*PlatformQueueName)(nil), // 2: buildbarn.buildqueuestate.PlatformQueueName - (*SizeClassQueueName)(nil), // 3: buildbarn.buildqueuestate.SizeClassQueueName - (*InvocationName)(nil), // 4: buildbarn.buildqueuestate.InvocationName - (*OperationState)(nil), // 5: buildbarn.buildqueuestate.OperationState - (*SizeClassQueueState)(nil), // 6: buildbarn.buildqueuestate.SizeClassQueueState - (*PlatformQueueState)(nil), // 7: buildbarn.buildqueuestate.PlatformQueueState - (*InvocationState)(nil), // 8: buildbarn.buildqueuestate.InvocationState - (*InvocationChildState)(nil), // 9: buildbarn.buildqueuestate.InvocationChildState - (*WorkerState)(nil), // 10: buildbarn.buildqueuestate.WorkerState - (*DrainState)(nil), // 11: buildbarn.buildqueuestate.DrainState - (*GetOperationRequest)(nil), // 12: buildbarn.buildqueuestate.GetOperationRequest - (*GetOperationResponse)(nil), // 13: buildbarn.buildqueuestate.GetOperationResponse - (*ListOperationsRequest)(nil), // 14: buildbarn.buildqueuestate.ListOperationsRequest - (*ListOperationsResponse)(nil), // 15: buildbarn.buildqueuestate.ListOperationsResponse - (*KillOperationsRequest)(nil), // 16: buildbarn.buildqueuestate.KillOperationsRequest - (*ListPlatformQueuesResponse)(nil), // 17: buildbarn.buildqueuestate.ListPlatformQueuesResponse - (*ListInvocationChildrenRequest)(nil), // 18: buildbarn.buildqueuestate.ListInvocationChildrenRequest - (*ListInvocationChildrenResponse)(nil), // 19: buildbarn.buildqueuestate.ListInvocationChildrenResponse - (*ListQueuedOperationsRequest)(nil), // 20: buildbarn.buildqueuestate.ListQueuedOperationsRequest - (*ListQueuedOperationsResponse)(nil), // 21: buildbarn.buildqueuestate.ListQueuedOperationsResponse - (*ListWorkersRequest)(nil), // 22: buildbarn.buildqueuestate.ListWorkersRequest - (*ListWorkersResponse)(nil), // 23: buildbarn.buildqueuestate.ListWorkersResponse - (*TerminateWorkersRequest)(nil), // 24: buildbarn.buildqueuestate.TerminateWorkersRequest - (*ListDrainsRequest)(nil), // 25: buildbarn.buildqueuestate.ListDrainsRequest - (*ListDrainsResponse)(nil), // 26: buildbarn.buildqueuestate.ListDrainsResponse - (*AddOrRemoveDrainRequest)(nil), // 27: buildbarn.buildqueuestate.AddOrRemoveDrainRequest - (*BackgroundLearning)(nil), // 28: buildbarn.buildqueuestate.BackgroundLearning - (*InvocationState_InvocationObjectCount)(nil), // 29: buildbarn.buildqueuestate.InvocationState.InvocationObjectCount - nil, // 30: buildbarn.buildqueuestate.WorkerState.IdEntry - nil, // 31: buildbarn.buildqueuestate.DrainState.WorkerIdPatternEntry - (*ListOperationsRequest_StartAfter)(nil), // 32: buildbarn.buildqueuestate.ListOperationsRequest.StartAfter - (*KillOperationsRequest_Filter)(nil), // 33: buildbarn.buildqueuestate.KillOperationsRequest.Filter - (*ListQueuedOperationsRequest_StartAfter)(nil), // 34: buildbarn.buildqueuestate.ListQueuedOperationsRequest.StartAfter - (*ListWorkersRequest_Filter)(nil), // 35: buildbarn.buildqueuestate.ListWorkersRequest.Filter - (*ListWorkersRequest_StartAfter)(nil), // 36: buildbarn.buildqueuestate.ListWorkersRequest.StartAfter - nil, // 37: buildbarn.buildqueuestate.ListWorkersRequest.StartAfter.WorkerIdEntry - nil, // 38: buildbarn.buildqueuestate.TerminateWorkersRequest.WorkerIdPatternEntry - nil, // 39: buildbarn.buildqueuestate.AddOrRemoveDrainRequest.WorkerIdPatternEntry - (*v2.Platform)(nil), // 40: build.bazel.remote.execution.v2.Platform - (*anypb.Any)(nil), // 41: google.protobuf.Any - (*durationpb.Duration)(nil), // 42: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 43: google.protobuf.Timestamp - (*v2.Digest)(nil), // 44: build.bazel.remote.execution.v2.Digest - (*emptypb.Empty)(nil), // 45: google.protobuf.Empty - (*v2.ExecuteResponse)(nil), // 46: build.bazel.remote.execution.v2.ExecuteResponse - (v2.DigestFunction_Value)(0), // 47: build.bazel.remote.execution.v2.DigestFunction.Value - (v2.ExecutionStage_Value)(0), // 48: build.bazel.remote.execution.v2.ExecutionStage.Value - (*status.Status)(nil), // 49: google.rpc.Status -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_depIdxs = []int32{ - 40, // 0: buildbarn.buildqueuestate.PlatformQueueName.platform:type_name -> build.bazel.remote.execution.v2.Platform - 2, // 1: buildbarn.buildqueuestate.SizeClassQueueName.platform_queue_name:type_name -> buildbarn.buildqueuestate.PlatformQueueName - 3, // 2: buildbarn.buildqueuestate.InvocationName.size_class_queue_name:type_name -> buildbarn.buildqueuestate.SizeClassQueueName - 41, // 3: buildbarn.buildqueuestate.InvocationName.ids:type_name -> google.protobuf.Any - 4, // 4: buildbarn.buildqueuestate.OperationState.invocation_name:type_name -> buildbarn.buildqueuestate.InvocationName - 42, // 5: buildbarn.buildqueuestate.OperationState.expected_duration:type_name -> google.protobuf.Duration - 43, // 6: buildbarn.buildqueuestate.OperationState.queued_timestamp:type_name -> google.protobuf.Timestamp - 44, // 7: buildbarn.buildqueuestate.OperationState.action_digest:type_name -> build.bazel.remote.execution.v2.Digest - 43, // 8: buildbarn.buildqueuestate.OperationState.timeout:type_name -> google.protobuf.Timestamp - 45, // 9: buildbarn.buildqueuestate.OperationState.queued:type_name -> google.protobuf.Empty - 45, // 10: buildbarn.buildqueuestate.OperationState.executing:type_name -> google.protobuf.Empty - 46, // 11: buildbarn.buildqueuestate.OperationState.completed:type_name -> build.bazel.remote.execution.v2.ExecuteResponse - 47, // 12: buildbarn.buildqueuestate.OperationState.digest_function:type_name -> build.bazel.remote.execution.v2.DigestFunction.Value - 43, // 13: buildbarn.buildqueuestate.SizeClassQueueState.timeout:type_name -> google.protobuf.Timestamp - 8, // 14: buildbarn.buildqueuestate.SizeClassQueueState.root_invocation:type_name -> buildbarn.buildqueuestate.InvocationState - 2, // 15: buildbarn.buildqueuestate.PlatformQueueState.name:type_name -> buildbarn.buildqueuestate.PlatformQueueName - 6, // 16: buildbarn.buildqueuestate.PlatformQueueState.size_class_queues:type_name -> buildbarn.buildqueuestate.SizeClassQueueState - 29, // 17: buildbarn.buildqueuestate.InvocationState.queued_operations_count:type_name -> buildbarn.buildqueuestate.InvocationState.InvocationObjectCount - 41, // 18: buildbarn.buildqueuestate.InvocationChildState.id:type_name -> google.protobuf.Any - 8, // 19: buildbarn.buildqueuestate.InvocationChildState.state:type_name -> buildbarn.buildqueuestate.InvocationState - 30, // 20: buildbarn.buildqueuestate.WorkerState.id:type_name -> buildbarn.buildqueuestate.WorkerState.IdEntry - 43, // 21: buildbarn.buildqueuestate.WorkerState.timeout:type_name -> google.protobuf.Timestamp - 5, // 22: buildbarn.buildqueuestate.WorkerState.current_operation:type_name -> buildbarn.buildqueuestate.OperationState - 31, // 23: buildbarn.buildqueuestate.DrainState.worker_id_pattern:type_name -> buildbarn.buildqueuestate.DrainState.WorkerIdPatternEntry - 43, // 24: buildbarn.buildqueuestate.DrainState.created_timestamp:type_name -> google.protobuf.Timestamp - 5, // 25: buildbarn.buildqueuestate.GetOperationResponse.operation:type_name -> buildbarn.buildqueuestate.OperationState - 32, // 26: buildbarn.buildqueuestate.ListOperationsRequest.start_after:type_name -> buildbarn.buildqueuestate.ListOperationsRequest.StartAfter - 41, // 27: buildbarn.buildqueuestate.ListOperationsRequest.filter_invocation_id:type_name -> google.protobuf.Any - 48, // 28: buildbarn.buildqueuestate.ListOperationsRequest.filter_stage:type_name -> build.bazel.remote.execution.v2.ExecutionStage.Value - 5, // 29: buildbarn.buildqueuestate.ListOperationsResponse.operations:type_name -> buildbarn.buildqueuestate.OperationState - 1, // 30: buildbarn.buildqueuestate.ListOperationsResponse.pagination_info:type_name -> buildbarn.buildqueuestate.PaginationInfo - 33, // 31: buildbarn.buildqueuestate.KillOperationsRequest.filter:type_name -> buildbarn.buildqueuestate.KillOperationsRequest.Filter - 49, // 32: buildbarn.buildqueuestate.KillOperationsRequest.status:type_name -> google.rpc.Status - 7, // 33: buildbarn.buildqueuestate.ListPlatformQueuesResponse.platform_queues:type_name -> buildbarn.buildqueuestate.PlatformQueueState - 4, // 34: buildbarn.buildqueuestate.ListInvocationChildrenRequest.invocation_name:type_name -> buildbarn.buildqueuestate.InvocationName - 0, // 35: buildbarn.buildqueuestate.ListInvocationChildrenRequest.filter:type_name -> buildbarn.buildqueuestate.ListInvocationChildrenRequest.Filter - 9, // 36: buildbarn.buildqueuestate.ListInvocationChildrenResponse.children:type_name -> buildbarn.buildqueuestate.InvocationChildState - 4, // 37: buildbarn.buildqueuestate.ListQueuedOperationsRequest.invocation_name:type_name -> buildbarn.buildqueuestate.InvocationName - 34, // 38: buildbarn.buildqueuestate.ListQueuedOperationsRequest.start_after:type_name -> buildbarn.buildqueuestate.ListQueuedOperationsRequest.StartAfter - 5, // 39: buildbarn.buildqueuestate.ListQueuedOperationsResponse.queued_operations:type_name -> buildbarn.buildqueuestate.OperationState - 1, // 40: buildbarn.buildqueuestate.ListQueuedOperationsResponse.pagination_info:type_name -> buildbarn.buildqueuestate.PaginationInfo - 35, // 41: buildbarn.buildqueuestate.ListWorkersRequest.filter:type_name -> buildbarn.buildqueuestate.ListWorkersRequest.Filter - 36, // 42: buildbarn.buildqueuestate.ListWorkersRequest.start_after:type_name -> buildbarn.buildqueuestate.ListWorkersRequest.StartAfter - 10, // 43: buildbarn.buildqueuestate.ListWorkersResponse.workers:type_name -> buildbarn.buildqueuestate.WorkerState - 1, // 44: buildbarn.buildqueuestate.ListWorkersResponse.pagination_info:type_name -> buildbarn.buildqueuestate.PaginationInfo - 38, // 45: buildbarn.buildqueuestate.TerminateWorkersRequest.worker_id_pattern:type_name -> buildbarn.buildqueuestate.TerminateWorkersRequest.WorkerIdPatternEntry - 3, // 46: buildbarn.buildqueuestate.ListDrainsRequest.size_class_queue_name:type_name -> buildbarn.buildqueuestate.SizeClassQueueName - 11, // 47: buildbarn.buildqueuestate.ListDrainsResponse.drains:type_name -> buildbarn.buildqueuestate.DrainState - 3, // 48: buildbarn.buildqueuestate.AddOrRemoveDrainRequest.size_class_queue_name:type_name -> buildbarn.buildqueuestate.SizeClassQueueName - 39, // 49: buildbarn.buildqueuestate.AddOrRemoveDrainRequest.worker_id_pattern:type_name -> buildbarn.buildqueuestate.AddOrRemoveDrainRequest.WorkerIdPatternEntry - 3, // 50: buildbarn.buildqueuestate.KillOperationsRequest.Filter.size_class_queue_without_workers:type_name -> buildbarn.buildqueuestate.SizeClassQueueName - 42, // 51: buildbarn.buildqueuestate.ListQueuedOperationsRequest.StartAfter.expected_duration:type_name -> google.protobuf.Duration - 43, // 52: buildbarn.buildqueuestate.ListQueuedOperationsRequest.StartAfter.queued_timestamp:type_name -> google.protobuf.Timestamp - 3, // 53: buildbarn.buildqueuestate.ListWorkersRequest.Filter.all:type_name -> buildbarn.buildqueuestate.SizeClassQueueName - 4, // 54: buildbarn.buildqueuestate.ListWorkersRequest.Filter.executing:type_name -> buildbarn.buildqueuestate.InvocationName - 4, // 55: buildbarn.buildqueuestate.ListWorkersRequest.Filter.idle_synchronizing:type_name -> buildbarn.buildqueuestate.InvocationName - 37, // 56: buildbarn.buildqueuestate.ListWorkersRequest.StartAfter.worker_id:type_name -> buildbarn.buildqueuestate.ListWorkersRequest.StartAfter.WorkerIdEntry - 12, // 57: buildbarn.buildqueuestate.BuildQueueState.GetOperation:input_type -> buildbarn.buildqueuestate.GetOperationRequest - 14, // 58: buildbarn.buildqueuestate.BuildQueueState.ListOperations:input_type -> buildbarn.buildqueuestate.ListOperationsRequest - 16, // 59: buildbarn.buildqueuestate.BuildQueueState.KillOperations:input_type -> buildbarn.buildqueuestate.KillOperationsRequest - 45, // 60: buildbarn.buildqueuestate.BuildQueueState.ListPlatformQueues:input_type -> google.protobuf.Empty - 18, // 61: buildbarn.buildqueuestate.BuildQueueState.ListInvocationChildren:input_type -> buildbarn.buildqueuestate.ListInvocationChildrenRequest - 20, // 62: buildbarn.buildqueuestate.BuildQueueState.ListQueuedOperations:input_type -> buildbarn.buildqueuestate.ListQueuedOperationsRequest - 22, // 63: buildbarn.buildqueuestate.BuildQueueState.ListWorkers:input_type -> buildbarn.buildqueuestate.ListWorkersRequest - 24, // 64: buildbarn.buildqueuestate.BuildQueueState.TerminateWorkers:input_type -> buildbarn.buildqueuestate.TerminateWorkersRequest - 25, // 65: buildbarn.buildqueuestate.BuildQueueState.ListDrains:input_type -> buildbarn.buildqueuestate.ListDrainsRequest - 27, // 66: buildbarn.buildqueuestate.BuildQueueState.AddDrain:input_type -> buildbarn.buildqueuestate.AddOrRemoveDrainRequest - 27, // 67: buildbarn.buildqueuestate.BuildQueueState.RemoveDrain:input_type -> buildbarn.buildqueuestate.AddOrRemoveDrainRequest - 13, // 68: buildbarn.buildqueuestate.BuildQueueState.GetOperation:output_type -> buildbarn.buildqueuestate.GetOperationResponse - 15, // 69: buildbarn.buildqueuestate.BuildQueueState.ListOperations:output_type -> buildbarn.buildqueuestate.ListOperationsResponse - 45, // 70: buildbarn.buildqueuestate.BuildQueueState.KillOperations:output_type -> google.protobuf.Empty - 17, // 71: buildbarn.buildqueuestate.BuildQueueState.ListPlatformQueues:output_type -> buildbarn.buildqueuestate.ListPlatformQueuesResponse - 19, // 72: buildbarn.buildqueuestate.BuildQueueState.ListInvocationChildren:output_type -> buildbarn.buildqueuestate.ListInvocationChildrenResponse - 21, // 73: buildbarn.buildqueuestate.BuildQueueState.ListQueuedOperations:output_type -> buildbarn.buildqueuestate.ListQueuedOperationsResponse - 23, // 74: buildbarn.buildqueuestate.BuildQueueState.ListWorkers:output_type -> buildbarn.buildqueuestate.ListWorkersResponse - 45, // 75: buildbarn.buildqueuestate.BuildQueueState.TerminateWorkers:output_type -> google.protobuf.Empty - 26, // 76: buildbarn.buildqueuestate.BuildQueueState.ListDrains:output_type -> buildbarn.buildqueuestate.ListDrainsResponse - 45, // 77: buildbarn.buildqueuestate.BuildQueueState.AddDrain:output_type -> google.protobuf.Empty - 45, // 78: buildbarn.buildqueuestate.BuildQueueState.RemoveDrain:output_type -> google.protobuf.Empty - 68, // [68:79] is the sub-list for method output_type - 57, // [57:68] is the sub-list for method input_type - 57, // [57:57] is the sub-list for extension type_name - 57, // [57:57] is the sub-list for extension extendee - 0, // [0:57] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[4].OneofWrappers = []any{ - (*OperationState_Queued)(nil), - (*OperationState_Executing)(nil), - (*OperationState_Completed)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[32].OneofWrappers = []any{ - (*KillOperationsRequest_Filter_OperationName)(nil), - (*KillOperationsRequest_Filter_SizeClassQueueWithoutWorkers)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes[34].OneofWrappers = []any{ - (*ListWorkersRequest_Filter_All)(nil), - (*ListWorkersRequest_Filter_Executing)(nil), - (*ListWorkersRequest_Filter_IdleSynchronizing)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_rawDesc)), - NumEnums: 1, - NumMessages: 39, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_depIdxs, - EnumInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_enumTypes, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_buildqueuestate_buildqueuestate_proto_depIdxs = nil -} diff --git a/pkg/proto/buildqueuestate/buildqueuestate_grpc.pb.go b/pkg/proto/buildqueuestate/buildqueuestate_grpc.pb.go deleted file mode 100644 index 5a950a79..00000000 --- a/pkg/proto/buildqueuestate/buildqueuestate_grpc.pb.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestate/buildqueuestate.proto - -package buildqueuestate - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - BuildQueueState_GetOperation_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/GetOperation" - BuildQueueState_ListOperations_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListOperations" - BuildQueueState_KillOperations_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/KillOperations" - BuildQueueState_ListPlatformQueues_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListPlatformQueues" - BuildQueueState_ListInvocationChildren_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListInvocationChildren" - BuildQueueState_ListQueuedOperations_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListQueuedOperations" - BuildQueueState_ListWorkers_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListWorkers" - BuildQueueState_TerminateWorkers_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/TerminateWorkers" - BuildQueueState_ListDrains_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/ListDrains" - BuildQueueState_AddDrain_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/AddDrain" - BuildQueueState_RemoveDrain_FullMethodName = "/buildbarn.buildqueuestate.BuildQueueState/RemoveDrain" -) - -// BuildQueueStateClient is the client API for BuildQueueState service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BuildQueueStateClient interface { - GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*GetOperationResponse, error) - ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) - KillOperations(ctx context.Context, in *KillOperationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ListPlatformQueues(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListPlatformQueuesResponse, error) - ListInvocationChildren(ctx context.Context, in *ListInvocationChildrenRequest, opts ...grpc.CallOption) (*ListInvocationChildrenResponse, error) - ListQueuedOperations(ctx context.Context, in *ListQueuedOperationsRequest, opts ...grpc.CallOption) (*ListQueuedOperationsResponse, error) - ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) - TerminateWorkers(ctx context.Context, in *TerminateWorkersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - ListDrains(ctx context.Context, in *ListDrainsRequest, opts ...grpc.CallOption) (*ListDrainsResponse, error) - AddDrain(ctx context.Context, in *AddOrRemoveDrainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - RemoveDrain(ctx context.Context, in *AddOrRemoveDrainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type buildQueueStateClient struct { - cc grpc.ClientConnInterface -} - -func NewBuildQueueStateClient(cc grpc.ClientConnInterface) BuildQueueStateClient { - return &buildQueueStateClient{cc} -} - -func (c *buildQueueStateClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*GetOperationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetOperationResponse) - err := c.cc.Invoke(ctx, BuildQueueState_GetOperation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListOperationsResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListOperations_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) KillOperations(ctx context.Context, in *KillOperationsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, BuildQueueState_KillOperations_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListPlatformQueues(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListPlatformQueuesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListPlatformQueuesResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListPlatformQueues_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListInvocationChildren(ctx context.Context, in *ListInvocationChildrenRequest, opts ...grpc.CallOption) (*ListInvocationChildrenResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListInvocationChildrenResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListInvocationChildren_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListQueuedOperations(ctx context.Context, in *ListQueuedOperationsRequest, opts ...grpc.CallOption) (*ListQueuedOperationsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListQueuedOperationsResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListQueuedOperations_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListWorkers(ctx context.Context, in *ListWorkersRequest, opts ...grpc.CallOption) (*ListWorkersResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListWorkersResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListWorkers_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) TerminateWorkers(ctx context.Context, in *TerminateWorkersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, BuildQueueState_TerminateWorkers_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) ListDrains(ctx context.Context, in *ListDrainsRequest, opts ...grpc.CallOption) (*ListDrainsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListDrainsResponse) - err := c.cc.Invoke(ctx, BuildQueueState_ListDrains_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) AddDrain(ctx context.Context, in *AddOrRemoveDrainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, BuildQueueState_AddDrain_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *buildQueueStateClient) RemoveDrain(ctx context.Context, in *AddOrRemoveDrainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, BuildQueueState_RemoveDrain_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BuildQueueStateServer is the server API for BuildQueueState service. -// All implementations should embed UnimplementedBuildQueueStateServer -// for forward compatibility. -type BuildQueueStateServer interface { - GetOperation(context.Context, *GetOperationRequest) (*GetOperationResponse, error) - ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) - KillOperations(context.Context, *KillOperationsRequest) (*emptypb.Empty, error) - ListPlatformQueues(context.Context, *emptypb.Empty) (*ListPlatformQueuesResponse, error) - ListInvocationChildren(context.Context, *ListInvocationChildrenRequest) (*ListInvocationChildrenResponse, error) - ListQueuedOperations(context.Context, *ListQueuedOperationsRequest) (*ListQueuedOperationsResponse, error) - ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) - TerminateWorkers(context.Context, *TerminateWorkersRequest) (*emptypb.Empty, error) - ListDrains(context.Context, *ListDrainsRequest) (*ListDrainsResponse, error) - AddDrain(context.Context, *AddOrRemoveDrainRequest) (*emptypb.Empty, error) - RemoveDrain(context.Context, *AddOrRemoveDrainRequest) (*emptypb.Empty, error) -} - -// UnimplementedBuildQueueStateServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBuildQueueStateServer struct{} - -func (UnimplementedBuildQueueStateServer) GetOperation(context.Context, *GetOperationRequest) (*GetOperationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOperation not implemented") -} -func (UnimplementedBuildQueueStateServer) ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented") -} -func (UnimplementedBuildQueueStateServer) KillOperations(context.Context, *KillOperationsRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method KillOperations not implemented") -} -func (UnimplementedBuildQueueStateServer) ListPlatformQueues(context.Context, *emptypb.Empty) (*ListPlatformQueuesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPlatformQueues not implemented") -} -func (UnimplementedBuildQueueStateServer) ListInvocationChildren(context.Context, *ListInvocationChildrenRequest) (*ListInvocationChildrenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListInvocationChildren not implemented") -} -func (UnimplementedBuildQueueStateServer) ListQueuedOperations(context.Context, *ListQueuedOperationsRequest) (*ListQueuedOperationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListQueuedOperations not implemented") -} -func (UnimplementedBuildQueueStateServer) ListWorkers(context.Context, *ListWorkersRequest) (*ListWorkersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListWorkers not implemented") -} -func (UnimplementedBuildQueueStateServer) TerminateWorkers(context.Context, *TerminateWorkersRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method TerminateWorkers not implemented") -} -func (UnimplementedBuildQueueStateServer) ListDrains(context.Context, *ListDrainsRequest) (*ListDrainsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListDrains not implemented") -} -func (UnimplementedBuildQueueStateServer) AddDrain(context.Context, *AddOrRemoveDrainRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddDrain not implemented") -} -func (UnimplementedBuildQueueStateServer) RemoveDrain(context.Context, *AddOrRemoveDrainRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveDrain not implemented") -} -func (UnimplementedBuildQueueStateServer) testEmbeddedByValue() {} - -// UnsafeBuildQueueStateServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BuildQueueStateServer will -// result in compilation errors. -type UnsafeBuildQueueStateServer interface { - mustEmbedUnimplementedBuildQueueStateServer() -} - -func RegisterBuildQueueStateServer(s grpc.ServiceRegistrar, srv BuildQueueStateServer) { - // If the following call pancis, it indicates UnimplementedBuildQueueStateServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BuildQueueState_ServiceDesc, srv) -} - -func _BuildQueueState_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).GetOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_GetOperation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).GetOperation(ctx, req.(*GetOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListOperations_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListOperations(ctx, req.(*ListOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_KillOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KillOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).KillOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_KillOperations_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).KillOperations(ctx, req.(*KillOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListPlatformQueues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListPlatformQueues(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListPlatformQueues_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListPlatformQueues(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListInvocationChildren_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListInvocationChildrenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListInvocationChildren(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListInvocationChildren_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListInvocationChildren(ctx, req.(*ListInvocationChildrenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListQueuedOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListQueuedOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListQueuedOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListQueuedOperations_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListQueuedOperations(ctx, req.(*ListQueuedOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListWorkers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListWorkersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListWorkers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListWorkers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListWorkers(ctx, req.(*ListWorkersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_TerminateWorkers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TerminateWorkersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).TerminateWorkers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_TerminateWorkers_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).TerminateWorkers(ctx, req.(*TerminateWorkersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_ListDrains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListDrainsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).ListDrains(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_ListDrains_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).ListDrains(ctx, req.(*ListDrainsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_AddDrain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddOrRemoveDrainRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).AddDrain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_AddDrain_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).AddDrain(ctx, req.(*AddOrRemoveDrainRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BuildQueueState_RemoveDrain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddOrRemoveDrainRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BuildQueueStateServer).RemoveDrain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BuildQueueState_RemoveDrain_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BuildQueueStateServer).RemoveDrain(ctx, req.(*AddOrRemoveDrainRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BuildQueueState_ServiceDesc is the grpc.ServiceDesc for BuildQueueState service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BuildQueueState_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.buildqueuestate.BuildQueueState", - HandlerType: (*BuildQueueStateServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetOperation", - Handler: _BuildQueueState_GetOperation_Handler, - }, - { - MethodName: "ListOperations", - Handler: _BuildQueueState_ListOperations_Handler, - }, - { - MethodName: "KillOperations", - Handler: _BuildQueueState_KillOperations_Handler, - }, - { - MethodName: "ListPlatformQueues", - Handler: _BuildQueueState_ListPlatformQueues_Handler, - }, - { - MethodName: "ListInvocationChildren", - Handler: _BuildQueueState_ListInvocationChildren_Handler, - }, - { - MethodName: "ListQueuedOperations", - Handler: _BuildQueueState_ListQueuedOperations_Handler, - }, - { - MethodName: "ListWorkers", - Handler: _BuildQueueState_ListWorkers_Handler, - }, - { - MethodName: "TerminateWorkers", - Handler: _BuildQueueState_TerminateWorkers_Handler, - }, - { - MethodName: "ListDrains", - Handler: _BuildQueueState_ListDrains_Handler, - }, - { - MethodName: "AddDrain", - Handler: _BuildQueueState_AddDrain_Handler, - }, - { - MethodName: "RemoveDrain", - Handler: _BuildQueueState_RemoveDrain_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/buildqueuestate/buildqueuestate.proto", -} diff --git a/pkg/proto/cas/cas.pb.go b/pkg/proto/cas/cas.pb.go deleted file mode 100644 index 7a542122..00000000 --- a/pkg/proto/cas/cas.pb.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/cas/cas.proto - -package cas - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type HistoricalExecuteResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActionDigest *v2.Digest `protobuf:"bytes,1,opt,name=action_digest,json=actionDigest,proto3" json:"action_digest,omitempty"` - ExecuteResponse *v2.ExecuteResponse `protobuf:"bytes,3,opt,name=execute_response,json=executeResponse,proto3" json:"execute_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HistoricalExecuteResponse) Reset() { - *x = HistoricalExecuteResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HistoricalExecuteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistoricalExecuteResponse) ProtoMessage() {} - -func (x *HistoricalExecuteResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistoricalExecuteResponse.ProtoReflect.Descriptor instead. -func (*HistoricalExecuteResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescGZIP(), []int{0} -} - -func (x *HistoricalExecuteResponse) GetActionDigest() *v2.Digest { - if x != nil { - return x.ActionDigest - } - return nil -} - -func (x *HistoricalExecuteResponse) GetExecuteResponse() *v2.ExecuteResponse { - if x != nil { - return x.ExecuteResponse - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDesc = "" + - "\n" + - "@github.com/buildbarn/bb-remote-execution/pkg/proto/cas/cas.proto\x12\rbuildbarn.cas\x1a6build/bazel/remote/execution/v2/remote_execution.proto\"\xcc\x01\n" + - "\x19HistoricalExecuteResponse\x12L\n" + - "\raction_digest\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\factionDigest\x12[\n" + - "\x10execute_response\x18\x03 \x01(\v20.build.bazel.remote.execution.v2.ExecuteResponseR\x0fexecuteResponseJ\x04\b\x02\x10\x03B8Z6github.com/buildbarn/bb-remote-execution/pkg/proto/casb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_goTypes = []any{ - (*HistoricalExecuteResponse)(nil), // 0: buildbarn.cas.HistoricalExecuteResponse - (*v2.Digest)(nil), // 1: build.bazel.remote.execution.v2.Digest - (*v2.ExecuteResponse)(nil), // 2: build.bazel.remote.execution.v2.ExecuteResponse -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_depIdxs = []int32{ - 1, // 0: buildbarn.cas.HistoricalExecuteResponse.action_digest:type_name -> build.bazel.remote.execution.v2.Digest - 2, // 1: buildbarn.cas.HistoricalExecuteResponse.execute_response:type_name -> build.bazel.remote.execution.v2.ExecuteResponse - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_init() } -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_cas_cas_proto_depIdxs = nil -} diff --git a/pkg/proto/completedactionlogger/completed_action_logger.pb.go b/pkg/proto/completedactionlogger/completed_action_logger.pb.go deleted file mode 100644 index e3481802..00000000 --- a/pkg/proto/completedactionlogger/completed_action_logger.pb.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/completedactionlogger/completed_action_logger.proto - -package completedactionlogger - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - cas "github.com/buildbarn/bb-remote-execution/pkg/proto/cas" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CompletedAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - HistoricalExecuteResponse *cas.HistoricalExecuteResponse `protobuf:"bytes,1,opt,name=historical_execute_response,json=historicalExecuteResponse,proto3" json:"historical_execute_response,omitempty"` - Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` - InstanceName string `protobuf:"bytes,3,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - DigestFunction v2.DigestFunction_Value `protobuf:"varint,4,opt,name=digest_function,json=digestFunction,proto3,enum=build.bazel.remote.execution.v2.DigestFunction_Value" json:"digest_function,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CompletedAction) Reset() { - *x = CompletedAction{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CompletedAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CompletedAction) ProtoMessage() {} - -func (x *CompletedAction) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CompletedAction.ProtoReflect.Descriptor instead. -func (*CompletedAction) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescGZIP(), []int{0} -} - -func (x *CompletedAction) GetHistoricalExecuteResponse() *cas.HistoricalExecuteResponse { - if x != nil { - return x.HistoricalExecuteResponse - } - return nil -} - -func (x *CompletedAction) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *CompletedAction) GetInstanceName() string { - if x != nil { - return x.InstanceName - } - return "" -} - -func (x *CompletedAction) GetDigestFunction() v2.DigestFunction_Value { - if x != nil { - return x.DigestFunction - } - return v2.DigestFunction_Value(0) -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDesc = "" + - "\n" + - "fgithub.com/buildbarn/bb-remote-execution/pkg/proto/completedactionlogger/completed_action_logger.proto\x12\x1fbuildbarn.completedactionlogger\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1a@github.com/buildbarn/bb-remote-execution/pkg/proto/cas/cas.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x94\x02\n" + - "\x0fCompletedAction\x12h\n" + - "\x1bhistorical_execute_response\x18\x01 \x01(\v2(.buildbarn.cas.HistoricalExecuteResponseR\x19historicalExecuteResponse\x12\x12\n" + - "\x04uuid\x18\x02 \x01(\tR\x04uuid\x12#\n" + - "\rinstance_name\x18\x03 \x01(\tR\finstanceName\x12^\n" + - "\x0fdigest_function\x18\x04 \x01(\x0e25.build.bazel.remote.execution.v2.DigestFunction.ValueR\x0edigestFunction2|\n" + - "\x15CompletedActionLogger\x12c\n" + - "\x13LogCompletedActions\x120.buildbarn.completedactionlogger.CompletedAction\x1a\x16.google.protobuf.Empty(\x010\x01BJZHgithub.com/buildbarn/bb-remote-execution/pkg/proto/completedactionloggerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_goTypes = []any{ - (*CompletedAction)(nil), // 0: buildbarn.completedactionlogger.CompletedAction - (*cas.HistoricalExecuteResponse)(nil), // 1: buildbarn.cas.HistoricalExecuteResponse - (v2.DigestFunction_Value)(0), // 2: build.bazel.remote.execution.v2.DigestFunction.Value - (*emptypb.Empty)(nil), // 3: google.protobuf.Empty -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_depIdxs = []int32{ - 1, // 0: buildbarn.completedactionlogger.CompletedAction.historical_execute_response:type_name -> buildbarn.cas.HistoricalExecuteResponse - 2, // 1: buildbarn.completedactionlogger.CompletedAction.digest_function:type_name -> build.bazel.remote.execution.v2.DigestFunction.Value - 0, // 2: buildbarn.completedactionlogger.CompletedActionLogger.LogCompletedActions:input_type -> buildbarn.completedactionlogger.CompletedAction - 3, // 3: buildbarn.completedactionlogger.CompletedActionLogger.LogCompletedActions:output_type -> google.protobuf.Empty - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_completedactionlogger_completed_action_logger_proto_depIdxs = nil -} diff --git a/pkg/proto/completedactionlogger/completed_action_logger_grpc.pb.go b/pkg/proto/completedactionlogger/completed_action_logger_grpc.pb.go deleted file mode 100644 index 419d32cb..00000000 --- a/pkg/proto/completedactionlogger/completed_action_logger_grpc.pb.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/completedactionlogger/completed_action_logger.proto - -package completedactionlogger - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - CompletedActionLogger_LogCompletedActions_FullMethodName = "/buildbarn.completedactionlogger.CompletedActionLogger/LogCompletedActions" -) - -// CompletedActionLoggerClient is the client API for CompletedActionLogger service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type CompletedActionLoggerClient interface { - LogCompletedActions(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CompletedAction, emptypb.Empty], error) -} - -type completedActionLoggerClient struct { - cc grpc.ClientConnInterface -} - -func NewCompletedActionLoggerClient(cc grpc.ClientConnInterface) CompletedActionLoggerClient { - return &completedActionLoggerClient{cc} -} - -func (c *completedActionLoggerClient) LogCompletedActions(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CompletedAction, emptypb.Empty], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &CompletedActionLogger_ServiceDesc.Streams[0], CompletedActionLogger_LogCompletedActions_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[CompletedAction, emptypb.Empty]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CompletedActionLogger_LogCompletedActionsClient = grpc.BidiStreamingClient[CompletedAction, emptypb.Empty] - -// CompletedActionLoggerServer is the server API for CompletedActionLogger service. -// All implementations should embed UnimplementedCompletedActionLoggerServer -// for forward compatibility. -type CompletedActionLoggerServer interface { - LogCompletedActions(grpc.BidiStreamingServer[CompletedAction, emptypb.Empty]) error -} - -// UnimplementedCompletedActionLoggerServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCompletedActionLoggerServer struct{} - -func (UnimplementedCompletedActionLoggerServer) LogCompletedActions(grpc.BidiStreamingServer[CompletedAction, emptypb.Empty]) error { - return status.Errorf(codes.Unimplemented, "method LogCompletedActions not implemented") -} -func (UnimplementedCompletedActionLoggerServer) testEmbeddedByValue() {} - -// UnsafeCompletedActionLoggerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CompletedActionLoggerServer will -// result in compilation errors. -type UnsafeCompletedActionLoggerServer interface { - mustEmbedUnimplementedCompletedActionLoggerServer() -} - -func RegisterCompletedActionLoggerServer(s grpc.ServiceRegistrar, srv CompletedActionLoggerServer) { - // If the following call pancis, it indicates UnimplementedCompletedActionLoggerServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&CompletedActionLogger_ServiceDesc, srv) -} - -func _CompletedActionLogger_LogCompletedActions_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CompletedActionLoggerServer).LogCompletedActions(&grpc.GenericServerStream[CompletedAction, emptypb.Empty]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CompletedActionLogger_LogCompletedActionsServer = grpc.BidiStreamingServer[CompletedAction, emptypb.Empty] - -// CompletedActionLogger_ServiceDesc is the grpc.ServiceDesc for CompletedActionLogger service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CompletedActionLogger_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.completedactionlogger.CompletedActionLogger", - HandlerType: (*CompletedActionLoggerServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "LogCompletedActions", - Handler: _CompletedActionLogger_LogCompletedActions_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/completedactionlogger/completed_action_logger.proto", -} diff --git a/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.pb.go b/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.pb.go deleted file mode 100644 index 4d90fa63..00000000 --- a/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.pb.go +++ /dev/null @@ -1,217 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto - -package bb_noop_worker - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - blobstore "github.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore" - global "github.com/buildbarn/bb-storage/pkg/proto/configuration/global" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - zstd "github.com/buildbarn/bb-storage/pkg/proto/configuration/zstd" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ApplicationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Global *global.Configuration `protobuf:"bytes,1,opt,name=global,proto3" json:"global,omitempty"` - BrowserUrl string `protobuf:"bytes,2,opt,name=browser_url,json=browserUrl,proto3" json:"browser_url,omitempty"` - Scheduler *grpc.ClientConfiguration `protobuf:"bytes,3,opt,name=scheduler,proto3" json:"scheduler,omitempty"` - InstanceNamePrefix string `protobuf:"bytes,4,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"` - WorkerId map[string]string `protobuf:"bytes,6,rep,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - ContentAddressableStorage *blobstore.BlobAccessConfiguration `protobuf:"bytes,7,opt,name=content_addressable_storage,json=contentAddressableStorage,proto3" json:"content_addressable_storage,omitempty"` - MaximumMessageSizeBytes int64 `protobuf:"varint,8,opt,name=maximum_message_size_bytes,json=maximumMessageSizeBytes,proto3" json:"maximum_message_size_bytes,omitempty"` - ZstdPool *zstd.PoolConfiguration `protobuf:"bytes,9,opt,name=zstd_pool,json=zstdPool,proto3" json:"zstd_pool,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApplicationConfiguration) Reset() { - *x = ApplicationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApplicationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationConfiguration) ProtoMessage() {} - -func (x *ApplicationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationConfiguration.ProtoReflect.Descriptor instead. -func (*ApplicationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationConfiguration) GetGlobal() *global.Configuration { - if x != nil { - return x.Global - } - return nil -} - -func (x *ApplicationConfiguration) GetBrowserUrl() string { - if x != nil { - return x.BrowserUrl - } - return "" -} - -func (x *ApplicationConfiguration) GetScheduler() *grpc.ClientConfiguration { - if x != nil { - return x.Scheduler - } - return nil -} - -func (x *ApplicationConfiguration) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *ApplicationConfiguration) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *ApplicationConfiguration) GetWorkerId() map[string]string { - if x != nil { - return x.WorkerId - } - return nil -} - -func (x *ApplicationConfiguration) GetContentAddressableStorage() *blobstore.BlobAccessConfiguration { - if x != nil { - return x.ContentAddressableStorage - } - return nil -} - -func (x *ApplicationConfiguration) GetMaximumMessageSizeBytes() int64 { - if x != nil { - return x.MaximumMessageSizeBytes - } - return 0 -} - -func (x *ApplicationConfiguration) GetZstdPool() *zstd.PoolConfiguration { - if x != nil { - return x.ZstdPool - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDesc = "" + - "\n" + - "dgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto\x12&buildbarn.configuration.bb_noop_worker\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1aQgithub.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore/blobstore.proto\x1aKgithub.com/buildbarn/bb-storage/pkg/proto/configuration/global/global.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/zstd/zstd.proto\"\xfd\x05\n" + - "\x18ApplicationConfiguration\x12E\n" + - "\x06global\x18\x01 \x01(\v2-.buildbarn.configuration.global.ConfigurationR\x06global\x12\x1f\n" + - "\vbrowser_url\x18\x02 \x01(\tR\n" + - "browserUrl\x12O\n" + - "\tscheduler\x18\x03 \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\tscheduler\x120\n" + - "\x14instance_name_prefix\x18\x04 \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x05 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\x12k\n" + - "\tworker_id\x18\x06 \x03(\v2N.buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.WorkerIdEntryR\bworkerId\x12z\n" + - "\x1bcontent_addressable_storage\x18\a \x01(\v2:.buildbarn.configuration.blobstore.BlobAccessConfigurationR\x19contentAddressableStorage\x12;\n" + - "\x1amaximum_message_size_bytes\x18\b \x01(\x03R\x17maximumMessageSizeBytes\x12L\n" + - "\tzstd_pool\x18\t \x01(\v2/.buildbarn.configuration.zstd.PoolConfigurationR\bzstdPool\x1a;\n" + - "\rWorkerIdEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01BQZOgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_noop_workerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_goTypes = []any{ - (*ApplicationConfiguration)(nil), // 0: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration - nil, // 1: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.WorkerIdEntry - (*global.Configuration)(nil), // 2: buildbarn.configuration.global.Configuration - (*grpc.ClientConfiguration)(nil), // 3: buildbarn.configuration.grpc.ClientConfiguration - (*v2.Platform)(nil), // 4: build.bazel.remote.execution.v2.Platform - (*blobstore.BlobAccessConfiguration)(nil), // 5: buildbarn.configuration.blobstore.BlobAccessConfiguration - (*zstd.PoolConfiguration)(nil), // 6: buildbarn.configuration.zstd.PoolConfiguration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_depIdxs = []int32{ - 2, // 0: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.global:type_name -> buildbarn.configuration.global.Configuration - 3, // 1: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.scheduler:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 4, // 2: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.platform:type_name -> build.bazel.remote.execution.v2.Platform - 1, // 3: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.worker_id:type_name -> buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.WorkerIdEntry - 5, // 4: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.content_addressable_storage:type_name -> buildbarn.configuration.blobstore.BlobAccessConfiguration - 6, // 5: buildbarn.configuration.bb_noop_worker.ApplicationConfiguration.zstd_pool:type_name -> buildbarn.configuration.zstd.PoolConfiguration - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_noop_worker_bb_noop_worker_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto b/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto index 8fba72c2..154c704a 100644 --- a/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto +++ b/pkg/proto/configuration/bb_noop_worker/bb_noop_worker.proto @@ -31,8 +31,8 @@ message ApplicationConfiguration { // as announced to the scheduler. map worker_id = 6; - // Configuration for blob storage. - buildbarn.configuration.blobstore.BlobAccessConfiguration + // Configuration for Content Addressable Storage + buildbarn.configuration.blobstore.ContentAddressableStorageConfiguration content_addressable_storage = 7; // Maximum Protobuf message size to unmarshal. diff --git a/pkg/proto/configuration/bb_runner/bb_runner.pb.go b/pkg/proto/configuration/bb_runner/bb_runner.pb.go deleted file mode 100644 index 3d180dae..00000000 --- a/pkg/proto/configuration/bb_runner/bb_runner.pb.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_runner/bb_runner.proto - -package bb_runner - -import ( - credentials "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/credentials" - global "github.com/buildbarn/bb-storage/pkg/proto/configuration/global" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ApplicationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildDirectoryPath string `protobuf:"bytes,1,opt,name=build_directory_path,json=buildDirectoryPath,proto3" json:"build_directory_path,omitempty"` - GrpcServers []*grpc.ServerConfiguration `protobuf:"bytes,2,rep,name=grpc_servers,json=grpcServers,proto3" json:"grpc_servers,omitempty"` - CleanTemporaryDirectories []string `protobuf:"bytes,3,rep,name=clean_temporary_directories,json=cleanTemporaryDirectories,proto3" json:"clean_temporary_directories,omitempty"` - Global *global.Configuration `protobuf:"bytes,4,opt,name=global,proto3" json:"global,omitempty"` - SetTmpdirEnvironmentVariable bool `protobuf:"varint,5,opt,name=set_tmpdir_environment_variable,json=setTmpdirEnvironmentVariable,proto3" json:"set_tmpdir_environment_variable,omitempty"` - TemporaryDirectoryInstaller *grpc.ClientConfiguration `protobuf:"bytes,6,opt,name=temporary_directory_installer,json=temporaryDirectoryInstaller,proto3" json:"temporary_directory_installer,omitempty"` - ChrootIntoInputRoot bool `protobuf:"varint,7,opt,name=chroot_into_input_root,json=chrootIntoInputRoot,proto3" json:"chroot_into_input_root,omitempty"` - CleanProcessTable bool `protobuf:"varint,8,opt,name=clean_process_table,json=cleanProcessTable,proto3" json:"clean_process_table,omitempty"` - ReadinessCheckingPathnames []string `protobuf:"bytes,10,rep,name=readiness_checking_pathnames,json=readinessCheckingPathnames,proto3" json:"readiness_checking_pathnames,omitempty"` - RunCommandsAs *credentials.UNIXCredentialsConfiguration `protobuf:"bytes,11,opt,name=run_commands_as,json=runCommandsAs,proto3" json:"run_commands_as,omitempty"` - SymlinkTemporaryDirectories []string `protobuf:"bytes,12,rep,name=symlink_temporary_directories,json=symlinkTemporaryDirectories,proto3" json:"symlink_temporary_directories,omitempty"` - RunCommandCleaner []string `protobuf:"bytes,13,rep,name=run_command_cleaner,json=runCommandCleaner,proto3" json:"run_command_cleaner,omitempty"` - AppleXcodeDeveloperDirectories map[string]string `protobuf:"bytes,14,rep,name=apple_xcode_developer_directories,json=appleXcodeDeveloperDirectories,proto3" json:"apple_xcode_developer_directories,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApplicationConfiguration) Reset() { - *x = ApplicationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApplicationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationConfiguration) ProtoMessage() {} - -func (x *ApplicationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationConfiguration.ProtoReflect.Descriptor instead. -func (*ApplicationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationConfiguration) GetBuildDirectoryPath() string { - if x != nil { - return x.BuildDirectoryPath - } - return "" -} - -func (x *ApplicationConfiguration) GetGrpcServers() []*grpc.ServerConfiguration { - if x != nil { - return x.GrpcServers - } - return nil -} - -func (x *ApplicationConfiguration) GetCleanTemporaryDirectories() []string { - if x != nil { - return x.CleanTemporaryDirectories - } - return nil -} - -func (x *ApplicationConfiguration) GetGlobal() *global.Configuration { - if x != nil { - return x.Global - } - return nil -} - -func (x *ApplicationConfiguration) GetSetTmpdirEnvironmentVariable() bool { - if x != nil { - return x.SetTmpdirEnvironmentVariable - } - return false -} - -func (x *ApplicationConfiguration) GetTemporaryDirectoryInstaller() *grpc.ClientConfiguration { - if x != nil { - return x.TemporaryDirectoryInstaller - } - return nil -} - -func (x *ApplicationConfiguration) GetChrootIntoInputRoot() bool { - if x != nil { - return x.ChrootIntoInputRoot - } - return false -} - -func (x *ApplicationConfiguration) GetCleanProcessTable() bool { - if x != nil { - return x.CleanProcessTable - } - return false -} - -func (x *ApplicationConfiguration) GetReadinessCheckingPathnames() []string { - if x != nil { - return x.ReadinessCheckingPathnames - } - return nil -} - -func (x *ApplicationConfiguration) GetRunCommandsAs() *credentials.UNIXCredentialsConfiguration { - if x != nil { - return x.RunCommandsAs - } - return nil -} - -func (x *ApplicationConfiguration) GetSymlinkTemporaryDirectories() []string { - if x != nil { - return x.SymlinkTemporaryDirectories - } - return nil -} - -func (x *ApplicationConfiguration) GetRunCommandCleaner() []string { - if x != nil { - return x.RunCommandCleaner - } - return nil -} - -func (x *ApplicationConfiguration) GetAppleXcodeDeveloperDirectories() map[string]string { - if x != nil { - return x.AppleXcodeDeveloperDirectories - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDesc = "" + - "\n" + - "Zgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_runner/bb_runner.proto\x12!buildbarn.configuration.bb_runner\x1a^github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/credentials/credentials.proto\x1aKgithub.com/buildbarn/bb-storage/pkg/proto/configuration/global/global.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\"\xf3\b\n" + - "\x18ApplicationConfiguration\x120\n" + - "\x14build_directory_path\x18\x01 \x01(\tR\x12buildDirectoryPath\x12T\n" + - "\fgrpc_servers\x18\x02 \x03(\v21.buildbarn.configuration.grpc.ServerConfigurationR\vgrpcServers\x12>\n" + - "\x1bclean_temporary_directories\x18\x03 \x03(\tR\x19cleanTemporaryDirectories\x12E\n" + - "\x06global\x18\x04 \x01(\v2-.buildbarn.configuration.global.ConfigurationR\x06global\x12E\n" + - "\x1fset_tmpdir_environment_variable\x18\x05 \x01(\bR\x1csetTmpdirEnvironmentVariable\x12u\n" + - "\x1dtemporary_directory_installer\x18\x06 \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\x1btemporaryDirectoryInstaller\x123\n" + - "\x16chroot_into_input_root\x18\a \x01(\bR\x13chrootIntoInputRoot\x12.\n" + - "\x13clean_process_table\x18\b \x01(\bR\x11cleanProcessTable\x12@\n" + - "\x1creadiness_checking_pathnames\x18\n" + - " \x03(\tR\x1areadinessCheckingPathnames\x12i\n" + - "\x0frun_commands_as\x18\v \x01(\v2A.buildbarn.configuration.credentials.UNIXCredentialsConfigurationR\rrunCommandsAs\x12B\n" + - "\x1dsymlink_temporary_directories\x18\f \x03(\tR\x1bsymlinkTemporaryDirectories\x12.\n" + - "\x13run_command_cleaner\x18\r \x03(\tR\x11runCommandCleaner\x12\xaa\x01\n" + - "!apple_xcode_developer_directories\x18\x0e \x03(\v2_.buildbarn.configuration.bb_runner.ApplicationConfiguration.AppleXcodeDeveloperDirectoriesEntryR\x1eappleXcodeDeveloperDirectories\x1aQ\n" + - "#AppleXcodeDeveloperDirectoriesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\t\x10\n" + - "BLZJgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_runnerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_goTypes = []any{ - (*ApplicationConfiguration)(nil), // 0: buildbarn.configuration.bb_runner.ApplicationConfiguration - nil, // 1: buildbarn.configuration.bb_runner.ApplicationConfiguration.AppleXcodeDeveloperDirectoriesEntry - (*grpc.ServerConfiguration)(nil), // 2: buildbarn.configuration.grpc.ServerConfiguration - (*global.Configuration)(nil), // 3: buildbarn.configuration.global.Configuration - (*grpc.ClientConfiguration)(nil), // 4: buildbarn.configuration.grpc.ClientConfiguration - (*credentials.UNIXCredentialsConfiguration)(nil), // 5: buildbarn.configuration.credentials.UNIXCredentialsConfiguration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_depIdxs = []int32{ - 2, // 0: buildbarn.configuration.bb_runner.ApplicationConfiguration.grpc_servers:type_name -> buildbarn.configuration.grpc.ServerConfiguration - 3, // 1: buildbarn.configuration.bb_runner.ApplicationConfiguration.global:type_name -> buildbarn.configuration.global.Configuration - 4, // 2: buildbarn.configuration.bb_runner.ApplicationConfiguration.temporary_directory_installer:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 5, // 3: buildbarn.configuration.bb_runner.ApplicationConfiguration.run_commands_as:type_name -> buildbarn.configuration.credentials.UNIXCredentialsConfiguration - 1, // 4: buildbarn.configuration.bb_runner.ApplicationConfiguration.apple_xcode_developer_directories:type_name -> buildbarn.configuration.bb_runner.ApplicationConfiguration.AppleXcodeDeveloperDirectoriesEntry - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_runner_bb_runner_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/bb_scheduler/bb_scheduler.pb.go b/pkg/proto/configuration/bb_scheduler/bb_scheduler.pb.go deleted file mode 100644 index 02f53a11..00000000 --- a/pkg/proto/configuration/bb_scheduler/bb_scheduler.pb.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto - -package bb_scheduler - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - scheduler "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler" - auth "github.com/buildbarn/bb-storage/pkg/proto/configuration/auth" - blobstore "github.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore" - global "github.com/buildbarn/bb-storage/pkg/proto/configuration/global" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - server "github.com/buildbarn/bb-storage/pkg/proto/configuration/http/server" - zstd "github.com/buildbarn/bb-storage/pkg/proto/configuration/zstd" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ApplicationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - ClientGrpcServers []*grpc.ServerConfiguration `protobuf:"bytes,3,rep,name=client_grpc_servers,json=clientGrpcServers,proto3" json:"client_grpc_servers,omitempty"` - WorkerGrpcServers []*grpc.ServerConfiguration `protobuf:"bytes,4,rep,name=worker_grpc_servers,json=workerGrpcServers,proto3" json:"worker_grpc_servers,omitempty"` - BrowserUrl string `protobuf:"bytes,5,opt,name=browser_url,json=browserUrl,proto3" json:"browser_url,omitempty"` - ContentAddressableStorage *blobstore.BlobAccessConfiguration `protobuf:"bytes,6,opt,name=content_addressable_storage,json=contentAddressableStorage,proto3" json:"content_addressable_storage,omitempty"` - MaximumMessageSizeBytes int64 `protobuf:"varint,7,opt,name=maximum_message_size_bytes,json=maximumMessageSizeBytes,proto3" json:"maximum_message_size_bytes,omitempty"` - Global *global.Configuration `protobuf:"bytes,8,opt,name=global,proto3" json:"global,omitempty"` - BuildQueueStateGrpcServers []*grpc.ServerConfiguration `protobuf:"bytes,11,rep,name=build_queue_state_grpc_servers,json=buildQueueStateGrpcServers,proto3" json:"build_queue_state_grpc_servers,omitempty"` - PredeclaredPlatformQueues []*PredeclaredPlatformQueueConfiguration `protobuf:"bytes,12,rep,name=predeclared_platform_queues,json=predeclaredPlatformQueues,proto3" json:"predeclared_platform_queues,omitempty"` - ExecuteAuthorizer *auth.AuthorizerConfiguration `protobuf:"bytes,15,opt,name=execute_authorizer,json=executeAuthorizer,proto3" json:"execute_authorizer,omitempty"` - ActionRouter *scheduler.ActionRouterConfiguration `protobuf:"bytes,16,opt,name=action_router,json=actionRouter,proto3" json:"action_router,omitempty"` - InitialSizeClassCache *blobstore.BlobAccessConfiguration `protobuf:"bytes,17,opt,name=initial_size_class_cache,json=initialSizeClassCache,proto3" json:"initial_size_class_cache,omitempty"` - PlatformQueueWithNoWorkersTimeout *durationpb.Duration `protobuf:"bytes,18,opt,name=platform_queue_with_no_workers_timeout,json=platformQueueWithNoWorkersTimeout,proto3" json:"platform_queue_with_no_workers_timeout,omitempty"` - AdminHttpServers []*server.Configuration `protobuf:"bytes,19,rep,name=admin_http_servers,json=adminHttpServers,proto3" json:"admin_http_servers,omitempty"` - ModifyDrainsAuthorizer *auth.AuthorizerConfiguration `protobuf:"bytes,20,opt,name=modify_drains_authorizer,json=modifyDrainsAuthorizer,proto3" json:"modify_drains_authorizer,omitempty"` - KillOperationsAuthorizer *auth.AuthorizerConfiguration `protobuf:"bytes,21,opt,name=kill_operations_authorizer,json=killOperationsAuthorizer,proto3" json:"kill_operations_authorizer,omitempty"` - AdminRoutePrefix string `protobuf:"bytes,22,opt,name=admin_route_prefix,json=adminRoutePrefix,proto3" json:"admin_route_prefix,omitempty"` - SynchronizeAuthorizer *auth.AuthorizerConfiguration `protobuf:"bytes,23,opt,name=synchronize_authorizer,json=synchronizeAuthorizer,proto3" json:"synchronize_authorizer,omitempty"` - ZstdPool *zstd.PoolConfiguration `protobuf:"bytes,24,opt,name=zstd_pool,json=zstdPool,proto3" json:"zstd_pool,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApplicationConfiguration) Reset() { - *x = ApplicationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApplicationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationConfiguration) ProtoMessage() {} - -func (x *ApplicationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationConfiguration.ProtoReflect.Descriptor instead. -func (*ApplicationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationConfiguration) GetClientGrpcServers() []*grpc.ServerConfiguration { - if x != nil { - return x.ClientGrpcServers - } - return nil -} - -func (x *ApplicationConfiguration) GetWorkerGrpcServers() []*grpc.ServerConfiguration { - if x != nil { - return x.WorkerGrpcServers - } - return nil -} - -func (x *ApplicationConfiguration) GetBrowserUrl() string { - if x != nil { - return x.BrowserUrl - } - return "" -} - -func (x *ApplicationConfiguration) GetContentAddressableStorage() *blobstore.BlobAccessConfiguration { - if x != nil { - return x.ContentAddressableStorage - } - return nil -} - -func (x *ApplicationConfiguration) GetMaximumMessageSizeBytes() int64 { - if x != nil { - return x.MaximumMessageSizeBytes - } - return 0 -} - -func (x *ApplicationConfiguration) GetGlobal() *global.Configuration { - if x != nil { - return x.Global - } - return nil -} - -func (x *ApplicationConfiguration) GetBuildQueueStateGrpcServers() []*grpc.ServerConfiguration { - if x != nil { - return x.BuildQueueStateGrpcServers - } - return nil -} - -func (x *ApplicationConfiguration) GetPredeclaredPlatformQueues() []*PredeclaredPlatformQueueConfiguration { - if x != nil { - return x.PredeclaredPlatformQueues - } - return nil -} - -func (x *ApplicationConfiguration) GetExecuteAuthorizer() *auth.AuthorizerConfiguration { - if x != nil { - return x.ExecuteAuthorizer - } - return nil -} - -func (x *ApplicationConfiguration) GetActionRouter() *scheduler.ActionRouterConfiguration { - if x != nil { - return x.ActionRouter - } - return nil -} - -func (x *ApplicationConfiguration) GetInitialSizeClassCache() *blobstore.BlobAccessConfiguration { - if x != nil { - return x.InitialSizeClassCache - } - return nil -} - -func (x *ApplicationConfiguration) GetPlatformQueueWithNoWorkersTimeout() *durationpb.Duration { - if x != nil { - return x.PlatformQueueWithNoWorkersTimeout - } - return nil -} - -func (x *ApplicationConfiguration) GetAdminHttpServers() []*server.Configuration { - if x != nil { - return x.AdminHttpServers - } - return nil -} - -func (x *ApplicationConfiguration) GetModifyDrainsAuthorizer() *auth.AuthorizerConfiguration { - if x != nil { - return x.ModifyDrainsAuthorizer - } - return nil -} - -func (x *ApplicationConfiguration) GetKillOperationsAuthorizer() *auth.AuthorizerConfiguration { - if x != nil { - return x.KillOperationsAuthorizer - } - return nil -} - -func (x *ApplicationConfiguration) GetAdminRoutePrefix() string { - if x != nil { - return x.AdminRoutePrefix - } - return "" -} - -func (x *ApplicationConfiguration) GetSynchronizeAuthorizer() *auth.AuthorizerConfiguration { - if x != nil { - return x.SynchronizeAuthorizer - } - return nil -} - -func (x *ApplicationConfiguration) GetZstdPool() *zstd.PoolConfiguration { - if x != nil { - return x.ZstdPool - } - return nil -} - -type PredeclaredPlatformQueueConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - InstanceNamePrefix string `protobuf:"bytes,1,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` - SizeClasses []uint32 `protobuf:"varint,3,rep,packed,name=size_classes,json=sizeClasses,proto3" json:"size_classes,omitempty"` - WorkerInvocationStickinessLimits []*durationpb.Duration `protobuf:"bytes,5,rep,name=worker_invocation_stickiness_limits,json=workerInvocationStickinessLimits,proto3" json:"worker_invocation_stickiness_limits,omitempty"` - MaximumQueuedBackgroundLearningOperations int32 `protobuf:"varint,6,opt,name=maximum_queued_background_learning_operations,json=maximumQueuedBackgroundLearningOperations,proto3" json:"maximum_queued_background_learning_operations,omitempty"` - BackgroundLearningOperationPriority int32 `protobuf:"varint,7,opt,name=background_learning_operation_priority,json=backgroundLearningOperationPriority,proto3" json:"background_learning_operation_priority,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PredeclaredPlatformQueueConfiguration) Reset() { - *x = PredeclaredPlatformQueueConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PredeclaredPlatformQueueConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PredeclaredPlatformQueueConfiguration) ProtoMessage() {} - -func (x *PredeclaredPlatformQueueConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PredeclaredPlatformQueueConfiguration.ProtoReflect.Descriptor instead. -func (*PredeclaredPlatformQueueConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescGZIP(), []int{1} -} - -func (x *PredeclaredPlatformQueueConfiguration) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *PredeclaredPlatformQueueConfiguration) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *PredeclaredPlatformQueueConfiguration) GetSizeClasses() []uint32 { - if x != nil { - return x.SizeClasses - } - return nil -} - -func (x *PredeclaredPlatformQueueConfiguration) GetWorkerInvocationStickinessLimits() []*durationpb.Duration { - if x != nil { - return x.WorkerInvocationStickinessLimits - } - return nil -} - -func (x *PredeclaredPlatformQueueConfiguration) GetMaximumQueuedBackgroundLearningOperations() int32 { - if x != nil { - return x.MaximumQueuedBackgroundLearningOperations - } - return 0 -} - -func (x *PredeclaredPlatformQueueConfiguration) GetBackgroundLearningOperationPriority() int32 { - if x != nil { - return x.BackgroundLearningOperationPriority - } - return 0 -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDesc = "" + - "\n" + - "`github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto\x12$buildbarn.configuration.bb_scheduler\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1aZgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler/scheduler.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/auth/auth.proto\x1aQgithub.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore/blobstore.proto\x1aKgithub.com/buildbarn/bb-storage/pkg/proto/configuration/global/global.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\x1aPgithub.com/buildbarn/bb-storage/pkg/proto/configuration/http/server/server.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/zstd/zstd.proto\x1a\x1egoogle/protobuf/duration.proto\"\x82\x0e\n" + - "\x18ApplicationConfiguration\x12a\n" + - "\x13client_grpc_servers\x18\x03 \x03(\v21.buildbarn.configuration.grpc.ServerConfigurationR\x11clientGrpcServers\x12a\n" + - "\x13worker_grpc_servers\x18\x04 \x03(\v21.buildbarn.configuration.grpc.ServerConfigurationR\x11workerGrpcServers\x12\x1f\n" + - "\vbrowser_url\x18\x05 \x01(\tR\n" + - "browserUrl\x12z\n" + - "\x1bcontent_addressable_storage\x18\x06 \x01(\v2:.buildbarn.configuration.blobstore.BlobAccessConfigurationR\x19contentAddressableStorage\x12;\n" + - "\x1amaximum_message_size_bytes\x18\a \x01(\x03R\x17maximumMessageSizeBytes\x12E\n" + - "\x06global\x18\b \x01(\v2-.buildbarn.configuration.global.ConfigurationR\x06global\x12u\n" + - "\x1ebuild_queue_state_grpc_servers\x18\v \x03(\v21.buildbarn.configuration.grpc.ServerConfigurationR\x1abuildQueueStateGrpcServers\x12\x8b\x01\n" + - "\x1bpredeclared_platform_queues\x18\f \x03(\v2K.buildbarn.configuration.bb_scheduler.PredeclaredPlatformQueueConfigurationR\x19predeclaredPlatformQueues\x12d\n" + - "\x12execute_authorizer\x18\x0f \x01(\v25.buildbarn.configuration.auth.AuthorizerConfigurationR\x11executeAuthorizer\x12a\n" + - "\raction_router\x18\x10 \x01(\v2<.buildbarn.configuration.scheduler.ActionRouterConfigurationR\factionRouter\x12s\n" + - "\x18initial_size_class_cache\x18\x11 \x01(\v2:.buildbarn.configuration.blobstore.BlobAccessConfigurationR\x15initialSizeClassCache\x12l\n" + - "&platform_queue_with_no_workers_timeout\x18\x12 \x01(\v2\x19.google.protobuf.DurationR!platformQueueWithNoWorkersTimeout\x12`\n" + - "\x12admin_http_servers\x18\x13 \x03(\v22.buildbarn.configuration.http.server.ConfigurationR\x10adminHttpServers\x12o\n" + - "\x18modify_drains_authorizer\x18\x14 \x01(\v25.buildbarn.configuration.auth.AuthorizerConfigurationR\x16modifyDrainsAuthorizer\x12s\n" + - "\x1akill_operations_authorizer\x18\x15 \x01(\v25.buildbarn.configuration.auth.AuthorizerConfigurationR\x18killOperationsAuthorizer\x12,\n" + - "\x12admin_route_prefix\x18\x16 \x01(\tR\x10adminRoutePrefix\x12l\n" + - "\x16synchronize_authorizer\x18\x17 \x01(\v25.buildbarn.configuration.auth.AuthorizerConfigurationR\x15synchronizeAuthorizer\x12L\n" + - "\tzstd_pool\x18\x18 \x01(\v2/.buildbarn.configuration.zstd.PoolConfigurationR\bzstdPoolJ\x04\b\x02\x10\x03J\x04\b\t\x10\n" + - "J\x04\b\n" + - "\x10\vJ\x04\b\r\x10\x0eJ\x04\b\x0e\x10\x0f\"\xea\x03\n" + - "%PredeclaredPlatformQueueConfiguration\x120\n" + - "\x14instance_name_prefix\x18\x01 \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x02 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\x12!\n" + - "\fsize_classes\x18\x03 \x03(\rR\vsizeClasses\x12h\n" + - "#worker_invocation_stickiness_limits\x18\x05 \x03(\v2\x19.google.protobuf.DurationR workerInvocationStickinessLimits\x12`\n" + - "-maximum_queued_background_learning_operations\x18\x06 \x01(\x05R)maximumQueuedBackgroundLearningOperations\x12S\n" + - "&background_learning_operation_priority\x18\a \x01(\x05R#backgroundLearningOperationPriorityJ\x04\b\x04\x10\x05BOZMgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_schedulerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_goTypes = []any{ - (*ApplicationConfiguration)(nil), // 0: buildbarn.configuration.bb_scheduler.ApplicationConfiguration - (*PredeclaredPlatformQueueConfiguration)(nil), // 1: buildbarn.configuration.bb_scheduler.PredeclaredPlatformQueueConfiguration - (*grpc.ServerConfiguration)(nil), // 2: buildbarn.configuration.grpc.ServerConfiguration - (*blobstore.BlobAccessConfiguration)(nil), // 3: buildbarn.configuration.blobstore.BlobAccessConfiguration - (*global.Configuration)(nil), // 4: buildbarn.configuration.global.Configuration - (*auth.AuthorizerConfiguration)(nil), // 5: buildbarn.configuration.auth.AuthorizerConfiguration - (*scheduler.ActionRouterConfiguration)(nil), // 6: buildbarn.configuration.scheduler.ActionRouterConfiguration - (*durationpb.Duration)(nil), // 7: google.protobuf.Duration - (*server.Configuration)(nil), // 8: buildbarn.configuration.http.server.Configuration - (*zstd.PoolConfiguration)(nil), // 9: buildbarn.configuration.zstd.PoolConfiguration - (*v2.Platform)(nil), // 10: build.bazel.remote.execution.v2.Platform -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_depIdxs = []int32{ - 2, // 0: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.client_grpc_servers:type_name -> buildbarn.configuration.grpc.ServerConfiguration - 2, // 1: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.worker_grpc_servers:type_name -> buildbarn.configuration.grpc.ServerConfiguration - 3, // 2: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.content_addressable_storage:type_name -> buildbarn.configuration.blobstore.BlobAccessConfiguration - 4, // 3: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.global:type_name -> buildbarn.configuration.global.Configuration - 2, // 4: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.build_queue_state_grpc_servers:type_name -> buildbarn.configuration.grpc.ServerConfiguration - 1, // 5: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.predeclared_platform_queues:type_name -> buildbarn.configuration.bb_scheduler.PredeclaredPlatformQueueConfiguration - 5, // 6: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.execute_authorizer:type_name -> buildbarn.configuration.auth.AuthorizerConfiguration - 6, // 7: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.action_router:type_name -> buildbarn.configuration.scheduler.ActionRouterConfiguration - 3, // 8: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.initial_size_class_cache:type_name -> buildbarn.configuration.blobstore.BlobAccessConfiguration - 7, // 9: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.platform_queue_with_no_workers_timeout:type_name -> google.protobuf.Duration - 8, // 10: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.admin_http_servers:type_name -> buildbarn.configuration.http.server.Configuration - 5, // 11: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.modify_drains_authorizer:type_name -> buildbarn.configuration.auth.AuthorizerConfiguration - 5, // 12: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.kill_operations_authorizer:type_name -> buildbarn.configuration.auth.AuthorizerConfiguration - 5, // 13: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.synchronize_authorizer:type_name -> buildbarn.configuration.auth.AuthorizerConfiguration - 9, // 14: buildbarn.configuration.bb_scheduler.ApplicationConfiguration.zstd_pool:type_name -> buildbarn.configuration.zstd.PoolConfiguration - 10, // 15: buildbarn.configuration.bb_scheduler.PredeclaredPlatformQueueConfiguration.platform:type_name -> build.bazel.remote.execution.v2.Platform - 7, // 16: buildbarn.configuration.bb_scheduler.PredeclaredPlatformQueueConfiguration.worker_invocation_stickiness_limits:type_name -> google.protobuf.Duration - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_scheduler_bb_scheduler_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto b/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto index 580e53c2..6f307fa9 100644 --- a/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto +++ b/pkg/proto/configuration/bb_scheduler/bb_scheduler.proto @@ -32,7 +32,7 @@ message ApplicationConfiguration { string browser_url = 5; // Configuration for blob storage. - buildbarn.configuration.blobstore.BlobAccessConfiguration + buildbarn.configuration.blobstore.ContentAddressableStorageConfiguration content_addressable_storage = 6; // Maximum Protobuf message size to unmarshal. diff --git a/pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.pb.go b/pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.pb.go deleted file mode 100644 index 853c8da7..00000000 --- a/pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.pb.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.proto - -package bb_virtual_tmp - -import ( - virtual "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual" - global "github.com/buildbarn/bb-storage/pkg/proto/configuration/global" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ApplicationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Global *global.Configuration `protobuf:"bytes,1,opt,name=global,proto3" json:"global,omitempty"` - BuildDirectoryPath string `protobuf:"bytes,2,opt,name=build_directory_path,json=buildDirectoryPath,proto3" json:"build_directory_path,omitempty"` - Mount *virtual.MountConfiguration `protobuf:"bytes,3,opt,name=mount,proto3" json:"mount,omitempty"` - GrpcServers []*grpc.ServerConfiguration `protobuf:"bytes,4,rep,name=grpc_servers,json=grpcServers,proto3" json:"grpc_servers,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApplicationConfiguration) Reset() { - *x = ApplicationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApplicationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationConfiguration) ProtoMessage() {} - -func (x *ApplicationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationConfiguration.ProtoReflect.Descriptor instead. -func (*ApplicationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationConfiguration) GetGlobal() *global.Configuration { - if x != nil { - return x.Global - } - return nil -} - -func (x *ApplicationConfiguration) GetBuildDirectoryPath() string { - if x != nil { - return x.BuildDirectoryPath - } - return "" -} - -func (x *ApplicationConfiguration) GetMount() *virtual.MountConfiguration { - if x != nil { - return x.Mount - } - return nil -} - -func (x *ApplicationConfiguration) GetGrpcServers() []*grpc.ServerConfiguration { - if x != nil { - return x.GrpcServers - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDesc = "" + - "\n" + - "dgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_virtual_tmp/bb_virtual_tmp.proto\x12&buildbarn.configuration.bb_virtual_tmp\x1aagithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual/virtual.proto\x1aKgithub.com/buildbarn/bb-storage/pkg/proto/configuration/global/global.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\"\xbf\x02\n" + - "\x18ApplicationConfiguration\x12E\n" + - "\x06global\x18\x01 \x01(\v2-.buildbarn.configuration.global.ConfigurationR\x06global\x120\n" + - "\x14build_directory_path\x18\x02 \x01(\tR\x12buildDirectoryPath\x12T\n" + - "\x05mount\x18\x03 \x01(\v2>.buildbarn.configuration.filesystem.virtual.MountConfigurationR\x05mount\x12T\n" + - "\fgrpc_servers\x18\x04 \x03(\v21.buildbarn.configuration.grpc.ServerConfigurationR\vgrpcServersBQZOgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_virtual_tmpb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_goTypes = []any{ - (*ApplicationConfiguration)(nil), // 0: buildbarn.configuration.bb_virtual_tmp.ApplicationConfiguration - (*global.Configuration)(nil), // 1: buildbarn.configuration.global.Configuration - (*virtual.MountConfiguration)(nil), // 2: buildbarn.configuration.filesystem.virtual.MountConfiguration - (*grpc.ServerConfiguration)(nil), // 3: buildbarn.configuration.grpc.ServerConfiguration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_depIdxs = []int32{ - 1, // 0: buildbarn.configuration.bb_virtual_tmp.ApplicationConfiguration.global:type_name -> buildbarn.configuration.global.Configuration - 2, // 1: buildbarn.configuration.bb_virtual_tmp.ApplicationConfiguration.mount:type_name -> buildbarn.configuration.filesystem.virtual.MountConfiguration - 3, // 2: buildbarn.configuration.bb_virtual_tmp.ApplicationConfiguration.grpc_servers:type_name -> buildbarn.configuration.grpc.ServerConfiguration - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_virtual_tmp_bb_virtual_tmp_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/bb_worker/bb_worker.pb.go b/pkg/proto/configuration/bb_worker/bb_worker.pb.go deleted file mode 100644 index 573e23a4..00000000 --- a/pkg/proto/configuration/bb_worker/bb_worker.pb.go +++ /dev/null @@ -1,956 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_worker/bb_worker.proto - -package bb_worker - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - cas "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/cas" - filesystem "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem" - virtual "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual" - resourceusage "github.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage" - blobstore "github.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore" - eviction "github.com/buildbarn/bb-storage/pkg/proto/configuration/eviction" - global "github.com/buildbarn/bb-storage/pkg/proto/configuration/global" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - client "github.com/buildbarn/bb-storage/pkg/proto/configuration/http/client" - zstd "github.com/buildbarn/bb-storage/pkg/proto/configuration/zstd" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ApplicationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Blobstore *blobstore.BlobstoreConfiguration `protobuf:"bytes,1,opt,name=blobstore,proto3" json:"blobstore,omitempty"` - BrowserUrl string `protobuf:"bytes,2,opt,name=browser_url,json=browserUrl,proto3" json:"browser_url,omitempty"` - MaximumMessageSizeBytes int64 `protobuf:"varint,6,opt,name=maximum_message_size_bytes,json=maximumMessageSizeBytes,proto3" json:"maximum_message_size_bytes,omitempty"` - Scheduler *grpc.ClientConfiguration `protobuf:"bytes,8,opt,name=scheduler,proto3" json:"scheduler,omitempty"` - Global *global.Configuration `protobuf:"bytes,19,opt,name=global,proto3" json:"global,omitempty"` - BuildDirectories []*BuildDirectoryConfiguration `protobuf:"bytes,20,rep,name=build_directories,json=buildDirectories,proto3" json:"build_directories,omitempty"` - FilePool *filesystem.FilePoolConfiguration `protobuf:"bytes,22,opt,name=file_pool,json=filePool,proto3" json:"file_pool,omitempty"` - CompletedActionLoggers []*CompletedActionLoggingConfiguration `protobuf:"bytes,23,rep,name=completed_action_loggers,json=completedActionLoggers,proto3" json:"completed_action_loggers,omitempty"` - OutputUploadConcurrency int64 `protobuf:"varint,24,opt,name=output_upload_concurrency,json=outputUploadConcurrency,proto3" json:"output_upload_concurrency,omitempty"` - DirectoryCache *cas.CachingDirectoryFetcherConfiguration `protobuf:"bytes,25,opt,name=directory_cache,json=directoryCache,proto3" json:"directory_cache,omitempty"` - Prefetching *PrefetchingConfiguration `protobuf:"bytes,26,opt,name=prefetching,proto3" json:"prefetching,omitempty"` - ForceUploadTreesAndDirectories bool `protobuf:"varint,27,opt,name=force_upload_trees_and_directories,json=forceUploadTreesAndDirectories,proto3" json:"force_upload_trees_and_directories,omitempty"` - InputDownloadConcurrency int64 `protobuf:"varint,28,opt,name=input_download_concurrency,json=inputDownloadConcurrency,proto3" json:"input_download_concurrency,omitempty"` - HttpExecutionTimeoutCompensators []*HttpExecutionTimeoutCompensator `protobuf:"bytes,30,rep,name=http_execution_timeout_compensators,json=httpExecutionTimeoutCompensators,proto3" json:"http_execution_timeout_compensators,omitempty"` - ZstdPool *zstd.PoolConfiguration `protobuf:"bytes,31,opt,name=zstd_pool,json=zstdPool,proto3" json:"zstd_pool,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApplicationConfiguration) Reset() { - *x = ApplicationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApplicationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApplicationConfiguration) ProtoMessage() {} - -func (x *ApplicationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApplicationConfiguration.ProtoReflect.Descriptor instead. -func (*ApplicationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{0} -} - -func (x *ApplicationConfiguration) GetBlobstore() *blobstore.BlobstoreConfiguration { - if x != nil { - return x.Blobstore - } - return nil -} - -func (x *ApplicationConfiguration) GetBrowserUrl() string { - if x != nil { - return x.BrowserUrl - } - return "" -} - -func (x *ApplicationConfiguration) GetMaximumMessageSizeBytes() int64 { - if x != nil { - return x.MaximumMessageSizeBytes - } - return 0 -} - -func (x *ApplicationConfiguration) GetScheduler() *grpc.ClientConfiguration { - if x != nil { - return x.Scheduler - } - return nil -} - -func (x *ApplicationConfiguration) GetGlobal() *global.Configuration { - if x != nil { - return x.Global - } - return nil -} - -func (x *ApplicationConfiguration) GetBuildDirectories() []*BuildDirectoryConfiguration { - if x != nil { - return x.BuildDirectories - } - return nil -} - -func (x *ApplicationConfiguration) GetFilePool() *filesystem.FilePoolConfiguration { - if x != nil { - return x.FilePool - } - return nil -} - -func (x *ApplicationConfiguration) GetCompletedActionLoggers() []*CompletedActionLoggingConfiguration { - if x != nil { - return x.CompletedActionLoggers - } - return nil -} - -func (x *ApplicationConfiguration) GetOutputUploadConcurrency() int64 { - if x != nil { - return x.OutputUploadConcurrency - } - return 0 -} - -func (x *ApplicationConfiguration) GetDirectoryCache() *cas.CachingDirectoryFetcherConfiguration { - if x != nil { - return x.DirectoryCache - } - return nil -} - -func (x *ApplicationConfiguration) GetPrefetching() *PrefetchingConfiguration { - if x != nil { - return x.Prefetching - } - return nil -} - -func (x *ApplicationConfiguration) GetForceUploadTreesAndDirectories() bool { - if x != nil { - return x.ForceUploadTreesAndDirectories - } - return false -} - -func (x *ApplicationConfiguration) GetInputDownloadConcurrency() int64 { - if x != nil { - return x.InputDownloadConcurrency - } - return 0 -} - -func (x *ApplicationConfiguration) GetHttpExecutionTimeoutCompensators() []*HttpExecutionTimeoutCompensator { - if x != nil { - return x.HttpExecutionTimeoutCompensators - } - return nil -} - -func (x *ApplicationConfiguration) GetZstdPool() *zstd.PoolConfiguration { - if x != nil { - return x.ZstdPool - } - return nil -} - -type BuildDirectoryConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Backend: - // - // *BuildDirectoryConfiguration_Native - // *BuildDirectoryConfiguration_Virtual - Backend isBuildDirectoryConfiguration_Backend `protobuf_oneof:"backend"` - Runners []*RunnerConfiguration `protobuf:"bytes,3,rep,name=runners,proto3" json:"runners,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BuildDirectoryConfiguration) Reset() { - *x = BuildDirectoryConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BuildDirectoryConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BuildDirectoryConfiguration) ProtoMessage() {} - -func (x *BuildDirectoryConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BuildDirectoryConfiguration.ProtoReflect.Descriptor instead. -func (*BuildDirectoryConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{1} -} - -func (x *BuildDirectoryConfiguration) GetBackend() isBuildDirectoryConfiguration_Backend { - if x != nil { - return x.Backend - } - return nil -} - -func (x *BuildDirectoryConfiguration) GetNative() *NativeBuildDirectoryConfiguration { - if x != nil { - if x, ok := x.Backend.(*BuildDirectoryConfiguration_Native); ok { - return x.Native - } - } - return nil -} - -func (x *BuildDirectoryConfiguration) GetVirtual() *VirtualBuildDirectoryConfiguration { - if x != nil { - if x, ok := x.Backend.(*BuildDirectoryConfiguration_Virtual); ok { - return x.Virtual - } - } - return nil -} - -func (x *BuildDirectoryConfiguration) GetRunners() []*RunnerConfiguration { - if x != nil { - return x.Runners - } - return nil -} - -type isBuildDirectoryConfiguration_Backend interface { - isBuildDirectoryConfiguration_Backend() -} - -type BuildDirectoryConfiguration_Native struct { - Native *NativeBuildDirectoryConfiguration `protobuf:"bytes,1,opt,name=native,proto3,oneof"` -} - -type BuildDirectoryConfiguration_Virtual struct { - Virtual *VirtualBuildDirectoryConfiguration `protobuf:"bytes,2,opt,name=virtual,proto3,oneof"` -} - -func (*BuildDirectoryConfiguration_Native) isBuildDirectoryConfiguration_Backend() {} - -func (*BuildDirectoryConfiguration_Virtual) isBuildDirectoryConfiguration_Backend() {} - -type NativeBuildDirectoryConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - BuildDirectoryPath string `protobuf:"bytes,1,opt,name=build_directory_path,json=buildDirectoryPath,proto3" json:"build_directory_path,omitempty"` - CacheDirectoryPath string `protobuf:"bytes,2,opt,name=cache_directory_path,json=cacheDirectoryPath,proto3" json:"cache_directory_path,omitempty"` - MaximumCacheFileCount uint64 `protobuf:"varint,3,opt,name=maximum_cache_file_count,json=maximumCacheFileCount,proto3" json:"maximum_cache_file_count,omitempty"` - MaximumCacheSizeBytes int64 `protobuf:"varint,4,opt,name=maximum_cache_size_bytes,json=maximumCacheSizeBytes,proto3" json:"maximum_cache_size_bytes,omitempty"` - CacheReplacementPolicy eviction.CacheReplacementPolicy `protobuf:"varint,5,opt,name=cache_replacement_policy,json=cacheReplacementPolicy,proto3,enum=buildbarn.configuration.eviction.CacheReplacementPolicy" json:"cache_replacement_policy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NativeBuildDirectoryConfiguration) Reset() { - *x = NativeBuildDirectoryConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NativeBuildDirectoryConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NativeBuildDirectoryConfiguration) ProtoMessage() {} - -func (x *NativeBuildDirectoryConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NativeBuildDirectoryConfiguration.ProtoReflect.Descriptor instead. -func (*NativeBuildDirectoryConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{2} -} - -func (x *NativeBuildDirectoryConfiguration) GetBuildDirectoryPath() string { - if x != nil { - return x.BuildDirectoryPath - } - return "" -} - -func (x *NativeBuildDirectoryConfiguration) GetCacheDirectoryPath() string { - if x != nil { - return x.CacheDirectoryPath - } - return "" -} - -func (x *NativeBuildDirectoryConfiguration) GetMaximumCacheFileCount() uint64 { - if x != nil { - return x.MaximumCacheFileCount - } - return 0 -} - -func (x *NativeBuildDirectoryConfiguration) GetMaximumCacheSizeBytes() int64 { - if x != nil { - return x.MaximumCacheSizeBytes - } - return 0 -} - -func (x *NativeBuildDirectoryConfiguration) GetCacheReplacementPolicy() eviction.CacheReplacementPolicy { - if x != nil { - return x.CacheReplacementPolicy - } - return eviction.CacheReplacementPolicy(0) -} - -type VirtualBuildDirectoryConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Mount *virtual.MountConfiguration `protobuf:"bytes,1,opt,name=mount,proto3" json:"mount,omitempty"` - MaximumExecutionTimeoutCompensation *durationpb.Duration `protobuf:"bytes,2,opt,name=maximum_execution_timeout_compensation,json=maximumExecutionTimeoutCompensation,proto3" json:"maximum_execution_timeout_compensation,omitempty"` - ShuffleDirectoryListings bool `protobuf:"varint,3,opt,name=shuffle_directory_listings,json=shuffleDirectoryListings,proto3" json:"shuffle_directory_listings,omitempty"` - HiddenFilesPattern string `protobuf:"bytes,4,opt,name=hidden_files_pattern,json=hiddenFilesPattern,proto3" json:"hidden_files_pattern,omitempty"` - MaximumWritableFileUploadDelay *durationpb.Duration `protobuf:"bytes,5,opt,name=maximum_writable_file_upload_delay,json=maximumWritableFileUploadDelay,proto3" json:"maximum_writable_file_upload_delay,omitempty"` - CaseInsensitive bool `protobuf:"varint,6,opt,name=case_insensitive,json=caseInsensitive,proto3" json:"case_insensitive,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VirtualBuildDirectoryConfiguration) Reset() { - *x = VirtualBuildDirectoryConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VirtualBuildDirectoryConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VirtualBuildDirectoryConfiguration) ProtoMessage() {} - -func (x *VirtualBuildDirectoryConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VirtualBuildDirectoryConfiguration.ProtoReflect.Descriptor instead. -func (*VirtualBuildDirectoryConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{3} -} - -func (x *VirtualBuildDirectoryConfiguration) GetMount() *virtual.MountConfiguration { - if x != nil { - return x.Mount - } - return nil -} - -func (x *VirtualBuildDirectoryConfiguration) GetMaximumExecutionTimeoutCompensation() *durationpb.Duration { - if x != nil { - return x.MaximumExecutionTimeoutCompensation - } - return nil -} - -func (x *VirtualBuildDirectoryConfiguration) GetShuffleDirectoryListings() bool { - if x != nil { - return x.ShuffleDirectoryListings - } - return false -} - -func (x *VirtualBuildDirectoryConfiguration) GetHiddenFilesPattern() string { - if x != nil { - return x.HiddenFilesPattern - } - return "" -} - -func (x *VirtualBuildDirectoryConfiguration) GetMaximumWritableFileUploadDelay() *durationpb.Duration { - if x != nil { - return x.MaximumWritableFileUploadDelay - } - return nil -} - -func (x *VirtualBuildDirectoryConfiguration) GetCaseInsensitive() bool { - if x != nil { - return x.CaseInsensitive - } - return false -} - -type RunnerConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Endpoint *grpc.ClientConfiguration `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - Concurrency uint64 `protobuf:"varint,2,opt,name=concurrency,proto3" json:"concurrency,omitempty"` - InstanceNamePrefix string `protobuf:"bytes,13,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` - SizeClass uint32 `protobuf:"varint,12,opt,name=size_class,json=sizeClass,proto3" json:"size_class,omitempty"` - MaximumFilePoolFileCount uint64 `protobuf:"varint,6,opt,name=maximum_file_pool_file_count,json=maximumFilePoolFileCount,proto3" json:"maximum_file_pool_file_count,omitempty"` - MaximumFilePoolSizeBytes uint64 `protobuf:"varint,7,opt,name=maximum_file_pool_size_bytes,json=maximumFilePoolSizeBytes,proto3" json:"maximum_file_pool_size_bytes,omitempty"` - WorkerId map[string]string `protobuf:"bytes,8,rep,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - InputRootCharacterDeviceNodes []string `protobuf:"bytes,9,rep,name=input_root_character_device_nodes,json=inputRootCharacterDeviceNodes,proto3" json:"input_root_character_device_nodes,omitempty"` - CostsPerSecond map[string]*resourceusage.MonetaryResourceUsage_Expense `protobuf:"bytes,10,rep,name=costs_per_second,json=costsPerSecond,proto3" json:"costs_per_second,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - EnvironmentVariables map[string]string `protobuf:"bytes,11,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - MaximumConsecutiveTestInfrastructureFailures uint32 `protobuf:"varint,14,opt,name=maximum_consecutive_test_infrastructure_failures,json=maximumConsecutiveTestInfrastructureFailures,proto3" json:"maximum_consecutive_test_infrastructure_failures,omitempty"` - BuildDirectoryOwnerUserId uint32 `protobuf:"varint,15,opt,name=build_directory_owner_user_id,json=buildDirectoryOwnerUserId,proto3" json:"build_directory_owner_user_id,omitempty"` - BuildDirectoryOwnerGroupId uint32 `protobuf:"varint,16,opt,name=build_directory_owner_group_id,json=buildDirectoryOwnerGroupId,proto3" json:"build_directory_owner_group_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RunnerConfiguration) Reset() { - *x = RunnerConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RunnerConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RunnerConfiguration) ProtoMessage() {} - -func (x *RunnerConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RunnerConfiguration.ProtoReflect.Descriptor instead. -func (*RunnerConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{4} -} - -func (x *RunnerConfiguration) GetEndpoint() *grpc.ClientConfiguration { - if x != nil { - return x.Endpoint - } - return nil -} - -func (x *RunnerConfiguration) GetConcurrency() uint64 { - if x != nil { - return x.Concurrency - } - return 0 -} - -func (x *RunnerConfiguration) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *RunnerConfiguration) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *RunnerConfiguration) GetSizeClass() uint32 { - if x != nil { - return x.SizeClass - } - return 0 -} - -func (x *RunnerConfiguration) GetMaximumFilePoolFileCount() uint64 { - if x != nil { - return x.MaximumFilePoolFileCount - } - return 0 -} - -func (x *RunnerConfiguration) GetMaximumFilePoolSizeBytes() uint64 { - if x != nil { - return x.MaximumFilePoolSizeBytes - } - return 0 -} - -func (x *RunnerConfiguration) GetWorkerId() map[string]string { - if x != nil { - return x.WorkerId - } - return nil -} - -func (x *RunnerConfiguration) GetInputRootCharacterDeviceNodes() []string { - if x != nil { - return x.InputRootCharacterDeviceNodes - } - return nil -} - -func (x *RunnerConfiguration) GetCostsPerSecond() map[string]*resourceusage.MonetaryResourceUsage_Expense { - if x != nil { - return x.CostsPerSecond - } - return nil -} - -func (x *RunnerConfiguration) GetEnvironmentVariables() map[string]string { - if x != nil { - return x.EnvironmentVariables - } - return nil -} - -func (x *RunnerConfiguration) GetMaximumConsecutiveTestInfrastructureFailures() uint32 { - if x != nil { - return x.MaximumConsecutiveTestInfrastructureFailures - } - return 0 -} - -func (x *RunnerConfiguration) GetBuildDirectoryOwnerUserId() uint32 { - if x != nil { - return x.BuildDirectoryOwnerUserId - } - return 0 -} - -func (x *RunnerConfiguration) GetBuildDirectoryOwnerGroupId() uint32 { - if x != nil { - return x.BuildDirectoryOwnerGroupId - } - return 0 -} - -type CompletedActionLoggingConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Client *grpc.ClientConfiguration `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"` - MaximumSendQueueSize uint32 `protobuf:"varint,2,opt,name=maximum_send_queue_size,json=maximumSendQueueSize,proto3" json:"maximum_send_queue_size,omitempty"` - AddInstanceNamePrefix string `protobuf:"bytes,3,opt,name=add_instance_name_prefix,json=addInstanceNamePrefix,proto3" json:"add_instance_name_prefix,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CompletedActionLoggingConfiguration) Reset() { - *x = CompletedActionLoggingConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CompletedActionLoggingConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CompletedActionLoggingConfiguration) ProtoMessage() {} - -func (x *CompletedActionLoggingConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CompletedActionLoggingConfiguration.ProtoReflect.Descriptor instead. -func (*CompletedActionLoggingConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{5} -} - -func (x *CompletedActionLoggingConfiguration) GetClient() *grpc.ClientConfiguration { - if x != nil { - return x.Client - } - return nil -} - -func (x *CompletedActionLoggingConfiguration) GetMaximumSendQueueSize() uint32 { - if x != nil { - return x.MaximumSendQueueSize - } - return 0 -} - -func (x *CompletedActionLoggingConfiguration) GetAddInstanceNamePrefix() string { - if x != nil { - return x.AddInstanceNamePrefix - } - return "" -} - -type PrefetchingConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - FileSystemAccessCache *blobstore.BlobAccessConfiguration `protobuf:"bytes,1,opt,name=file_system_access_cache,json=fileSystemAccessCache,proto3" json:"file_system_access_cache,omitempty"` - BloomFilterBitsPerPath uint32 `protobuf:"varint,2,opt,name=bloom_filter_bits_per_path,json=bloomFilterBitsPerPath,proto3" json:"bloom_filter_bits_per_path,omitempty"` - BloomFilterMaximumSizeBytes uint32 `protobuf:"varint,3,opt,name=bloom_filter_maximum_size_bytes,json=bloomFilterMaximumSizeBytes,proto3" json:"bloom_filter_maximum_size_bytes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PrefetchingConfiguration) Reset() { - *x = PrefetchingConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PrefetchingConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrefetchingConfiguration) ProtoMessage() {} - -func (x *PrefetchingConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrefetchingConfiguration.ProtoReflect.Descriptor instead. -func (*PrefetchingConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{6} -} - -func (x *PrefetchingConfiguration) GetFileSystemAccessCache() *blobstore.BlobAccessConfiguration { - if x != nil { - return x.FileSystemAccessCache - } - return nil -} - -func (x *PrefetchingConfiguration) GetBloomFilterBitsPerPath() uint32 { - if x != nil { - return x.BloomFilterBitsPerPath - } - return 0 -} - -func (x *PrefetchingConfiguration) GetBloomFilterMaximumSizeBytes() uint32 { - if x != nil { - return x.BloomFilterMaximumSizeBytes - } - return 0 -} - -type HttpExecutionTimeoutCompensator struct { - state protoimpl.MessageState `protogen:"open.v1"` - HttpClient *client.Configuration `protobuf:"bytes,1,opt,name=http_client,json=httpClient,proto3" json:"http_client,omitempty"` - SuspendUrl string `protobuf:"bytes,2,opt,name=suspend_url,json=suspendUrl,proto3" json:"suspend_url,omitempty"` - ResumeUrl string `protobuf:"bytes,3,opt,name=resume_url,json=resumeUrl,proto3" json:"resume_url,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HttpExecutionTimeoutCompensator) Reset() { - *x = HttpExecutionTimeoutCompensator{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HttpExecutionTimeoutCompensator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HttpExecutionTimeoutCompensator) ProtoMessage() {} - -func (x *HttpExecutionTimeoutCompensator) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HttpExecutionTimeoutCompensator.ProtoReflect.Descriptor instead. -func (*HttpExecutionTimeoutCompensator) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP(), []int{7} -} - -func (x *HttpExecutionTimeoutCompensator) GetHttpClient() *client.Configuration { - if x != nil { - return x.HttpClient - } - return nil -} - -func (x *HttpExecutionTimeoutCompensator) GetSuspendUrl() string { - if x != nil { - return x.SuspendUrl - } - return "" -} - -func (x *HttpExecutionTimeoutCompensator) GetResumeUrl() string { - if x != nil { - return x.ResumeUrl - } - return "" -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDesc = "" + - "\n" + - "Zgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_worker/bb_worker.proto\x12!buildbarn.configuration.bb_worker\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1aNgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/cas/cas.proto\x1a\\github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/filesystem.proto\x1aagithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual/virtual.proto\x1aTgithub.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage/resourceusage.proto\x1aQgithub.com/buildbarn/bb-storage/pkg/proto/configuration/blobstore/blobstore.proto\x1aOgithub.com/buildbarn/bb-storage/pkg/proto/configuration/eviction/eviction.proto\x1aKgithub.com/buildbarn/bb-storage/pkg/proto/configuration/global/global.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\x1aPgithub.com/buildbarn/bb-storage/pkg/proto/configuration/http/client/client.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/zstd/zstd.proto\x1a\x1egoogle/protobuf/duration.proto\"\xc8\n" + - "\n" + - "\x18ApplicationConfiguration\x12W\n" + - "\tblobstore\x18\x01 \x01(\v29.buildbarn.configuration.blobstore.BlobstoreConfigurationR\tblobstore\x12\x1f\n" + - "\vbrowser_url\x18\x02 \x01(\tR\n" + - "browserUrl\x12;\n" + - "\x1amaximum_message_size_bytes\x18\x06 \x01(\x03R\x17maximumMessageSizeBytes\x12O\n" + - "\tscheduler\x18\b \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\tscheduler\x12E\n" + - "\x06global\x18\x13 \x01(\v2-.buildbarn.configuration.global.ConfigurationR\x06global\x12k\n" + - "\x11build_directories\x18\x14 \x03(\v2>.buildbarn.configuration.bb_worker.BuildDirectoryConfigurationR\x10buildDirectories\x12V\n" + - "\tfile_pool\x18\x16 \x01(\v29.buildbarn.configuration.filesystem.FilePoolConfigurationR\bfilePool\x12\x80\x01\n" + - "\x18completed_action_loggers\x18\x17 \x03(\v2F.buildbarn.configuration.bb_worker.CompletedActionLoggingConfigurationR\x16completedActionLoggers\x12:\n" + - "\x19output_upload_concurrency\x18\x18 \x01(\x03R\x17outputUploadConcurrency\x12j\n" + - "\x0fdirectory_cache\x18\x19 \x01(\v2A.buildbarn.configuration.cas.CachingDirectoryFetcherConfigurationR\x0edirectoryCache\x12]\n" + - "\vprefetching\x18\x1a \x01(\v2;.buildbarn.configuration.bb_worker.PrefetchingConfigurationR\vprefetching\x12J\n" + - "\"force_upload_trees_and_directories\x18\x1b \x01(\bR\x1eforceUploadTreesAndDirectories\x12<\n" + - "\x1ainput_download_concurrency\x18\x1c \x01(\x03R\x18inputDownloadConcurrency\x12\x91\x01\n" + - "#http_execution_timeout_compensators\x18\x1e \x03(\v2B.buildbarn.configuration.bb_worker.HttpExecutionTimeoutCompensatorR httpExecutionTimeoutCompensators\x12L\n" + - "\tzstd_pool\x18\x1f \x01(\v2/.buildbarn.configuration.zstd.PoolConfigurationR\bzstdPoolJ\x04\b\t\x10\n" + - "J\x04\b\f\x10\rJ\x04\b\x10\x10\x11J\x04\b\x12\x10\x13J\x04\b\x15\x10\x16J\x04\b\x1d\x10\x1e\"\xbd\x02\n" + - "\x1bBuildDirectoryConfiguration\x12^\n" + - "\x06native\x18\x01 \x01(\v2D.buildbarn.configuration.bb_worker.NativeBuildDirectoryConfigurationH\x00R\x06native\x12a\n" + - "\avirtual\x18\x02 \x01(\v2E.buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfigurationH\x00R\avirtual\x12P\n" + - "\arunners\x18\x03 \x03(\v26.buildbarn.configuration.bb_worker.RunnerConfigurationR\arunnersB\t\n" + - "\abackend\"\xed\x02\n" + - "!NativeBuildDirectoryConfiguration\x120\n" + - "\x14build_directory_path\x18\x01 \x01(\tR\x12buildDirectoryPath\x120\n" + - "\x14cache_directory_path\x18\x02 \x01(\tR\x12cacheDirectoryPath\x127\n" + - "\x18maximum_cache_file_count\x18\x03 \x01(\x04R\x15maximumCacheFileCount\x127\n" + - "\x18maximum_cache_size_bytes\x18\x04 \x01(\x03R\x15maximumCacheSizeBytes\x12r\n" + - "\x18cache_replacement_policy\x18\x05 \x01(\x0e28.buildbarn.configuration.eviction.CacheReplacementPolicyR\x16cacheReplacementPolicy\"\xec\x03\n" + - "\"VirtualBuildDirectoryConfiguration\x12T\n" + - "\x05mount\x18\x01 \x01(\v2>.buildbarn.configuration.filesystem.virtual.MountConfigurationR\x05mount\x12n\n" + - "&maximum_execution_timeout_compensation\x18\x02 \x01(\v2\x19.google.protobuf.DurationR#maximumExecutionTimeoutCompensation\x12<\n" + - "\x1ashuffle_directory_listings\x18\x03 \x01(\bR\x18shuffleDirectoryListings\x120\n" + - "\x14hidden_files_pattern\x18\x04 \x01(\tR\x12hiddenFilesPattern\x12e\n" + - "\"maximum_writable_file_upload_delay\x18\x05 \x01(\v2\x19.google.protobuf.DurationR\x1emaximumWritableFileUploadDelay\x12)\n" + - "\x10case_insensitive\x18\x06 \x01(\bR\x0fcaseInsensitive\"\xc4\n" + - "\n" + - "\x13RunnerConfiguration\x12M\n" + - "\bendpoint\x18\x01 \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\bendpoint\x12 \n" + - "\vconcurrency\x18\x02 \x01(\x04R\vconcurrency\x120\n" + - "\x14instance_name_prefix\x18\r \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x03 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\x12\x1d\n" + - "\n" + - "size_class\x18\f \x01(\rR\tsizeClass\x12>\n" + - "\x1cmaximum_file_pool_file_count\x18\x06 \x01(\x04R\x18maximumFilePoolFileCount\x12>\n" + - "\x1cmaximum_file_pool_size_bytes\x18\a \x01(\x04R\x18maximumFilePoolSizeBytes\x12a\n" + - "\tworker_id\x18\b \x03(\v2D.buildbarn.configuration.bb_worker.RunnerConfiguration.WorkerIdEntryR\bworkerId\x12H\n" + - "!input_root_character_device_nodes\x18\t \x03(\tR\x1dinputRootCharacterDeviceNodes\x12t\n" + - "\x10costs_per_second\x18\n" + - " \x03(\v2J.buildbarn.configuration.bb_worker.RunnerConfiguration.CostsPerSecondEntryR\x0ecostsPerSecond\x12\x85\x01\n" + - "\x15environment_variables\x18\v \x03(\v2P.buildbarn.configuration.bb_worker.RunnerConfiguration.EnvironmentVariablesEntryR\x14environmentVariables\x12f\n" + - "0maximum_consecutive_test_infrastructure_failures\x18\x0e \x01(\rR,maximumConsecutiveTestInfrastructureFailures\x12@\n" + - "\x1dbuild_directory_owner_user_id\x18\x0f \x01(\rR\x19buildDirectoryOwnerUserId\x12B\n" + - "\x1ebuild_directory_owner_group_id\x18\x10 \x01(\rR\x1abuildDirectoryOwnerGroupId\x1a;\n" + - "\rWorkerIdEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1ay\n" + - "\x13CostsPerSecondEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12L\n" + - "\x05value\x18\x02 \x01(\v26.buildbarn.resourceusage.MonetaryResourceUsage.ExpenseR\x05value:\x028\x01\x1aG\n" + - "\x19EnvironmentVariablesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06\"\xe0\x01\n" + - "#CompletedActionLoggingConfiguration\x12I\n" + - "\x06client\x18\x01 \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\x06client\x125\n" + - "\x17maximum_send_queue_size\x18\x02 \x01(\rR\x14maximumSendQueueSize\x127\n" + - "\x18add_instance_name_prefix\x18\x03 \x01(\tR\x15addInstanceNamePrefix\"\x97\x02\n" + - "\x18PrefetchingConfiguration\x12s\n" + - "\x18file_system_access_cache\x18\x01 \x01(\v2:.buildbarn.configuration.blobstore.BlobAccessConfigurationR\x15fileSystemAccessCache\x12:\n" + - "\x1abloom_filter_bits_per_path\x18\x02 \x01(\rR\x16bloomFilterBitsPerPath\x12D\n" + - "\x1fbloom_filter_maximum_size_bytes\x18\x03 \x01(\rR\x1bbloomFilterMaximumSizeBytesJ\x04\b\x04\x10\x05\"\xb6\x01\n" + - "\x1fHttpExecutionTimeoutCompensator\x12S\n" + - "\vhttp_client\x18\x01 \x01(\v22.buildbarn.configuration.http.client.ConfigurationR\n" + - "httpClient\x12\x1f\n" + - "\vsuspend_url\x18\x02 \x01(\tR\n" + - "suspendUrl\x12\x1d\n" + - "\n" + - "resume_url\x18\x03 \x01(\tR\tresumeUrlBLZJgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/bb_workerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_goTypes = []any{ - (*ApplicationConfiguration)(nil), // 0: buildbarn.configuration.bb_worker.ApplicationConfiguration - (*BuildDirectoryConfiguration)(nil), // 1: buildbarn.configuration.bb_worker.BuildDirectoryConfiguration - (*NativeBuildDirectoryConfiguration)(nil), // 2: buildbarn.configuration.bb_worker.NativeBuildDirectoryConfiguration - (*VirtualBuildDirectoryConfiguration)(nil), // 3: buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfiguration - (*RunnerConfiguration)(nil), // 4: buildbarn.configuration.bb_worker.RunnerConfiguration - (*CompletedActionLoggingConfiguration)(nil), // 5: buildbarn.configuration.bb_worker.CompletedActionLoggingConfiguration - (*PrefetchingConfiguration)(nil), // 6: buildbarn.configuration.bb_worker.PrefetchingConfiguration - (*HttpExecutionTimeoutCompensator)(nil), // 7: buildbarn.configuration.bb_worker.HttpExecutionTimeoutCompensator - nil, // 8: buildbarn.configuration.bb_worker.RunnerConfiguration.WorkerIdEntry - nil, // 9: buildbarn.configuration.bb_worker.RunnerConfiguration.CostsPerSecondEntry - nil, // 10: buildbarn.configuration.bb_worker.RunnerConfiguration.EnvironmentVariablesEntry - (*blobstore.BlobstoreConfiguration)(nil), // 11: buildbarn.configuration.blobstore.BlobstoreConfiguration - (*grpc.ClientConfiguration)(nil), // 12: buildbarn.configuration.grpc.ClientConfiguration - (*global.Configuration)(nil), // 13: buildbarn.configuration.global.Configuration - (*filesystem.FilePoolConfiguration)(nil), // 14: buildbarn.configuration.filesystem.FilePoolConfiguration - (*cas.CachingDirectoryFetcherConfiguration)(nil), // 15: buildbarn.configuration.cas.CachingDirectoryFetcherConfiguration - (*zstd.PoolConfiguration)(nil), // 16: buildbarn.configuration.zstd.PoolConfiguration - (eviction.CacheReplacementPolicy)(0), // 17: buildbarn.configuration.eviction.CacheReplacementPolicy - (*virtual.MountConfiguration)(nil), // 18: buildbarn.configuration.filesystem.virtual.MountConfiguration - (*durationpb.Duration)(nil), // 19: google.protobuf.Duration - (*v2.Platform)(nil), // 20: build.bazel.remote.execution.v2.Platform - (*blobstore.BlobAccessConfiguration)(nil), // 21: buildbarn.configuration.blobstore.BlobAccessConfiguration - (*client.Configuration)(nil), // 22: buildbarn.configuration.http.client.Configuration - (*resourceusage.MonetaryResourceUsage_Expense)(nil), // 23: buildbarn.resourceusage.MonetaryResourceUsage.Expense -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_depIdxs = []int32{ - 11, // 0: buildbarn.configuration.bb_worker.ApplicationConfiguration.blobstore:type_name -> buildbarn.configuration.blobstore.BlobstoreConfiguration - 12, // 1: buildbarn.configuration.bb_worker.ApplicationConfiguration.scheduler:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 13, // 2: buildbarn.configuration.bb_worker.ApplicationConfiguration.global:type_name -> buildbarn.configuration.global.Configuration - 1, // 3: buildbarn.configuration.bb_worker.ApplicationConfiguration.build_directories:type_name -> buildbarn.configuration.bb_worker.BuildDirectoryConfiguration - 14, // 4: buildbarn.configuration.bb_worker.ApplicationConfiguration.file_pool:type_name -> buildbarn.configuration.filesystem.FilePoolConfiguration - 5, // 5: buildbarn.configuration.bb_worker.ApplicationConfiguration.completed_action_loggers:type_name -> buildbarn.configuration.bb_worker.CompletedActionLoggingConfiguration - 15, // 6: buildbarn.configuration.bb_worker.ApplicationConfiguration.directory_cache:type_name -> buildbarn.configuration.cas.CachingDirectoryFetcherConfiguration - 6, // 7: buildbarn.configuration.bb_worker.ApplicationConfiguration.prefetching:type_name -> buildbarn.configuration.bb_worker.PrefetchingConfiguration - 7, // 8: buildbarn.configuration.bb_worker.ApplicationConfiguration.http_execution_timeout_compensators:type_name -> buildbarn.configuration.bb_worker.HttpExecutionTimeoutCompensator - 16, // 9: buildbarn.configuration.bb_worker.ApplicationConfiguration.zstd_pool:type_name -> buildbarn.configuration.zstd.PoolConfiguration - 2, // 10: buildbarn.configuration.bb_worker.BuildDirectoryConfiguration.native:type_name -> buildbarn.configuration.bb_worker.NativeBuildDirectoryConfiguration - 3, // 11: buildbarn.configuration.bb_worker.BuildDirectoryConfiguration.virtual:type_name -> buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfiguration - 4, // 12: buildbarn.configuration.bb_worker.BuildDirectoryConfiguration.runners:type_name -> buildbarn.configuration.bb_worker.RunnerConfiguration - 17, // 13: buildbarn.configuration.bb_worker.NativeBuildDirectoryConfiguration.cache_replacement_policy:type_name -> buildbarn.configuration.eviction.CacheReplacementPolicy - 18, // 14: buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfiguration.mount:type_name -> buildbarn.configuration.filesystem.virtual.MountConfiguration - 19, // 15: buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfiguration.maximum_execution_timeout_compensation:type_name -> google.protobuf.Duration - 19, // 16: buildbarn.configuration.bb_worker.VirtualBuildDirectoryConfiguration.maximum_writable_file_upload_delay:type_name -> google.protobuf.Duration - 12, // 17: buildbarn.configuration.bb_worker.RunnerConfiguration.endpoint:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 20, // 18: buildbarn.configuration.bb_worker.RunnerConfiguration.platform:type_name -> build.bazel.remote.execution.v2.Platform - 8, // 19: buildbarn.configuration.bb_worker.RunnerConfiguration.worker_id:type_name -> buildbarn.configuration.bb_worker.RunnerConfiguration.WorkerIdEntry - 9, // 20: buildbarn.configuration.bb_worker.RunnerConfiguration.costs_per_second:type_name -> buildbarn.configuration.bb_worker.RunnerConfiguration.CostsPerSecondEntry - 10, // 21: buildbarn.configuration.bb_worker.RunnerConfiguration.environment_variables:type_name -> buildbarn.configuration.bb_worker.RunnerConfiguration.EnvironmentVariablesEntry - 12, // 22: buildbarn.configuration.bb_worker.CompletedActionLoggingConfiguration.client:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 21, // 23: buildbarn.configuration.bb_worker.PrefetchingConfiguration.file_system_access_cache:type_name -> buildbarn.configuration.blobstore.BlobAccessConfiguration - 22, // 24: buildbarn.configuration.bb_worker.HttpExecutionTimeoutCompensator.http_client:type_name -> buildbarn.configuration.http.client.Configuration - 23, // 25: buildbarn.configuration.bb_worker.RunnerConfiguration.CostsPerSecondEntry.value:type_name -> buildbarn.resourceusage.MonetaryResourceUsage.Expense - 26, // [26:26] is the sub-list for method output_type - 26, // [26:26] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes[1].OneofWrappers = []any{ - (*BuildDirectoryConfiguration_Native)(nil), - (*BuildDirectoryConfiguration_Virtual)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_rawDesc)), - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_bb_worker_bb_worker_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/cas/cas.pb.go b/pkg/proto/configuration/cas/cas.pb.go deleted file mode 100644 index 0f5938d3..00000000 --- a/pkg/proto/configuration/cas/cas.pb.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/cas/cas.proto - -package cas - -import ( - eviction "github.com/buildbarn/bb-storage/pkg/proto/configuration/eviction" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CachingDirectoryFetcherConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - MaximumCount int64 `protobuf:"varint,1,opt,name=maximum_count,json=maximumCount,proto3" json:"maximum_count,omitempty"` - MaximumSizeBytes int64 `protobuf:"varint,2,opt,name=maximum_size_bytes,json=maximumSizeBytes,proto3" json:"maximum_size_bytes,omitempty"` - CacheReplacementPolicy eviction.CacheReplacementPolicy `protobuf:"varint,3,opt,name=cache_replacement_policy,json=cacheReplacementPolicy,proto3,enum=buildbarn.configuration.eviction.CacheReplacementPolicy" json:"cache_replacement_policy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CachingDirectoryFetcherConfiguration) Reset() { - *x = CachingDirectoryFetcherConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CachingDirectoryFetcherConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CachingDirectoryFetcherConfiguration) ProtoMessage() {} - -func (x *CachingDirectoryFetcherConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CachingDirectoryFetcherConfiguration.ProtoReflect.Descriptor instead. -func (*CachingDirectoryFetcherConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescGZIP(), []int{0} -} - -func (x *CachingDirectoryFetcherConfiguration) GetMaximumCount() int64 { - if x != nil { - return x.MaximumCount - } - return 0 -} - -func (x *CachingDirectoryFetcherConfiguration) GetMaximumSizeBytes() int64 { - if x != nil { - return x.MaximumSizeBytes - } - return 0 -} - -func (x *CachingDirectoryFetcherConfiguration) GetCacheReplacementPolicy() eviction.CacheReplacementPolicy { - if x != nil { - return x.CacheReplacementPolicy - } - return eviction.CacheReplacementPolicy(0) -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDesc = "" + - "\n" + - "Ngithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/cas/cas.proto\x12\x1bbuildbarn.configuration.cas\x1aOgithub.com/buildbarn/bb-storage/pkg/proto/configuration/eviction/eviction.proto\"\xed\x01\n" + - "$CachingDirectoryFetcherConfiguration\x12#\n" + - "\rmaximum_count\x18\x01 \x01(\x03R\fmaximumCount\x12,\n" + - "\x12maximum_size_bytes\x18\x02 \x01(\x03R\x10maximumSizeBytes\x12r\n" + - "\x18cache_replacement_policy\x18\x03 \x01(\x0e28.buildbarn.configuration.eviction.CacheReplacementPolicyR\x16cacheReplacementPolicyBFZDgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/casb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_goTypes = []any{ - (*CachingDirectoryFetcherConfiguration)(nil), // 0: buildbarn.configuration.cas.CachingDirectoryFetcherConfiguration - (eviction.CacheReplacementPolicy)(0), // 1: buildbarn.configuration.eviction.CacheReplacementPolicy -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_depIdxs = []int32{ - 1, // 0: buildbarn.configuration.cas.CachingDirectoryFetcherConfiguration.cache_replacement_policy:type_name -> buildbarn.configuration.eviction.CacheReplacementPolicy - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_cas_cas_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/credentials/credentials.pb.go b/pkg/proto/configuration/credentials/credentials.pb.go deleted file mode 100644 index 8370c056..00000000 --- a/pkg/proto/configuration/credentials/credentials.pb.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/credentials/credentials.proto - -package credentials - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type UNIXCredentialsConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId uint32 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - GroupId uint32 `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - AdditionalGroupIds []uint32 `protobuf:"varint,3,rep,packed,name=additional_group_ids,json=additionalGroupIds,proto3" json:"additional_group_ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UNIXCredentialsConfiguration) Reset() { - *x = UNIXCredentialsConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UNIXCredentialsConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UNIXCredentialsConfiguration) ProtoMessage() {} - -func (x *UNIXCredentialsConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UNIXCredentialsConfiguration.ProtoReflect.Descriptor instead. -func (*UNIXCredentialsConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescGZIP(), []int{0} -} - -func (x *UNIXCredentialsConfiguration) GetUserId() uint32 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UNIXCredentialsConfiguration) GetGroupId() uint32 { - if x != nil { - return x.GroupId - } - return 0 -} - -func (x *UNIXCredentialsConfiguration) GetAdditionalGroupIds() []uint32 { - if x != nil { - return x.AdditionalGroupIds - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDesc = "" + - "\n" + - "^github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/credentials/credentials.proto\x12#buildbarn.configuration.credentials\"\x84\x01\n" + - "\x1cUNIXCredentialsConfiguration\x12\x17\n" + - "\auser_id\x18\x01 \x01(\rR\x06userId\x12\x19\n" + - "\bgroup_id\x18\x02 \x01(\rR\agroupId\x120\n" + - "\x14additional_group_ids\x18\x03 \x03(\rR\x12additionalGroupIdsBNZLgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/credentialsb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_goTypes = []any{ - (*UNIXCredentialsConfiguration)(nil), // 0: buildbarn.configuration.credentials.UNIXCredentialsConfiguration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_credentials_credentials_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/filesystem/filesystem.pb.go b/pkg/proto/configuration/filesystem/filesystem.pb.go deleted file mode 100644 index b5263bd1..00000000 --- a/pkg/proto/configuration/filesystem/filesystem.pb.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/filesystem.proto - -package filesystem - -import ( - blockdevice "github.com/buildbarn/bb-storage/pkg/proto/configuration/blockdevice" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FilePoolConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Backend: - // - // *FilePoolConfiguration_BlockDevice - Backend isFilePoolConfiguration_Backend `protobuf_oneof:"backend"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilePoolConfiguration) Reset() { - *x = FilePoolConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilePoolConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilePoolConfiguration) ProtoMessage() {} - -func (x *FilePoolConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FilePoolConfiguration.ProtoReflect.Descriptor instead. -func (*FilePoolConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescGZIP(), []int{0} -} - -func (x *FilePoolConfiguration) GetBackend() isFilePoolConfiguration_Backend { - if x != nil { - return x.Backend - } - return nil -} - -func (x *FilePoolConfiguration) GetBlockDevice() *blockdevice.Configuration { - if x != nil { - if x, ok := x.Backend.(*FilePoolConfiguration_BlockDevice); ok { - return x.BlockDevice - } - } - return nil -} - -type isFilePoolConfiguration_Backend interface { - isFilePoolConfiguration_Backend() -} - -type FilePoolConfiguration_BlockDevice struct { - BlockDevice *blockdevice.Configuration `protobuf:"bytes,3,opt,name=block_device,json=blockDevice,proto3,oneof"` -} - -func (*FilePoolConfiguration_BlockDevice) isFilePoolConfiguration_Backend() {} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDesc = "" + - "\n" + - "\\github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/filesystem.proto\x12\"buildbarn.configuration.filesystem\x1aUgithub.com/buildbarn/bb-storage/pkg/proto/configuration/blockdevice/blockdevice.proto\"\x87\x01\n" + - "\x15FilePoolConfiguration\x12W\n" + - "\fblock_device\x18\x03 \x01(\v22.buildbarn.configuration.blockdevice.ConfigurationH\x00R\vblockDeviceB\t\n" + - "\abackendJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03BMZKgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystemb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_goTypes = []any{ - (*FilePoolConfiguration)(nil), // 0: buildbarn.configuration.filesystem.FilePoolConfiguration - (*blockdevice.Configuration)(nil), // 1: buildbarn.configuration.blockdevice.Configuration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_depIdxs = []int32{ - 1, // 0: buildbarn.configuration.filesystem.FilePoolConfiguration.block_device:type_name -> buildbarn.configuration.blockdevice.Configuration - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_msgTypes[0].OneofWrappers = []any{ - (*FilePoolConfiguration_BlockDevice)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_filesystem_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/filesystem/virtual/virtual.pb.go b/pkg/proto/configuration/filesystem/virtual/virtual.pb.go deleted file mode 100644 index 446336f9..00000000 --- a/pkg/proto/configuration/filesystem/virtual/virtual.pb.go +++ /dev/null @@ -1,683 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual/virtual.proto - -package virtual - -import ( - eviction "github.com/buildbarn/bb-storage/pkg/proto/configuration/eviction" - jmespath "github.com/buildbarn/bb-storage/pkg/proto/configuration/jmespath" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FUSEMountConfiguration_MountMethod int32 - -const ( - FUSEMountConfiguration_FUSERMOUNT FUSEMountConfiguration_MountMethod = 0 - FUSEMountConfiguration_DIRECT FUSEMountConfiguration_MountMethod = 1 - FUSEMountConfiguration_DIRECT_AND_FUSERMOUNT FUSEMountConfiguration_MountMethod = 2 -) - -// Enum value maps for FUSEMountConfiguration_MountMethod. -var ( - FUSEMountConfiguration_MountMethod_name = map[int32]string{ - 0: "FUSERMOUNT", - 1: "DIRECT", - 2: "DIRECT_AND_FUSERMOUNT", - } - FUSEMountConfiguration_MountMethod_value = map[string]int32{ - "FUSERMOUNT": 0, - "DIRECT": 1, - "DIRECT_AND_FUSERMOUNT": 2, - } -) - -func (x FUSEMountConfiguration_MountMethod) Enum() *FUSEMountConfiguration_MountMethod { - p := new(FUSEMountConfiguration_MountMethod) - *p = x - return p -} - -func (x FUSEMountConfiguration_MountMethod) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FUSEMountConfiguration_MountMethod) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_enumTypes[0].Descriptor() -} - -func (FUSEMountConfiguration_MountMethod) Type() protoreflect.EnumType { - return &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_enumTypes[0] -} - -func (x FUSEMountConfiguration_MountMethod) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FUSEMountConfiguration_MountMethod.Descriptor instead. -func (FUSEMountConfiguration_MountMethod) EnumDescriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{1, 0} -} - -type MountConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - MountPath string `protobuf:"bytes,1,opt,name=mount_path,json=mountPath,proto3" json:"mount_path,omitempty"` - // Types that are valid to be assigned to Backend: - // - // *MountConfiguration_Fuse - // *MountConfiguration_Nfsv4 - // *MountConfiguration_Winfsp - Backend isMountConfiguration_Backend `protobuf_oneof:"backend"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MountConfiguration) Reset() { - *x = MountConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MountConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MountConfiguration) ProtoMessage() {} - -func (x *MountConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MountConfiguration.ProtoReflect.Descriptor instead. -func (*MountConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{0} -} - -func (x *MountConfiguration) GetMountPath() string { - if x != nil { - return x.MountPath - } - return "" -} - -func (x *MountConfiguration) GetBackend() isMountConfiguration_Backend { - if x != nil { - return x.Backend - } - return nil -} - -func (x *MountConfiguration) GetFuse() *FUSEMountConfiguration { - if x != nil { - if x, ok := x.Backend.(*MountConfiguration_Fuse); ok { - return x.Fuse - } - } - return nil -} - -func (x *MountConfiguration) GetNfsv4() *NFSv4MountConfiguration { - if x != nil { - if x, ok := x.Backend.(*MountConfiguration_Nfsv4); ok { - return x.Nfsv4 - } - } - return nil -} - -func (x *MountConfiguration) GetWinfsp() *emptypb.Empty { - if x != nil { - if x, ok := x.Backend.(*MountConfiguration_Winfsp); ok { - return x.Winfsp - } - } - return nil -} - -type isMountConfiguration_Backend interface { - isMountConfiguration_Backend() -} - -type MountConfiguration_Fuse struct { - Fuse *FUSEMountConfiguration `protobuf:"bytes,2,opt,name=fuse,proto3,oneof"` -} - -type MountConfiguration_Nfsv4 struct { - Nfsv4 *NFSv4MountConfiguration `protobuf:"bytes,3,opt,name=nfsv4,proto3,oneof"` -} - -type MountConfiguration_Winfsp struct { - Winfsp *emptypb.Empty `protobuf:"bytes,4,opt,name=winfsp,proto3,oneof"` -} - -func (*MountConfiguration_Fuse) isMountConfiguration_Backend() {} - -func (*MountConfiguration_Nfsv4) isMountConfiguration_Backend() {} - -func (*MountConfiguration_Winfsp) isMountConfiguration_Backend() {} - -type FUSEMountConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - DirectoryEntryValidity *durationpb.Duration `protobuf:"bytes,2,opt,name=directory_entry_validity,json=directoryEntryValidity,proto3" json:"directory_entry_validity,omitempty"` - InodeAttributeValidity *durationpb.Duration `protobuf:"bytes,3,opt,name=inode_attribute_validity,json=inodeAttributeValidity,proto3" json:"inode_attribute_validity,omitempty"` - AllowOther bool `protobuf:"varint,6,opt,name=allow_other,json=allowOther,proto3" json:"allow_other,omitempty"` - InHeaderAuthenticationMetadataJmespathExpression *jmespath.Expression `protobuf:"bytes,8,opt,name=in_header_authentication_metadata_jmespath_expression,json=inHeaderAuthenticationMetadataJmespathExpression,proto3" json:"in_header_authentication_metadata_jmespath_expression,omitempty"` - LinuxBackingDevInfoTunables map[string]string `protobuf:"bytes,9,rep,name=linux_backing_dev_info_tunables,json=linuxBackingDevInfoTunables,proto3" json:"linux_backing_dev_info_tunables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - MountMethod FUSEMountConfiguration_MountMethod `protobuf:"varint,10,opt,name=mount_method,json=mountMethod,proto3,enum=buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration_MountMethod" json:"mount_method,omitempty"` - MaximumBackgroundTasks uint32 `protobuf:"varint,11,opt,name=maximum_background_tasks,json=maximumBackgroundTasks,proto3" json:"maximum_background_tasks,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FUSEMountConfiguration) Reset() { - *x = FUSEMountConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FUSEMountConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FUSEMountConfiguration) ProtoMessage() {} - -func (x *FUSEMountConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FUSEMountConfiguration.ProtoReflect.Descriptor instead. -func (*FUSEMountConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{1} -} - -func (x *FUSEMountConfiguration) GetDirectoryEntryValidity() *durationpb.Duration { - if x != nil { - return x.DirectoryEntryValidity - } - return nil -} - -func (x *FUSEMountConfiguration) GetInodeAttributeValidity() *durationpb.Duration { - if x != nil { - return x.InodeAttributeValidity - } - return nil -} - -func (x *FUSEMountConfiguration) GetAllowOther() bool { - if x != nil { - return x.AllowOther - } - return false -} - -func (x *FUSEMountConfiguration) GetInHeaderAuthenticationMetadataJmespathExpression() *jmespath.Expression { - if x != nil { - return x.InHeaderAuthenticationMetadataJmespathExpression - } - return nil -} - -func (x *FUSEMountConfiguration) GetLinuxBackingDevInfoTunables() map[string]string { - if x != nil { - return x.LinuxBackingDevInfoTunables - } - return nil -} - -func (x *FUSEMountConfiguration) GetMountMethod() FUSEMountConfiguration_MountMethod { - if x != nil { - return x.MountMethod - } - return FUSEMountConfiguration_FUSERMOUNT -} - -func (x *FUSEMountConfiguration) GetMaximumBackgroundTasks() uint32 { - if x != nil { - return x.MaximumBackgroundTasks - } - return 0 -} - -type NFSv4MountConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to OperatingSystem: - // - // *NFSv4MountConfiguration_Darwin - // *NFSv4MountConfiguration_Linux - OperatingSystem isNFSv4MountConfiguration_OperatingSystem `protobuf_oneof:"operating_system"` - EnforcedLeaseTime *durationpb.Duration `protobuf:"bytes,2,opt,name=enforced_lease_time,json=enforcedLeaseTime,proto3" json:"enforced_lease_time,omitempty"` - AnnouncedLeaseTime *durationpb.Duration `protobuf:"bytes,3,opt,name=announced_lease_time,json=announcedLeaseTime,proto3" json:"announced_lease_time,omitempty"` - SystemAuthentication *RPCv2SystemAuthenticationConfiguration `protobuf:"bytes,4,opt,name=system_authentication,json=systemAuthentication,proto3" json:"system_authentication,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NFSv4MountConfiguration) Reset() { - *x = NFSv4MountConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NFSv4MountConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NFSv4MountConfiguration) ProtoMessage() {} - -func (x *NFSv4MountConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NFSv4MountConfiguration.ProtoReflect.Descriptor instead. -func (*NFSv4MountConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{2} -} - -func (x *NFSv4MountConfiguration) GetOperatingSystem() isNFSv4MountConfiguration_OperatingSystem { - if x != nil { - return x.OperatingSystem - } - return nil -} - -func (x *NFSv4MountConfiguration) GetDarwin() *NFSv4DarwinMountConfiguration { - if x != nil { - if x, ok := x.OperatingSystem.(*NFSv4MountConfiguration_Darwin); ok { - return x.Darwin - } - } - return nil -} - -func (x *NFSv4MountConfiguration) GetLinux() *NFSv4LinuxMountConfiguration { - if x != nil { - if x, ok := x.OperatingSystem.(*NFSv4MountConfiguration_Linux); ok { - return x.Linux - } - } - return nil -} - -func (x *NFSv4MountConfiguration) GetEnforcedLeaseTime() *durationpb.Duration { - if x != nil { - return x.EnforcedLeaseTime - } - return nil -} - -func (x *NFSv4MountConfiguration) GetAnnouncedLeaseTime() *durationpb.Duration { - if x != nil { - return x.AnnouncedLeaseTime - } - return nil -} - -func (x *NFSv4MountConfiguration) GetSystemAuthentication() *RPCv2SystemAuthenticationConfiguration { - if x != nil { - return x.SystemAuthentication - } - return nil -} - -type isNFSv4MountConfiguration_OperatingSystem interface { - isNFSv4MountConfiguration_OperatingSystem() -} - -type NFSv4MountConfiguration_Darwin struct { - Darwin *NFSv4DarwinMountConfiguration `protobuf:"bytes,1,opt,name=darwin,proto3,oneof"` -} - -type NFSv4MountConfiguration_Linux struct { - Linux *NFSv4LinuxMountConfiguration `protobuf:"bytes,5,opt,name=linux,proto3,oneof"` -} - -func (*NFSv4MountConfiguration_Darwin) isNFSv4MountConfiguration_OperatingSystem() {} - -func (*NFSv4MountConfiguration_Linux) isNFSv4MountConfiguration_OperatingSystem() {} - -type NFSv4DarwinMountConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - SocketPath string `protobuf:"bytes,1,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"` - AccessCacheSize uint32 `protobuf:"varint,4,opt,name=access_cache_size,json=accessCacheSize,proto3" json:"access_cache_size,omitempty"` - MinorVersion *wrapperspb.UInt32Value `protobuf:"bytes,5,opt,name=minor_version,json=minorVersion,proto3" json:"minor_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NFSv4DarwinMountConfiguration) Reset() { - *x = NFSv4DarwinMountConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NFSv4DarwinMountConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NFSv4DarwinMountConfiguration) ProtoMessage() {} - -func (x *NFSv4DarwinMountConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NFSv4DarwinMountConfiguration.ProtoReflect.Descriptor instead. -func (*NFSv4DarwinMountConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{3} -} - -func (x *NFSv4DarwinMountConfiguration) GetSocketPath() string { - if x != nil { - return x.SocketPath - } - return "" -} - -func (x *NFSv4DarwinMountConfiguration) GetAccessCacheSize() uint32 { - if x != nil { - return x.AccessCacheSize - } - return 0 -} - -func (x *NFSv4DarwinMountConfiguration) GetMinorVersion() *wrapperspb.UInt32Value { - if x != nil { - return x.MinorVersion - } - return nil -} - -type NFSv4LinuxMountConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - MountOptions []string `protobuf:"bytes,1,rep,name=mount_options,json=mountOptions,proto3" json:"mount_options,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NFSv4LinuxMountConfiguration) Reset() { - *x = NFSv4LinuxMountConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NFSv4LinuxMountConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NFSv4LinuxMountConfiguration) ProtoMessage() {} - -func (x *NFSv4LinuxMountConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NFSv4LinuxMountConfiguration.ProtoReflect.Descriptor instead. -func (*NFSv4LinuxMountConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{4} -} - -func (x *NFSv4LinuxMountConfiguration) GetMountOptions() []string { - if x != nil { - return x.MountOptions - } - return nil -} - -type RPCv2SystemAuthenticationConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - MetadataJmespathExpression *jmespath.Expression `protobuf:"bytes,1,opt,name=metadata_jmespath_expression,json=metadataJmespathExpression,proto3" json:"metadata_jmespath_expression,omitempty"` - MaximumCacheSize int32 `protobuf:"varint,2,opt,name=maximum_cache_size,json=maximumCacheSize,proto3" json:"maximum_cache_size,omitempty"` - CacheReplacementPolicy eviction.CacheReplacementPolicy `protobuf:"varint,3,opt,name=cache_replacement_policy,json=cacheReplacementPolicy,proto3,enum=buildbarn.configuration.eviction.CacheReplacementPolicy" json:"cache_replacement_policy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RPCv2SystemAuthenticationConfiguration) Reset() { - *x = RPCv2SystemAuthenticationConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RPCv2SystemAuthenticationConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RPCv2SystemAuthenticationConfiguration) ProtoMessage() {} - -func (x *RPCv2SystemAuthenticationConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RPCv2SystemAuthenticationConfiguration.ProtoReflect.Descriptor instead. -func (*RPCv2SystemAuthenticationConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP(), []int{5} -} - -func (x *RPCv2SystemAuthenticationConfiguration) GetMetadataJmespathExpression() *jmespath.Expression { - if x != nil { - return x.MetadataJmespathExpression - } - return nil -} - -func (x *RPCv2SystemAuthenticationConfiguration) GetMaximumCacheSize() int32 { - if x != nil { - return x.MaximumCacheSize - } - return 0 -} - -func (x *RPCv2SystemAuthenticationConfiguration) GetCacheReplacementPolicy() eviction.CacheReplacementPolicy { - if x != nil { - return x.CacheReplacementPolicy - } - return eviction.CacheReplacementPolicy(0) -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDesc = "" + - "\n" + - "agithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtual/virtual.proto\x12*buildbarn.configuration.filesystem.virtual\x1aOgithub.com/buildbarn/bb-storage/pkg/proto/configuration/eviction/eviction.proto\x1aOgithub.com/buildbarn/bb-storage/pkg/proto/configuration/jmespath/jmespath.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xa7\x02\n" + - "\x12MountConfiguration\x12\x1d\n" + - "\n" + - "mount_path\x18\x01 \x01(\tR\tmountPath\x12X\n" + - "\x04fuse\x18\x02 \x01(\v2B.buildbarn.configuration.filesystem.virtual.FUSEMountConfigurationH\x00R\x04fuse\x12[\n" + - "\x05nfsv4\x18\x03 \x01(\v2C.buildbarn.configuration.filesystem.virtual.NFSv4MountConfigurationH\x00R\x05nfsv4\x120\n" + - "\x06winfsp\x18\x04 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x06winfspB\t\n" + - "\abackend\"\x84\a\n" + - "\x16FUSEMountConfiguration\x12S\n" + - "\x18directory_entry_validity\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x16directoryEntryValidity\x12S\n" + - "\x18inode_attribute_validity\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x16inodeAttributeValidity\x12\x1f\n" + - "\vallow_other\x18\x06 \x01(\bR\n" + - "allowOther\x12\x9d\x01\n" + - "5in_header_authentication_metadata_jmespath_expression\x18\b \x01(\v2,.buildbarn.configuration.jmespath.ExpressionR0inHeaderAuthenticationMetadataJmespathExpression\x12\xa9\x01\n" + - "\x1flinux_backing_dev_info_tunables\x18\t \x03(\v2c.buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.LinuxBackingDevInfoTunablesEntryR\x1blinuxBackingDevInfoTunables\x12q\n" + - "\fmount_method\x18\n" + - " \x01(\x0e2N.buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.MountMethodR\vmountMethod\x128\n" + - "\x18maximum_background_tasks\x18\v \x01(\rR\x16maximumBackgroundTasks\x1aN\n" + - " LinuxBackingDevInfoTunablesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"D\n" + - "\vMountMethod\x12\x0e\n" + - "\n" + - "FUSERMOUNT\x10\x00\x12\n" + - "\n" + - "\x06DIRECT\x10\x01\x12\x19\n" + - "\x15DIRECT_AND_FUSERMOUNT\x10\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\a\x10\b\"\x96\x04\n" + - "\x17NFSv4MountConfiguration\x12c\n" + - "\x06darwin\x18\x01 \x01(\v2I.buildbarn.configuration.filesystem.virtual.NFSv4DarwinMountConfigurationH\x00R\x06darwin\x12`\n" + - "\x05linux\x18\x05 \x01(\v2H.buildbarn.configuration.filesystem.virtual.NFSv4LinuxMountConfigurationH\x00R\x05linux\x12I\n" + - "\x13enforced_lease_time\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x11enforcedLeaseTime\x12K\n" + - "\x14announced_lease_time\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x12announcedLeaseTime\x12\x87\x01\n" + - "\x15system_authentication\x18\x04 \x01(\v2R.buildbarn.configuration.filesystem.virtual.RPCv2SystemAuthenticationConfigurationR\x14systemAuthenticationB\x12\n" + - "\x10operating_system\"\xbb\x01\n" + - "\x1dNFSv4DarwinMountConfiguration\x12\x1f\n" + - "\vsocket_path\x18\x01 \x01(\tR\n" + - "socketPath\x12*\n" + - "\x11access_cache_size\x18\x04 \x01(\rR\x0faccessCacheSize\x12A\n" + - "\rminor_version\x18\x05 \x01(\v2\x1c.google.protobuf.UInt32ValueR\fminorVersionJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04\"C\n" + - "\x1cNFSv4LinuxMountConfiguration\x12#\n" + - "\rmount_options\x18\x01 \x03(\tR\fmountOptions\"\xba\x02\n" + - "&RPCv2SystemAuthenticationConfiguration\x12n\n" + - "\x1cmetadata_jmespath_expression\x18\x01 \x01(\v2,.buildbarn.configuration.jmespath.ExpressionR\x1ametadataJmespathExpression\x12,\n" + - "\x12maximum_cache_size\x18\x02 \x01(\x05R\x10maximumCacheSize\x12r\n" + - "\x18cache_replacement_policy\x18\x03 \x01(\x0e28.buildbarn.configuration.eviction.CacheReplacementPolicyR\x16cacheReplacementPolicyBUZSgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/filesystem/virtualb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_goTypes = []any{ - (FUSEMountConfiguration_MountMethod)(0), // 0: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.MountMethod - (*MountConfiguration)(nil), // 1: buildbarn.configuration.filesystem.virtual.MountConfiguration - (*FUSEMountConfiguration)(nil), // 2: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration - (*NFSv4MountConfiguration)(nil), // 3: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration - (*NFSv4DarwinMountConfiguration)(nil), // 4: buildbarn.configuration.filesystem.virtual.NFSv4DarwinMountConfiguration - (*NFSv4LinuxMountConfiguration)(nil), // 5: buildbarn.configuration.filesystem.virtual.NFSv4LinuxMountConfiguration - (*RPCv2SystemAuthenticationConfiguration)(nil), // 6: buildbarn.configuration.filesystem.virtual.RPCv2SystemAuthenticationConfiguration - nil, // 7: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.LinuxBackingDevInfoTunablesEntry - (*emptypb.Empty)(nil), // 8: google.protobuf.Empty - (*durationpb.Duration)(nil), // 9: google.protobuf.Duration - (*jmespath.Expression)(nil), // 10: buildbarn.configuration.jmespath.Expression - (*wrapperspb.UInt32Value)(nil), // 11: google.protobuf.UInt32Value - (eviction.CacheReplacementPolicy)(0), // 12: buildbarn.configuration.eviction.CacheReplacementPolicy -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_depIdxs = []int32{ - 2, // 0: buildbarn.configuration.filesystem.virtual.MountConfiguration.fuse:type_name -> buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration - 3, // 1: buildbarn.configuration.filesystem.virtual.MountConfiguration.nfsv4:type_name -> buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration - 8, // 2: buildbarn.configuration.filesystem.virtual.MountConfiguration.winfsp:type_name -> google.protobuf.Empty - 9, // 3: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.directory_entry_validity:type_name -> google.protobuf.Duration - 9, // 4: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.inode_attribute_validity:type_name -> google.protobuf.Duration - 10, // 5: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.in_header_authentication_metadata_jmespath_expression:type_name -> buildbarn.configuration.jmespath.Expression - 7, // 6: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.linux_backing_dev_info_tunables:type_name -> buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.LinuxBackingDevInfoTunablesEntry - 0, // 7: buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.mount_method:type_name -> buildbarn.configuration.filesystem.virtual.FUSEMountConfiguration.MountMethod - 4, // 8: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration.darwin:type_name -> buildbarn.configuration.filesystem.virtual.NFSv4DarwinMountConfiguration - 5, // 9: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration.linux:type_name -> buildbarn.configuration.filesystem.virtual.NFSv4LinuxMountConfiguration - 9, // 10: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration.enforced_lease_time:type_name -> google.protobuf.Duration - 9, // 11: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration.announced_lease_time:type_name -> google.protobuf.Duration - 6, // 12: buildbarn.configuration.filesystem.virtual.NFSv4MountConfiguration.system_authentication:type_name -> buildbarn.configuration.filesystem.virtual.RPCv2SystemAuthenticationConfiguration - 11, // 13: buildbarn.configuration.filesystem.virtual.NFSv4DarwinMountConfiguration.minor_version:type_name -> google.protobuf.UInt32Value - 10, // 14: buildbarn.configuration.filesystem.virtual.RPCv2SystemAuthenticationConfiguration.metadata_jmespath_expression:type_name -> buildbarn.configuration.jmespath.Expression - 12, // 15: buildbarn.configuration.filesystem.virtual.RPCv2SystemAuthenticationConfiguration.cache_replacement_policy:type_name -> buildbarn.configuration.eviction.CacheReplacementPolicy - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[0].OneofWrappers = []any{ - (*MountConfiguration_Fuse)(nil), - (*MountConfiguration_Nfsv4)(nil), - (*MountConfiguration_Winfsp)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes[2].OneofWrappers = []any{ - (*NFSv4MountConfiguration_Darwin)(nil), - (*NFSv4MountConfiguration_Linux)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_rawDesc)), - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_depIdxs, - EnumInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_enumTypes, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_filesystem_virtual_virtual_proto_depIdxs = nil -} diff --git a/pkg/proto/configuration/scheduler/scheduler.pb.go b/pkg/proto/configuration/scheduler/scheduler.pb.go deleted file mode 100644 index 4e89df92..00000000 --- a/pkg/proto/configuration/scheduler/scheduler.pb.go +++ /dev/null @@ -1,877 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler/scheduler.proto - -package scheduler - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - grpc "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ActionRouterConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *ActionRouterConfiguration_Simple - // *ActionRouterConfiguration_Demultiplexing - // *ActionRouterConfiguration_Remote - Kind isActionRouterConfiguration_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ActionRouterConfiguration) Reset() { - *x = ActionRouterConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ActionRouterConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActionRouterConfiguration) ProtoMessage() {} - -func (x *ActionRouterConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ActionRouterConfiguration.ProtoReflect.Descriptor instead. -func (*ActionRouterConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{0} -} - -func (x *ActionRouterConfiguration) GetKind() isActionRouterConfiguration_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *ActionRouterConfiguration) GetSimple() *SimpleActionRouterConfiguration { - if x != nil { - if x, ok := x.Kind.(*ActionRouterConfiguration_Simple); ok { - return x.Simple - } - } - return nil -} - -func (x *ActionRouterConfiguration) GetDemultiplexing() *DemultiplexingActionRouterConfiguration { - if x != nil { - if x, ok := x.Kind.(*ActionRouterConfiguration_Demultiplexing); ok { - return x.Demultiplexing - } - } - return nil -} - -func (x *ActionRouterConfiguration) GetRemote() *RemoteActionRouterConfiguration { - if x != nil { - if x, ok := x.Kind.(*ActionRouterConfiguration_Remote); ok { - return x.Remote - } - } - return nil -} - -type isActionRouterConfiguration_Kind interface { - isActionRouterConfiguration_Kind() -} - -type ActionRouterConfiguration_Simple struct { - Simple *SimpleActionRouterConfiguration `protobuf:"bytes,1,opt,name=simple,proto3,oneof"` -} - -type ActionRouterConfiguration_Demultiplexing struct { - Demultiplexing *DemultiplexingActionRouterConfiguration `protobuf:"bytes,2,opt,name=demultiplexing,proto3,oneof"` -} - -type ActionRouterConfiguration_Remote struct { - Remote *RemoteActionRouterConfiguration `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` -} - -func (*ActionRouterConfiguration_Simple) isActionRouterConfiguration_Kind() {} - -func (*ActionRouterConfiguration_Demultiplexing) isActionRouterConfiguration_Kind() {} - -func (*ActionRouterConfiguration_Remote) isActionRouterConfiguration_Kind() {} - -type SimpleActionRouterConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - PlatformKeyExtractor *PlatformKeyExtractorConfiguration `protobuf:"bytes,1,opt,name=platform_key_extractor,json=platformKeyExtractor,proto3" json:"platform_key_extractor,omitempty"` - InvocationKeyExtractors []*InvocationKeyExtractorConfiguration `protobuf:"bytes,2,rep,name=invocation_key_extractors,json=invocationKeyExtractors,proto3" json:"invocation_key_extractors,omitempty"` - InitialSizeClassAnalyzer *InitialSizeClassAnalyzerConfiguration `protobuf:"bytes,3,opt,name=initial_size_class_analyzer,json=initialSizeClassAnalyzer,proto3" json:"initial_size_class_analyzer,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SimpleActionRouterConfiguration) Reset() { - *x = SimpleActionRouterConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SimpleActionRouterConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleActionRouterConfiguration) ProtoMessage() {} - -func (x *SimpleActionRouterConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleActionRouterConfiguration.ProtoReflect.Descriptor instead. -func (*SimpleActionRouterConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{1} -} - -func (x *SimpleActionRouterConfiguration) GetPlatformKeyExtractor() *PlatformKeyExtractorConfiguration { - if x != nil { - return x.PlatformKeyExtractor - } - return nil -} - -func (x *SimpleActionRouterConfiguration) GetInvocationKeyExtractors() []*InvocationKeyExtractorConfiguration { - if x != nil { - return x.InvocationKeyExtractors - } - return nil -} - -func (x *SimpleActionRouterConfiguration) GetInitialSizeClassAnalyzer() *InitialSizeClassAnalyzerConfiguration { - if x != nil { - return x.InitialSizeClassAnalyzer - } - return nil -} - -type DemultiplexingActionRouterConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - PlatformKeyExtractor *PlatformKeyExtractorConfiguration `protobuf:"bytes,1,opt,name=platform_key_extractor,json=platformKeyExtractor,proto3" json:"platform_key_extractor,omitempty"` - Backends []*DemultiplexingActionRouterConfiguration_Backend `protobuf:"bytes,2,rep,name=backends,proto3" json:"backends,omitempty"` - DefaultActionRouter *ActionRouterConfiguration `protobuf:"bytes,3,opt,name=default_action_router,json=defaultActionRouter,proto3" json:"default_action_router,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DemultiplexingActionRouterConfiguration) Reset() { - *x = DemultiplexingActionRouterConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DemultiplexingActionRouterConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DemultiplexingActionRouterConfiguration) ProtoMessage() {} - -func (x *DemultiplexingActionRouterConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DemultiplexingActionRouterConfiguration.ProtoReflect.Descriptor instead. -func (*DemultiplexingActionRouterConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{2} -} - -func (x *DemultiplexingActionRouterConfiguration) GetPlatformKeyExtractor() *PlatformKeyExtractorConfiguration { - if x != nil { - return x.PlatformKeyExtractor - } - return nil -} - -func (x *DemultiplexingActionRouterConfiguration) GetBackends() []*DemultiplexingActionRouterConfiguration_Backend { - if x != nil { - return x.Backends - } - return nil -} - -func (x *DemultiplexingActionRouterConfiguration) GetDefaultActionRouter() *ActionRouterConfiguration { - if x != nil { - return x.DefaultActionRouter - } - return nil -} - -type RemoteActionRouterConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - GrpcClient *grpc.ClientConfiguration `protobuf:"bytes,1,opt,name=grpc_client,json=grpcClient,proto3" json:"grpc_client,omitempty"` - InitialSizeClassAnalyzer *InitialSizeClassAnalyzerConfiguration `protobuf:"bytes,2,opt,name=initial_size_class_analyzer,json=initialSizeClassAnalyzer,proto3" json:"initial_size_class_analyzer,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteActionRouterConfiguration) Reset() { - *x = RemoteActionRouterConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteActionRouterConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteActionRouterConfiguration) ProtoMessage() {} - -func (x *RemoteActionRouterConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoteActionRouterConfiguration.ProtoReflect.Descriptor instead. -func (*RemoteActionRouterConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{3} -} - -func (x *RemoteActionRouterConfiguration) GetGrpcClient() *grpc.ClientConfiguration { - if x != nil { - return x.GrpcClient - } - return nil -} - -func (x *RemoteActionRouterConfiguration) GetInitialSizeClassAnalyzer() *InitialSizeClassAnalyzerConfiguration { - if x != nil { - return x.InitialSizeClassAnalyzer - } - return nil -} - -type PlatformKeyExtractorConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *PlatformKeyExtractorConfiguration_Action - // *PlatformKeyExtractorConfiguration_Static - Kind isPlatformKeyExtractorConfiguration_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PlatformKeyExtractorConfiguration) Reset() { - *x = PlatformKeyExtractorConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PlatformKeyExtractorConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformKeyExtractorConfiguration) ProtoMessage() {} - -func (x *PlatformKeyExtractorConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformKeyExtractorConfiguration.ProtoReflect.Descriptor instead. -func (*PlatformKeyExtractorConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{4} -} - -func (x *PlatformKeyExtractorConfiguration) GetKind() isPlatformKeyExtractorConfiguration_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *PlatformKeyExtractorConfiguration) GetAction() *emptypb.Empty { - if x != nil { - if x, ok := x.Kind.(*PlatformKeyExtractorConfiguration_Action); ok { - return x.Action - } - } - return nil -} - -func (x *PlatformKeyExtractorConfiguration) GetStatic() *v2.Platform { - if x != nil { - if x, ok := x.Kind.(*PlatformKeyExtractorConfiguration_Static); ok { - return x.Static - } - } - return nil -} - -type isPlatformKeyExtractorConfiguration_Kind interface { - isPlatformKeyExtractorConfiguration_Kind() -} - -type PlatformKeyExtractorConfiguration_Action struct { - Action *emptypb.Empty `protobuf:"bytes,1,opt,name=action,proto3,oneof"` -} - -type PlatformKeyExtractorConfiguration_Static struct { - Static *v2.Platform `protobuf:"bytes,3,opt,name=static,proto3,oneof"` -} - -func (*PlatformKeyExtractorConfiguration_Action) isPlatformKeyExtractorConfiguration_Kind() {} - -func (*PlatformKeyExtractorConfiguration_Static) isPlatformKeyExtractorConfiguration_Kind() {} - -type InvocationKeyExtractorConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: - // - // *InvocationKeyExtractorConfiguration_ToolInvocationId - // *InvocationKeyExtractorConfiguration_CorrelatedInvocationsId - // *InvocationKeyExtractorConfiguration_AuthenticationMetadata - Kind isInvocationKeyExtractorConfiguration_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InvocationKeyExtractorConfiguration) Reset() { - *x = InvocationKeyExtractorConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InvocationKeyExtractorConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvocationKeyExtractorConfiguration) ProtoMessage() {} - -func (x *InvocationKeyExtractorConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvocationKeyExtractorConfiguration.ProtoReflect.Descriptor instead. -func (*InvocationKeyExtractorConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{5} -} - -func (x *InvocationKeyExtractorConfiguration) GetKind() isInvocationKeyExtractorConfiguration_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *InvocationKeyExtractorConfiguration) GetToolInvocationId() *emptypb.Empty { - if x != nil { - if x, ok := x.Kind.(*InvocationKeyExtractorConfiguration_ToolInvocationId); ok { - return x.ToolInvocationId - } - } - return nil -} - -func (x *InvocationKeyExtractorConfiguration) GetCorrelatedInvocationsId() *emptypb.Empty { - if x != nil { - if x, ok := x.Kind.(*InvocationKeyExtractorConfiguration_CorrelatedInvocationsId); ok { - return x.CorrelatedInvocationsId - } - } - return nil -} - -func (x *InvocationKeyExtractorConfiguration) GetAuthenticationMetadata() *emptypb.Empty { - if x != nil { - if x, ok := x.Kind.(*InvocationKeyExtractorConfiguration_AuthenticationMetadata); ok { - return x.AuthenticationMetadata - } - } - return nil -} - -type isInvocationKeyExtractorConfiguration_Kind interface { - isInvocationKeyExtractorConfiguration_Kind() -} - -type InvocationKeyExtractorConfiguration_ToolInvocationId struct { - ToolInvocationId *emptypb.Empty `protobuf:"bytes,2,opt,name=tool_invocation_id,json=toolInvocationId,proto3,oneof"` -} - -type InvocationKeyExtractorConfiguration_CorrelatedInvocationsId struct { - CorrelatedInvocationsId *emptypb.Empty `protobuf:"bytes,3,opt,name=correlated_invocations_id,json=correlatedInvocationsId,proto3,oneof"` -} - -type InvocationKeyExtractorConfiguration_AuthenticationMetadata struct { - AuthenticationMetadata *emptypb.Empty `protobuf:"bytes,4,opt,name=authentication_metadata,json=authenticationMetadata,proto3,oneof"` -} - -func (*InvocationKeyExtractorConfiguration_ToolInvocationId) isInvocationKeyExtractorConfiguration_Kind() { -} - -func (*InvocationKeyExtractorConfiguration_CorrelatedInvocationsId) isInvocationKeyExtractorConfiguration_Kind() { -} - -func (*InvocationKeyExtractorConfiguration_AuthenticationMetadata) isInvocationKeyExtractorConfiguration_Kind() { -} - -type InitialSizeClassAnalyzerConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - DefaultExecutionTimeout *durationpb.Duration `protobuf:"bytes,1,opt,name=default_execution_timeout,json=defaultExecutionTimeout,proto3" json:"default_execution_timeout,omitempty"` - MaximumExecutionTimeout *durationpb.Duration `protobuf:"bytes,2,opt,name=maximum_execution_timeout,json=maximumExecutionTimeout,proto3" json:"maximum_execution_timeout,omitempty"` - FeedbackDriven *InitialSizeClassFeedbackDrivenAnalyzerConfiguration `protobuf:"bytes,3,opt,name=feedback_driven,json=feedbackDriven,proto3" json:"feedback_driven,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InitialSizeClassAnalyzerConfiguration) Reset() { - *x = InitialSizeClassAnalyzerConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InitialSizeClassAnalyzerConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitialSizeClassAnalyzerConfiguration) ProtoMessage() {} - -func (x *InitialSizeClassAnalyzerConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitialSizeClassAnalyzerConfiguration.ProtoReflect.Descriptor instead. -func (*InitialSizeClassAnalyzerConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{6} -} - -func (x *InitialSizeClassAnalyzerConfiguration) GetDefaultExecutionTimeout() *durationpb.Duration { - if x != nil { - return x.DefaultExecutionTimeout - } - return nil -} - -func (x *InitialSizeClassAnalyzerConfiguration) GetMaximumExecutionTimeout() *durationpb.Duration { - if x != nil { - return x.MaximumExecutionTimeout - } - return nil -} - -func (x *InitialSizeClassAnalyzerConfiguration) GetFeedbackDriven() *InitialSizeClassFeedbackDrivenAnalyzerConfiguration { - if x != nil { - return x.FeedbackDriven - } - return nil -} - -type InitialSizeClassFeedbackDrivenAnalyzerConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - FailureCacheDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=failure_cache_duration,json=failureCacheDuration,proto3" json:"failure_cache_duration,omitempty"` - HistorySize int32 `protobuf:"varint,6,opt,name=history_size,json=historySize,proto3" json:"history_size,omitempty"` - PageRank *InitialSizeClassPageRankStrategyCalculatorConfiguration `protobuf:"bytes,7,opt,name=page_rank,json=pageRank,proto3" json:"page_rank,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) Reset() { - *x = InitialSizeClassFeedbackDrivenAnalyzerConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitialSizeClassFeedbackDrivenAnalyzerConfiguration) ProtoMessage() {} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitialSizeClassFeedbackDrivenAnalyzerConfiguration.ProtoReflect.Descriptor instead. -func (*InitialSizeClassFeedbackDrivenAnalyzerConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{7} -} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) GetFailureCacheDuration() *durationpb.Duration { - if x != nil { - return x.FailureCacheDuration - } - return nil -} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) GetHistorySize() int32 { - if x != nil { - return x.HistorySize - } - return 0 -} - -func (x *InitialSizeClassFeedbackDrivenAnalyzerConfiguration) GetPageRank() *InitialSizeClassPageRankStrategyCalculatorConfiguration { - if x != nil { - return x.PageRank - } - return nil -} - -type InitialSizeClassPageRankStrategyCalculatorConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - AcceptableExecutionTimeIncreaseExponent float64 `protobuf:"fixed64,1,opt,name=acceptable_execution_time_increase_exponent,json=acceptableExecutionTimeIncreaseExponent,proto3" json:"acceptable_execution_time_increase_exponent,omitempty"` - SmallerSizeClassExecutionTimeoutMultiplier float64 `protobuf:"fixed64,2,opt,name=smaller_size_class_execution_timeout_multiplier,json=smallerSizeClassExecutionTimeoutMultiplier,proto3" json:"smaller_size_class_execution_timeout_multiplier,omitempty"` - MinimumExecutionTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=minimum_execution_timeout,json=minimumExecutionTimeout,proto3" json:"minimum_execution_timeout,omitempty"` - MaximumConvergenceError float64 `protobuf:"fixed64,4,opt,name=maximum_convergence_error,json=maximumConvergenceError,proto3" json:"maximum_convergence_error,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) Reset() { - *x = InitialSizeClassPageRankStrategyCalculatorConfiguration{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitialSizeClassPageRankStrategyCalculatorConfiguration) ProtoMessage() {} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitialSizeClassPageRankStrategyCalculatorConfiguration.ProtoReflect.Descriptor instead. -func (*InitialSizeClassPageRankStrategyCalculatorConfiguration) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{8} -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) GetAcceptableExecutionTimeIncreaseExponent() float64 { - if x != nil { - return x.AcceptableExecutionTimeIncreaseExponent - } - return 0 -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) GetSmallerSizeClassExecutionTimeoutMultiplier() float64 { - if x != nil { - return x.SmallerSizeClassExecutionTimeoutMultiplier - } - return 0 -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) GetMinimumExecutionTimeout() *durationpb.Duration { - if x != nil { - return x.MinimumExecutionTimeout - } - return nil -} - -func (x *InitialSizeClassPageRankStrategyCalculatorConfiguration) GetMaximumConvergenceError() float64 { - if x != nil { - return x.MaximumConvergenceError - } - return 0 -} - -type DemultiplexingActionRouterConfiguration_Backend struct { - state protoimpl.MessageState `protogen:"open.v1"` - InstanceNamePrefix string `protobuf:"bytes,1,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` - ActionRouter *ActionRouterConfiguration `protobuf:"bytes,3,opt,name=action_router,json=actionRouter,proto3" json:"action_router,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DemultiplexingActionRouterConfiguration_Backend) Reset() { - *x = DemultiplexingActionRouterConfiguration_Backend{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DemultiplexingActionRouterConfiguration_Backend) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DemultiplexingActionRouterConfiguration_Backend) ProtoMessage() {} - -func (x *DemultiplexingActionRouterConfiguration_Backend) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DemultiplexingActionRouterConfiguration_Backend.ProtoReflect.Descriptor instead. -func (*DemultiplexingActionRouterConfiguration_Backend) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *DemultiplexingActionRouterConfiguration_Backend) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *DemultiplexingActionRouterConfiguration_Backend) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *DemultiplexingActionRouterConfiguration_Backend) GetActionRouter() *ActionRouterConfiguration { - if x != nil { - return x.ActionRouter - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDesc = "" + - "\n" + - "Zgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler/scheduler.proto\x12!buildbarn.configuration.scheduler\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1aGgithub.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xd5\x02\n" + - "\x19ActionRouterConfiguration\x12\\\n" + - "\x06simple\x18\x01 \x01(\v2B.buildbarn.configuration.scheduler.SimpleActionRouterConfigurationH\x00R\x06simple\x12t\n" + - "\x0edemultiplexing\x18\x02 \x01(\v2J.buildbarn.configuration.scheduler.DemultiplexingActionRouterConfigurationH\x00R\x0edemultiplexing\x12\\\n" + - "\x06remote\x18\x03 \x01(\v2B.buildbarn.configuration.scheduler.RemoteActionRouterConfigurationH\x00R\x06remoteB\x06\n" + - "\x04kind\"\xac\x03\n" + - "\x1fSimpleActionRouterConfiguration\x12z\n" + - "\x16platform_key_extractor\x18\x01 \x01(\v2D.buildbarn.configuration.scheduler.PlatformKeyExtractorConfigurationR\x14platformKeyExtractor\x12\x82\x01\n" + - "\x19invocation_key_extractors\x18\x02 \x03(\v2F.buildbarn.configuration.scheduler.InvocationKeyExtractorConfigurationR\x17invocationKeyExtractors\x12\x87\x01\n" + - "\x1binitial_size_class_analyzer\x18\x03 \x01(\v2H.buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfigurationR\x18initialSizeClassAnalyzer\"\xef\x04\n" + - "'DemultiplexingActionRouterConfiguration\x12z\n" + - "\x16platform_key_extractor\x18\x01 \x01(\v2D.buildbarn.configuration.scheduler.PlatformKeyExtractorConfigurationR\x14platformKeyExtractor\x12n\n" + - "\bbackends\x18\x02 \x03(\v2R.buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.BackendR\bbackends\x12p\n" + - "\x15default_action_router\x18\x03 \x01(\v2<.buildbarn.configuration.scheduler.ActionRouterConfigurationR\x13defaultActionRouter\x1a\xe5\x01\n" + - "\aBackend\x120\n" + - "\x14instance_name_prefix\x18\x01 \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x02 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\x12a\n" + - "\raction_router\x18\x03 \x01(\v2<.buildbarn.configuration.scheduler.ActionRouterConfigurationR\factionRouter\"\xff\x01\n" + - "\x1fRemoteActionRouterConfiguration\x12R\n" + - "\vgrpc_client\x18\x01 \x01(\v21.buildbarn.configuration.grpc.ClientConfigurationR\n" + - "grpcClient\x12\x87\x01\n" + - "\x1binitial_size_class_analyzer\x18\x02 \x01(\v2H.buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfigurationR\x18initialSizeClassAnalyzer\"\xa8\x01\n" + - "!PlatformKeyExtractorConfiguration\x120\n" + - "\x06action\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x06action\x12C\n" + - "\x06static\x18\x03 \x01(\v2).build.bazel.remote.execution.v2.PlatformH\x00R\x06staticB\x06\n" + - "\x04kindJ\x04\b\x02\x10\x03\"\xa4\x02\n" + - "#InvocationKeyExtractorConfiguration\x12F\n" + - "\x12tool_invocation_id\x18\x02 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x10toolInvocationId\x12T\n" + - "\x19correlated_invocations_id\x18\x03 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x17correlatedInvocationsId\x12Q\n" + - "\x17authentication_metadata\x18\x04 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x16authenticationMetadataB\x06\n" + - "\x04kindJ\x04\b\x01\x10\x02\"\xd6\x02\n" + - "%InitialSizeClassAnalyzerConfiguration\x12U\n" + - "\x19default_execution_timeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x17defaultExecutionTimeout\x12U\n" + - "\x19maximum_execution_timeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\x17maximumExecutionTimeout\x12\x7f\n" + - "\x0ffeedback_driven\x18\x03 \x01(\v2V.buildbarn.configuration.scheduler.InitialSizeClassFeedbackDrivenAnalyzerConfigurationR\x0efeedbackDriven\"\xba\x02\n" + - "3InitialSizeClassFeedbackDrivenAnalyzerConfiguration\x12O\n" + - "\x16failure_cache_duration\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\x14failureCacheDuration\x12!\n" + - "\fhistory_size\x18\x06 \x01(\x05R\vhistorySize\x12w\n" + - "\tpage_rank\x18\a \x01(\v2Z.buildbarn.configuration.scheduler.InitialSizeClassPageRankStrategyCalculatorConfigurationR\bpageRankJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06\"\x8f\x03\n" + - "7InitialSizeClassPageRankStrategyCalculatorConfiguration\x12\\\n" + - "+acceptable_execution_time_increase_exponent\x18\x01 \x01(\x01R'acceptableExecutionTimeIncreaseExponent\x12c\n" + - "/smaller_size_class_execution_timeout_multiplier\x18\x02 \x01(\x01R*smallerSizeClassExecutionTimeoutMultiplier\x12U\n" + - "\x19minimum_execution_timeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\x17minimumExecutionTimeout\x12:\n" + - "\x19maximum_convergence_error\x18\x04 \x01(\x01R\x17maximumConvergenceErrorBLZJgithub.com/buildbarn/bb-remote-execution/pkg/proto/configuration/schedulerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_goTypes = []any{ - (*ActionRouterConfiguration)(nil), // 0: buildbarn.configuration.scheduler.ActionRouterConfiguration - (*SimpleActionRouterConfiguration)(nil), // 1: buildbarn.configuration.scheduler.SimpleActionRouterConfiguration - (*DemultiplexingActionRouterConfiguration)(nil), // 2: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration - (*RemoteActionRouterConfiguration)(nil), // 3: buildbarn.configuration.scheduler.RemoteActionRouterConfiguration - (*PlatformKeyExtractorConfiguration)(nil), // 4: buildbarn.configuration.scheduler.PlatformKeyExtractorConfiguration - (*InvocationKeyExtractorConfiguration)(nil), // 5: buildbarn.configuration.scheduler.InvocationKeyExtractorConfiguration - (*InitialSizeClassAnalyzerConfiguration)(nil), // 6: buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration - (*InitialSizeClassFeedbackDrivenAnalyzerConfiguration)(nil), // 7: buildbarn.configuration.scheduler.InitialSizeClassFeedbackDrivenAnalyzerConfiguration - (*InitialSizeClassPageRankStrategyCalculatorConfiguration)(nil), // 8: buildbarn.configuration.scheduler.InitialSizeClassPageRankStrategyCalculatorConfiguration - (*DemultiplexingActionRouterConfiguration_Backend)(nil), // 9: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.Backend - (*grpc.ClientConfiguration)(nil), // 10: buildbarn.configuration.grpc.ClientConfiguration - (*emptypb.Empty)(nil), // 11: google.protobuf.Empty - (*v2.Platform)(nil), // 12: build.bazel.remote.execution.v2.Platform - (*durationpb.Duration)(nil), // 13: google.protobuf.Duration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_depIdxs = []int32{ - 1, // 0: buildbarn.configuration.scheduler.ActionRouterConfiguration.simple:type_name -> buildbarn.configuration.scheduler.SimpleActionRouterConfiguration - 2, // 1: buildbarn.configuration.scheduler.ActionRouterConfiguration.demultiplexing:type_name -> buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration - 3, // 2: buildbarn.configuration.scheduler.ActionRouterConfiguration.remote:type_name -> buildbarn.configuration.scheduler.RemoteActionRouterConfiguration - 4, // 3: buildbarn.configuration.scheduler.SimpleActionRouterConfiguration.platform_key_extractor:type_name -> buildbarn.configuration.scheduler.PlatformKeyExtractorConfiguration - 5, // 4: buildbarn.configuration.scheduler.SimpleActionRouterConfiguration.invocation_key_extractors:type_name -> buildbarn.configuration.scheduler.InvocationKeyExtractorConfiguration - 6, // 5: buildbarn.configuration.scheduler.SimpleActionRouterConfiguration.initial_size_class_analyzer:type_name -> buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration - 4, // 6: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.platform_key_extractor:type_name -> buildbarn.configuration.scheduler.PlatformKeyExtractorConfiguration - 9, // 7: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.backends:type_name -> buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.Backend - 0, // 8: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.default_action_router:type_name -> buildbarn.configuration.scheduler.ActionRouterConfiguration - 10, // 9: buildbarn.configuration.scheduler.RemoteActionRouterConfiguration.grpc_client:type_name -> buildbarn.configuration.grpc.ClientConfiguration - 6, // 10: buildbarn.configuration.scheduler.RemoteActionRouterConfiguration.initial_size_class_analyzer:type_name -> buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration - 11, // 11: buildbarn.configuration.scheduler.PlatformKeyExtractorConfiguration.action:type_name -> google.protobuf.Empty - 12, // 12: buildbarn.configuration.scheduler.PlatformKeyExtractorConfiguration.static:type_name -> build.bazel.remote.execution.v2.Platform - 11, // 13: buildbarn.configuration.scheduler.InvocationKeyExtractorConfiguration.tool_invocation_id:type_name -> google.protobuf.Empty - 11, // 14: buildbarn.configuration.scheduler.InvocationKeyExtractorConfiguration.correlated_invocations_id:type_name -> google.protobuf.Empty - 11, // 15: buildbarn.configuration.scheduler.InvocationKeyExtractorConfiguration.authentication_metadata:type_name -> google.protobuf.Empty - 13, // 16: buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration.default_execution_timeout:type_name -> google.protobuf.Duration - 13, // 17: buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration.maximum_execution_timeout:type_name -> google.protobuf.Duration - 7, // 18: buildbarn.configuration.scheduler.InitialSizeClassAnalyzerConfiguration.feedback_driven:type_name -> buildbarn.configuration.scheduler.InitialSizeClassFeedbackDrivenAnalyzerConfiguration - 13, // 19: buildbarn.configuration.scheduler.InitialSizeClassFeedbackDrivenAnalyzerConfiguration.failure_cache_duration:type_name -> google.protobuf.Duration - 8, // 20: buildbarn.configuration.scheduler.InitialSizeClassFeedbackDrivenAnalyzerConfiguration.page_rank:type_name -> buildbarn.configuration.scheduler.InitialSizeClassPageRankStrategyCalculatorConfiguration - 13, // 21: buildbarn.configuration.scheduler.InitialSizeClassPageRankStrategyCalculatorConfiguration.minimum_execution_timeout:type_name -> google.protobuf.Duration - 12, // 22: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.Backend.platform:type_name -> build.bazel.remote.execution.v2.Platform - 0, // 23: buildbarn.configuration.scheduler.DemultiplexingActionRouterConfiguration.Backend.action_router:type_name -> buildbarn.configuration.scheduler.ActionRouterConfiguration - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[0].OneofWrappers = []any{ - (*ActionRouterConfiguration_Simple)(nil), - (*ActionRouterConfiguration_Demultiplexing)(nil), - (*ActionRouterConfiguration_Remote)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[4].OneofWrappers = []any{ - (*PlatformKeyExtractorConfiguration_Action)(nil), - (*PlatformKeyExtractorConfiguration_Static)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes[5].OneofWrappers = []any{ - (*InvocationKeyExtractorConfiguration_ToolInvocationId)(nil), - (*InvocationKeyExtractorConfiguration_CorrelatedInvocationsId)(nil), - (*InvocationKeyExtractorConfiguration_AuthenticationMetadata)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_rawDesc)), - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_configuration_scheduler_scheduler_proto_depIdxs = nil -} diff --git a/pkg/proto/outputpathpersistency/outputpathpersistency.pb.go b/pkg/proto/outputpathpersistency/outputpathpersistency.pb.go deleted file mode 100644 index d3ba15ae..00000000 --- a/pkg/proto/outputpathpersistency/outputpathpersistency.pb.go +++ /dev/null @@ -1,324 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/outputpathpersistency/outputpathpersistency.proto - -package outputpathpersistency - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RootDirectory struct { - state protoimpl.MessageState `protogen:"open.v1"` - InitialCreationTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=initial_creation_time,json=initialCreationTime,proto3" json:"initial_creation_time,omitempty"` - Contents *Directory `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RootDirectory) Reset() { - *x = RootDirectory{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RootDirectory) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RootDirectory) ProtoMessage() {} - -func (x *RootDirectory) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RootDirectory.ProtoReflect.Descriptor instead. -func (*RootDirectory) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescGZIP(), []int{0} -} - -func (x *RootDirectory) GetInitialCreationTime() *timestamppb.Timestamp { - if x != nil { - return x.InitialCreationTime - } - return nil -} - -func (x *RootDirectory) GetContents() *Directory { - if x != nil { - return x.Contents - } - return nil -} - -type Directory struct { - state protoimpl.MessageState `protogen:"open.v1"` - Files []*v2.FileNode `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` - Directories []*DirectoryNode `protobuf:"bytes,2,rep,name=directories,proto3" json:"directories,omitempty"` - Symlinks []*v2.SymlinkNode `protobuf:"bytes,3,rep,name=symlinks,proto3" json:"symlinks,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Directory) Reset() { - *x = Directory{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Directory) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Directory) ProtoMessage() {} - -func (x *Directory) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Directory.ProtoReflect.Descriptor instead. -func (*Directory) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescGZIP(), []int{1} -} - -func (x *Directory) GetFiles() []*v2.FileNode { - if x != nil { - return x.Files - } - return nil -} - -func (x *Directory) GetDirectories() []*DirectoryNode { - if x != nil { - return x.Directories - } - return nil -} - -func (x *Directory) GetSymlinks() []*v2.SymlinkNode { - if x != nil { - return x.Symlinks - } - return nil -} - -type DirectoryNode struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - FileRegion *FileRegion `protobuf:"bytes,2,opt,name=file_region,json=fileRegion,proto3" json:"file_region,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DirectoryNode) Reset() { - *x = DirectoryNode{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DirectoryNode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DirectoryNode) ProtoMessage() {} - -func (x *DirectoryNode) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DirectoryNode.ProtoReflect.Descriptor instead. -func (*DirectoryNode) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescGZIP(), []int{2} -} - -func (x *DirectoryNode) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DirectoryNode) GetFileRegion() *FileRegion { - if x != nil { - return x.FileRegion - } - return nil -} - -type FileRegion struct { - state protoimpl.MessageState `protogen:"open.v1"` - OffsetBytes int64 `protobuf:"varint,1,opt,name=offset_bytes,json=offsetBytes,proto3" json:"offset_bytes,omitempty"` - SizeBytes int32 `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FileRegion) Reset() { - *x = FileRegion{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FileRegion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileRegion) ProtoMessage() {} - -func (x *FileRegion) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileRegion.ProtoReflect.Descriptor instead. -func (*FileRegion) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescGZIP(), []int{3} -} - -func (x *FileRegion) GetOffsetBytes() int64 { - if x != nil { - return x.OffsetBytes - } - return 0 -} - -func (x *FileRegion) GetSizeBytes() int32 { - if x != nil { - return x.SizeBytes - } - return 0 -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDesc = "" + - "\n" + - "dgithub.com/buildbarn/bb-remote-execution/pkg/proto/outputpathpersistency/outputpathpersistency.proto\x12\x1fbuildbarn.outputpathpersistency\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa7\x01\n" + - "\rRootDirectory\x12N\n" + - "\x15initial_creation_time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x13initialCreationTime\x12F\n" + - "\bcontents\x18\x02 \x01(\v2*.buildbarn.outputpathpersistency.DirectoryR\bcontents\"\xe8\x01\n" + - "\tDirectory\x12?\n" + - "\x05files\x18\x01 \x03(\v2).build.bazel.remote.execution.v2.FileNodeR\x05files\x12P\n" + - "\vdirectories\x18\x02 \x03(\v2..buildbarn.outputpathpersistency.DirectoryNodeR\vdirectories\x12H\n" + - "\bsymlinks\x18\x03 \x03(\v2,.build.bazel.remote.execution.v2.SymlinkNodeR\bsymlinks\"q\n" + - "\rDirectoryNode\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12L\n" + - "\vfile_region\x18\x02 \x01(\v2+.buildbarn.outputpathpersistency.FileRegionR\n" + - "fileRegion\"N\n" + - "\n" + - "FileRegion\x12!\n" + - "\foffset_bytes\x18\x01 \x01(\x03R\voffsetBytes\x12\x1d\n" + - "\n" + - "size_bytes\x18\x02 \x01(\x05R\tsizeBytesBJZHgithub.com/buildbarn/bb-remote-execution/pkg/proto/outputpathpersistencyb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_goTypes = []any{ - (*RootDirectory)(nil), // 0: buildbarn.outputpathpersistency.RootDirectory - (*Directory)(nil), // 1: buildbarn.outputpathpersistency.Directory - (*DirectoryNode)(nil), // 2: buildbarn.outputpathpersistency.DirectoryNode - (*FileRegion)(nil), // 3: buildbarn.outputpathpersistency.FileRegion - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp - (*v2.FileNode)(nil), // 5: build.bazel.remote.execution.v2.FileNode - (*v2.SymlinkNode)(nil), // 6: build.bazel.remote.execution.v2.SymlinkNode -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_depIdxs = []int32{ - 4, // 0: buildbarn.outputpathpersistency.RootDirectory.initial_creation_time:type_name -> google.protobuf.Timestamp - 1, // 1: buildbarn.outputpathpersistency.RootDirectory.contents:type_name -> buildbarn.outputpathpersistency.Directory - 5, // 2: buildbarn.outputpathpersistency.Directory.files:type_name -> build.bazel.remote.execution.v2.FileNode - 2, // 3: buildbarn.outputpathpersistency.Directory.directories:type_name -> buildbarn.outputpathpersistency.DirectoryNode - 6, // 4: buildbarn.outputpathpersistency.Directory.symlinks:type_name -> build.bazel.remote.execution.v2.SymlinkNode - 3, // 5: buildbarn.outputpathpersistency.DirectoryNode.file_region:type_name -> buildbarn.outputpathpersistency.FileRegion - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_outputpathpersistency_outputpathpersistency_proto_depIdxs = nil -} diff --git a/pkg/proto/remoteactionrouter/remoteactionrouter.pb.go b/pkg/proto/remoteactionrouter/remoteactionrouter.pb.go deleted file mode 100644 index ec83075d..00000000 --- a/pkg/proto/remoteactionrouter/remoteactionrouter.pb.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter/remoteactionrouter.proto - -package remoteactionrouter - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RouteActionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` - DigestFunction v2.DigestFunction_Value `protobuf:"varint,2,opt,name=digest_function,json=digestFunction,proto3,enum=build.bazel.remote.execution.v2.DigestFunction_Value" json:"digest_function,omitempty"` - Action *v2.Action `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` - RequestMetadata *v2.RequestMetadata `protobuf:"bytes,4,opt,name=request_metadata,json=requestMetadata,proto3" json:"request_metadata,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RouteActionRequest) Reset() { - *x = RouteActionRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RouteActionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RouteActionRequest) ProtoMessage() {} - -func (x *RouteActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RouteActionRequest.ProtoReflect.Descriptor instead. -func (*RouteActionRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescGZIP(), []int{0} -} - -func (x *RouteActionRequest) GetInstanceName() string { - if x != nil { - return x.InstanceName - } - return "" -} - -func (x *RouteActionRequest) GetDigestFunction() v2.DigestFunction_Value { - if x != nil { - return x.DigestFunction - } - return v2.DigestFunction_Value(0) -} - -func (x *RouteActionRequest) GetAction() *v2.Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *RouteActionRequest) GetRequestMetadata() *v2.RequestMetadata { - if x != nil { - return x.RequestMetadata - } - return nil -} - -type RouteActionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Action *v2.Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - InvocationKeys []*anypb.Any `protobuf:"bytes,4,rep,name=invocation_keys,json=invocationKeys,proto3" json:"invocation_keys,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RouteActionResponse) Reset() { - *x = RouteActionResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RouteActionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RouteActionResponse) ProtoMessage() {} - -func (x *RouteActionResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RouteActionResponse.ProtoReflect.Descriptor instead. -func (*RouteActionResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescGZIP(), []int{1} -} - -func (x *RouteActionResponse) GetAction() *v2.Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *RouteActionResponse) GetInvocationKeys() []*anypb.Any { - if x != nil { - return x.InvocationKeys - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDesc = "" + - "\n" + - "^github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter/remoteactionrouter.proto\x12\x1cbuildbarn.remoteactionrouter\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1a\x19google/protobuf/any.proto\"\xb7\x02\n" + - "\x12RouteActionRequest\x12#\n" + - "\rinstance_name\x18\x01 \x01(\tR\finstanceName\x12^\n" + - "\x0fdigest_function\x18\x02 \x01(\x0e25.build.bazel.remote.execution.v2.DigestFunction.ValueR\x0edigestFunction\x12?\n" + - "\x06action\x18\x03 \x01(\v2'.build.bazel.remote.execution.v2.ActionR\x06action\x12[\n" + - "\x10request_metadata\x18\x04 \x01(\v20.build.bazel.remote.execution.v2.RequestMetadataR\x0frequestMetadata\"\x95\x01\n" + - "\x13RouteActionResponse\x12?\n" + - "\x06action\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.ActionR\x06action\x12=\n" + - "\x0finvocation_keys\x18\x04 \x03(\v2\x14.google.protobuf.AnyR\x0einvocationKeys2\x82\x01\n" + - "\fActionRouter\x12r\n" + - "\vRouteAction\x120.buildbarn.remoteactionrouter.RouteActionRequest\x1a1.buildbarn.remoteactionrouter.RouteActionResponseBGZEgithub.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouterb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_goTypes = []any{ - (*RouteActionRequest)(nil), // 0: buildbarn.remoteactionrouter.RouteActionRequest - (*RouteActionResponse)(nil), // 1: buildbarn.remoteactionrouter.RouteActionResponse - (v2.DigestFunction_Value)(0), // 2: build.bazel.remote.execution.v2.DigestFunction.Value - (*v2.Action)(nil), // 3: build.bazel.remote.execution.v2.Action - (*v2.RequestMetadata)(nil), // 4: build.bazel.remote.execution.v2.RequestMetadata - (*anypb.Any)(nil), // 5: google.protobuf.Any -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_depIdxs = []int32{ - 2, // 0: buildbarn.remoteactionrouter.RouteActionRequest.digest_function:type_name -> build.bazel.remote.execution.v2.DigestFunction.Value - 3, // 1: buildbarn.remoteactionrouter.RouteActionRequest.action:type_name -> build.bazel.remote.execution.v2.Action - 4, // 2: buildbarn.remoteactionrouter.RouteActionRequest.request_metadata:type_name -> build.bazel.remote.execution.v2.RequestMetadata - 3, // 3: buildbarn.remoteactionrouter.RouteActionResponse.action:type_name -> build.bazel.remote.execution.v2.Action - 5, // 4: buildbarn.remoteactionrouter.RouteActionResponse.invocation_keys:type_name -> google.protobuf.Any - 0, // 5: buildbarn.remoteactionrouter.ActionRouter.RouteAction:input_type -> buildbarn.remoteactionrouter.RouteActionRequest - 1, // 6: buildbarn.remoteactionrouter.ActionRouter.RouteAction:output_type -> buildbarn.remoteactionrouter.RouteActionResponse - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteactionrouter_remoteactionrouter_proto_depIdxs = nil -} diff --git a/pkg/proto/remoteactionrouter/remoteactionrouter_grpc.pb.go b/pkg/proto/remoteactionrouter/remoteactionrouter_grpc.pb.go deleted file mode 100644 index 19776b5b..00000000 --- a/pkg/proto/remoteactionrouter/remoteactionrouter_grpc.pb.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter/remoteactionrouter.proto - -package remoteactionrouter - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ActionRouter_RouteAction_FullMethodName = "/buildbarn.remoteactionrouter.ActionRouter/RouteAction" -) - -// ActionRouterClient is the client API for ActionRouter service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ActionRouterClient interface { - RouteAction(ctx context.Context, in *RouteActionRequest, opts ...grpc.CallOption) (*RouteActionResponse, error) -} - -type actionRouterClient struct { - cc grpc.ClientConnInterface -} - -func NewActionRouterClient(cc grpc.ClientConnInterface) ActionRouterClient { - return &actionRouterClient{cc} -} - -func (c *actionRouterClient) RouteAction(ctx context.Context, in *RouteActionRequest, opts ...grpc.CallOption) (*RouteActionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RouteActionResponse) - err := c.cc.Invoke(ctx, ActionRouter_RouteAction_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ActionRouterServer is the server API for ActionRouter service. -// All implementations should embed UnimplementedActionRouterServer -// for forward compatibility. -type ActionRouterServer interface { - RouteAction(context.Context, *RouteActionRequest) (*RouteActionResponse, error) -} - -// UnimplementedActionRouterServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedActionRouterServer struct{} - -func (UnimplementedActionRouterServer) RouteAction(context.Context, *RouteActionRequest) (*RouteActionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RouteAction not implemented") -} -func (UnimplementedActionRouterServer) testEmbeddedByValue() {} - -// UnsafeActionRouterServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ActionRouterServer will -// result in compilation errors. -type UnsafeActionRouterServer interface { - mustEmbedUnimplementedActionRouterServer() -} - -func RegisterActionRouterServer(s grpc.ServiceRegistrar, srv ActionRouterServer) { - // If the following call pancis, it indicates UnimplementedActionRouterServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ActionRouter_ServiceDesc, srv) -} - -func _ActionRouter_RouteAction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RouteActionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ActionRouterServer).RouteAction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ActionRouter_RouteAction_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ActionRouterServer).RouteAction(ctx, req.(*RouteActionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ActionRouter_ServiceDesc is the grpc.ServiceDesc for ActionRouter service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ActionRouter_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.remoteactionrouter.ActionRouter", - HandlerType: (*ActionRouterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RouteAction", - Handler: _ActionRouter_RouteAction_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter/remoteactionrouter.proto", -} diff --git a/pkg/proto/remoteworker/remoteworker.pb.go b/pkg/proto/remoteworker/remoteworker.pb.go deleted file mode 100644 index 0442f3de..00000000 --- a/pkg/proto/remoteworker/remoteworker.pb.go +++ /dev/null @@ -1,708 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker/remoteworker.proto - -package remoteworker - -import ( - v2 "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SynchronizeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkerId map[string]string `protobuf:"bytes,1,rep,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - InstanceNamePrefix string `protobuf:"bytes,2,opt,name=instance_name_prefix,json=instanceNamePrefix,proto3" json:"instance_name_prefix,omitempty"` - Platform *v2.Platform `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` - SizeClass uint32 `protobuf:"varint,5,opt,name=size_class,json=sizeClass,proto3" json:"size_class,omitempty"` - CurrentState *CurrentState `protobuf:"bytes,4,opt,name=current_state,json=currentState,proto3" json:"current_state,omitempty"` - PreferBeingIdle bool `protobuf:"varint,6,opt,name=prefer_being_idle,json=preferBeingIdle,proto3" json:"prefer_being_idle,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SynchronizeRequest) Reset() { - *x = SynchronizeRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SynchronizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SynchronizeRequest) ProtoMessage() {} - -func (x *SynchronizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SynchronizeRequest.ProtoReflect.Descriptor instead. -func (*SynchronizeRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{0} -} - -func (x *SynchronizeRequest) GetWorkerId() map[string]string { - if x != nil { - return x.WorkerId - } - return nil -} - -func (x *SynchronizeRequest) GetInstanceNamePrefix() string { - if x != nil { - return x.InstanceNamePrefix - } - return "" -} - -func (x *SynchronizeRequest) GetPlatform() *v2.Platform { - if x != nil { - return x.Platform - } - return nil -} - -func (x *SynchronizeRequest) GetSizeClass() uint32 { - if x != nil { - return x.SizeClass - } - return 0 -} - -func (x *SynchronizeRequest) GetCurrentState() *CurrentState { - if x != nil { - return x.CurrentState - } - return nil -} - -func (x *SynchronizeRequest) GetPreferBeingIdle() bool { - if x != nil { - return x.PreferBeingIdle - } - return false -} - -type CurrentState struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to WorkerState: - // - // *CurrentState_Idle - // *CurrentState_Executing_ - WorkerState isCurrentState_WorkerState `protobuf_oneof:"worker_state"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CurrentState) Reset() { - *x = CurrentState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CurrentState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CurrentState) ProtoMessage() {} - -func (x *CurrentState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CurrentState.ProtoReflect.Descriptor instead. -func (*CurrentState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{1} -} - -func (x *CurrentState) GetWorkerState() isCurrentState_WorkerState { - if x != nil { - return x.WorkerState - } - return nil -} - -func (x *CurrentState) GetIdle() *emptypb.Empty { - if x != nil { - if x, ok := x.WorkerState.(*CurrentState_Idle); ok { - return x.Idle - } - } - return nil -} - -func (x *CurrentState) GetExecuting() *CurrentState_Executing { - if x != nil { - if x, ok := x.WorkerState.(*CurrentState_Executing_); ok { - return x.Executing - } - } - return nil -} - -type isCurrentState_WorkerState interface { - isCurrentState_WorkerState() -} - -type CurrentState_Idle struct { - Idle *emptypb.Empty `protobuf:"bytes,1,opt,name=idle,proto3,oneof"` -} - -type CurrentState_Executing_ struct { - Executing *CurrentState_Executing `protobuf:"bytes,2,opt,name=executing,proto3,oneof"` -} - -func (*CurrentState_Idle) isCurrentState_WorkerState() {} - -func (*CurrentState_Executing_) isCurrentState_WorkerState() {} - -type SynchronizeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - NextSynchronizationAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=next_synchronization_at,json=nextSynchronizationAt,proto3" json:"next_synchronization_at,omitempty"` - DesiredState *DesiredState `protobuf:"bytes,2,opt,name=desired_state,json=desiredState,proto3" json:"desired_state,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SynchronizeResponse) Reset() { - *x = SynchronizeResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SynchronizeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SynchronizeResponse) ProtoMessage() {} - -func (x *SynchronizeResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SynchronizeResponse.ProtoReflect.Descriptor instead. -func (*SynchronizeResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{2} -} - -func (x *SynchronizeResponse) GetNextSynchronizationAt() *timestamppb.Timestamp { - if x != nil { - return x.NextSynchronizationAt - } - return nil -} - -func (x *SynchronizeResponse) GetDesiredState() *DesiredState { - if x != nil { - return x.DesiredState - } - return nil -} - -type DesiredState struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to WorkerState: - // - // *DesiredState_Idle - // *DesiredState_Executing_ - WorkerState isDesiredState_WorkerState `protobuf_oneof:"worker_state"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DesiredState) Reset() { - *x = DesiredState{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DesiredState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DesiredState) ProtoMessage() {} - -func (x *DesiredState) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DesiredState.ProtoReflect.Descriptor instead. -func (*DesiredState) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{3} -} - -func (x *DesiredState) GetWorkerState() isDesiredState_WorkerState { - if x != nil { - return x.WorkerState - } - return nil -} - -func (x *DesiredState) GetIdle() *emptypb.Empty { - if x != nil { - if x, ok := x.WorkerState.(*DesiredState_Idle); ok { - return x.Idle - } - } - return nil -} - -func (x *DesiredState) GetExecuting() *DesiredState_Executing { - if x != nil { - if x, ok := x.WorkerState.(*DesiredState_Executing_); ok { - return x.Executing - } - } - return nil -} - -type isDesiredState_WorkerState interface { - isDesiredState_WorkerState() -} - -type DesiredState_Idle struct { - Idle *emptypb.Empty `protobuf:"bytes,1,opt,name=idle,proto3,oneof"` -} - -type DesiredState_Executing_ struct { - Executing *DesiredState_Executing `protobuf:"bytes,2,opt,name=executing,proto3,oneof"` -} - -func (*DesiredState_Idle) isDesiredState_WorkerState() {} - -func (*DesiredState_Executing_) isDesiredState_WorkerState() {} - -type CurrentState_Executing struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActionDigest *v2.Digest `protobuf:"bytes,1,opt,name=action_digest,json=actionDigest,proto3" json:"action_digest,omitempty"` - // Types that are valid to be assigned to ExecutionState: - // - // *CurrentState_Executing_Started - // *CurrentState_Executing_FetchingInputs - // *CurrentState_Executing_Running - // *CurrentState_Executing_UploadingOutputs - // *CurrentState_Executing_Completed - ExecutionState isCurrentState_Executing_ExecutionState `protobuf_oneof:"execution_state"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CurrentState_Executing) Reset() { - *x = CurrentState_Executing{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CurrentState_Executing) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CurrentState_Executing) ProtoMessage() {} - -func (x *CurrentState_Executing) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CurrentState_Executing.ProtoReflect.Descriptor instead. -func (*CurrentState_Executing) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *CurrentState_Executing) GetActionDigest() *v2.Digest { - if x != nil { - return x.ActionDigest - } - return nil -} - -func (x *CurrentState_Executing) GetExecutionState() isCurrentState_Executing_ExecutionState { - if x != nil { - return x.ExecutionState - } - return nil -} - -func (x *CurrentState_Executing) GetStarted() *emptypb.Empty { - if x != nil { - if x, ok := x.ExecutionState.(*CurrentState_Executing_Started); ok { - return x.Started - } - } - return nil -} - -func (x *CurrentState_Executing) GetFetchingInputs() *emptypb.Empty { - if x != nil { - if x, ok := x.ExecutionState.(*CurrentState_Executing_FetchingInputs); ok { - return x.FetchingInputs - } - } - return nil -} - -func (x *CurrentState_Executing) GetRunning() *emptypb.Empty { - if x != nil { - if x, ok := x.ExecutionState.(*CurrentState_Executing_Running); ok { - return x.Running - } - } - return nil -} - -func (x *CurrentState_Executing) GetUploadingOutputs() *emptypb.Empty { - if x != nil { - if x, ok := x.ExecutionState.(*CurrentState_Executing_UploadingOutputs); ok { - return x.UploadingOutputs - } - } - return nil -} - -func (x *CurrentState_Executing) GetCompleted() *v2.ExecuteResponse { - if x != nil { - if x, ok := x.ExecutionState.(*CurrentState_Executing_Completed); ok { - return x.Completed - } - } - return nil -} - -type isCurrentState_Executing_ExecutionState interface { - isCurrentState_Executing_ExecutionState() -} - -type CurrentState_Executing_Started struct { - Started *emptypb.Empty `protobuf:"bytes,2,opt,name=started,proto3,oneof"` -} - -type CurrentState_Executing_FetchingInputs struct { - FetchingInputs *emptypb.Empty `protobuf:"bytes,3,opt,name=fetching_inputs,json=fetchingInputs,proto3,oneof"` -} - -type CurrentState_Executing_Running struct { - Running *emptypb.Empty `protobuf:"bytes,4,opt,name=running,proto3,oneof"` -} - -type CurrentState_Executing_UploadingOutputs struct { - UploadingOutputs *emptypb.Empty `protobuf:"bytes,5,opt,name=uploading_outputs,json=uploadingOutputs,proto3,oneof"` -} - -type CurrentState_Executing_Completed struct { - Completed *v2.ExecuteResponse `protobuf:"bytes,6,opt,name=completed,proto3,oneof"` -} - -func (*CurrentState_Executing_Started) isCurrentState_Executing_ExecutionState() {} - -func (*CurrentState_Executing_FetchingInputs) isCurrentState_Executing_ExecutionState() {} - -func (*CurrentState_Executing_Running) isCurrentState_Executing_ExecutionState() {} - -func (*CurrentState_Executing_UploadingOutputs) isCurrentState_Executing_ExecutionState() {} - -func (*CurrentState_Executing_Completed) isCurrentState_Executing_ExecutionState() {} - -type DesiredState_Executing struct { - state protoimpl.MessageState `protogen:"open.v1"` - ActionDigest *v2.Digest `protobuf:"bytes,1,opt,name=action_digest,json=actionDigest,proto3" json:"action_digest,omitempty"` - Action *v2.Action `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` - QueuedTimestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=queued_timestamp,json=queuedTimestamp,proto3" json:"queued_timestamp,omitempty"` - AuxiliaryMetadata []*anypb.Any `protobuf:"bytes,6,rep,name=auxiliary_metadata,json=auxiliaryMetadata,proto3" json:"auxiliary_metadata,omitempty"` - InstanceNameSuffix string `protobuf:"bytes,7,opt,name=instance_name_suffix,json=instanceNameSuffix,proto3" json:"instance_name_suffix,omitempty"` - W3CTraceContext map[string]string `protobuf:"bytes,8,rep,name=w3c_trace_context,json=w3cTraceContext,proto3" json:"w3c_trace_context,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - DigestFunction v2.DigestFunction_Value `protobuf:"varint,9,opt,name=digest_function,json=digestFunction,proto3,enum=build.bazel.remote.execution.v2.DigestFunction_Value" json:"digest_function,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DesiredState_Executing) Reset() { - *x = DesiredState_Executing{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DesiredState_Executing) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DesiredState_Executing) ProtoMessage() {} - -func (x *DesiredState_Executing) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DesiredState_Executing.ProtoReflect.Descriptor instead. -func (*DesiredState_Executing) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *DesiredState_Executing) GetActionDigest() *v2.Digest { - if x != nil { - return x.ActionDigest - } - return nil -} - -func (x *DesiredState_Executing) GetAction() *v2.Action { - if x != nil { - return x.Action - } - return nil -} - -func (x *DesiredState_Executing) GetQueuedTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.QueuedTimestamp - } - return nil -} - -func (x *DesiredState_Executing) GetAuxiliaryMetadata() []*anypb.Any { - if x != nil { - return x.AuxiliaryMetadata - } - return nil -} - -func (x *DesiredState_Executing) GetInstanceNameSuffix() string { - if x != nil { - return x.InstanceNameSuffix - } - return "" -} - -func (x *DesiredState_Executing) GetW3CTraceContext() map[string]string { - if x != nil { - return x.W3CTraceContext - } - return nil -} - -func (x *DesiredState_Executing) GetDigestFunction() v2.DigestFunction_Value { - if x != nil { - return x.DigestFunction - } - return v2.DigestFunction_Value(0) -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDesc = "" + - "\n" + - "Rgithub.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker/remoteworker.proto\x12\x16buildbarn.remoteworker\x1a6build/bazel/remote/execution/v2/remote_execution.proto\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x03\n" + - "\x12SynchronizeRequest\x12U\n" + - "\tworker_id\x18\x01 \x03(\v28.buildbarn.remoteworker.SynchronizeRequest.WorkerIdEntryR\bworkerId\x120\n" + - "\x14instance_name_prefix\x18\x02 \x01(\tR\x12instanceNamePrefix\x12E\n" + - "\bplatform\x18\x03 \x01(\v2).build.bazel.remote.execution.v2.PlatformR\bplatform\x12\x1d\n" + - "\n" + - "size_class\x18\x05 \x01(\rR\tsizeClass\x12I\n" + - "\rcurrent_state\x18\x04 \x01(\v2$.buildbarn.remoteworker.CurrentStateR\fcurrentState\x12*\n" + - "\x11prefer_being_idle\x18\x06 \x01(\bR\x0fpreferBeingIdle\x1a;\n" + - "\rWorkerIdEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd5\x04\n" + - "\fCurrentState\x12,\n" + - "\x04idle\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x04idle\x12N\n" + - "\texecuting\x18\x02 \x01(\v2..buildbarn.remoteworker.CurrentState.ExecutingH\x00R\texecuting\x1a\xb6\x03\n" + - "\tExecuting\x12L\n" + - "\raction_digest\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\factionDigest\x122\n" + - "\astarted\x18\x02 \x01(\v2\x16.google.protobuf.EmptyH\x00R\astarted\x12A\n" + - "\x0ffetching_inputs\x18\x03 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x0efetchingInputs\x122\n" + - "\arunning\x18\x04 \x01(\v2\x16.google.protobuf.EmptyH\x00R\arunning\x12E\n" + - "\x11uploading_outputs\x18\x05 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x10uploadingOutputs\x12P\n" + - "\tcompleted\x18\x06 \x01(\v20.build.bazel.remote.execution.v2.ExecuteResponseH\x00R\tcompletedB\x11\n" + - "\x0fexecution_stateJ\x04\b\a\x10\bB\x0e\n" + - "\fworker_state\"\xb4\x01\n" + - "\x13SynchronizeResponse\x12R\n" + - "\x17next_synchronization_at\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x15nextSynchronizationAt\x12I\n" + - "\rdesired_state\x18\x02 \x01(\v2$.buildbarn.remoteworker.DesiredStateR\fdesiredState\"\x98\x06\n" + - "\fDesiredState\x12,\n" + - "\x04idle\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x04idle\x12N\n" + - "\texecuting\x18\x02 \x01(\v2..buildbarn.remoteworker.DesiredState.ExecutingH\x00R\texecuting\x1a\xf9\x04\n" + - "\tExecuting\x12L\n" + - "\raction_digest\x18\x01 \x01(\v2'.build.bazel.remote.execution.v2.DigestR\factionDigest\x12?\n" + - "\x06action\x18\x02 \x01(\v2'.build.bazel.remote.execution.v2.ActionR\x06action\x12E\n" + - "\x10queued_timestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x0fqueuedTimestamp\x12C\n" + - "\x12auxiliary_metadata\x18\x06 \x03(\v2\x14.google.protobuf.AnyR\x11auxiliaryMetadata\x120\n" + - "\x14instance_name_suffix\x18\a \x01(\tR\x12instanceNameSuffix\x12o\n" + - "\x11w3c_trace_context\x18\b \x03(\v2C.buildbarn.remoteworker.DesiredState.Executing.W3cTraceContextEntryR\x0fw3cTraceContext\x12^\n" + - "\x0fdigest_function\x18\t \x01(\x0e25.build.bazel.remote.execution.v2.DigestFunction.ValueR\x0edigestFunction\x1aB\n" + - "\x14W3cTraceContextEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\x03\x10\x04J\x04\b\x05\x10\x06B\x0e\n" + - "\fworker_state2x\n" + - "\x0eOperationQueue\x12f\n" + - "\vSynchronize\x12*.buildbarn.remoteworker.SynchronizeRequest\x1a+.buildbarn.remoteworker.SynchronizeResponseBAZ?github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworkerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_goTypes = []any{ - (*SynchronizeRequest)(nil), // 0: buildbarn.remoteworker.SynchronizeRequest - (*CurrentState)(nil), // 1: buildbarn.remoteworker.CurrentState - (*SynchronizeResponse)(nil), // 2: buildbarn.remoteworker.SynchronizeResponse - (*DesiredState)(nil), // 3: buildbarn.remoteworker.DesiredState - nil, // 4: buildbarn.remoteworker.SynchronizeRequest.WorkerIdEntry - (*CurrentState_Executing)(nil), // 5: buildbarn.remoteworker.CurrentState.Executing - (*DesiredState_Executing)(nil), // 6: buildbarn.remoteworker.DesiredState.Executing - nil, // 7: buildbarn.remoteworker.DesiredState.Executing.W3cTraceContextEntry - (*v2.Platform)(nil), // 8: build.bazel.remote.execution.v2.Platform - (*emptypb.Empty)(nil), // 9: google.protobuf.Empty - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*v2.Digest)(nil), // 11: build.bazel.remote.execution.v2.Digest - (*v2.ExecuteResponse)(nil), // 12: build.bazel.remote.execution.v2.ExecuteResponse - (*v2.Action)(nil), // 13: build.bazel.remote.execution.v2.Action - (*anypb.Any)(nil), // 14: google.protobuf.Any - (v2.DigestFunction_Value)(0), // 15: build.bazel.remote.execution.v2.DigestFunction.Value -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_depIdxs = []int32{ - 4, // 0: buildbarn.remoteworker.SynchronizeRequest.worker_id:type_name -> buildbarn.remoteworker.SynchronizeRequest.WorkerIdEntry - 8, // 1: buildbarn.remoteworker.SynchronizeRequest.platform:type_name -> build.bazel.remote.execution.v2.Platform - 1, // 2: buildbarn.remoteworker.SynchronizeRequest.current_state:type_name -> buildbarn.remoteworker.CurrentState - 9, // 3: buildbarn.remoteworker.CurrentState.idle:type_name -> google.protobuf.Empty - 5, // 4: buildbarn.remoteworker.CurrentState.executing:type_name -> buildbarn.remoteworker.CurrentState.Executing - 10, // 5: buildbarn.remoteworker.SynchronizeResponse.next_synchronization_at:type_name -> google.protobuf.Timestamp - 3, // 6: buildbarn.remoteworker.SynchronizeResponse.desired_state:type_name -> buildbarn.remoteworker.DesiredState - 9, // 7: buildbarn.remoteworker.DesiredState.idle:type_name -> google.protobuf.Empty - 6, // 8: buildbarn.remoteworker.DesiredState.executing:type_name -> buildbarn.remoteworker.DesiredState.Executing - 11, // 9: buildbarn.remoteworker.CurrentState.Executing.action_digest:type_name -> build.bazel.remote.execution.v2.Digest - 9, // 10: buildbarn.remoteworker.CurrentState.Executing.started:type_name -> google.protobuf.Empty - 9, // 11: buildbarn.remoteworker.CurrentState.Executing.fetching_inputs:type_name -> google.protobuf.Empty - 9, // 12: buildbarn.remoteworker.CurrentState.Executing.running:type_name -> google.protobuf.Empty - 9, // 13: buildbarn.remoteworker.CurrentState.Executing.uploading_outputs:type_name -> google.protobuf.Empty - 12, // 14: buildbarn.remoteworker.CurrentState.Executing.completed:type_name -> build.bazel.remote.execution.v2.ExecuteResponse - 11, // 15: buildbarn.remoteworker.DesiredState.Executing.action_digest:type_name -> build.bazel.remote.execution.v2.Digest - 13, // 16: buildbarn.remoteworker.DesiredState.Executing.action:type_name -> build.bazel.remote.execution.v2.Action - 10, // 17: buildbarn.remoteworker.DesiredState.Executing.queued_timestamp:type_name -> google.protobuf.Timestamp - 14, // 18: buildbarn.remoteworker.DesiredState.Executing.auxiliary_metadata:type_name -> google.protobuf.Any - 7, // 19: buildbarn.remoteworker.DesiredState.Executing.w3c_trace_context:type_name -> buildbarn.remoteworker.DesiredState.Executing.W3cTraceContextEntry - 15, // 20: buildbarn.remoteworker.DesiredState.Executing.digest_function:type_name -> build.bazel.remote.execution.v2.DigestFunction.Value - 0, // 21: buildbarn.remoteworker.OperationQueue.Synchronize:input_type -> buildbarn.remoteworker.SynchronizeRequest - 2, // 22: buildbarn.remoteworker.OperationQueue.Synchronize:output_type -> buildbarn.remoteworker.SynchronizeResponse - 22, // [22:23] is the sub-list for method output_type - 21, // [21:22] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto != nil { - return - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[1].OneofWrappers = []any{ - (*CurrentState_Idle)(nil), - (*CurrentState_Executing_)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[3].OneofWrappers = []any{ - (*DesiredState_Idle)(nil), - (*DesiredState_Executing_)(nil), - } - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes[5].OneofWrappers = []any{ - (*CurrentState_Executing_Started)(nil), - (*CurrentState_Executing_FetchingInputs)(nil), - (*CurrentState_Executing_Running)(nil), - (*CurrentState_Executing_UploadingOutputs)(nil), - (*CurrentState_Executing_Completed)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_rawDesc)), - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_remoteworker_remoteworker_proto_depIdxs = nil -} diff --git a/pkg/proto/remoteworker/remoteworker_grpc.pb.go b/pkg/proto/remoteworker/remoteworker_grpc.pb.go deleted file mode 100644 index 8971e206..00000000 --- a/pkg/proto/remoteworker/remoteworker_grpc.pb.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker/remoteworker.proto - -package remoteworker - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - OperationQueue_Synchronize_FullMethodName = "/buildbarn.remoteworker.OperationQueue/Synchronize" -) - -// OperationQueueClient is the client API for OperationQueue service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type OperationQueueClient interface { - Synchronize(ctx context.Context, in *SynchronizeRequest, opts ...grpc.CallOption) (*SynchronizeResponse, error) -} - -type operationQueueClient struct { - cc grpc.ClientConnInterface -} - -func NewOperationQueueClient(cc grpc.ClientConnInterface) OperationQueueClient { - return &operationQueueClient{cc} -} - -func (c *operationQueueClient) Synchronize(ctx context.Context, in *SynchronizeRequest, opts ...grpc.CallOption) (*SynchronizeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SynchronizeResponse) - err := c.cc.Invoke(ctx, OperationQueue_Synchronize_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OperationQueueServer is the server API for OperationQueue service. -// All implementations should embed UnimplementedOperationQueueServer -// for forward compatibility. -type OperationQueueServer interface { - Synchronize(context.Context, *SynchronizeRequest) (*SynchronizeResponse, error) -} - -// UnimplementedOperationQueueServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedOperationQueueServer struct{} - -func (UnimplementedOperationQueueServer) Synchronize(context.Context, *SynchronizeRequest) (*SynchronizeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Synchronize not implemented") -} -func (UnimplementedOperationQueueServer) testEmbeddedByValue() {} - -// UnsafeOperationQueueServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to OperationQueueServer will -// result in compilation errors. -type UnsafeOperationQueueServer interface { - mustEmbedUnimplementedOperationQueueServer() -} - -func RegisterOperationQueueServer(s grpc.ServiceRegistrar, srv OperationQueueServer) { - // If the following call pancis, it indicates UnimplementedOperationQueueServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&OperationQueue_ServiceDesc, srv) -} - -func _OperationQueue_Synchronize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SynchronizeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationQueueServer).Synchronize(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OperationQueue_Synchronize_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationQueueServer).Synchronize(ctx, req.(*SynchronizeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// OperationQueue_ServiceDesc is the grpc.ServiceDesc for OperationQueue service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var OperationQueue_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.remoteworker.OperationQueue", - HandlerType: (*OperationQueueServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Synchronize", - Handler: _OperationQueue_Synchronize_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker/remoteworker.proto", -} diff --git a/pkg/proto/resourceusage/resourceusage.pb.go b/pkg/proto/resourceusage/resourceusage.pb.go deleted file mode 100644 index 69a56188..00000000 --- a/pkg/proto/resourceusage/resourceusage.pb.go +++ /dev/null @@ -1,534 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage/resourceusage.proto - -package resourceusage - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FilePoolResourceUsage struct { - state protoimpl.MessageState `protogen:"open.v1"` - FilesCreated uint64 `protobuf:"varint,1,opt,name=files_created,json=filesCreated,proto3" json:"files_created,omitempty"` - FilesCountPeak uint64 `protobuf:"varint,2,opt,name=files_count_peak,json=filesCountPeak,proto3" json:"files_count_peak,omitempty"` - FilesSizeBytesPeak uint64 `protobuf:"varint,3,opt,name=files_size_bytes_peak,json=filesSizeBytesPeak,proto3" json:"files_size_bytes_peak,omitempty"` - ReadsCount uint64 `protobuf:"varint,4,opt,name=reads_count,json=readsCount,proto3" json:"reads_count,omitempty"` - ReadsSizeBytes uint64 `protobuf:"varint,5,opt,name=reads_size_bytes,json=readsSizeBytes,proto3" json:"reads_size_bytes,omitempty"` - WritesCount uint64 `protobuf:"varint,6,opt,name=writes_count,json=writesCount,proto3" json:"writes_count,omitempty"` - WritesSizeBytes uint64 `protobuf:"varint,7,opt,name=writes_size_bytes,json=writesSizeBytes,proto3" json:"writes_size_bytes,omitempty"` - TruncatesCount uint64 `protobuf:"varint,8,opt,name=truncates_count,json=truncatesCount,proto3" json:"truncates_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilePoolResourceUsage) Reset() { - *x = FilePoolResourceUsage{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilePoolResourceUsage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilePoolResourceUsage) ProtoMessage() {} - -func (x *FilePoolResourceUsage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FilePoolResourceUsage.ProtoReflect.Descriptor instead. -func (*FilePoolResourceUsage) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP(), []int{0} -} - -func (x *FilePoolResourceUsage) GetFilesCreated() uint64 { - if x != nil { - return x.FilesCreated - } - return 0 -} - -func (x *FilePoolResourceUsage) GetFilesCountPeak() uint64 { - if x != nil { - return x.FilesCountPeak - } - return 0 -} - -func (x *FilePoolResourceUsage) GetFilesSizeBytesPeak() uint64 { - if x != nil { - return x.FilesSizeBytesPeak - } - return 0 -} - -func (x *FilePoolResourceUsage) GetReadsCount() uint64 { - if x != nil { - return x.ReadsCount - } - return 0 -} - -func (x *FilePoolResourceUsage) GetReadsSizeBytes() uint64 { - if x != nil { - return x.ReadsSizeBytes - } - return 0 -} - -func (x *FilePoolResourceUsage) GetWritesCount() uint64 { - if x != nil { - return x.WritesCount - } - return 0 -} - -func (x *FilePoolResourceUsage) GetWritesSizeBytes() uint64 { - if x != nil { - return x.WritesSizeBytes - } - return 0 -} - -func (x *FilePoolResourceUsage) GetTruncatesCount() uint64 { - if x != nil { - return x.TruncatesCount - } - return 0 -} - -type POSIXResourceUsage struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserTime *durationpb.Duration `protobuf:"bytes,1,opt,name=user_time,json=userTime,proto3" json:"user_time,omitempty"` - SystemTime *durationpb.Duration `protobuf:"bytes,2,opt,name=system_time,json=systemTime,proto3" json:"system_time,omitempty"` - MaximumResidentSetSize int64 `protobuf:"varint,3,opt,name=maximum_resident_set_size,json=maximumResidentSetSize,proto3" json:"maximum_resident_set_size,omitempty"` - PageReclaims int64 `protobuf:"varint,7,opt,name=page_reclaims,json=pageReclaims,proto3" json:"page_reclaims,omitempty"` - PageFaults int64 `protobuf:"varint,8,opt,name=page_faults,json=pageFaults,proto3" json:"page_faults,omitempty"` - Swaps int64 `protobuf:"varint,9,opt,name=swaps,proto3" json:"swaps,omitempty"` - BlockInputOperations int64 `protobuf:"varint,10,opt,name=block_input_operations,json=blockInputOperations,proto3" json:"block_input_operations,omitempty"` - BlockOutputOperations int64 `protobuf:"varint,11,opt,name=block_output_operations,json=blockOutputOperations,proto3" json:"block_output_operations,omitempty"` - MessagesSent int64 `protobuf:"varint,12,opt,name=messages_sent,json=messagesSent,proto3" json:"messages_sent,omitempty"` - MessagesReceived int64 `protobuf:"varint,13,opt,name=messages_received,json=messagesReceived,proto3" json:"messages_received,omitempty"` - SignalsReceived int64 `protobuf:"varint,14,opt,name=signals_received,json=signalsReceived,proto3" json:"signals_received,omitempty"` - VoluntaryContextSwitches int64 `protobuf:"varint,15,opt,name=voluntary_context_switches,json=voluntaryContextSwitches,proto3" json:"voluntary_context_switches,omitempty"` - InvoluntaryContextSwitches int64 `protobuf:"varint,16,opt,name=involuntary_context_switches,json=involuntaryContextSwitches,proto3" json:"involuntary_context_switches,omitempty"` - TerminationSignal string `protobuf:"bytes,17,opt,name=termination_signal,json=terminationSignal,proto3" json:"termination_signal,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *POSIXResourceUsage) Reset() { - *x = POSIXResourceUsage{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *POSIXResourceUsage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*POSIXResourceUsage) ProtoMessage() {} - -func (x *POSIXResourceUsage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use POSIXResourceUsage.ProtoReflect.Descriptor instead. -func (*POSIXResourceUsage) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP(), []int{1} -} - -func (x *POSIXResourceUsage) GetUserTime() *durationpb.Duration { - if x != nil { - return x.UserTime - } - return nil -} - -func (x *POSIXResourceUsage) GetSystemTime() *durationpb.Duration { - if x != nil { - return x.SystemTime - } - return nil -} - -func (x *POSIXResourceUsage) GetMaximumResidentSetSize() int64 { - if x != nil { - return x.MaximumResidentSetSize - } - return 0 -} - -func (x *POSIXResourceUsage) GetPageReclaims() int64 { - if x != nil { - return x.PageReclaims - } - return 0 -} - -func (x *POSIXResourceUsage) GetPageFaults() int64 { - if x != nil { - return x.PageFaults - } - return 0 -} - -func (x *POSIXResourceUsage) GetSwaps() int64 { - if x != nil { - return x.Swaps - } - return 0 -} - -func (x *POSIXResourceUsage) GetBlockInputOperations() int64 { - if x != nil { - return x.BlockInputOperations - } - return 0 -} - -func (x *POSIXResourceUsage) GetBlockOutputOperations() int64 { - if x != nil { - return x.BlockOutputOperations - } - return 0 -} - -func (x *POSIXResourceUsage) GetMessagesSent() int64 { - if x != nil { - return x.MessagesSent - } - return 0 -} - -func (x *POSIXResourceUsage) GetMessagesReceived() int64 { - if x != nil { - return x.MessagesReceived - } - return 0 -} - -func (x *POSIXResourceUsage) GetSignalsReceived() int64 { - if x != nil { - return x.SignalsReceived - } - return 0 -} - -func (x *POSIXResourceUsage) GetVoluntaryContextSwitches() int64 { - if x != nil { - return x.VoluntaryContextSwitches - } - return 0 -} - -func (x *POSIXResourceUsage) GetInvoluntaryContextSwitches() int64 { - if x != nil { - return x.InvoluntaryContextSwitches - } - return 0 -} - -func (x *POSIXResourceUsage) GetTerminationSignal() string { - if x != nil { - return x.TerminationSignal - } - return "" -} - -type MonetaryResourceUsage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Expenses map[string]*MonetaryResourceUsage_Expense `protobuf:"bytes,1,rep,name=expenses,proto3" json:"expenses,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MonetaryResourceUsage) Reset() { - *x = MonetaryResourceUsage{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MonetaryResourceUsage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MonetaryResourceUsage) ProtoMessage() {} - -func (x *MonetaryResourceUsage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MonetaryResourceUsage.ProtoReflect.Descriptor instead. -func (*MonetaryResourceUsage) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP(), []int{2} -} - -func (x *MonetaryResourceUsage) GetExpenses() map[string]*MonetaryResourceUsage_Expense { - if x != nil { - return x.Expenses - } - return nil -} - -type InputRootResourceUsage struct { - state protoimpl.MessageState `protogen:"open.v1"` - DirectoriesResolved uint64 `protobuf:"varint,1,opt,name=directories_resolved,json=directoriesResolved,proto3" json:"directories_resolved,omitempty"` - DirectoriesRead uint64 `protobuf:"varint,2,opt,name=directories_read,json=directoriesRead,proto3" json:"directories_read,omitempty"` - FilesRead uint64 `protobuf:"varint,3,opt,name=files_read,json=filesRead,proto3" json:"files_read,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InputRootResourceUsage) Reset() { - *x = InputRootResourceUsage{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InputRootResourceUsage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InputRootResourceUsage) ProtoMessage() {} - -func (x *InputRootResourceUsage) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InputRootResourceUsage.ProtoReflect.Descriptor instead. -func (*InputRootResourceUsage) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP(), []int{3} -} - -func (x *InputRootResourceUsage) GetDirectoriesResolved() uint64 { - if x != nil { - return x.DirectoriesResolved - } - return 0 -} - -func (x *InputRootResourceUsage) GetDirectoriesRead() uint64 { - if x != nil { - return x.DirectoriesRead - } - return 0 -} - -func (x *InputRootResourceUsage) GetFilesRead() uint64 { - if x != nil { - return x.FilesRead - } - return 0 -} - -type MonetaryResourceUsage_Expense struct { - state protoimpl.MessageState `protogen:"open.v1"` - Currency string `protobuf:"bytes,1,opt,name=currency,proto3" json:"currency,omitempty"` - Cost float64 `protobuf:"fixed64,2,opt,name=cost,proto3" json:"cost,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MonetaryResourceUsage_Expense) Reset() { - *x = MonetaryResourceUsage_Expense{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MonetaryResourceUsage_Expense) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MonetaryResourceUsage_Expense) ProtoMessage() {} - -func (x *MonetaryResourceUsage_Expense) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MonetaryResourceUsage_Expense.ProtoReflect.Descriptor instead. -func (*MonetaryResourceUsage_Expense) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *MonetaryResourceUsage_Expense) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *MonetaryResourceUsage_Expense) GetCost() float64 { - if x != nil { - return x.Cost - } - return 0 -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDesc = "" + - "\n" + - "Tgithub.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage/resourceusage.proto\x12\x17buildbarn.resourceusage\x1a\x1egoogle/protobuf/duration.proto\"\xdc\x02\n" + - "\x15FilePoolResourceUsage\x12#\n" + - "\rfiles_created\x18\x01 \x01(\x04R\ffilesCreated\x12(\n" + - "\x10files_count_peak\x18\x02 \x01(\x04R\x0efilesCountPeak\x121\n" + - "\x15files_size_bytes_peak\x18\x03 \x01(\x04R\x12filesSizeBytesPeak\x12\x1f\n" + - "\vreads_count\x18\x04 \x01(\x04R\n" + - "readsCount\x12(\n" + - "\x10reads_size_bytes\x18\x05 \x01(\x04R\x0ereadsSizeBytes\x12!\n" + - "\fwrites_count\x18\x06 \x01(\x04R\vwritesCount\x12*\n" + - "\x11writes_size_bytes\x18\a \x01(\x04R\x0fwritesSizeBytes\x12'\n" + - "\x0ftruncates_count\x18\b \x01(\x04R\x0etruncatesCount\"\xcb\x05\n" + - "\x12POSIXResourceUsage\x126\n" + - "\tuser_time\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\buserTime\x12:\n" + - "\vsystem_time\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\n" + - "systemTime\x129\n" + - "\x19maximum_resident_set_size\x18\x03 \x01(\x03R\x16maximumResidentSetSize\x12#\n" + - "\rpage_reclaims\x18\a \x01(\x03R\fpageReclaims\x12\x1f\n" + - "\vpage_faults\x18\b \x01(\x03R\n" + - "pageFaults\x12\x14\n" + - "\x05swaps\x18\t \x01(\x03R\x05swaps\x124\n" + - "\x16block_input_operations\x18\n" + - " \x01(\x03R\x14blockInputOperations\x126\n" + - "\x17block_output_operations\x18\v \x01(\x03R\x15blockOutputOperations\x12#\n" + - "\rmessages_sent\x18\f \x01(\x03R\fmessagesSent\x12+\n" + - "\x11messages_received\x18\r \x01(\x03R\x10messagesReceived\x12)\n" + - "\x10signals_received\x18\x0e \x01(\x03R\x0fsignalsReceived\x12<\n" + - "\x1avoluntary_context_switches\x18\x0f \x01(\x03R\x18voluntaryContextSwitches\x12@\n" + - "\x1cinvoluntary_context_switches\x18\x10 \x01(\x03R\x1ainvoluntaryContextSwitches\x12-\n" + - "\x12termination_signal\x18\x11 \x01(\tR\x11terminationSignalJ\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\a\"\xa1\x02\n" + - "\x15MonetaryResourceUsage\x12X\n" + - "\bexpenses\x18\x01 \x03(\v2<.buildbarn.resourceusage.MonetaryResourceUsage.ExpensesEntryR\bexpenses\x1a9\n" + - "\aExpense\x12\x1a\n" + - "\bcurrency\x18\x01 \x01(\tR\bcurrency\x12\x12\n" + - "\x04cost\x18\x02 \x01(\x01R\x04cost\x1as\n" + - "\rExpensesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12L\n" + - "\x05value\x18\x02 \x01(\v26.buildbarn.resourceusage.MonetaryResourceUsage.ExpenseR\x05value:\x028\x01\"\x95\x01\n" + - "\x16InputRootResourceUsage\x121\n" + - "\x14directories_resolved\x18\x01 \x01(\x04R\x13directoriesResolved\x12)\n" + - "\x10directories_read\x18\x02 \x01(\x04R\x0fdirectoriesRead\x12\x1d\n" + - "\n" + - "files_read\x18\x03 \x01(\x04R\tfilesReadBBZ@github.com/buildbarn/bb-remote-execution/pkg/proto/resourceusageb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_goTypes = []any{ - (*FilePoolResourceUsage)(nil), // 0: buildbarn.resourceusage.FilePoolResourceUsage - (*POSIXResourceUsage)(nil), // 1: buildbarn.resourceusage.POSIXResourceUsage - (*MonetaryResourceUsage)(nil), // 2: buildbarn.resourceusage.MonetaryResourceUsage - (*InputRootResourceUsage)(nil), // 3: buildbarn.resourceusage.InputRootResourceUsage - (*MonetaryResourceUsage_Expense)(nil), // 4: buildbarn.resourceusage.MonetaryResourceUsage.Expense - nil, // 5: buildbarn.resourceusage.MonetaryResourceUsage.ExpensesEntry - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_depIdxs = []int32{ - 6, // 0: buildbarn.resourceusage.POSIXResourceUsage.user_time:type_name -> google.protobuf.Duration - 6, // 1: buildbarn.resourceusage.POSIXResourceUsage.system_time:type_name -> google.protobuf.Duration - 5, // 2: buildbarn.resourceusage.MonetaryResourceUsage.expenses:type_name -> buildbarn.resourceusage.MonetaryResourceUsage.ExpensesEntry - 4, // 3: buildbarn.resourceusage.MonetaryResourceUsage.ExpensesEntry.value:type_name -> buildbarn.resourceusage.MonetaryResourceUsage.Expense - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_rawDesc)), - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_resourceusage_resourceusage_proto_depIdxs = nil -} diff --git a/pkg/proto/runner/runner.pb.go b/pkg/proto/runner/runner.pb.go deleted file mode 100644 index b47dcdac..00000000 --- a/pkg/proto/runner/runner.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/runner/runner.proto - -package runner - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CheckReadinessRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckReadinessRequest) Reset() { - *x = CheckReadinessRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckReadinessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckReadinessRequest) ProtoMessage() {} - -func (x *CheckReadinessRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CheckReadinessRequest.ProtoReflect.Descriptor instead. -func (*CheckReadinessRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescGZIP(), []int{0} -} - -func (x *CheckReadinessRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type RunRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Arguments []string `protobuf:"bytes,1,rep,name=arguments,proto3" json:"arguments,omitempty"` - EnvironmentVariables map[string]string `protobuf:"bytes,2,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - WorkingDirectory string `protobuf:"bytes,3,opt,name=working_directory,json=workingDirectory,proto3" json:"working_directory,omitempty"` - StdoutPath string `protobuf:"bytes,4,opt,name=stdout_path,json=stdoutPath,proto3" json:"stdout_path,omitempty"` - StderrPath string `protobuf:"bytes,5,opt,name=stderr_path,json=stderrPath,proto3" json:"stderr_path,omitempty"` - InputRootDirectory string `protobuf:"bytes,6,opt,name=input_root_directory,json=inputRootDirectory,proto3" json:"input_root_directory,omitempty"` - TemporaryDirectory string `protobuf:"bytes,7,opt,name=temporary_directory,json=temporaryDirectory,proto3" json:"temporary_directory,omitempty"` - ServerLogsDirectory string `protobuf:"bytes,8,opt,name=server_logs_directory,json=serverLogsDirectory,proto3" json:"server_logs_directory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RunRequest) Reset() { - *x = RunRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RunRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RunRequest) ProtoMessage() {} - -func (x *RunRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RunRequest.ProtoReflect.Descriptor instead. -func (*RunRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescGZIP(), []int{1} -} - -func (x *RunRequest) GetArguments() []string { - if x != nil { - return x.Arguments - } - return nil -} - -func (x *RunRequest) GetEnvironmentVariables() map[string]string { - if x != nil { - return x.EnvironmentVariables - } - return nil -} - -func (x *RunRequest) GetWorkingDirectory() string { - if x != nil { - return x.WorkingDirectory - } - return "" -} - -func (x *RunRequest) GetStdoutPath() string { - if x != nil { - return x.StdoutPath - } - return "" -} - -func (x *RunRequest) GetStderrPath() string { - if x != nil { - return x.StderrPath - } - return "" -} - -func (x *RunRequest) GetInputRootDirectory() string { - if x != nil { - return x.InputRootDirectory - } - return "" -} - -func (x *RunRequest) GetTemporaryDirectory() string { - if x != nil { - return x.TemporaryDirectory - } - return "" -} - -func (x *RunRequest) GetServerLogsDirectory() string { - if x != nil { - return x.ServerLogsDirectory - } - return "" -} - -type RunResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ExitCode int64 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` - ResourceUsage []*anypb.Any `protobuf:"bytes,2,rep,name=resource_usage,json=resourceUsage,proto3" json:"resource_usage,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RunResponse) Reset() { - *x = RunResponse{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RunResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RunResponse) ProtoMessage() {} - -func (x *RunResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RunResponse.ProtoReflect.Descriptor instead. -func (*RunResponse) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescGZIP(), []int{2} -} - -func (x *RunResponse) GetExitCode() int64 { - if x != nil { - return x.ExitCode - } - return 0 -} - -func (x *RunResponse) GetResourceUsage() []*anypb.Any { - if x != nil { - return x.ResourceUsage - } - return nil -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDesc = "" + - "\n" + - "Fgithub.com/buildbarn/bb-remote-execution/pkg/proto/runner/runner.proto\x12\x10buildbarn.runner\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\"+\n" + - "\x15CheckReadinessRequest\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\"\xe6\x03\n" + - "\n" + - "RunRequest\x12\x1c\n" + - "\targuments\x18\x01 \x03(\tR\targuments\x12k\n" + - "\x15environment_variables\x18\x02 \x03(\v26.buildbarn.runner.RunRequest.EnvironmentVariablesEntryR\x14environmentVariables\x12+\n" + - "\x11working_directory\x18\x03 \x01(\tR\x10workingDirectory\x12\x1f\n" + - "\vstdout_path\x18\x04 \x01(\tR\n" + - "stdoutPath\x12\x1f\n" + - "\vstderr_path\x18\x05 \x01(\tR\n" + - "stderrPath\x120\n" + - "\x14input_root_directory\x18\x06 \x01(\tR\x12inputRootDirectory\x12/\n" + - "\x13temporary_directory\x18\a \x01(\tR\x12temporaryDirectory\x122\n" + - "\x15server_logs_directory\x18\b \x01(\tR\x13serverLogsDirectory\x1aG\n" + - "\x19EnvironmentVariablesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"g\n" + - "\vRunResponse\x12\x1b\n" + - "\texit_code\x18\x01 \x01(\x03R\bexitCode\x12;\n" + - "\x0eresource_usage\x18\x02 \x03(\v2\x14.google.protobuf.AnyR\rresourceUsage2\x9f\x01\n" + - "\x06Runner\x12Q\n" + - "\x0eCheckReadiness\x12'.buildbarn.runner.CheckReadinessRequest\x1a\x16.google.protobuf.Empty\x12B\n" + - "\x03Run\x12\x1c.buildbarn.runner.RunRequest\x1a\x1d.buildbarn.runner.RunResponseB;Z9github.com/buildbarn/bb-remote-execution/pkg/proto/runnerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_goTypes = []any{ - (*CheckReadinessRequest)(nil), // 0: buildbarn.runner.CheckReadinessRequest - (*RunRequest)(nil), // 1: buildbarn.runner.RunRequest - (*RunResponse)(nil), // 2: buildbarn.runner.RunResponse - nil, // 3: buildbarn.runner.RunRequest.EnvironmentVariablesEntry - (*anypb.Any)(nil), // 4: google.protobuf.Any - (*emptypb.Empty)(nil), // 5: google.protobuf.Empty -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_depIdxs = []int32{ - 3, // 0: buildbarn.runner.RunRequest.environment_variables:type_name -> buildbarn.runner.RunRequest.EnvironmentVariablesEntry - 4, // 1: buildbarn.runner.RunResponse.resource_usage:type_name -> google.protobuf.Any - 0, // 2: buildbarn.runner.Runner.CheckReadiness:input_type -> buildbarn.runner.CheckReadinessRequest - 1, // 3: buildbarn.runner.Runner.Run:input_type -> buildbarn.runner.RunRequest - 5, // 4: buildbarn.runner.Runner.CheckReadiness:output_type -> google.protobuf.Empty - 2, // 5: buildbarn.runner.Runner.Run:output_type -> buildbarn.runner.RunResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_init() } -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_runner_runner_proto_depIdxs = nil -} diff --git a/pkg/proto/runner/runner_grpc.pb.go b/pkg/proto/runner/runner_grpc.pb.go deleted file mode 100644 index a016024c..00000000 --- a/pkg/proto/runner/runner_grpc.pb.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/runner/runner.proto - -package runner - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Runner_CheckReadiness_FullMethodName = "/buildbarn.runner.Runner/CheckReadiness" - Runner_Run_FullMethodName = "/buildbarn.runner.Runner/Run" -) - -// RunnerClient is the client API for Runner service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type RunnerClient interface { - CheckReadiness(ctx context.Context, in *CheckReadinessRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error) -} - -type runnerClient struct { - cc grpc.ClientConnInterface -} - -func NewRunnerClient(cc grpc.ClientConnInterface) RunnerClient { - return &runnerClient{cc} -} - -func (c *runnerClient) CheckReadiness(ctx context.Context, in *CheckReadinessRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Runner_CheckReadiness_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runnerClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RunResponse) - err := c.cc.Invoke(ctx, Runner_Run_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RunnerServer is the server API for Runner service. -// All implementations should embed UnimplementedRunnerServer -// for forward compatibility. -type RunnerServer interface { - CheckReadiness(context.Context, *CheckReadinessRequest) (*emptypb.Empty, error) - Run(context.Context, *RunRequest) (*RunResponse, error) -} - -// UnimplementedRunnerServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedRunnerServer struct{} - -func (UnimplementedRunnerServer) CheckReadiness(context.Context, *CheckReadinessRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckReadiness not implemented") -} -func (UnimplementedRunnerServer) Run(context.Context, *RunRequest) (*RunResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Run not implemented") -} -func (UnimplementedRunnerServer) testEmbeddedByValue() {} - -// UnsafeRunnerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RunnerServer will -// result in compilation errors. -type UnsafeRunnerServer interface { - mustEmbedUnimplementedRunnerServer() -} - -func RegisterRunnerServer(s grpc.ServiceRegistrar, srv RunnerServer) { - // If the following call pancis, it indicates UnimplementedRunnerServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Runner_ServiceDesc, srv) -} - -func _Runner_CheckReadiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckReadinessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RunnerServer).CheckReadiness(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Runner_CheckReadiness_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RunnerServer).CheckReadiness(ctx, req.(*CheckReadinessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runner_Run_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RunRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RunnerServer).Run(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Runner_Run_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RunnerServer).Run(ctx, req.(*RunRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Runner_ServiceDesc is the grpc.ServiceDesc for Runner service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Runner_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.runner.Runner", - HandlerType: (*RunnerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CheckReadiness", - Handler: _Runner_CheckReadiness_Handler, - }, - { - MethodName: "Run", - Handler: _Runner_Run_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/runner/runner.proto", -} diff --git a/pkg/proto/tmp_installer/tmp_installer.pb.go b/pkg/proto/tmp_installer/tmp_installer.pb.go deleted file mode 100644 index 9ec73869..00000000 --- a/pkg/proto/tmp_installer/tmp_installer.pb.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11-devel -// protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/tmp_installer/tmp_installer.proto - -package tmp_installer - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type InstallTemporaryDirectoryRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - TemporaryDirectory string `protobuf:"bytes,1,opt,name=temporary_directory,json=temporaryDirectory,proto3" json:"temporary_directory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InstallTemporaryDirectoryRequest) Reset() { - *x = InstallTemporaryDirectoryRequest{} - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InstallTemporaryDirectoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstallTemporaryDirectoryRequest) ProtoMessage() {} - -func (x *InstallTemporaryDirectoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstallTemporaryDirectoryRequest.ProtoReflect.Descriptor instead. -func (*InstallTemporaryDirectoryRequest) Descriptor() ([]byte, []int) { - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescGZIP(), []int{0} -} - -func (x *InstallTemporaryDirectoryRequest) GetTemporaryDirectory() string { - if x != nil { - return x.TemporaryDirectory - } - return "" -} - -var File_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto protoreflect.FileDescriptor - -const file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDesc = "" + - "\n" + - "Tgithub.com/buildbarn/bb-remote-execution/pkg/proto/tmp_installer/tmp_installer.proto\x12\x17buildbarn.tmp_installer\x1a\x1bgoogle/protobuf/empty.proto\"S\n" + - " InstallTemporaryDirectoryRequest\x12/\n" + - "\x13temporary_directory\x18\x01 \x01(\tR\x12temporaryDirectory2\xcf\x01\n" + - "\x1bTemporaryDirectoryInstaller\x12@\n" + - "\x0eCheckReadiness\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\x12n\n" + - "\x19InstallTemporaryDirectory\x129.buildbarn.tmp_installer.InstallTemporaryDirectoryRequest\x1a\x16.google.protobuf.EmptyBBZ@github.com/buildbarn/bb-remote-execution/pkg/proto/tmp_installerb\x06proto3" - -var ( - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescOnce sync.Once - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescData []byte -) - -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescGZIP() []byte { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescOnce.Do(func() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDesc))) - }) - return file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDescData -} - -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_goTypes = []any{ - (*InstallTemporaryDirectoryRequest)(nil), // 0: buildbarn.tmp_installer.InstallTemporaryDirectoryRequest - (*emptypb.Empty)(nil), // 1: google.protobuf.Empty -} -var file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_depIdxs = []int32{ - 1, // 0: buildbarn.tmp_installer.TemporaryDirectoryInstaller.CheckReadiness:input_type -> google.protobuf.Empty - 0, // 1: buildbarn.tmp_installer.TemporaryDirectoryInstaller.InstallTemporaryDirectory:input_type -> buildbarn.tmp_installer.InstallTemporaryDirectoryRequest - 1, // 2: buildbarn.tmp_installer.TemporaryDirectoryInstaller.CheckReadiness:output_type -> google.protobuf.Empty - 1, // 3: buildbarn.tmp_installer.TemporaryDirectoryInstaller.InstallTemporaryDirectory:output_type -> google.protobuf.Empty - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_init() -} -func file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_init() { - if File_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDesc), len(file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_goTypes, - DependencyIndexes: file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_depIdxs, - MessageInfos: file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_msgTypes, - }.Build() - File_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto = out.File - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_goTypes = nil - file_github_com_buildbarn_bb_remote_execution_pkg_proto_tmp_installer_tmp_installer_proto_depIdxs = nil -} diff --git a/pkg/proto/tmp_installer/tmp_installer_grpc.pb.go b/pkg/proto/tmp_installer/tmp_installer_grpc.pb.go deleted file mode 100644 index 5e9701ae..00000000 --- a/pkg/proto/tmp_installer/tmp_installer_grpc.pb.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v7.35.0 -// source: github.com/buildbarn/bb-remote-execution/pkg/proto/tmp_installer/tmp_installer.proto - -package tmp_installer - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - TemporaryDirectoryInstaller_CheckReadiness_FullMethodName = "/buildbarn.tmp_installer.TemporaryDirectoryInstaller/CheckReadiness" - TemporaryDirectoryInstaller_InstallTemporaryDirectory_FullMethodName = "/buildbarn.tmp_installer.TemporaryDirectoryInstaller/InstallTemporaryDirectory" -) - -// TemporaryDirectoryInstallerClient is the client API for TemporaryDirectoryInstaller service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TemporaryDirectoryInstallerClient interface { - CheckReadiness(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) - InstallTemporaryDirectory(ctx context.Context, in *InstallTemporaryDirectoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type temporaryDirectoryInstallerClient struct { - cc grpc.ClientConnInterface -} - -func NewTemporaryDirectoryInstallerClient(cc grpc.ClientConnInterface) TemporaryDirectoryInstallerClient { - return &temporaryDirectoryInstallerClient{cc} -} - -func (c *temporaryDirectoryInstallerClient) CheckReadiness(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, TemporaryDirectoryInstaller_CheckReadiness_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *temporaryDirectoryInstallerClient) InstallTemporaryDirectory(ctx context.Context, in *InstallTemporaryDirectoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, TemporaryDirectoryInstaller_InstallTemporaryDirectory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TemporaryDirectoryInstallerServer is the server API for TemporaryDirectoryInstaller service. -// All implementations should embed UnimplementedTemporaryDirectoryInstallerServer -// for forward compatibility. -type TemporaryDirectoryInstallerServer interface { - CheckReadiness(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - InstallTemporaryDirectory(context.Context, *InstallTemporaryDirectoryRequest) (*emptypb.Empty, error) -} - -// UnimplementedTemporaryDirectoryInstallerServer should be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedTemporaryDirectoryInstallerServer struct{} - -func (UnimplementedTemporaryDirectoryInstallerServer) CheckReadiness(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckReadiness not implemented") -} -func (UnimplementedTemporaryDirectoryInstallerServer) InstallTemporaryDirectory(context.Context, *InstallTemporaryDirectoryRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method InstallTemporaryDirectory not implemented") -} -func (UnimplementedTemporaryDirectoryInstallerServer) testEmbeddedByValue() {} - -// UnsafeTemporaryDirectoryInstallerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TemporaryDirectoryInstallerServer will -// result in compilation errors. -type UnsafeTemporaryDirectoryInstallerServer interface { - mustEmbedUnimplementedTemporaryDirectoryInstallerServer() -} - -func RegisterTemporaryDirectoryInstallerServer(s grpc.ServiceRegistrar, srv TemporaryDirectoryInstallerServer) { - // If the following call pancis, it indicates UnimplementedTemporaryDirectoryInstallerServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&TemporaryDirectoryInstaller_ServiceDesc, srv) -} - -func _TemporaryDirectoryInstaller_CheckReadiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TemporaryDirectoryInstallerServer).CheckReadiness(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TemporaryDirectoryInstaller_CheckReadiness_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TemporaryDirectoryInstallerServer).CheckReadiness(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _TemporaryDirectoryInstaller_InstallTemporaryDirectory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InstallTemporaryDirectoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TemporaryDirectoryInstallerServer).InstallTemporaryDirectory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TemporaryDirectoryInstaller_InstallTemporaryDirectory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TemporaryDirectoryInstallerServer).InstallTemporaryDirectory(ctx, req.(*InstallTemporaryDirectoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TemporaryDirectoryInstaller_ServiceDesc is the grpc.ServiceDesc for TemporaryDirectoryInstaller service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TemporaryDirectoryInstaller_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "buildbarn.tmp_installer.TemporaryDirectoryInstaller", - HandlerType: (*TemporaryDirectoryInstallerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CheckReadiness", - Handler: _TemporaryDirectoryInstaller_CheckReadiness_Handler, - }, - { - MethodName: "InstallTemporaryDirectory", - Handler: _TemporaryDirectoryInstaller_InstallTemporaryDirectory_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/buildbarn/bb-remote-execution/pkg/proto/tmp_installer/tmp_installer.proto", -} diff --git a/pkg/scheduler/platform/BUILD.bazel b/pkg/scheduler/platform/BUILD.bazel index f08447c6..c03f1f21 100644 --- a/pkg/scheduler/platform/BUILD.bazel +++ b/pkg/scheduler/platform/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//pkg/proto/buildqueuestate", "//pkg/proto/configuration/scheduler", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_golang_protobuf//jsonpb", diff --git a/pkg/scheduler/platform/configuration.go b/pkg/scheduler/platform/configuration.go index 8702ca44..800035a4 100644 --- a/pkg/scheduler/platform/configuration.go +++ b/pkg/scheduler/platform/configuration.go @@ -2,7 +2,7 @@ package platform import ( pb "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -10,7 +10,7 @@ import ( // NewKeyExtractorFromConfiguration creates a new KeyExtractor based on // options specified in a configuration file. -func NewKeyExtractorFromConfiguration(configuration *pb.PlatformKeyExtractorConfiguration, contentAddressableStorage blobstore.BlobAccess) (KeyExtractor, error) { +func NewKeyExtractorFromConfiguration(configuration *pb.PlatformKeyExtractorConfiguration, contentAddressableStorage cdc.ContentAddressableStorage) (KeyExtractor, error) { if configuration == nil { return nil, status.Error(codes.InvalidArgument, "No platform key extractor configuration provided") } diff --git a/pkg/scheduler/routing/BUILD.bazel b/pkg/scheduler/routing/BUILD.bazel index 67f8eb6f..505ff5e7 100644 --- a/pkg/scheduler/routing/BUILD.bazel +++ b/pkg/scheduler/routing/BUILD.bazel @@ -18,7 +18,7 @@ go_library( "//pkg/scheduler/invocation", "//pkg/scheduler/platform", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore", + "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/grpc", "@com_github_buildbarn_bb_storage//pkg/program", diff --git a/pkg/scheduler/routing/configuration.go b/pkg/scheduler/routing/configuration.go index b65e8320..7ec6129c 100644 --- a/pkg/scheduler/routing/configuration.go +++ b/pkg/scheduler/routing/configuration.go @@ -6,7 +6,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/initialsizeclass" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/invocation" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/platform" - "github.com/buildbarn/bb-storage/pkg/blobstore" + "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" bb_grpc "github.com/buildbarn/bb-storage/pkg/grpc" "github.com/buildbarn/bb-storage/pkg/program" @@ -18,7 +18,7 @@ import ( // NewActionRouterFromConfiguration creates an ActionRouter based on // options specified in a configuration file. -func NewActionRouterFromConfiguration(configuration *pb.ActionRouterConfiguration, contentAddressableStorage blobstore.BlobAccess, previousExecutionStatsStore initialsizeclass.PreviousExecutionStatsStore, grpcClientFactory bb_grpc.ClientFactory, dependenciesGroup program.Group) (ActionRouter, error) { +func NewActionRouterFromConfiguration(configuration *pb.ActionRouterConfiguration, contentAddressableStorage cdc.ContentAddressableStorage, previousExecutionStatsStore initialsizeclass.PreviousExecutionStatsStore, grpcClientFactory bb_grpc.ClientFactory, dependenciesGroup program.Group) (ActionRouter, error) { if configuration == nil { return nil, status.Error(codes.InvalidArgument, "No action router configuration provided") } From 0b76660d872e0c2343f3ff7bc46da18076e5f69d Mon Sep 17 00:00:00 2001 From: Benjamin Ingberg Date: Wed, 26 Aug 2026 14:57:17 +0200 Subject: [PATCH 3/4] Move ContentAddressableStorage to pkg/cas --- cmd/bb_scheduler/BUILD.bazel | 1 - internal/mock/BUILD.bazel | 25 ++++++++++--------- pkg/builder/BUILD.bazel | 2 +- pkg/builder/caching_build_executor.go | 8 +++--- pkg/builder/local_build_executor.go | 10 ++++---- pkg/builder/naive_build_directory.go | 2 +- pkg/builder/prefetching_build_executor.go | 16 ++++++------ pkg/builder/virtual_build_directory.go | 14 +++++------ pkg/cas/BUILD.bazel | 1 + pkg/cas/batching_blob_uploader.go | 6 ++--- pkg/cas/cas_directory_fetcher.go | 10 ++++---- pkg/cas/cas_file_fetcher.go | 8 +++--- pkg/cas/cas_message_reader.go | 8 +++--- ...recondition_content_addressable_storage.go | 6 ++--- pkg/cas/put_blob.go | 12 ++++----- .../suspending_content_addressable_storage.go | 5 ++-- pkg/filesystem/virtual/BUILD.bazel | 2 +- .../virtual/blob_access_cas_file_factory.go | 8 +++--- pkg/scheduler/platform/BUILD.bazel | 2 +- pkg/scheduler/platform/configuration.go | 4 +-- pkg/scheduler/routing/BUILD.bazel | 2 +- pkg/scheduler/routing/configuration.go | 4 +-- 22 files changed, 79 insertions(+), 77 deletions(-) diff --git a/cmd/bb_scheduler/BUILD.bazel b/cmd/bb_scheduler/BUILD.bazel index 2ab6cf61..5d1e52ca 100644 --- a/cmd/bb_scheduler/BUILD.bazel +++ b/cmd/bb_scheduler/BUILD.bazel @@ -40,7 +40,6 @@ go_library( "//pkg/util", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth/configuration", - "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/configuration", "@com_github_buildbarn_bb_storage//pkg/capabilities", "@com_github_buildbarn_bb_storage//pkg/clock", diff --git a/internal/mock/BUILD.bazel b/internal/mock/BUILD.bazel index e817b1fc..3c48e8b3 100644 --- a/internal/mock/BUILD.bazel +++ b/internal/mock/BUILD.bazel @@ -93,16 +93,6 @@ gomock( package = "mock", ) -gomock( - name = "cdc", - out = "cdc.go", - interfaces = ["ContentAddressableStorage"], - library = "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", - mockgen_model_library = "@org_uber_go_mock//mockgen/model", - mockgen_tool = "@org_uber_go_mock//mockgen", - package = "mock", -) - gomock( name = "cleaner", out = "cleaner.go", @@ -407,6 +397,16 @@ gomock( package = "mock", ) +gomock( + name = "storage_cas", + out = "storage_cas.go", + interfaces = ["ContentAddressableStorage"], + library = "@com_github_buildbarn_bb_storage//pkg/cas", + mockgen_model_library = "@org_uber_go_mock//mockgen/model", + mockgen_tool = "@org_uber_go_mock//mockgen", + package = "mock", +) + gomock( name = "storage_util", out = "storage_util.go", @@ -459,7 +459,6 @@ go_library( ":blockdevice.go", ":builder.go", ":cas.go", - ":cdc.go", ":cleaner.go", ":clock.go", ":clock_re.go", @@ -481,6 +480,7 @@ go_library( ":runner_pb.go", ":storage.go", ":storage_builder.go", + ":storage_cas.go", ":storage_util.go", ":sync.go", ":trace.go", @@ -522,10 +522,11 @@ go_library( "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", - "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/blobstore/slicing", "@com_github_buildbarn_bb_storage//pkg/blobstore/chunklist", "@com_github_buildbarn_bb_storage//pkg/builder", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", diff --git a/pkg/builder/BUILD.bazel b/pkg/builder/BUILD.bazel index 374df7ee..a8ede5d5 100644 --- a/pkg/builder/BUILD.bazel +++ b/pkg/builder/BUILD.bazel @@ -48,7 +48,7 @@ go_library( "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/blobstore", "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", - "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", diff --git a/pkg/builder/caching_build_executor.go b/pkg/builder/caching_build_executor.go index 13dcd2bb..65bdad38 100644 --- a/pkg/builder/caching_build_executor.go +++ b/pkg/builder/caching_build_executor.go @@ -12,7 +12,7 @@ import ( re_util "github.com/buildbarn/bb-remote-execution/pkg/util" "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/util" @@ -22,7 +22,7 @@ import ( type cachingBuildExecutor struct { BuildExecutor - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage actionCache blobstore.BlobAccess browserURL *url.URL } @@ -34,7 +34,7 @@ type cachingBuildExecutor struct { // // In both cases, a link to bb_browser is added to the ExecuteResponse, // so that the user may inspect the Action and ActionResult in detail. -func NewCachingBuildExecutor(base BuildExecutor, contentAddressableStorage cdc.ContentAddressableStorage, actionCache blobstore.BlobAccess, browserURL *url.URL) BuildExecutor { +func NewCachingBuildExecutor(base BuildExecutor, contentAddressableStorage cas.ContentAddressableStorage, actionCache blobstore.BlobAccess, browserURL *url.URL) BuildExecutor { return &cachingBuildExecutor{ BuildExecutor: base, contentAddressableStorage: contentAddressableStorage, @@ -60,7 +60,7 @@ func (be *cachingBuildExecutor) Execute(ctx context.Context, filePool pool.FileP // Extension: store the result in the Content // Addressable Storage, so the user can at least inspect // it through bb_browser. - if historicalExecuteResponseDigest, err := cdc.PutProto( + if historicalExecuteResponseDigest, err := cas.PutProto( ctx, be.contentAddressableStorage, &cas_proto.HistoricalExecuteResponse{ diff --git a/pkg/builder/local_build_executor.go b/pkg/builder/local_build_executor.go index 00d253e7..5e384924 100644 --- a/pkg/builder/local_build_executor.go +++ b/pkg/builder/local_build_executor.go @@ -7,13 +7,13 @@ import ( "time" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/pkg/cas" + re_cas "github.com/buildbarn/bb-remote-execution/pkg/cas" re_clock "github.com/buildbarn/bb-remote-execution/pkg/clock" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" runner_pb "github.com/buildbarn/bb-remote-execution/pkg/proto/runner" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" @@ -68,8 +68,8 @@ func (el *capturingErrorLogger) GetError() error { type localBuildExecutor struct { commandReader storage.MessageReader[*remoteexecution.Command] - blobUploader cas.BlobUploader - contentAddressableStorage cdc.ContentAddressableStorage + blobUploader re_cas.BlobUploader + contentAddressableStorage cas.ContentAddressableStorage buildDirectoryCreator BuildDirectoryCreator runner runner_pb.RunnerClient clock clock.Clock @@ -81,7 +81,7 @@ type localBuildExecutor struct { // NewLocalBuildExecutor returns a BuildExecutor that executes build // steps on the local system. -func NewLocalBuildExecutor(contentAddressableStorage cdc.ContentAddressableStorage, commandReader storage.MessageReader[*remoteexecution.Command], blobUploader cas.BlobUploader, buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { +func NewLocalBuildExecutor(contentAddressableStorage cas.ContentAddressableStorage, commandReader storage.MessageReader[*remoteexecution.Command], blobUploader re_cas.BlobUploader, buildDirectoryCreator BuildDirectoryCreator, runner runner_pb.RunnerClient, clock clock.Clock, maximumWritableFileUploadDelay time.Duration, inputRootCharacterDevices map[path.Component]filesystem.DeviceNumber, environmentVariables map[string]string, forceUploadTreesAndDirectories bool) BuildExecutor { return &localBuildExecutor{ blobUploader: blobUploader, contentAddressableStorage: contentAddressableStorage, diff --git a/pkg/builder/naive_build_directory.go b/pkg/builder/naive_build_directory.go index f9b745a8..ef28a23e 100644 --- a/pkg/builder/naive_build_directory.go +++ b/pkg/builder/naive_build_directory.go @@ -23,7 +23,7 @@ type naiveBuildDirectoryOptions struct { directoryFetcher cas.DirectoryFetcher fileFetcher cas.FileFetcher fileFetcherSemaphore *semaphore.Weighted - // contentAddressableStorage cdc.ContentAddressableStorage + // contentAddressableStorage cas.ContentAddressableStorage blobUploader cas.BlobUploader } diff --git a/pkg/builder/prefetching_build_executor.go b/pkg/builder/prefetching_build_executor.go index da00bdd1..059fbca4 100644 --- a/pkg/builder/prefetching_build_executor.go +++ b/pkg/builder/prefetching_build_executor.go @@ -6,13 +6,13 @@ import ( "log" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/pkg/cas" + re_cas "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" "github.com/buildbarn/bb-storage/pkg/blobstore" "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem/path" "github.com/buildbarn/bb-storage/pkg/proto/fsac" @@ -28,8 +28,8 @@ import ( type prefetchingBuildExecutor struct { BuildExecutor - contentAddressableStorage cdc.ContentAddressableStorage - directoryFetcher cas.DirectoryFetcher + contentAddressableStorage cas.ContentAddressableStorage + directoryFetcher re_cas.DirectoryFetcher fileReadSemaphore *semaphore.Weighted fileSystemAccessCache blobstore.BlobAccess maximumMessageSizeBytes int @@ -54,7 +54,7 @@ type prefetchingBuildExecutor struct { // directory (FUSE, NFSv4). On workers that use native build // directories, the monitor is ignored, leading to empty Bloom filters // being stored. -func NewPrefetchingBuildExecutor(buildExecutor BuildExecutor, contentAddressableStorage cdc.ContentAddressableStorage, directoryFetcher cas.DirectoryFetcher, fileReadSemaphore *semaphore.Weighted, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes, bloomFilterBitsPerElement, bloomFilterMaximumSizeBytes int) BuildExecutor { +func NewPrefetchingBuildExecutor(buildExecutor BuildExecutor, contentAddressableStorage cas.ContentAddressableStorage, directoryFetcher re_cas.DirectoryFetcher, fileReadSemaphore *semaphore.Weighted, fileSystemAccessCache blobstore.BlobAccess, maximumMessageSizeBytes, bloomFilterBitsPerElement, bloomFilterMaximumSizeBytes int) BuildExecutor { be := &prefetchingBuildExecutor{ BuildExecutor: buildExecutor, contentAddressableStorage: contentAddressableStorage, @@ -193,8 +193,8 @@ type directoryPrefetcher struct { group *errgroup.Group bloomFilter *access.BloomFilterReader digestFunction digest.Function - contentAddressableStorage cdc.ContentAddressableStorage - directoryFetcher cas.DirectoryFetcher + contentAddressableStorage cas.ContentAddressableStorage + directoryFetcher re_cas.DirectoryFetcher fileReadSemaphore *semaphore.Weighted } @@ -246,7 +246,7 @@ func (dp *directoryPrefetcher) prefetchRecursively(pathTrace *path.Trace, direct } dp.group.Go(func() error { var b [1]byte - _, err := cdc.ReadBlobAt(dp.context, dp.contentAddressableStorage, fileDigest, b[:], 0) + _, err := cas.ReadBlobAt(dp.context, dp.contentAddressableStorage, fileDigest, b[:], 0) dp.fileReadSemaphore.Release(1) if err != nil && err != io.EOF && status.Code(err) != codes.Canceled { return util.StatusWrapf(err, "Failed to prefetch file %#v", childPathTrace.GetUNIXString()) diff --git a/pkg/builder/virtual_build_directory.go b/pkg/builder/virtual_build_directory.go index f61c0ab7..d9b1cd4e 100644 --- a/pkg/builder/virtual_build_directory.go +++ b/pkg/builder/virtual_build_directory.go @@ -5,11 +5,11 @@ import ( "os" "syscall" - "github.com/buildbarn/bb-remote-execution/pkg/cas" + re_cas "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/virtual" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/clock" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" @@ -21,9 +21,9 @@ import ( ) type virtualBuildDirectoryOptions struct { - directoryFetcher cas.DirectoryFetcher - contentAddressableStorage cdc.ContentAddressableStorage - blobUploader cas.BlobUploader + directoryFetcher re_cas.DirectoryFetcher + contentAddressableStorage cas.ContentAddressableStorage + blobUploader re_cas.BlobUploader symlinkFactory virtual.SymlinkFactory characterDeviceFactory virtual.CharacterDeviceFactory handleAllocator virtual.StatefulHandleAllocator @@ -41,7 +41,7 @@ type virtualBuildDirectory struct { // input root explicitly, it calls PrepopulatedDirectory.CreateChildren // to add special file and directory nodes whose contents are read on // demand. -func NewVirtualBuildDirectory(directory virtual.PrepopulatedDirectory, directoryFetcher cas.DirectoryFetcher, contentAddressableStorage cdc.ContentAddressableStorage, blobUploader cas.BlobUploader, symlinkFactory virtual.SymlinkFactory, characterDeviceFactory virtual.CharacterDeviceFactory, handleAllocator virtual.StatefulHandleAllocator, defaultAttributesSetter virtual.DefaultAttributesSetter, clock clock.Clock) BuildDirectory { +func NewVirtualBuildDirectory(directory virtual.PrepopulatedDirectory, directoryFetcher re_cas.DirectoryFetcher, contentAddressableStorage cas.ContentAddressableStorage, blobUploader re_cas.BlobUploader, symlinkFactory virtual.SymlinkFactory, characterDeviceFactory virtual.CharacterDeviceFactory, handleAllocator virtual.StatefulHandleAllocator, defaultAttributesSetter virtual.DefaultAttributesSetter, clock clock.Clock) BuildDirectory { return &virtualBuildDirectory{ PrepopulatedDirectory: directory, options: &virtualBuildDirectoryOptions{ @@ -122,7 +122,7 @@ func (d *virtualBuildDirectory) InstallHooks(filePool pool.FilePool, errorLogger func (d *virtualBuildDirectory) MergeDirectoryContents(ctx context.Context, errorLogger util.ErrorLogger, digest digest.Digest, monitor access.UnreadDirectoryMonitor) error { initialContentsFetcher := virtual.NewCASInitialContentsFetcher( ctx, - cas.NewDecomposedDirectoryWalker(d.options.directoryFetcher, digest), + re_cas.NewDecomposedDirectoryWalker(d.options.directoryFetcher, digest), virtual.NewStatelessHandleAllocatingCASFileFactory( virtual.NewBlobAccessCASFileFactory( ctx, diff --git a/pkg/cas/BUILD.bazel b/pkg/cas/BUILD.bazel index b307ec6d..eb45fc4a 100644 --- a/pkg/cas/BUILD.bazel +++ b/pkg/cas/BUILD.bazel @@ -31,6 +31,7 @@ go_library( "@com_github_buildbarn_bb_storage//pkg/blobstore/buffer", "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", "@com_github_buildbarn_bb_storage//pkg/blobstore/chunklist", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/eviction", "@com_github_buildbarn_bb_storage//pkg/filesystem", diff --git a/pkg/cas/batching_blob_uploader.go b/pkg/cas/batching_blob_uploader.go index 93095f50..d29179b3 100644 --- a/pkg/cas/batching_blob_uploader.go +++ b/pkg/cas/batching_blob_uploader.go @@ -4,7 +4,7 @@ import ( "context" "sync" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/util" @@ -18,7 +18,7 @@ type pendingUploadOperation struct { } type batchingBlobUploader struct { - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage digestKeyFormat digest.KeyFormat batchSize int uploadConcurrencySemaphore *semaphore.Weighted @@ -31,7 +31,7 @@ type batchingBlobUploader struct { // NewBatchingBlobUploader returns a BlobUploader that batches uploads // to the Content Addressable Storage (CAS) into batches of the // specified size while still respecting an upload concurrency. -func NewBatchingBlobUploader(contentAddressableStorage cdc.ContentAddressableStorage, batchSize int, uploadConcurrencySemaphore *semaphore.Weighted) (BlobUploader, func(context.Context) error) { +func NewBatchingBlobUploader(contentAddressableStorage cas.ContentAddressableStorage, batchSize int, uploadConcurrencySemaphore *semaphore.Weighted) (BlobUploader, func(context.Context) error) { bu := &batchingBlobUploader{ contentAddressableStorage: contentAddressableStorage, digestKeyFormat: contentAddressableStorage.GetDigestKeyFormat(), diff --git a/pkg/cas/cas_directory_fetcher.go b/pkg/cas/cas_directory_fetcher.go index 3f037bb1..f8a92897 100644 --- a/pkg/cas/cas_directory_fetcher.go +++ b/pkg/cas/cas_directory_fetcher.go @@ -7,7 +7,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/util" @@ -23,14 +23,14 @@ import ( var errTargetFound = errors.New("target directory found") type casDirectoryFetcher struct { - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage maximumTreeSizeBytes int64 maximumDirectorySizeBytes int64 } // NewCASDirectoryFetcher creates a DirectoryFetcher that reads Directory // objects from a CAS. -func NewCASDirectoryFetcher(contentAddressableStorage cdc.ContentAddressableStorage, maximumDirectorySizeBytes, maximumTreeSizeBytes int64) DirectoryFetcher { +func NewCASDirectoryFetcher(contentAddressableStorage cas.ContentAddressableStorage, maximumDirectorySizeBytes, maximumTreeSizeBytes int64) DirectoryFetcher { return &casDirectoryFetcher{ contentAddressableStorage: contentAddressableStorage, maximumDirectorySizeBytes: maximumDirectorySizeBytes, @@ -43,7 +43,7 @@ func (df *casDirectoryFetcher) GetDirectory(ctx context.Context, directoryDigest return nil, status.Errorf(codes.InvalidArgument, "Directory exceeds the maximum permitted size of %d bytes", df.maximumDirectorySizeBytes) } - m, err := cdc.GetProto(ctx, df.contentAddressableStorage, directoryDigest, &remoteexecution.Directory{}) + m, err := cas.GetProto(ctx, df.contentAddressableStorage, directoryDigest, &remoteexecution.Directory{}) if err != nil { return nil, err } @@ -60,7 +60,7 @@ func (df *casDirectoryFetcher) streamTree(ctx context.Context, treeDigest digest return status.Errorf(codes.InvalidArgument, "Tree exceeds the maximum permitted size of %d bytes", df.maximumTreeSizeBytes) } - r, err := cdc.GetReadCloser(ctx, df.contentAddressableStorage, treeDigest) + r, err := cas.GetReadCloser(ctx, df.contentAddressableStorage, treeDigest) if err != nil { return err } diff --git a/pkg/cas/cas_file_fetcher.go b/pkg/cas/cas_file_fetcher.go index 924e789e..1dfc36ad 100644 --- a/pkg/cas/cas_file_fetcher.go +++ b/pkg/cas/cas_file_fetcher.go @@ -4,19 +4,19 @@ import ( "context" "os" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" ) type blobAccessFileFetcher struct { - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage } // NewCASFileFetcher creates a FileFetcher that reads files fom a // Content Addressable Storage (CAS). -func NewCASFileFetcher(contentAddressableStorage cdc.ContentAddressableStorage) FileFetcher { +func NewCASFileFetcher(contentAddressableStorage cas.ContentAddressableStorage) FileFetcher { return &blobAccessFileFetcher{ contentAddressableStorage: contentAddressableStorage, } @@ -34,7 +34,7 @@ func (ff *blobAccessFileFetcher) GetFile(ctx context.Context, digest digest.Dige } defer w.Close() - if err := cdc.IntoWriter(ctx, ff.contentAddressableStorage, digest, 0, w); err != nil { + if err := cas.IntoWriter(ctx, ff.contentAddressableStorage, digest, 0, w); err != nil { // Ensure no traces are left behind upon failure. directory.Remove(name) return err diff --git a/pkg/cas/cas_message_reader.go b/pkg/cas/cas_message_reader.go index a1f5c7eb..ba467148 100644 --- a/pkg/cas/cas_message_reader.go +++ b/pkg/cas/cas_message_reader.go @@ -3,7 +3,7 @@ package cas import ( "context" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/storage" @@ -13,11 +13,11 @@ import ( ) type casMessageReader[T proto.Message] struct { - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage maximumMessageSizeBytes int } -func NewCASMessageReader[T proto.Message](contentAddressableStorage cdc.ContentAddressableStorage, maximumMessageSizeBytes int) storage.MessageReader[T] { +func NewCASMessageReader[T proto.Message](contentAddressableStorage cas.ContentAddressableStorage, maximumMessageSizeBytes int) storage.MessageReader[T] { return &casMessageReader[T]{ contentAddressableStorage: contentAddressableStorage, maximumMessageSizeBytes: maximumMessageSizeBytes, @@ -29,5 +29,5 @@ func (r *casMessageReader[T]) ReadMessage(ctx context.Context, d digest.Digest, if d.GetSizeBytes() > int64(r.maximumMessageSizeBytes) { return zero, status.Errorf(codes.InvalidArgument, "Message size %d exceeds maximum allowed size %d", d.GetSizeBytes(), r.maximumMessageSizeBytes) } - return cdc.GetProto(ctx, r.contentAddressableStorage, d, message) + return cas.GetProto(ctx, r.contentAddressableStorage, d, message) } diff --git a/pkg/cas/existence_precondition_content_addressable_storage.go b/pkg/cas/existence_precondition_content_addressable_storage.go index 8d0c8437..fdd33c2c 100644 --- a/pkg/cas/existence_precondition_content_addressable_storage.go +++ b/pkg/cas/existence_precondition_content_addressable_storage.go @@ -4,8 +4,8 @@ import ( "context" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/blobstore/chunklist" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "google.golang.org/genproto/googleapis/rpc/errdetails" @@ -14,7 +14,7 @@ import ( ) type existencePreconditionContentAddressableStorage struct { - cdc.ContentAddressableStorage + cas.ContentAddressableStorage } // NewExistencePreconditionContentAddressableStorage wraps a @@ -22,7 +22,7 @@ type existencePreconditionContentAddressableStorage struct { // code "FAILED_PRECONDITION" instead of "NOT_FOUND" for Get() style // operations. This is used by worker processes to make // Execution::Execute() comply to the protocol. -func NewExistencePreconditionContentAddressableStorage(contentAddressableStorage cdc.ContentAddressableStorage) cdc.ContentAddressableStorage { +func NewExistencePreconditionContentAddressableStorage(contentAddressableStorage cas.ContentAddressableStorage) cas.ContentAddressableStorage { return &existencePreconditionContentAddressableStorage{ ContentAddressableStorage: contentAddressableStorage, } diff --git a/pkg/cas/put_blob.go b/pkg/cas/put_blob.go index 260ee3c4..2a2842a5 100644 --- a/pkg/cas/put_blob.go +++ b/pkg/cas/put_blob.go @@ -4,13 +4,13 @@ import ( "context" "io" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/util" ) -func PutBlob(ctx context.Context, cas cdc.ContentAddressableStorage, d digest.Digest, blob Blob) error { - params, err := cas.FetchCDCParameters(ctx, d.GetInstanceName()) +func PutBlob(ctx context.Context, contentAddressableStorage cas.ContentAddressableStorage, d digest.Digest, blob Blob) error { + params, err := contentAddressableStorage.FetchCDCParameters(ctx, d.GetInstanceName()) if err != nil { blob.Discard() return util.StatusWrap(err, "Could not fetch CDC parameters") @@ -18,17 +18,17 @@ func PutBlob(ctx context.Context, cas cdc.ContentAddressableStorage, d digest.Di // For small blobs, extracting the full byte slice is most optimal and hooks natively // into PutChunk without the overhead of initializing the chunker stream inside PutReader. - if cdc.IsSingleChunk(params, d) { + if cas.IsSingleChunk(params, d) { data, err := blob.ToByteSlice() if err != nil { return err } - return cas.PutChunk(ctx, d, data) + return contentAddressableStorage.PutChunk(ctx, d, data) } // For larger blobs, we rely on the single-threaded chunker implementation in PutReader // to process the stream without loading it completely into memory. r := blob.ToReaderAt() defer r.Close() - return cdc.PutReader(ctx, cas, d, io.NewSectionReader(r, 0, d.GetSizeBytes())) + return cas.PutReader(ctx, contentAddressableStorage, d, io.NewSectionReader(r, 0, d.GetSizeBytes())) } diff --git a/pkg/cas/suspending_content_addressable_storage.go b/pkg/cas/suspending_content_addressable_storage.go index bf4ac382..aa37655c 100644 --- a/pkg/cas/suspending_content_addressable_storage.go +++ b/pkg/cas/suspending_content_addressable_storage.go @@ -6,11 +6,12 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/clock" "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/blobstore/chunklist" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" ) type suspendingContentAddressableStorage struct { - base cdc.ContentAddressableStorage + base cas.ContentAddressableStorage suspendable clock.Suspendable } @@ -22,7 +23,7 @@ type suspendingContentAddressableStorage struct { // This decorator is used in combination with SuspendableClock, allowing // VFS-based workers to compensate the execution timeout of build // actions for any time spent downloading the input root. -func NewSuspendingContentAddressableStorage(base cdc.ContentAddressableStorage, suspendable clock.Suspendable) cdc.ContentAddressableStorage { +func NewSuspendingContentAddressableStorage(base cas.ContentAddressableStorage, suspendable clock.Suspendable) cas.ContentAddressableStorage { return &suspendingContentAddressableStorage{ base: base, suspendable: suspendable, diff --git a/pkg/filesystem/virtual/BUILD.bazel b/pkg/filesystem/virtual/BUILD.bazel index 28722f89..4a33566b 100644 --- a/pkg/filesystem/virtual/BUILD.bazel +++ b/pkg/filesystem/virtual/BUILD.bazel @@ -57,7 +57,7 @@ go_library( "//pkg/sync", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", "@com_github_buildbarn_bb_storage//pkg/auth", - "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/clock", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/filesystem", diff --git a/pkg/filesystem/virtual/blob_access_cas_file_factory.go b/pkg/filesystem/virtual/blob_access_cas_file_factory.go index ea7a5240..13674dcd 100644 --- a/pkg/filesystem/virtual/blob_access_cas_file_factory.go +++ b/pkg/filesystem/virtual/blob_access_cas_file_factory.go @@ -6,7 +6,7 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" bazeloutputservicerev2 "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice/rev2" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/util" @@ -18,7 +18,7 @@ import ( type blobAccessCASFileFactory struct { context context.Context - contentAddressableStorage cdc.ContentAddressableStorage + contentAddressableStorage cas.ContentAddressableStorage errorLogger util.ErrorLogger } @@ -26,7 +26,7 @@ type blobAccessCASFileFactory struct { // to create FUSE files that are directly backed by BlobAccess. Files // created by this factory are entirely immutable; it is only possible // to read their contents. -func NewBlobAccessCASFileFactory(ctx context.Context, contentAddressableStorage cdc.ContentAddressableStorage, errorLogger util.ErrorLogger) CASFileFactory { +func NewBlobAccessCASFileFactory(ctx context.Context, contentAddressableStorage cas.ContentAddressableStorage, errorLogger util.ErrorLogger) CASFileFactory { return &blobAccessCASFileFactory{ context: ctx, contentAddressableStorage: contentAddressableStorage, @@ -136,7 +136,7 @@ func (f *blobAccessCASFile) VirtualRead(ctx context.Context, buf []byte, off uin size := uint64(f.digest.GetSizeBytes()) buf, eof := BoundReadToFileSize(buf, off, size) if len(buf) > 0 { - if n, err := cdc.ReadBlobAt(f.factory.context, f.factory.contentAddressableStorage, f.digest, buf, int64(off)); n != len(buf) { + if n, err := cas.ReadBlobAt(f.factory.context, f.factory.contentAddressableStorage, f.digest, buf, int64(off)); n != len(buf) { f.factory.errorLogger.Log(util.StatusWrapf(err, "Failed to read from %s at offset %d", f.digest, off)) return 0, false, StatusErrIO } diff --git a/pkg/scheduler/platform/BUILD.bazel b/pkg/scheduler/platform/BUILD.bazel index c03f1f21..e3a98f5a 100644 --- a/pkg/scheduler/platform/BUILD.bazel +++ b/pkg/scheduler/platform/BUILD.bazel @@ -16,7 +16,7 @@ go_library( "//pkg/proto/buildqueuestate", "//pkg/proto/configuration/scheduler", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/util", "@com_github_golang_protobuf//jsonpb", diff --git a/pkg/scheduler/platform/configuration.go b/pkg/scheduler/platform/configuration.go index 800035a4..52070b65 100644 --- a/pkg/scheduler/platform/configuration.go +++ b/pkg/scheduler/platform/configuration.go @@ -2,7 +2,7 @@ package platform import ( pb "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -10,7 +10,7 @@ import ( // NewKeyExtractorFromConfiguration creates a new KeyExtractor based on // options specified in a configuration file. -func NewKeyExtractorFromConfiguration(configuration *pb.PlatformKeyExtractorConfiguration, contentAddressableStorage cdc.ContentAddressableStorage) (KeyExtractor, error) { +func NewKeyExtractorFromConfiguration(configuration *pb.PlatformKeyExtractorConfiguration, contentAddressableStorage cas.ContentAddressableStorage) (KeyExtractor, error) { if configuration == nil { return nil, status.Error(codes.InvalidArgument, "No platform key extractor configuration provided") } diff --git a/pkg/scheduler/routing/BUILD.bazel b/pkg/scheduler/routing/BUILD.bazel index 505ff5e7..18c1f473 100644 --- a/pkg/scheduler/routing/BUILD.bazel +++ b/pkg/scheduler/routing/BUILD.bazel @@ -18,7 +18,7 @@ go_library( "//pkg/scheduler/invocation", "//pkg/scheduler/platform", "@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto", - "@com_github_buildbarn_bb_storage//pkg/blobstore/cdc", + "@com_github_buildbarn_bb_storage//pkg/cas", "@com_github_buildbarn_bb_storage//pkg/digest", "@com_github_buildbarn_bb_storage//pkg/grpc", "@com_github_buildbarn_bb_storage//pkg/program", diff --git a/pkg/scheduler/routing/configuration.go b/pkg/scheduler/routing/configuration.go index 7ec6129c..95efc07c 100644 --- a/pkg/scheduler/routing/configuration.go +++ b/pkg/scheduler/routing/configuration.go @@ -6,7 +6,7 @@ import ( "github.com/buildbarn/bb-remote-execution/pkg/scheduler/initialsizeclass" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/invocation" "github.com/buildbarn/bb-remote-execution/pkg/scheduler/platform" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" + "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" bb_grpc "github.com/buildbarn/bb-storage/pkg/grpc" "github.com/buildbarn/bb-storage/pkg/program" @@ -18,7 +18,7 @@ import ( // NewActionRouterFromConfiguration creates an ActionRouter based on // options specified in a configuration file. -func NewActionRouterFromConfiguration(configuration *pb.ActionRouterConfiguration, contentAddressableStorage cdc.ContentAddressableStorage, previousExecutionStatsStore initialsizeclass.PreviousExecutionStatsStore, grpcClientFactory bb_grpc.ClientFactory, dependenciesGroup program.Group) (ActionRouter, error) { +func NewActionRouterFromConfiguration(configuration *pb.ActionRouterConfiguration, contentAddressableStorage cas.ContentAddressableStorage, previousExecutionStatsStore initialsizeclass.PreviousExecutionStatsStore, grpcClientFactory bb_grpc.ClientFactory, dependenciesGroup program.Group) (ActionRouter, error) { if configuration == nil { return nil, status.Error(codes.InvalidArgument, "No action router configuration provided") } From c9900b4d47a8a64d95e6e23554cdf7ec89941e9d Mon Sep 17 00:00:00 2001 From: Benjamin Ingberg Date: Wed, 26 Aug 2026 21:02:29 +0200 Subject: [PATCH 4/4] Refactor blob uploader --- pkg/blobstore/BUILD.bazel | 8 +- pkg/blobstore/batched_store_blob_access.go | 134 ----------- .../batched_store_blob_access_test.go | 211 ------------------ pkg/builder/BUILD.bazel | 2 +- pkg/builder/caching_build_executor_test.go | 17 +- pkg/builder/local_build_executor_test.go | 17 +- pkg/builder/naive_build_directory.go | 45 +--- pkg/builder/naive_build_directory_test.go | 92 +------- pkg/builder/output_hierarchy.go | 7 +- pkg/builder/output_hierarchy_test.go | 134 +++++------ pkg/cas/BUILD.bazel | 4 +- pkg/cas/batching_blob_uploader.go | 66 +++++- pkg/cas/batching_blob_uploader_test.go | 106 +++++++-- pkg/cas/blob.go | 104 --------- pkg/cas/blob_uploader.go | 3 +- pkg/cas/byte_slice_file_reader.go | 39 ++++ pkg/cas/put_blob.go | 34 --- pkg/cas/put_blob_test.go | 101 --------- pkg/filesystem/virtual/BUILD.bazel | 1 - .../virtual/pool_backed_file_allocator.go | 4 +- .../pool_backed_file_allocator_test.go | 20 +- 21 files changed, 304 insertions(+), 845 deletions(-) delete mode 100644 pkg/blobstore/batched_store_blob_access.go delete mode 100644 pkg/blobstore/batched_store_blob_access_test.go delete mode 100644 pkg/cas/blob.go create mode 100644 pkg/cas/byte_slice_file_reader.go delete mode 100644 pkg/cas/put_blob.go delete mode 100644 pkg/cas/put_blob_test.go diff --git a/pkg/blobstore/BUILD.bazel b/pkg/blobstore/BUILD.bazel index 11a60560..58a21788 100644 --- a/pkg/blobstore/BUILD.bazel +++ b/pkg/blobstore/BUILD.bazel @@ -3,7 +3,6 @@ load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "blobstore", srcs = [ - "batched_store_blob_access.go", "blob_access_mutable_proto_store.go", "mutable_proto_store.go", ], @@ -19,16 +18,12 @@ go_library( "@org_golang_google_grpc//status", "@org_golang_google_protobuf//proto", "@org_golang_x_sync//errgroup", - "@org_golang_x_sync//semaphore", ], ) go_test( name = "blobstore_test", - srcs = [ - "batched_store_blob_access_test.go", - "blob_access_mutable_proto_store_test.go", - ], + srcs = ["blob_access_mutable_proto_store_test.go"], deps = [ ":blobstore", "//internal/mock", @@ -41,7 +36,6 @@ go_test( "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_x_sync//semaphore", "@org_uber_go_mock//gomock", ], ) diff --git a/pkg/blobstore/batched_store_blob_access.go b/pkg/blobstore/batched_store_blob_access.go deleted file mode 100644 index b152c122..00000000 --- a/pkg/blobstore/batched_store_blob_access.go +++ /dev/null @@ -1,134 +0,0 @@ -package blobstore - -import ( - "context" - "sync" - - "github.com/buildbarn/bb-storage/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/util" - - "golang.org/x/sync/errgroup" - "golang.org/x/sync/semaphore" -) - -type pendingPutOperation struct { - digest digest.Digest - b buffer.Buffer -} - -type batchedStoreBlobAccess struct { - blobstore.BlobAccess - blobKeyFormat digest.KeyFormat - batchSize int - putSemaphore *semaphore.Weighted - - lock sync.Mutex - pendingPutOperations map[string]pendingPutOperation - flushError error -} - -// NewBatchedStoreBlobAccess is an adapter for BlobAccess that causes -// Put() operations to be enqueued. When a sufficient number of -// operations are enqueued, a FindMissing() call is generated to -// determine which blobs actually need to be stored. Writes for blobs -// with the same digest are merged. -// -// This adapter may be used by the worker to speed up the uploading -// phase of actions. -func NewBatchedStoreBlobAccess(blobAccess blobstore.BlobAccess, blobKeyFormat digest.KeyFormat, batchSize int, putSemaphore *semaphore.Weighted) (blobstore.BlobAccess, func(ctx context.Context) error) { - ba := &batchedStoreBlobAccess{ - BlobAccess: blobAccess, - blobKeyFormat: blobKeyFormat, - batchSize: batchSize, - pendingPutOperations: map[string]pendingPutOperation{}, - putSemaphore: putSemaphore, - } - return ba, func(ctx context.Context) error { - ba.lock.Lock() - defer ba.lock.Unlock() - - // Flush last batch of blobs. Return any errors that occurred. - ba.flushLocked(ctx) - err := ba.flushError - ba.flushError = nil - return err - } -} - -func (ba *batchedStoreBlobAccess) flushLocked(ctx context.Context) { - // Ensure that all pending blobs are closed upon termination. - defer func() { - for _, pendingPutOperation := range ba.pendingPutOperations { - pendingPutOperation.b.Discard() - } - ba.pendingPutOperations = map[string]pendingPutOperation{} - }() - - // Determine which blobs are missing. - digests := digest.NewSetBuilder(len(ba.pendingPutOperations)) - for _, pendingPutOperation := range ba.pendingPutOperations { - digests.Add(pendingPutOperation.digest) - } - missing, err := ba.BlobAccess.FindMissing(ctx, digests.Build()) - if err != nil { - ba.flushError = util.StatusWrap(err, "Failed to determine existence of previous batch of blobs") - return - } - - // Upload the missing ones. - if !missing.Empty() { - group, groupCtx := errgroup.WithContext(ctx) - group.Go(func() error { - for _, digest := range missing.Items() { - key := digest.GetKey(ba.blobKeyFormat) - if pendingPutOperation, ok := ba.pendingPutOperations[key]; ok { - if err := util.AcquireSemaphore(groupCtx, ba.putSemaphore, 1); err != nil { - return err - } - delete(ba.pendingPutOperations, key) - group.Go(func() error { - err := ba.BlobAccess.Put(groupCtx, pendingPutOperation.digest, pendingPutOperation.b) - ba.putSemaphore.Release(1) - if err != nil { - return util.StatusWrapf(err, "Failed to store previous blob %s", pendingPutOperation.digest) - } - return nil - }) - } - } - return nil - }) - if err := group.Wait(); err != nil { - ba.flushError = err - } - } -} - -func (ba *batchedStoreBlobAccess) Put(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - ba.lock.Lock() - defer ba.lock.Unlock() - - // Discard duplicate writes. - key := digest.GetKey(ba.blobKeyFormat) - if _, ok := ba.pendingPutOperations[key]; ok { - b.Discard() - return nil - } - - // Flush the existing blobs if there are too many pending. - if len(ba.pendingPutOperations) >= ba.batchSize { - ba.flushLocked(ctx) - } - if err := ba.flushError; err != nil { - b.Discard() - return err - } - - ba.pendingPutOperations[key] = pendingPutOperation{ - digest: digest, - b: b, - } - return nil -} diff --git a/pkg/blobstore/batched_store_blob_access_test.go b/pkg/blobstore/batched_store_blob_access_test.go deleted file mode 100644 index 1847444d..00000000 --- a/pkg/blobstore/batched_store_blob_access_test.go +++ /dev/null @@ -1,211 +0,0 @@ -package blobstore_test - -import ( - "context" - "testing" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/internal/mock" - "github.com/buildbarn/bb-remote-execution/pkg/blobstore" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/testutil" - "github.com/stretchr/testify/require" - - "golang.org/x/sync/semaphore" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "go.uber.org/mock/gomock" -) - -func TestBatchedStoreBlobAccessSuccess(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - baseBlobAccess := mock.NewMockBlobAccess(ctrl) - putSemaphore := semaphore.NewWeighted(1) - blobAccess, flush := blobstore.NewBatchedStoreBlobAccess(baseBlobAccess, digest.KeyWithoutInstance, 2, putSemaphore) - - // Empty calls to FindMissing() may be generated at any point in - // time. It is up to the storage backend to filter those out. - baseBlobAccess.EXPECT().FindMissing(ctx, digest.EmptySet).Return(digest.EmptySet, nil).AnyTimes() - - // We should be able to enqueue requests for up to two blobs - // without generating any calls on the storage backend. - digestEmpty := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "d41d8cd98f00b204e9800998ecf8427e", - 0, - ) - for i := 0; i < 10; i++ { - require.NoError(t, blobAccess.Put(ctx, digestEmpty, buffer.NewValidatedBufferFromByteSlice(nil))) - } - - digestHello := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "8b1a9953c4611296a827abf8c47804d7", - 5, - ) - for i := 0; i < 10; i++ { - require.NoError(t, blobAccess.Put(ctx, digestHello, buffer.NewValidatedBufferFromByteSlice([]byte("Hello")))) - } - - // Attempting to store a third blob should cause the first two - // blobs to be flushed. - baseBlobAccess.EXPECT().FindMissing( - ctx, - digest.NewSetBuilder(2).Add(digestHello).Add(digestEmpty).Build(), - ).Return( - digest.NewSetBuilder(1).Add(digestHello).Build(), nil, - ) - baseBlobAccess.EXPECT().Put(gomock.Any(), digestHello, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(100) - require.NoError(t, err) - require.Equal(t, []byte("Hello"), data) - return nil - }, - ) - - digestGoodbye := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "6fc422233a40a75a1f028e11c3cd1140", - 7, - ) - require.NoError(t, blobAccess.Put(ctx, digestGoodbye, buffer.NewValidatedBufferFromByteSlice([]byte("Goodbye")))) - - // Flushing should cause the third blob to be written. - baseBlobAccess.EXPECT().FindMissing( - ctx, - digest.NewSetBuilder(1).Add(digestGoodbye).Build(), - ).Return( - digest.NewSetBuilder(1).Add(digestGoodbye).Build(), nil, - ) - baseBlobAccess.EXPECT().Put(gomock.Any(), digestGoodbye, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(100) - require.NoError(t, err) - require.Equal(t, []byte("Goodbye"), data) - return nil - }, - ) - - require.NoError(t, flush(ctx)) - - // Flushing redundantly should have no longer have any effect. - require.NoError(t, flush(ctx)) -} - -func TestBatchedStoreBlobAccessFailure(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - baseBlobAccess := mock.NewMockBlobAccess(ctrl) - putSemaphore := semaphore.NewWeighted(1) - blobAccess, flush := blobstore.NewBatchedStoreBlobAccess(baseBlobAccess, digest.KeyWithoutInstance, 2, putSemaphore) - - // Empty calls to FindMissing() may be generated at any point in - // time. It is up to the storage backend to filter those out. - baseBlobAccess.EXPECT().FindMissing(ctx, digest.EmptySet).Return(digest.EmptySet, nil).AnyTimes() - - // We should be able to enqueue requests for up to two blobs - // without generating any calls on the storage backend. - digestEmpty := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "d41d8cd98f00b204e9800998ecf8427e", - 0, - ) - for i := 0; i < 10; i++ { - require.NoError(t, blobAccess.Put(ctx, digestEmpty, buffer.NewValidatedBufferFromByteSlice(nil))) - } - - digestHello := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "8b1a9953c4611296a827abf8c47804d7", - 5, - ) - for i := 0; i < 10; i++ { - require.NoError(t, blobAccess.Put(ctx, digestHello, buffer.NewValidatedBufferFromByteSlice([]byte("Hello")))) - } - - // Attempting to store a third blob should cause the first two - // blobs to be flushed. Due to an I/O failure, we should switch - // to an error state in which we no longer perform I/O until - // flushed. - baseBlobAccess.EXPECT().FindMissing( - ctx, - digest.NewSetBuilder(2).Add(digestHello).Add(digestEmpty).Build(), - ).Return( - digest.NewSetBuilder(1).Add(digestHello).Build(), nil, - ) - baseBlobAccess.EXPECT().Put( - gomock.Any(), digestHello, gomock.Any(), - ).DoAndReturn(func(ctx context.Context, digest digest.Digest, b buffer.Buffer) error { - data, err := b.ToByteSlice(100) - require.NoError(t, err) - require.Equal(t, []byte("Hello"), data) - return status.Error(codes.Internal, "Storage backend on fire") - }) - - digestGoodbye := digest.MustNewDigest( - "default", - remoteexecution.DigestFunction_MD5, - "6fc422233a40a75a1f028e11c3cd1140", - 7, - ) - testutil.RequireEqualStatus( - t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), - blobAccess.Put(ctx, digestGoodbye, buffer.NewValidatedBufferFromByteSlice([]byte("Goodbye"))), - ) - - // Future requests to store blobs should be discarded - // immediately, returning same error. - testutil.RequireEqualStatus( - t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), - blobAccess.Put(ctx, digestGoodbye, buffer.NewValidatedBufferFromByteSlice([]byte("Goodbye"))), - ) - - // Flushing should not cause any requests on the backend, due to - // it being in the error state. It should return the error that - // caused it to go into the error state. - testutil.RequireEqualStatus( - t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), - flush(ctx), - ) - - // Successive stores and flushes should be functional once again. - require.NoError(t, blobAccess.Put(ctx, digestGoodbye, buffer.NewValidatedBufferFromByteSlice([]byte("Goodbye")))) - baseBlobAccess.EXPECT().FindMissing(ctx, digest.NewSetBuilder(1).Add(digestGoodbye).Build()).Return(digest.EmptySet, nil) - require.NoError(t, flush(ctx)) -} - -func TestBatchedStoreBlobAccessCanceledWhileWaitingOnSemaphore(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - - baseBlobAccess := mock.NewMockBlobAccess(ctrl) - putSemaphore := semaphore.NewWeighted(0) - blobAccess, flush := blobstore.NewBatchedStoreBlobAccess(baseBlobAccess, digest.KeyWithoutInstance, 2, putSemaphore) - - // Enqueue a blob for writing. - digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) - reader := mock.NewMockFileReader(ctrl) - require.NoError(t, blobAccess.Put(ctx, digestHello, buffer.NewValidatedBufferFromReaderAt(reader, 5))) - - // Flushing it should attempt to write it. Because the semaphore - // is set to zero, there is no capacity to do this. As we're - // using a context that is canceled, this should not cause - // flushing to block. - ctxCanceled, cancel := context.WithCancel(ctx) - cancel() - baseBlobAccess.EXPECT().FindMissing(ctxCanceled, digestHello.ToSingletonSet()).Return(digestHello.ToSingletonSet(), nil) - reader.EXPECT().Close() - - testutil.RequireEqualStatus(t, status.Error(codes.Canceled, "context canceled"), flush(ctxCanceled)) -} diff --git a/pkg/builder/BUILD.bazel b/pkg/builder/BUILD.bazel index a8ede5d5..89ec6be9 100644 --- a/pkg/builder/BUILD.bazel +++ b/pkg/builder/BUILD.bazel @@ -104,7 +104,6 @@ go_test( deps = [ ":builder", "//internal/mock", - "//pkg/cas", "//pkg/cleaner", "//pkg/clock", "//pkg/filesystem/access", @@ -123,6 +122,7 @@ go_test( "@com_github_buildbarn_bb_storage//pkg/proto/fsac", "@com_github_buildbarn_bb_storage//pkg/testutil", "@com_github_buildbarn_bb_storage//pkg/util", + "@com_github_golang_protobuf//proto", "@com_github_google_uuid//:uuid", "@com_github_stretchr_testify//require", "@io_opentelemetry_go_otel//attribute", diff --git a/pkg/builder/caching_build_executor_test.go b/pkg/builder/caching_build_executor_test.go index ca78c9b2..f92a50fa 100644 --- a/pkg/builder/caching_build_executor_test.go +++ b/pkg/builder/caching_build_executor_test.go @@ -14,6 +14,7 @@ import ( "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" status_pb "google.golang.org/genproto/googleapis/rpc/status" @@ -171,7 +172,9 @@ func TestCachingBuildExecutorCachedSuccessNonZeroExitCode(t *testing.T) { gomock.Any(), ). DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { - historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) + historicalExecuteResponse := &cas_proto.HistoricalExecuteResponse{} + err := proto.Unmarshal(b, historicalExecuteResponse) + require.NoError(t, err) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -291,7 +294,9 @@ func TestCachingBuildExecutorUncachedDoNotCache(t *testing.T) { gomock.Any(), ). DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { - historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) + historicalExecuteResponse := &cas_proto.HistoricalExecuteResponse{} + err := proto.Unmarshal(b, historicalExecuteResponse) + require.NoError(t, err) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -356,7 +361,9 @@ func TestCachingBuildExecutorUncachedError(t *testing.T) { gomock.Any(), ). DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { - historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) + historicalExecuteResponse := &cas_proto.HistoricalExecuteResponse{} + err := proto.Unmarshal(b, historicalExecuteResponse) + require.NoError(t, err) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", @@ -423,7 +430,9 @@ func TestCachingBuildExecutorUncachedStorageFailure(t *testing.T) { gomock.Any(), ). DoAndReturn(func(ctx context.Context, digest digest.Digest, b []byte) error { - historicalExecuteResponse := testutil.MustUnmarshal(t, b, &cas_proto.HistoricalExecuteResponse{}) + historicalExecuteResponse := &cas_proto.HistoricalExecuteResponse{} + err := proto.Unmarshal(b, historicalExecuteResponse) + require.NoError(t, err) testutil.RequireEqualProto(t, &cas_proto.HistoricalExecuteResponse{ ActionDigest: &remoteexecution.Digest{ Hash: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c", diff --git a/pkg/builder/local_build_executor_test.go b/pkg/builder/local_build_executor_test.go index 01d3f1a3..1e91b1be 100644 --- a/pkg/builder/local_build_executor_test.go +++ b/pkg/builder/local_build_executor_test.go @@ -9,7 +9,6 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" - "github.com/buildbarn/bb-remote-execution/pkg/cas" re_clock "github.com/buildbarn/bb-remote-execution/pkg/clock" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteworker" @@ -435,19 +434,19 @@ func TestLocalBuildExecutorOutputSymlinkReadingFailure(t *testing.T) { nil, ) blobUploader := mock.NewMockBlobUploader(ctrl) + blobDigest := digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "102b51b9765a56a3e899f7cf0ee38e5251f9c503b357b330a49183eb7b155604", 2) + digestFunction := blobDigest.GetDigestFunction() blobUploader.EXPECT().UploadBlob( ctx, - digest.MustNewDigest("nintendo64", remoteexecution.DigestFunction_SHA256, "102b51b9765a56a3e899f7cf0ee38e5251f9c503b357b330a49183eb7b155604", 2), + digestFunction, gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - data, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, data, &remoteexecution.Tree{}) - testutil.RequireEqualProto(t, &remoteexecution.Tree{ + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, b filesystem.FileReader) (digest.Digest, error) { + testutil.FileReaderIsProto(t, b, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, - }, m) - return nil + }, &remoteexecution.Tree{}) + b.Close() + return blobDigest, nil }) buildDirectoryCreator := mock.NewMockBuildDirectoryCreator(ctrl) diff --git a/pkg/builder/naive_build_directory.go b/pkg/builder/naive_build_directory.go index ef28a23e..f0c073fb 100644 --- a/pkg/builder/naive_build_directory.go +++ b/pkg/builder/naive_build_directory.go @@ -2,12 +2,10 @@ package builder import ( "context" - "io" "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/access" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" @@ -171,46 +169,5 @@ func (d *naiveBuildDirectory) UploadFile(ctx context.Context, name path.Componen if err != nil { return digest.BadDigest, err } - sizeBytes, err := file.Len() - if err != nil { - return digest.BadDigest, err - } - - // Walk through the file to compute the digest. - digestGenerator := digestFunction.NewGenerator(sizeBytes) - if _, err := io.Copy(digestGenerator, io.NewSectionReader(file, 0, sizeBytes)); err != nil { - file.Close() - return digest.BadDigest, util.StatusWrap(err, "Failed to compute file digest") - } - blobDigest := digestGenerator.Sum() - - // Rewind and store it. Limit uploading to the size that was - // used to compute the digest. This ensures uploads succeed, - // even if more data gets appended in the meantime. This is not - // uncommon, especially for stdout and stderr logs. - if err := d.options.blobUploader.UploadBlob( - ctx, - blobDigest, - cas.NewBlobFromReaderAt( - newSectionReadAtCloser(file, 0, sizeBytes), - sizeBytes, - ), - ); err != nil { - return digest.BadDigest, util.StatusWrap(err, "Failed to upload file") - } - return blobDigest, nil -} - -// newSectionReadAtCloser returns an io.ReadCloser that reads from r at -// a given offset, but stops with EOF after n bytes. This function is -// identical to io.NewSectionReader(), except that it provides an -// buffer.ReadAtCloser instead of an io.ReaderAt. -func newSectionReadAtCloser(r filesystem.FileReader, off, n int64) buffer.ReadAtCloser { - return &struct { - io.SectionReader - io.Closer - }{ - SectionReader: *io.NewSectionReader(r, off, n), - Closer: r, - } + return d.options.blobUploader.UploadBlob(ctx, digestFunction, file) } diff --git a/pkg/builder/naive_build_directory_test.go b/pkg/builder/naive_build_directory_test.go index f6f2a81c..d5d8613b 100644 --- a/pkg/builder/naive_build_directory_test.go +++ b/pkg/builder/naive_build_directory_test.go @@ -2,7 +2,6 @@ package builder_test import ( "context" - "io" "os" "syscall" "testing" @@ -10,7 +9,6 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" - "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem/path" "github.com/buildbarn/bb-storage/pkg/testutil" @@ -481,95 +479,15 @@ func TestNaiveBuildDirectoryUploadFile(t *testing.T) { require.Equal(t, syscall.ENOENT, err) }) - t.Run("IOFailureDuringDigestComputation", func(t *testing.T) { + t.Run("UploadFailure", func(t *testing.T) { + // Errors during upload are properly delegated. file := mock.NewMockFileReader(ctrl) buildDirectory.EXPECT().OpenRead(path.MustNewComponent("hello")).Return(file, nil) - gomock.InOrder( - file.EXPECT().Len().Return(int64(10), nil), - file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( - func(p []byte, off int64) (int, error) { - return 0, status.Error(codes.Unavailable, "Disk on fire") - }, - ), - file.EXPECT().Close().Return(nil), - ) - _, err := inputRootPopulator.UploadFile(ctx, path.MustNewComponent("hello"), digestFunction, writableFileUploadDelay) - testutil.RequireEqualStatus(t, status.Error(codes.Unavailable, "Failed to compute file digest: Disk on fire"), err) - }) - - t.Run("FileChangedDuringUpload", func(t *testing.T) { - // Changes to the file contents between the digest - // computation and upload phases should be detected. - file := mock.NewMockFileReader(ctrl) - buildDirectory.EXPECT().OpenRead(path.MustNewComponent("hello")).Return(file, nil) - gomock.InOrder( - file.EXPECT().Len().Return(int64(11), nil), - file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( - func(p []byte, off int64) (int, error) { - require.Len(t, p, 11) - copy(p, "Hello world") - return 11, io.EOF - }, - ), - file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( - func(p []byte, off int64) (int, error) { - require.Greater(t, len(p), 9) - copy(p, "Different") - return 9, io.EOF - }, - ), - file.EXPECT().Close().Return(nil), - ) - blobUploader.EXPECT().UploadBlob(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - _, err := b.ToByteSlice() - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Stream was 9 bytes in size, while 11 bytes were expected"), err) - return err - }, - ) + blobUploader.EXPECT().UploadBlob(ctx, digestFunction, file). + Return(digest.BadDigest, status.Error(codes.Unavailable, "Server on fire")) _, err := inputRootPopulator.UploadFile(ctx, path.MustNewComponent("hello"), digestFunction, writableFileUploadDelay) - testutil.RequireEqualStatus(t, status.Error(codes.InvalidArgument, "Failed to upload file: Stream was 9 bytes in size, while 11 bytes were expected"), err) - }) - - t.Run("SuccessFileGrownDuringUpload", func(t *testing.T) { - // Simulate the case where the file to be uploaded grows - // while being uploaded. The newly added part should be - // ignored, as it wasn't used to compute the digest. - // This is not uncommon, especially for stdout and - // stderr logs. - file := mock.NewMockFileReader(ctrl) - buildDirectory.EXPECT().OpenRead(path.MustNewComponent("hello")).Return(file, nil) - gomock.InOrder( - file.EXPECT().Len().Return(int64(11), nil), - file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( - func(p []byte, off int64) (int, error) { - require.Len(t, p, 11) - copy(p, "Hello world") - return 11, io.EOF - }, - ), - file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( - func(p []byte, off int64) (int, error) { - require.Len(t, p, 11) - copy(p, "Hello world") - return 11, nil - }, - ), - file.EXPECT().Close().Return(nil), - ) - blobUploader.EXPECT().UploadBlob(ctx, helloWorldDigest, gomock.Any()).DoAndReturn( - func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - data, err := b.ToByteSlice() - require.NoError(t, err) - require.Equal(t, []byte("Hello world"), data) - return nil - }, - ) - - digest, err := inputRootPopulator.UploadFile(ctx, path.MustNewComponent("hello"), digestFunction, writableFileUploadDelay) - require.NoError(t, err) - require.Equal(t, digest, helloWorldDigest) + testutil.RequireEqualStatus(t, status.Error(codes.Unavailable, "Server on fire"), err) }) } diff --git a/pkg/builder/output_hierarchy.go b/pkg/builder/output_hierarchy.go index 9ea3d619..2105759b 100644 --- a/pkg/builder/output_hierarchy.go +++ b/pkg/builder/output_hierarchy.go @@ -187,7 +187,8 @@ func (s *uploadOutputsState) uploadOutputDirectoryEntered(d UploadableDirectory, // depends on it to work efficiently. successfullyUploaded := true treeDigest := s.computeDigest(treeData) - if err := s.blobUploader.UploadBlob(s.context, treeDigest, cas.NewBlobFromByteslice(treeData)); err != nil { + treeDigest, err := s.blobUploader.UploadBlob(s.context, s.digestFunction, cas.ByteSliceFileReader(treeData)) + if err != nil { s.saveError(util.StatusWrapf(err, "Failed to store output directory %#v", dPath.GetUNIXString())) successfullyUploaded = false } @@ -198,8 +199,8 @@ func (s *uploadOutputsState) uploadOutputDirectoryEntered(d UploadableDirectory, var rootDirectoryDigestProto *remoteexecution.Digest if s.uploadTreesAndDirectories { rootDirectoryDigestProto = rootDirectoryDigest.GetProto() - for directoryDigest, directory := range dState.directoriesSeen { - if err := s.blobUploader.UploadBlob(s.context, directoryDigest, cas.NewBlobFromByteslice(directory)); err != nil { + for _, directory := range dState.directoriesSeen { + if _, err := s.blobUploader.UploadBlob(s.context, s.digestFunction, cas.ByteSliceFileReader(directory)); err != nil { s.saveError(util.StatusWrapf(err, "Failed to store output directory %#v", dPath.GetUNIXString())) successfullyUploaded = false } diff --git a/pkg/builder/output_hierarchy_test.go b/pkg/builder/output_hierarchy_test.go index 24fdb26f..a5f28080 100644 --- a/pkg/builder/output_hierarchy_test.go +++ b/pkg/builder/output_hierarchy_test.go @@ -9,11 +9,11 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" "github.com/buildbarn/bb-remote-execution/pkg/builder" - "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/filesystem/path" "github.com/buildbarn/bb-storage/pkg/testutil" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" @@ -253,16 +253,15 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { Return(digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "af37d08ae228a87dc6b265fd1019c97d", 7), nil) directoryDirectory.EXPECT().Readlink(path.MustNewComponent("symlink")).Return(path.UNIXFormat.NewParser("symlink-target"), nil) directoryDirectory.EXPECT().Close() + directoryDirectoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "55aed4acf40a28132fb2d2de2b5962f0", 184) + digestFunction := directoryDirectoryDigest.GetDigestFunction() blobUploader.EXPECT().UploadBlob( ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "55aed4acf40a28132fb2d2de2b5962f0", 184), + digestFunction, gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) - testutil.RequireEqualProto(t, &remoteexecution.Tree{ + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, b filesystem.FileReader) (digest.Digest, error) { + testutil.FileReaderIsProto(t, b, &remoteexecution.Tree{ Root: &remoteexecution.Directory{ Files: []*remoteexecution.FileNode{ { @@ -300,8 +299,9 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { Children: []*remoteexecution.Directory{ {}, }, - }, m) - return nil + }, &remoteexecution.Tree{}) + b.Close() + return directoryDirectoryDigest, nil }) // Uploading of /foo/path-directory. @@ -309,20 +309,18 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { foo.EXPECT().EnterUploadableDirectory(path.MustNewComponent("path-directory")).Return(pathDirectory, nil) pathDirectory.EXPECT().ReadDir().Return(nil, nil) pathDirectory.EXPECT().Close() + pathDirectoryDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2) blobUploader.EXPECT().UploadBlob( ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2), + digestFunction, gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) - require.NoError(t, err) - testutil.RequireEqualProto(t, &remoteexecution.Tree{ + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, b filesystem.FileReader) (digest.Digest, error) { + testutil.FileReaderIsProto(t, b, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, - }, m) - return nil + }, &remoteexecution.Tree{}) + b.Close() + return pathDirectoryDigest, nil }) foo.EXPECT().Close() @@ -500,19 +498,17 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { // It is permitted to add the root directory as an // output path. root.EXPECT().ReadDir().Return(nil, nil) + rootDigest := digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2) blobUploader.EXPECT().UploadBlob( ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "9dd94c5a4b02914af42e8e6372e0b709", 2), + digestFunction, gomock.Any(), ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) - testutil.RequireEqualProto(t, &remoteexecution.Tree{ + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, b filesystem.FileReader) (digest.Digest, error) { + testutil.FileReaderIsProto(t, b, &remoteexecution.Tree{ Root: &remoteexecution.Directory{}, - }, m) - return nil + }, &remoteexecution.Tree{}) + return rootDigest, nil }) oh, err := builder.NewOutputHierarchy(&remoteexecution.Command{ @@ -634,47 +630,53 @@ func TestOutputHierarchyUploadOutputs(t *testing.T) { blobUploader.EXPECT().UploadBlob( ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "aa5a55cc8d4d32abd00adf5dd1ed93b5", 193), + digestFunction, gomock.Any(), - ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Tree{}) - require.NoError(t, err) - testutil.RequireEqualProto(t, &remoteexecution.Tree{ - Root: rootDirectory, - Children: []*remoteexecution.Directory{ - directory1Directory, - }, - }, m) - return nil - }) - blobUploader.EXPECT().UploadBlob( - ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "f782fc2043b00886534aee47de8c522a", 120), - gomock.Any(), - ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Directory{}) - require.NoError(t, err) - testutil.RequireEqualProto(t, rootDirectory, m) - return nil - }) - blobUploader.EXPECT().UploadBlob( - ctx, - digest.MustNewDigest("example", remoteexecution.DigestFunction_MD5, "460270223db29e8867bad29c658c1395", 69), - gomock.Any(), - ). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - bytes, err := b.ToByteSlice() - require.NoError(t, err) - m := testutil.MustUnmarshal(t, bytes, &remoteexecution.Directory{}) - require.NoError(t, err) - testutil.RequireEqualProto(t, directory1Directory, m) - return nil + ).Times(3). + DoAndReturn(func(ctx context.Context, digestFunc digest.Function, b filesystem.FileReader) (digest.Digest, error) { + // Because map iteration order is non deterministic and + // the function signature does not discriminate which + // blob we are looking at we have to read the data to + // figure it out. + length, _ := b.Len() + data := make([]byte, length) + if length > 0 { + b.ReadAt(data, 0) + } + b.Close() + + // Compute the actual digest + digestGenerator := digestFunc.NewGenerator(length) + digestGenerator.Write(data) + computedDigest := digestGenerator.Sum() + + // Discriminate and assert based on the computed hash + switch hash := computedDigest.GetHashString(); hash { + case "aa5a55cc8d4d32abd00adf5dd1ed93b5": + m := &remoteexecution.Tree{} + err := proto.Unmarshal(data, m) + require.NoError(t, err) + testutil.RequireEqualProto(t, &remoteexecution.Tree{ + Root: rootDirectory, + Children: []*remoteexecution.Directory{ + directory1Directory, + }, + }, m) + case "f782fc2043b00886534aee47de8c522a": + m := &remoteexecution.Directory{} + err := proto.Unmarshal(data, m) + require.NoError(t, err) + testutil.RequireEqualProto(t, rootDirectory, m) + case "460270223db29e8867bad29c658c1395": + m := &remoteexecution.Directory{} + err := proto.Unmarshal(data, m) + require.NoError(t, err) + testutil.RequireEqualProto(t, directory1Directory, m) + default: + t.Fatalf("Unexpected blob uploaded with hash: %s", hash) + } + + return computedDigest, nil }) oh, err := builder.NewOutputHierarchy(&remoteexecution.Command{ diff --git a/pkg/cas/BUILD.bazel b/pkg/cas/BUILD.bazel index eb45fc4a..6c61052e 100644 --- a/pkg/cas/BUILD.bazel +++ b/pkg/cas/BUILD.bazel @@ -4,8 +4,8 @@ go_library( name = "cas", srcs = [ "batching_blob_uploader.go", - "blob.go", "blob_uploader.go", + "byte_slice_file_reader.go", "caching_directory_fetcher.go", "cas_directory_fetcher.go", "cas_file_fetcher.go", @@ -17,7 +17,6 @@ go_library( "existence_precondition_content_addressable_storage.go", "file_fetcher.go", "hardlinking_file_fetcher.go", - "put_blob.go", "suspending_content_addressable_storage.go", "suspending_directory_fetcher.go", ], @@ -57,7 +56,6 @@ go_test( "decomposed_directory_walker_test.go", "existence_precondition_content_addressable_storage_test.go", "hardlinking_file_fetcher_test.go", - "put_blob_test.go", ], deps = [ ":cas", diff --git a/pkg/cas/batching_blob_uploader.go b/pkg/cas/batching_blob_uploader.go index d29179b3..fa7dcfa6 100644 --- a/pkg/cas/batching_blob_uploader.go +++ b/pkg/cas/batching_blob_uploader.go @@ -2,10 +2,13 @@ package cas import ( "context" + "io" "sync" + "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" "github.com/buildbarn/bb-storage/pkg/cas" "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/filesystem" "github.com/buildbarn/bb-storage/pkg/util" "golang.org/x/sync/errgroup" @@ -14,7 +17,7 @@ import ( type pendingUploadOperation struct { digest digest.Digest - blob Blob + file buffer.ReadAtCloser } type batchingBlobUploader struct { @@ -30,7 +33,7 @@ type batchingBlobUploader struct { // NewBatchingBlobUploader returns a BlobUploader that batches uploads // to the Content Addressable Storage (CAS) into batches of the -// specified size while still respecting an upload concurrency. +// specified size while respecting an upload concurrency. func NewBatchingBlobUploader(contentAddressableStorage cas.ContentAddressableStorage, batchSize int, uploadConcurrencySemaphore *semaphore.Weighted) (BlobUploader, func(context.Context) error) { bu := &batchingBlobUploader{ contentAddressableStorage: contentAddressableStorage, @@ -55,7 +58,7 @@ func (bu *batchingBlobUploader) flushLocked(ctx context.Context) { // Ensure that all pending blobs are closed upon termination. defer func() { for _, pending := range bu.pendingUploadOperations { - pending.blob.Discard() + pending.file.Close() } bu.pendingUploadOperations = map[string]pendingUploadOperation{} }() @@ -69,7 +72,6 @@ func (bu *batchingBlobUploader) flushLocked(ctx context.Context) { for _, pending := range bu.pendingUploadOperations { digests.Add(pending.digest) } - missing, err := bu.contentAddressableStorage.FindMissing(ctx, digests.Build()) if err != nil { bu.flushError = util.StatusWrap(err, "Failed to determine existence of previous batch of blobs") @@ -83,13 +85,15 @@ func (bu *batchingBlobUploader) flushLocked(ctx context.Context) { for _, d := range missing.Items() { key := d.GetKey(bu.digestKeyFormat) if pending, ok := bu.pendingUploadOperations[key]; ok { - // Mirroring batchedStoreBlobAccess: Acquire semaphore before spinning up the goroutine. if err := util.AcquireSemaphore(groupCtx, bu.uploadConcurrencySemaphore, 1); err != nil { return err } delete(bu.pendingUploadOperations, key) group.Go(func() error { - err := PutBlob(groupCtx, bu.contentAddressableStorage, pending.digest, pending.blob) + defer pending.file.Close() + // TODO: Use our random access io to do + // multithreaded chunking. + err := cas.PutReader(groupCtx, bu.contentAddressableStorage, pending.digest, io.NewSectionReader(pending.file, 0, d.GetSizeBytes())) bu.uploadConcurrencySemaphore.Release(1) if err != nil { return util.StatusWrapf(err, "Failed to store previous blob %s", pending.digest) @@ -106,14 +110,14 @@ func (bu *batchingBlobUploader) flushLocked(ctx context.Context) { } } -func (bu *batchingBlobUploader) UploadBlob(ctx context.Context, d digest.Digest, blob Blob) error { +func (bu *batchingBlobUploader) uploadBlob(ctx context.Context, d digest.Digest, blob buffer.ReadAtCloser) error { bu.lock.Lock() defer bu.lock.Unlock() // Discard duplicate writes. key := d.GetKey(bu.digestKeyFormat) if _, ok := bu.pendingUploadOperations[key]; ok { - blob.Discard() + blob.Close() return nil } @@ -122,13 +126,55 @@ func (bu *batchingBlobUploader) UploadBlob(ctx context.Context, d digest.Digest, bu.flushLocked(ctx) } if err := bu.flushError; err != nil { - blob.Discard() + blob.Close() return err } bu.pendingUploadOperations[key] = pendingUploadOperation{ digest: d, - blob: blob, + file: blob, } return nil } + +func (bu *batchingBlobUploader) UploadBlob(ctx context.Context, digestFunction digest.Function, blob filesystem.FileReader) (digest.Digest, error) { + sizeBytes, err := blob.Len() + if err != nil { + return digest.BadDigest, err + } + + // Walk through the file to compute the digest. + digestGenerator := digestFunction.NewGenerator(sizeBytes) + if _, err := io.Copy(digestGenerator, io.NewSectionReader(blob, 0, sizeBytes)); err != nil { + blob.Close() + return digest.BadDigest, util.StatusWrap(err, "Failed to compute file digest") + } + blobDigest := digestGenerator.Sum() + + // Rewind and store it. Limit uploading to the size that was + // used to compute the digest. This ensures uploads succeed, + // even if more data gets appended in the meantime. This is not + // uncommon, especially for stdout and stderr logs. + if err := bu.uploadBlob( + ctx, + blobDigest, + newSectionReadAtCloser(blob, 0, sizeBytes), + ); err != nil { + return digest.BadDigest, err + } + return blobDigest, nil +} + +// newSectionReadAtCloser returns a buffer.ReadAtCloser that reads from +// r at a given offset, but stops with EOF after n bytes. This function +// is identical to io.NewSectionReader(), except that it provides an +// buffer.ReadAtCloser instead of an io.ReaderAt. +func newSectionReadAtCloser(r filesystem.FileReader, off, n int64) buffer.ReadAtCloser { + return &struct { + io.SectionReader + io.Closer + }{ + SectionReader: *io.NewSectionReader(r, off, n), + Closer: r, + } +} diff --git a/pkg/cas/batching_blob_uploader_test.go b/pkg/cas/batching_blob_uploader_test.go index fddc2134..8fb73b57 100644 --- a/pkg/cas/batching_blob_uploader_test.go +++ b/pkg/cas/batching_blob_uploader_test.go @@ -2,6 +2,7 @@ package cas_test import ( "context" + "io" "testing" remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" @@ -29,12 +30,17 @@ func TestBatchingBlobUploadSuccess(t *testing.T) { // We should be able to enqueue requests for up to two blobs // without generating any calls on the storage backend. digestEmpty := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "d41d8cd98f00b204e9800998ecf8427e", 0) + digestFunction := digestEmpty.GetDigestFunction() for i := 0; i < 10; i++ { - require.NoError(t, blobUploader.UploadBlob(ctx, digestEmpty, cas.NewBlobFromByteslice(nil))) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader(nil)) + require.NoError(t, err) + require.Equal(t, digestEmpty, d) } digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) for i := 0; i < 10; i++ { - require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromByteslice([]byte("Hello")))) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Hello"))) + require.NoError(t, err) + require.Equal(t, digestHello, d) } // Attempting to store a third blob should cause the first two blobs @@ -46,7 +52,7 @@ func TestBatchingBlobUploadSuccess(t *testing.T) { }, nil) contentAddressableStorage.EXPECT(). FindMissing(gomock.Any(), digest.NewSetBuilder(2).Add(digestHello).Add(digestEmpty).Build()). - Return(digest.NewSetBuilder(1).Add(digestHello).Build(), nil) + Return(digestHello.ToSingletonSet(), nil) contentAddressableStorage.EXPECT().PutChunk(gomock.Any(), digestHello, gomock.Any()).DoAndReturn( func(ctx context.Context, digest digest.Digest, data []byte) error { require.Equal(t, []byte("Hello"), data) @@ -55,7 +61,9 @@ func TestBatchingBlobUploadSuccess(t *testing.T) { ) digestGoodbye := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "6fc422233a40a75a1f028e11c3cd1140", 7) - require.NoError(t, blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye")))) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Goodbye"))) + require.NoError(t, err) + require.Equal(t, digestGoodbye, d) // The third blob is enqueued and should be written when flushed. contentAddressableStorage.EXPECT().FetchCDCParameters(gomock.Any(), gomock.Any()).Return(cdc.Parameters{ @@ -88,12 +96,17 @@ func TestBatchingBlobUploaderFailure(t *testing.T) { // We should be able to enqueue requests for up to two blobs // without generating any calls on the storage backend. digestEmpty := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "d41d8cd98f00b204e9800998ecf8427e", 0) + digestFunction := digestEmpty.GetDigestFunction() for i := 0; i < 10; i++ { - require.NoError(t, blobUploader.UploadBlob(ctx, digestEmpty, cas.NewBlobFromByteslice(nil))) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader(nil)) + require.NoError(t, err) + require.Equal(t, digestEmpty, d) } digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) for i := 0; i < 10; i++ { - require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromByteslice([]byte("Hello")))) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Hello"))) + require.NoError(t, err) + require.Equal(t, digestHello, d) } // Attempting to store a third blob should cause the first two blobs @@ -114,18 +127,20 @@ func TestBatchingBlobUploaderFailure(t *testing.T) { ) digestGoodbye := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "6fc422233a40a75a1f028e11c3cd1140", 7) + _, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Goodbye"))) testutil.RequireEqualStatus( t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), - blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye"))), + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Failed to save chunk: Storage backend on fire"), + err, ) // Future requests to store blobs should be discarded // immediately, returning same error. + _, err = blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Goodbye"))) testutil.RequireEqualStatus( t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), - blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye"))), + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Failed to save chunk: Storage backend on fire"), + err, ) // Flushing should not cause any requests on the backend, due to @@ -133,13 +148,15 @@ func TestBatchingBlobUploaderFailure(t *testing.T) { // caused it to go into the error state. testutil.RequireEqualStatus( t, - status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Storage backend on fire"), + status.Error(codes.Internal, "Failed to store previous blob 3-8b1a9953c4611296a827abf8c47804d7-5-default: Failed to save chunk: Storage backend on fire"), flush(ctx), ) // Successive stores and flushes should be functional once again. - require.NoError(t, blobUploader.UploadBlob(ctx, digestGoodbye, cas.NewBlobFromByteslice([]byte("Goodbye")))) - contentAddressableStorage.EXPECT().FindMissing(ctx, digest.NewSetBuilder(1).Add(digestGoodbye).Build()).Return(digest.EmptySet, nil) + d, err := blobUploader.UploadBlob(ctx, digestFunction, cas.ByteSliceFileReader([]byte("Goodbye"))) + require.NoError(t, err) + require.Equal(t, digestGoodbye, d) + contentAddressableStorage.EXPECT().FindMissing(ctx, digestGoodbye.ToSingletonSet()).Return(digest.EmptySet, nil) require.NoError(t, flush(ctx)) } @@ -153,8 +170,17 @@ func TestBatchingBlobUploaderCanceledWhileWaitingOnSemaphore(t *testing.T) { // Enqueue a blob for writing. digestHello := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) + digestFunction := digestHello.GetDigestFunction() reader := mock.NewMockFileReader(ctrl) - require.NoError(t, blobUploader.UploadBlob(ctx, digestHello, cas.NewBlobFromReaderAt(reader, 5))) + reader.EXPECT().Len().Return(int64(5), nil) + reader.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn(func(p []byte, off int64) (int, error) { + copy(p, "Hello") + return 5, io.EOF + }) + + d, err := blobUploader.UploadBlob(ctx, digestFunction, reader) + require.NoError(t, err) + require.Equal(t, digestHello, d) // Flushing it should attempt to write it. Because the semaphore // is set to zero, there is no capacity to do this. As we're @@ -167,3 +193,55 @@ func TestBatchingBlobUploaderCanceledWhileWaitingOnSemaphore(t *testing.T) { testutil.RequireEqualStatus(t, status.Error(codes.Canceled, "context canceled"), flush(ctxCanceled)) } + +func TestBatchingBlobUploaderSuccessFileGrownDuringUpload(t *testing.T) { + ctrl, ctx := gomock.WithContext(context.Background(), t) + + contentAddressableStorage := mock.NewMockContentAddressableStorage(ctrl) + contentAddressableStorage.EXPECT().GetDigestKeyFormat().Return(digest.KeyWithoutInstance) + uploadConcurrencySemaphore := semaphore.NewWeighted(1) + blobUploader, flush := cas.NewBatchingBlobUploader(contentAddressableStorage, 2, uploadConcurrencySemaphore) + + helloWorldDigest := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "3e25960a79dbc69b674cd4ec67a72c62", 11) + digestFunction := helloWorldDigest.GetDigestFunction() + + file := mock.NewMockFileReader(ctrl) + gomock.InOrder( + file.EXPECT().Len().Return(int64(11), nil), + file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( + func(p []byte, off int64) (int, error) { + require.Len(t, p, 11) + copy(p, "Hello world") + return 11, io.EOF + }, + ), + file.EXPECT().ReadAt(gomock.Any(), int64(0)).DoAndReturn( + func(p []byte, off int64) (int, error) { + require.Len(t, p, 11) + copy(p, "Hello world") + return 11, nil + }, + ), + file.EXPECT().Close().Return(nil), + ) + + d, err := blobUploader.UploadBlob(ctx, digestFunction, file) + require.NoError(t, err) + require.Equal(t, helloWorldDigest, d) + + contentAddressableStorage.EXPECT().FetchCDCParameters(gomock.Any(), gomock.Any()).Return(cdc.Parameters{ + MinChunkSizeBytes: 256 << 10, + HorizonSizeBytes: 8 * 256 << 10, + }, nil) + contentAddressableStorage.EXPECT(). + FindMissing(gomock.Any(), helloWorldDigest.ToSingletonSet()). + Return(helloWorldDigest.ToSingletonSet(), nil) + contentAddressableStorage.EXPECT().PutChunk(gomock.Any(), helloWorldDigest, gomock.Any()).DoAndReturn( + func(ctx context.Context, digest digest.Digest, data []byte) error { + require.Equal(t, []byte("Hello world"), data) + return nil + }, + ) + + require.NoError(t, flush(ctx)) +} diff --git a/pkg/cas/blob.go b/pkg/cas/blob.go deleted file mode 100644 index 13e1acad..00000000 --- a/pkg/cas/blob.go +++ /dev/null @@ -1,104 +0,0 @@ -package cas - -import ( - "bytes" - "io" - - "github.com/buildbarn/bb-storage/pkg/blobstore/buffer" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// Blob is an abstraction interface over a set amount of data to be -// uploaded. Calling any of its methods will consume the blob. -type Blob interface { - ToReaderAt() buffer.ReadAtCloser - ToByteSlice() ([]byte, error) - Discard() error -} - -type readerAtBlob struct { - r buffer.ReadAtCloser - sizeBytes int64 -} - -func NewBlobFromReaderAt(r buffer.ReadAtCloser, sizeBytes int64) Blob { - return &readerAtBlob{ - sizeBytes: sizeBytes, - r: r, - } -} - -func (b *readerAtBlob) ToReaderAt() buffer.ReadAtCloser { - ret := b.r - b.r = nil - return ret -} - -func (b *readerAtBlob) ToByteSlice() (data []byte, err error) { - if b.r == nil { - return nil, status.Error(codes.FailedPrecondition, "Blob has already been consumed") - } - - defer func() { - closeErr := b.r.Close() - b.r = nil - if err == nil && closeErr != nil { - err = closeErr - } - }() - - data = make([]byte, b.sizeBytes) - - if n, readErr := b.r.ReadAt(data, 0); readErr != nil { - if readErr == io.EOF { - if n == len(data) { - return data, nil - } - return nil, status.Errorf(codes.InvalidArgument, "Stream was %d bytes in size, while %d bytes were expected", n, b.sizeBytes) - } - return nil, readErr - } - - return data, nil -} - -func (b *readerAtBlob) Discard() error { - if b.r == nil { - return status.Error(codes.FailedPrecondition, "Blob has already been consumed") - } - err := b.r.Close() - b.r = nil - return err -} - -type bytesliceBlob struct { - data []byte -} - -func NewBlobFromByteslice(data []byte) Blob { - return &bytesliceBlob{data: data} -} - -func (bytesliceBlob) Discard() error { - return nil -} - -func (b *bytesliceBlob) ToByteSlice() ([]byte, error) { - return b.data, nil -} - -func (b *bytesliceBlob) ToReaderAt() buffer.ReadAtCloser { - return bytesliceReadAtCloser{ - Reader: bytes.NewReader(b.data), - } -} - -type bytesliceReadAtCloser struct { - *bytes.Reader -} - -func (bytesliceReadAtCloser) Close() error { - return nil -} diff --git a/pkg/cas/blob_uploader.go b/pkg/cas/blob_uploader.go index dda21ab1..63b06b7b 100644 --- a/pkg/cas/blob_uploader.go +++ b/pkg/cas/blob_uploader.go @@ -4,9 +4,10 @@ import ( "context" "github.com/buildbarn/bb-storage/pkg/digest" + "github.com/buildbarn/bb-storage/pkg/filesystem" ) // BlobUploader is an interface for uploading an arbitrary blob. type BlobUploader interface { - UploadBlob(ctx context.Context, d digest.Digest, blob Blob) error + UploadBlob(ctx context.Context, digestFunction digest.Function, blob filesystem.FileReader) (digest.Digest, error) } diff --git a/pkg/cas/byte_slice_file_reader.go b/pkg/cas/byte_slice_file_reader.go new file mode 100644 index 00000000..7df56a67 --- /dev/null +++ b/pkg/cas/byte_slice_file_reader.go @@ -0,0 +1,39 @@ +package cas + +import ( + "io" + + "github.com/buildbarn/bb-storage/pkg/filesystem" +) + +// ByteSliceFileReader implements the filesystem.FileReader interface +// for a byte slice, which is convenient to use for the BlobUploader +// when uploading small blobs to the cas. +type ByteSliceFileReader []byte + +func (b ByteSliceFileReader) Close() error { return nil } + +func (b ByteSliceFileReader) Len() (int64, error) { return int64(len(b)), nil } + +func (b ByteSliceFileReader) ReadAt(p []byte, off int64) (n int, err error) { + if off < 0 || off >= int64(len(b)) { + return 0, io.EOF + } + n = copy(p, b[off:]) + if n < len(p) { + err = io.EOF + } + return n, err +} + +func (b ByteSliceFileReader) GetNextRegionOffset(off int64, regionType filesystem.RegionType) (int64, error) { + if off < 0 || off >= int64(len(b)) { + return 0, io.EOF + } + if regionType == filesystem.Hole { + return int64(len(b)), nil + } + return off, nil // Data +} + +var _ filesystem.FileReader = ByteSliceFileReader([]byte("")) diff --git a/pkg/cas/put_blob.go b/pkg/cas/put_blob.go deleted file mode 100644 index 2a2842a5..00000000 --- a/pkg/cas/put_blob.go +++ /dev/null @@ -1,34 +0,0 @@ -package cas - -import ( - "context" - "io" - - "github.com/buildbarn/bb-storage/pkg/cas" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/util" -) - -func PutBlob(ctx context.Context, contentAddressableStorage cas.ContentAddressableStorage, d digest.Digest, blob Blob) error { - params, err := contentAddressableStorage.FetchCDCParameters(ctx, d.GetInstanceName()) - if err != nil { - blob.Discard() - return util.StatusWrap(err, "Could not fetch CDC parameters") - } - - // For small blobs, extracting the full byte slice is most optimal and hooks natively - // into PutChunk without the overhead of initializing the chunker stream inside PutReader. - if cas.IsSingleChunk(params, d) { - data, err := blob.ToByteSlice() - if err != nil { - return err - } - return contentAddressableStorage.PutChunk(ctx, d, data) - } - - // For larger blobs, we rely on the single-threaded chunker implementation in PutReader - // to process the stream without loading it completely into memory. - r := blob.ToReaderAt() - defer r.Close() - return cas.PutReader(ctx, contentAddressableStorage, d, io.NewSectionReader(r, 0, d.GetSizeBytes())) -} diff --git a/pkg/cas/put_blob_test.go b/pkg/cas/put_blob_test.go deleted file mode 100644 index 0d5eae2b..00000000 --- a/pkg/cas/put_blob_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package cas_test - -import ( - "context" - "testing" - - remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" - "github.com/buildbarn/bb-remote-execution/internal/mock" - "github.com/buildbarn/bb-remote-execution/pkg/cas" - "github.com/buildbarn/bb-storage/pkg/blobstore/cdc" - "github.com/buildbarn/bb-storage/pkg/digest" - "github.com/buildbarn/bb-storage/pkg/testutil" - "github.com/stretchr/testify/require" - - "go.uber.org/mock/gomock" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func TestPutBlob(t *testing.T) { - ctrl, ctx := gomock.WithContext(context.Background(), t) - casBackend := mock.NewMockContentAddressableStorage(ctrl) - - d := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "8b1a9953c4611296a827abf8c47804d7", 5) - - t.Run("FetchCDCParametersFailure", func(t *testing.T) { - // Verify that a failure to fetch CDC parameters correctly halts - // execution and propagates the error, inherently relying on - // PutBlob to discard the blob. - blob := cas.NewBlobFromByteslice([]byte("Hello")) - - casBackend.EXPECT().FetchCDCParameters(ctx, d.GetInstanceName()). - Return(cdc.Parameters{}, status.Error(codes.Internal, "Backend offline")) - - err := cas.PutBlob(ctx, casBackend, d, blob) - testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Could not fetch CDC parameters: Backend offline"), err) - }) - - t.Run("SingleChunkUpload", func(t *testing.T) { - // Verify that a blob smaller than the single chunk threshold is - // successfully extracted via ToByteSlice and inserted directly - // into PutChunk. - blob := cas.NewBlobFromByteslice([]byte("Hello")) - - casBackend.EXPECT().FetchCDCParameters(ctx, d.GetInstanceName()). - Return(cdc.Parameters{ - MinChunkSizeBytes: 256 << 10, // 256 KB - }, nil) - - casBackend.EXPECT().PutChunk(ctx, d, []byte("Hello")).Return(nil) - - err := cas.PutBlob(ctx, casBackend, d, blob) - require.NoError(t, err) - }) - - t.Run("MultiChunkStreamSuccess", func(t *testing.T) { - // Verify that a blob larger than the single chunk threshold - // triggers the upload of all its chunk and its chunk list. - largeDigest := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "fbaf48ec981a5eecdb57b929fdd426e8", 200) - blob := cas.NewBlobFromByteslice(make([]byte, 200)) - - casBackend.EXPECT().FetchCDCParameters(ctx, largeDigest.GetInstanceName()). - Return(cdc.Parameters{ - MinChunkSizeBytes: 64, - HorizonSizeBytes: 128, - }, nil).Times(2) - - casBackend.EXPECT().PutChunk(ctx, gomock.Any(), gomock.Any()). - Return(nil).Times(3) - - casBackend.EXPECT().PutManifest(gomock.Any(), gomock.Any(), gomock.Any()). - Return(nil) - - err := cas.PutBlob(ctx, casBackend, largeDigest, blob) - require.NoError(t, err) - }) - - t.Run("MultiChunkStreamFailure", func(t *testing.T) { - // Verify that a blob larger than the single chunk threshold - // triggers the ToReaderAt streaming path (which eventually - // delegates to cdc.PutReader). We simulate a chunk upload - // failure to ensure the stream correctly surfaces it. - largeDigest := digest.MustNewDigest("default", remoteexecution.DigestFunction_MD5, "fbaf48ec981a5eecdb57b929fdd426e8", 200) - blob := cas.NewBlobFromByteslice(make([]byte, 200)) - - casBackend.EXPECT().FetchCDCParameters(ctx, largeDigest.GetInstanceName()). - Return(cdc.Parameters{ - MinChunkSizeBytes: 64, - HorizonSizeBytes: 128, - }, nil).Times(2) - - // We mock the first PutChunk to fail, verifying the error - // bubbles up safely. - casBackend.EXPECT().PutChunk(ctx, gomock.Any(), gomock.Any()). - Return(status.Error(codes.Internal, "Server on fire")) - - err := cas.PutBlob(ctx, casBackend, largeDigest, blob) - testutil.RequireEqualStatus(t, status.Error(codes.Internal, "Failed to save chunk: Server on fire"), err) - }) -} diff --git a/pkg/filesystem/virtual/BUILD.bazel b/pkg/filesystem/virtual/BUILD.bazel index 4a33566b..f329b79d 100644 --- a/pkg/filesystem/virtual/BUILD.bazel +++ b/pkg/filesystem/virtual/BUILD.bazel @@ -92,7 +92,6 @@ go_test( deps = [ ":virtual", "//internal/mock", - "//pkg/cas", "//pkg/filesystem/pool", "//pkg/proto/bazeloutputservice", "//pkg/proto/bazeloutputservice/rev2", diff --git a/pkg/filesystem/virtual/pool_backed_file_allocator.go b/pkg/filesystem/virtual/pool_backed_file_allocator.go index 1e6edbd1..bbe86c19 100644 --- a/pkg/filesystem/virtual/pool_backed_file_allocator.go +++ b/pkg/filesystem/virtual/pool_backed_file_allocator.go @@ -247,13 +247,15 @@ func (f *fileBackedFile) uploadFile(ctx context.Context, blobUploader cas.BlobUp return digest.BadDigest, status.Error(codes.NotFound, "File was unlinked before uploading could start") } + // TODO: blobUploader.UploadBlob already computes the digest should + // we do it here as well? blobDigest, err := f.updateCachedDigest(digestFunction, frozenFile) if err != nil { frozenFile.Close() return digest.BadDigest, err } - if err := blobUploader.UploadBlob(ctx, blobDigest, cas.NewBlobFromReaderAt(frozenFile, blobDigest.GetSizeBytes())); err != nil { + if _, err := blobUploader.UploadBlob(ctx, digestFunction, frozenFile); err != nil { return digest.BadDigest, util.StatusWrap(err, "Failed to upload file") } return blobDigest, nil diff --git a/pkg/filesystem/virtual/pool_backed_file_allocator_test.go b/pkg/filesystem/virtual/pool_backed_file_allocator_test.go index 272668b5..e4923af4 100644 --- a/pkg/filesystem/virtual/pool_backed_file_allocator_test.go +++ b/pkg/filesystem/virtual/pool_backed_file_allocator_test.go @@ -8,7 +8,6 @@ import ( remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2" "github.com/buildbarn/bb-remote-execution/internal/mock" - "github.com/buildbarn/bb-remote-execution/pkg/cas" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/pool" "github.com/buildbarn/bb-remote-execution/pkg/filesystem/virtual" "github.com/buildbarn/bb-remote-execution/pkg/proto/bazeloutputservice" @@ -500,10 +499,10 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { return 5, io.EOF }) blobUploader := mock.NewMockBlobUploader(ctrl) - blobUploader.EXPECT().UploadBlob(ctx, fileDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { - b.Discard() - return status.Error(codes.Internal, "Server on fire") + blobUploader.EXPECT().UploadBlob(ctx, digestFunction, gomock.Any()). + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, b filesystem.FileReader) (digest.Digest, error) { + b.Close() + return digest.BadDigest, status.Error(codes.Internal, "Server on fire") }) p := virtual.ApplyUploadFile{ @@ -522,8 +521,8 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { return 5, io.EOF }) blobUploader := mock.NewMockBlobUploader(ctrl) - blobUploader.EXPECT().UploadBlob(ctx, fileDigest, gomock.Any()). - DoAndReturn(func(ctx context.Context, digest digest.Digest, b cas.Blob) error { + blobUploader.EXPECT().UploadBlob(ctx, digestFunction, gomock.Any()). + DoAndReturn(func(ctx context.Context, digestFunction digest.Function, blob filesystem.FileReader) (digest.Digest, error) { // As long as we haven't completely read // the file, any operation that modifies // the file's contents should block. @@ -584,9 +583,10 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { underlyingFile.EXPECT().WriteAt([]byte("Foo"), int64(120)).Return(3, nil) // Complete reading the file. - data, err := b.ToByteSlice() - require.NoError(t, err) + data := make([]byte, 5) + blob.ReadAt(data, 0) require.Equal(t, []byte("Hello"), data) + require.NoError(t, blob.Close()) // All mutable operations should now be // able to complete. @@ -594,7 +594,7 @@ func TestPoolBackedFileAllocatorUploadFile(t *testing.T) { <-a2 <-a3 <-a4 - return nil + return fileDigest, nil }) p := virtual.ApplyUploadFile{