Skip to content

Commit

Permalink
feat: enable run-time override of fetch/push concurrency
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Goller <[email protected]>
  • Loading branch information
goller committed Sep 19, 2023
1 parent 95d8c46 commit 37d08e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions proto/depot/cloud/v3/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ message RegisterMachineResponse {

// Disable fstrim on shutdown
optional bool disable_fstrim = 14;
optional int32 resolver_concurrency = 15;
}

// Specifies sending buildkit profiling data to a remote endpoint.
Expand Down
6 changes: 6 additions & 0 deletions src/gen/ts/depot/cloud/v3/machine_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
*/
disableFstrim?: boolean

/**
* @generated from field: optional int32 resolver_concurrency = 15;
*/
resolverConcurrency?: number

constructor(data?: PartialMessage<RegisterMachineResponse_BuildKitTask>) {
super()
proto3.util.initPartial(data, this)
Expand All @@ -486,6 +491,7 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
{no: 12, name: 'disable_merge_to', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
{no: 13, name: 'max_parallelism', kind: 'scalar', T: 5 /* ScalarType.INT32 */},
{no: 14, name: 'disable_fstrim', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
{no: 15, name: 'resolver_concurrency', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true},
])

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RegisterMachineResponse_BuildKitTask {
Expand Down
4 changes: 4 additions & 0 deletions src/tasks/buildkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ keepBytes = ${cacheSizeBytes}
env.BUILDKIT_SCHEDULER_DEBUG = '1'
}

if (task.resolverConcurrency) {
env.DEPOT_RESOLVER_CONCURRENCY = task.resolverConcurrency.toString()
}

async function runBuildKit() {
try {
await execa('/usr/bin/buildkitd', [], {stdio: 'inherit', signal, env})
Expand Down

0 comments on commit 37d08e8

Please sign in to comment.