diff --git a/enterprise/server/cmd/server/BUILD b/enterprise/server/cmd/server/BUILD index d93be81db1b..f878b528d02 100644 --- a/enterprise/server/cmd/server/BUILD +++ b/enterprise/server/cmd/server/BUILD @@ -49,6 +49,7 @@ go_library( "//server/static", "//server/telemetry", "//server/util/fileresolver", + "//server/util/flagutil", "//server/util/grpc_client", "//server/util/grpc_server", "//server/util/healthcheck", diff --git a/enterprise/server/cmd/server/main.go b/enterprise/server/cmd/server/main.go index 3a8de9b271f..2e7a6f550f2 100644 --- a/enterprise/server/cmd/server/main.go +++ b/enterprise/server/cmd/server/main.go @@ -43,6 +43,7 @@ import ( "github.com/buildbuddy-io/buildbuddy/server/static" "github.com/buildbuddy-io/buildbuddy/server/telemetry" "github.com/buildbuddy-io/buildbuddy/server/util/fileresolver" + "github.com/buildbuddy-io/buildbuddy/server/util/flagutil" "github.com/buildbuddy-io/buildbuddy/server/util/grpc_client" "github.com/buildbuddy-io/buildbuddy/server/util/grpc_server" "github.com/buildbuddy-io/buildbuddy/server/util/healthcheck" @@ -58,7 +59,29 @@ import ( httpfilters "github.com/buildbuddy-io/buildbuddy/server/http/filters" ) -var serverType = flag.String("server_type", "buildbuddy-server", "The server type to match on health checks") +var ( + // Remote Execution Config + remoteExecDefaultPoolName = flag.String("remote_execution.default_pool_name", "", "The default executor pool to use if one is not specified.") + remoteExecEnableWorkflows = flag.Bool("remote_execution.enable_workflows", false, "Whether to enable BuildBuddy workflows.") + remoteExecWorkflowsPoolName = flag.String("remote_execution.workflows_pool_name", "", "The executor pool to use for workflow actions. Defaults to the default executor pool if not specified.") + remoteExecWorkflowsDefaultImage = flag.String("remote_execution.workflows_default_image", "", "The default docker image to use for running workflows.") + remoteExecWorkflowsCIRunnerDebug = flag.Bool("remote_execution.workflows_ci_runner_debug", false, "Whether to run the CI runner in debug mode.") + remoteExecWorkflowsCIRunnerBazelCommand = flag.String("remote_execution.workflows_ci_runner_bazel_command", "", "Bazel command to be used by the CI runner.") + remoteExecRedisTarget = flag.String("remote_execution.redis_target", "", "A Redis target for storing remote execution state. Falls back to app.default_redis_target if unspecified. Required for remote execution. To ease migration, the redis target from the cache config will be used if neither this value nor app.default_redis_target are specified.") + remoteExecRedisShards = flagutil.StringSlice("remote_execution.sharded_redis.shards", []string{}, "Ordered list of Redis shard addresses.") + remoteExecRedisUsername = flag.String("remote_execution.sharded_redis.username", "", "Redis username") + remoteExecRedisPassword = flag.String("remote_execution.sharded_redis.password", "", "Redis password") + remoteExecSharedExecutorPoolGroupID = flag.String("remote_execution.shared_executor_pool_group_id", "", "Group ID that owns the shared executor pool.") + remoteExecRedisPubSubPoolSize = flag.Int("remote_execution.redis_pubsub_pool_size", 0, "Maximum number of connections used for waiting for execution updates.") + remoteExecEnableRemoteExec = flag.Bool("remote_execution.enable_remote_exec", false, "If true, enable remote-exec. ** Enterprise only **") + remoteExecRequireExecutorAuthorization = flag.Bool("remote_execution.require_executor_authorization", false, "If true, executors connecting to this server must provide a valid executor API key.") + remoteExecEnableUserOwnedExecutors = flag.Bool("remote_execution.enable_user_owned_executors", false, "If enabled, users can register their own executors with the scheduler.") + remoteExecForceUserOwnedDarwinExecutors = flag.Bool("remote_execution.force_user_owned_darwin_executors", false, "If enabled, darwin actions will always run on user-owned executors.") + remoteExecEnableExecutorKeyCreation = flag.Bool("remote_execution.enable_executor_key_creation", false, "If enabled, UI will allow executor keys to be created.") + remoteExecEnableRedisAvailabilityMonitoring = flag.Bool("remote_execution.enable_redis_availability_monitoring", false, "If enabled, the execution server will detect if Redis has lost state and will ask Bazel to retry executions.") + + serverType = flag.String("server_type", "buildbuddy-server", "The server type to match on health checks") +) func configureFilesystemsOrDie(realEnv *real_environment.RealEnv) { // Ensure we always override the app filesystem because the enterprise