Skip to content
Closed
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.*.swp
/bazel-*
/node_modules
go.work
go.work.sum
158 changes: 158 additions & 0 deletions MODULE.bazel.lock

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

3 changes: 2 additions & 1 deletion cmd/bb_noop_worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +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/configuration",
"@com_github_buildbarn_bb_storage//pkg/clock",
"@com_github_buildbarn_bb_storage//pkg/digest",
Expand Down
21 changes: 11 additions & 10 deletions cmd/bb_noop_worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"net/url"
"os"

re_blobstore "github.com/buildbarn/bb-remote-execution/pkg/blobstore"
remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
"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"
Expand Down Expand Up @@ -45,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 {
Expand All @@ -78,8 +77,10 @@ func main() {
buildClient := builder.NewBuildClient(
schedulerClient,
builder.NewNoopBuildExecutor(
contentAddressableStorage,
int(configuration.MaximumMessageSizeBytes),
cas.NewCASMessageReader[*remoteexecution.Command](
contentAddressableStorage,
int(configuration.MaximumMessageSizeBytes),
),
browserURL,
),
pool.EmptyFilePool,
Expand Down
1 change: 1 addition & 0 deletions cmd/bb_scheduler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 10 additions & 9 deletions cmd/bb_scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -60,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
Expand Down Expand Up @@ -132,7 +131,10 @@ func main() {
// TODO: Make timeouts configurable.
generator := random.NewFastSingleThreadedGenerator()
buildQueue := scheduler.NewInMemoryBuildQueue(
contentAddressableStorage,
cas.NewCASMessageReader[*remoteexecution.Action](
contentAddressableStorage,
int(configuration.MaximumMessageSizeBytes),
),
clock.SystemClock,
uuid.NewRandom,
&scheduler.InMemoryBuildQueueConfiguration{
Expand All @@ -149,7 +151,6 @@ func main() {
WorkerTaskRetryCount: 9,
WorkerWithNoSynchronizationsTimeout: time.Minute,
},
int(configuration.MaximumMessageSizeBytes),
actionRouter,
executeAuthorizer,
modifyDrainsAuthorizer,
Expand Down
2 changes: 1 addition & 1 deletion cmd/bb_worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -23,6 +22,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",
Expand Down
Loading
Loading