Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/bb_scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func main() {
// Create an action router that is responsible for analyzing
// incoming execution requests and determining how they are
// scheduled.
actionRouter, err := routing.NewActionRouterFromConfiguration(configuration.ActionRouter, contentAddressableStorage, int(configuration.MaximumMessageSizeBytes), previousExecutionStatsStore)
actionRouter, err := routing.NewActionRouterFromConfiguration(configuration.ActionRouter, contentAddressableStorage, int(configuration.MaximumMessageSizeBytes), previousExecutionStatsStore, grpcClientFactory, dependenciesGroup)
if err != nil {
return util.StatusWrap(err, "Failed to create action router")
}
Expand Down
14 changes: 14 additions & 0 deletions internal/mock/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ gomock(
name = "initialsizeclass",
out = "initialsizeclass.go",
interfaces = [
"Analyzer",
"Learner",
"PreviousExecutionStatsHandle",
"PreviousExecutionStatsStore",
Expand Down Expand Up @@ -312,6 +313,16 @@ gomock(
package = "mock",
)

gomock(
name = "remoteactionrouter",
out = "remoteactionrouter.go",
interfaces = ["ActionRouterClient"],
library = "//pkg/proto/remoteactionrouter",
mockgen_model_library = "@org_uber_go_mock//mockgen/model",
mockgen_tool = "@org_uber_go_mock//mockgen",
package = "mock",
)

gomock(
name = "remoteworker",
out = "remoteworker.go",
Expand Down Expand Up @@ -430,6 +441,7 @@ go_library(
":initialsizeclass.go",
":platform.go",
":random.go",
":remoteactionrouter.go",
":remoteexecution.go",
":remoteworker.go",
":routing.go",
Expand Down Expand Up @@ -465,11 +477,13 @@ go_library(
"//pkg/proto/cas",
"//pkg/proto/completedactionlogger",
"//pkg/proto/outputpathpersistency",
"//pkg/proto/remoteactionrouter",
"//pkg/proto/remoteworker",
"//pkg/proto/runner",
"//pkg/scheduler/initialsizeclass",
"//pkg/scheduler/invocation",
"//pkg/scheduler/platform",
"//pkg/scheduler/routing",
"@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",
Expand Down
6 changes: 5 additions & 1 deletion pkg/proto/configuration/scheduler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ proto_library(
visibility = ["//visibility:public"],
deps = [
"@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_proto",
"@com_github_buildbarn_bb_storage//pkg/proto/configuration/grpc:grpc_proto",
"@protobuf//:duration_proto",
"@protobuf//:empty_proto",
],
Expand All @@ -19,7 +20,10 @@ go_proto_library(
importpath = "github.com/buildbarn/bb-remote-execution/pkg/proto/configuration/scheduler",
proto = ":scheduler_proto",
visibility = ["//visibility:public"],
deps = ["@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto"],
deps = [
"@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto",
"@com_github_buildbarn_bb_storage//pkg/proto/configuration/grpc",
],
)

go_library(
Expand Down
196 changes: 138 additions & 58 deletions pkg/proto/configuration/scheduler/scheduler.pb.go

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions pkg/proto/configuration/scheduler/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package buildbarn.configuration.scheduler;

import "build/bazel/remote/execution/v2/remote_execution.proto";
import "github.com/buildbarn/bb-storage/pkg/proto/configuration/grpc/grpc.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";

Expand All @@ -18,6 +19,10 @@ message ActionRouterConfiguration {
// Demultiplex incoming requests based on the client-provided REv2
// instance name prefix and platform properties.
DemultiplexingActionRouterConfiguration demultiplexing = 2;

// Delegate action routing to a gRPC service, using the protocol defined
// in pkg/protocol/remoteactionrouter/remoteactionrouter.proto.
RemoteActionRouterConfiguration remote = 3;
}
}

Expand Down Expand Up @@ -88,6 +93,18 @@ message DemultiplexingActionRouterConfiguration {
ActionRouterConfiguration default_action_router = 3;
}

message RemoteActionRouterConfiguration {
// gRPC client configuration.
buildbarn.configuration.grpc.ClientConfiguration grpc_client = 1;

// The initial size class analyzer that is used. This is performed
// locally after receiving the routing decision from the remote service.
//
// See SimpleActionRouterConfiguration.initial_size_class_analyzer for
// details on how to set this field.
InitialSizeClassAnalyzerConfiguration initial_size_class_analyzer = 2;
}

message PlatformKeyExtractorConfiguration {
oneof kind {
// Attempt to extract platform properties from the REv2 Action
Expand Down
33 changes: 33 additions & 0 deletions pkg/proto/remoteactionrouter/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
load("@rules_go//go:def.bzl", "go_library")
load("@rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "remoteactionrouter_proto",
srcs = ["remoteactionrouter.proto"],
import_prefix = "github.com/buildbarn/bb-remote-execution",
visibility = ["//visibility:public"],
deps = [
"@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_proto",
"@protobuf//:any_proto",
],
)

go_proto_library(
name = "remoteactionrouter_go_proto",
compilers = [
"@rules_go//proto:go_proto",
"@rules_go//proto:go_grpc_v2",
],
importpath = "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter",
proto = ":remoteactionrouter_proto",
visibility = ["//visibility:public"],
deps = ["@bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto"],
)

go_library(
name = "remoteactionrouter",
embed = [":remoteactionrouter_go_proto"],
importpath = "github.com/buildbarn/bb-remote-execution/pkg/proto/remoteactionrouter",
visibility = ["//visibility:public"],
)
222 changes: 222 additions & 0 deletions pkg/proto/remoteactionrouter/remoteactionrouter.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading