Skip to content

Commit

Permalink
Refactor to use a configMapGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
stagnation authored and moroten committed Jan 10, 2024
1 parent 7a75b74 commit b4cc640
Show file tree
Hide file tree
Showing 24 changed files with 353 additions and 420 deletions.
8 changes: 5 additions & 3 deletions bare/config/frontend.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ local common = import 'common.libsonnet';
'': {
endpoint: {
address: 'localhost:8982',
addMetadataJmespathExpression: '{
"build.bazel.remote.execution.v2.requestmetadata-bin": incomingGRPCMetadata."build.bazel.remote.execution.v2.requestmetadata-bin"
}',
addMetadataJmespathExpression: |||
{
"build.bazel.remote.execution.v2.requestmetadata-bin": incomingGRPCMetadata."build.bazel.remote.execution.v2.requestmetadata-bin"
}
|||,
},
},
},
Expand Down
8 changes: 5 additions & 3 deletions docker-compose/config/frontend.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ local common = import 'common.libsonnet';
'': {
endpoint: {
address: 'scheduler:8982',
addMetadataJmespathExpression: '{
"build.bazel.remote.execution.v2.requestmetadata-bin": incomingGRPCMetadata."build.bazel.remote.execution.v2.requestmetadata-bin"
}',
addMetadataJmespathExpression: |||
{
"build.bazel.remote.execution.v2.requestmetadata-bin": incomingGRPCMetadata."build.bazel.remote.execution.v2.requestmetadata-bin"
}
|||,
},
},
},
Expand Down
19 changes: 7 additions & 12 deletions kubernetes/browser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ spec:
readOnly: true
volumes:
- name: configs
projected:
sources:
- configMap:
name: browser
items:
- key: browser.jsonnet
path: browser.jsonnet
- configMap:
name: common
items:
- key: common.libsonnet
path: common.libsonnet
configMap:
name: buildbarn-config
items:
- key: common.libsonnet
path: common.libsonnet
- key: browser.jsonnet
path: browser.jsonnet
---
apiVersion: v1
kind: Service
Expand Down
12 changes: 12 additions & 0 deletions kubernetes/config/browser.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local common = import 'common.libsonnet';

{
blobstore: common.blobstore,
maximumMessageSizeBytes: common.maximumMessageSizeBytes,
httpServers: [{
listenAddresses: [':7984'],
authenticationPolicy: { allow: {} },
}],
global: common.global,
authorizer: { allow: {} },
}
19 changes: 0 additions & 19 deletions kubernetes/config/browser.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions kubernetes/config/common.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
blobstore: {
contentAddressableStorage: {
sharding: {
hashInitialization: 11946695773637837490,
shards: [
{
backend: { grpc: { address: 'storage-0.storage.buildbarn:8981' } },
weight: 1,
},
{
backend: { grpc: { address: 'storage-1.storage.buildbarn:8981' } },
weight: 1,
},
],
},
},
actionCache: {
completenessChecking: {
backend: {
sharding: {
hashInitialization: 14897363947481274433,
shards: [
{
backend: { grpc: { address: 'storage-0.storage.buildbarn:8981' } },
weight: 1,
},
{
backend: { grpc: { address: 'storage-1.storage.buildbarn:8981' } },
weight: 1,
},
],
},
},
maximumTotalTreeSizeBytes: 64 * 1024 * 1024,
},
},
},
browserUrl: 'http://bb-browser.example.com:80',
httpServers: [{
listenAddresses: [':80'],
authenticationPolicy: { allow: {} },
}],
maximumMessageSizeBytes: 2 * 1024 * 1024,
global: {
diagnosticsHttpServer: {
httpServers: [{
listenAddresses: [':9980'],
authenticationPolicy: { allow: {} },
}],
enablePrometheus: true,
enablePprof: true,
enableActiveSpans: true,
},
},
}
63 changes: 0 additions & 63 deletions kubernetes/config/common.yaml

This file was deleted.

34 changes: 34 additions & 0 deletions kubernetes/config/frontend.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
local common = import 'common.libsonnet';

{
grpcServers: [{
listenAddresses: [':8980'],
authenticationPolicy: { allow: {} },
}],
schedulers: {
'': {
endpoint: {
address: 'scheduler:8982',
addMetadataJmespathExpression: |||
{
"build.bazel.remote.execution.v2.requestmetadata-bin": incomingGRPCMetadata."build.bazel.remote.execution.v2.requestmetadata-bin"
}
|||,
},
},
},
maximumMessageSizeBytes: common.maximumMessageSizeBytes,
global: common.global,
contentAddressableStorage: {
backend: common.blobstore.contentAddressableStorage,
getAuthorizer: { allow: {} },
putAuthorizer: { allow: {} },
findMissingAuthorizer: { allow: {} },
},
actionCache: {
backend: common.blobstore.actionCache,
getAuthorizer: { allow: {} },
putAuthorizer: { allow: {} },
},
executeAuthorizer: { allow: {} },
}
39 changes: 0 additions & 39 deletions kubernetes/config/frontend.yaml

This file was deleted.

19 changes: 11 additions & 8 deletions kubernetes/config/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- browser.yaml
- common.yaml
- frontend.yaml
- runner-ubuntu22-04.yaml
- scheduler.yaml
- storage.yaml
- worker-ubuntu22-04.yaml
configMapGenerator:
- name: buildbarn-config
namespace: buildbarn
files:
- browser.jsonnet
- common.libsonnet
- frontend.jsonnet
- runner-ubuntu22-04.jsonnet
- scheduler.jsonnet
- storage.jsonnet
- worker-ubuntu22-04.jsonnet
10 changes: 10 additions & 0 deletions kubernetes/config/runner-ubuntu22-04.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
local common = import 'common.libsonnet';

{
buildDirectoryPath: '/worker/build',
// TODO: global: common.global,
grpcServers: [{
listenPaths: ['/worker/runner'],
authenticationPolicy: { allow: {} },
}],
}
17 changes: 0 additions & 17 deletions kubernetes/config/runner-ubuntu22-04.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions kubernetes/config/scheduler.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
local common = import 'common.libsonnet';

{
adminHttpServers: [{
listenAddresses: [':7982'],
authenticationPolicy: { allow: {} },
}],
clientGrpcServers: [{
listenAddresses: [':8982'],
authenticationPolicy: { allow: {} },
}],
workerGrpcServers: [{
listenAddresses: [':8983'],
authenticationPolicy: { allow: {} },
}],
browserUrl: common.browserUrl,
contentAddressableStorage: common.blobstore.contentAddressableStorage,
maximumMessageSizeBytes: common.maximumMessageSizeBytes,
global: common.global,
executeAuthorizer: { allow: {} },
modifyDrainsAuthorizer: { allow: {} },
killOperationsAuthorizer: { allow: {} },
actionRouter: {
simple: {
platformKeyExtractor: { actionAndCommand: {} },
invocationKeyExtractors: [
{ correlatedInvocationsId: {} },
{ toolInvocationId: {} },
],
initialSizeClassAnalyzer: {
defaultExecutionTimeout: '1800s',
maximumExecutionTimeout: '7200s',
},
},
},
platformQueueWithNoWorkersTimeout: '900s',
}
Loading

0 comments on commit b4cc640

Please sign in to comment.