Skip to content

Commit

Permalink
Merge pull request #90 from depot/feat/context-logging-feature-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
goller authored Nov 20, 2023
2 parents 2d1211e + 76518fa commit 052061c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions proto/depot/cloud/v3/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ message RegisterMachineResponse {
optional int32 resolver_concurrency = 15;
// Enable buildkit debug logging
optional bool enable_debug_logging = 16;
// Enable buildkit context logging. This can be deprecated in the future
// when all customers are using context logging.
optional bool enable_context_logging = 17;
}

// Specifies sending buildkit profiling data to a remote endpoint.
Expand Down
2 changes: 1 addition & 1 deletion src/gen/ts/depot/cloud/v3/machine_connect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts,import_extension=none"
// @generated by protoc-gen-connect-es v0.12.0 with parameter "target=ts,import_extension=none"
// @generated from file depot/cloud/v3/machine.proto (package depot.cloud.v3, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
9 changes: 9 additions & 0 deletions src/gen/ts/depot/cloud/v3/machine_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,14 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
*/
enableDebugLogging?: boolean

/**
* Enable buildkit context logging. This can be deprecated in the future
* when all customers are using context logging.
*
* @generated from field: optional bool enable_context_logging = 17;
*/
enableContextLogging?: boolean

constructor(data?: PartialMessage<RegisterMachineResponse_BuildKitTask>) {
super()
proto3.util.initPartial(data, this)
Expand All @@ -502,6 +510,7 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
{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},
{no: 16, name: 'enable_debug_logging', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
{no: 17, name: 'enable_context_logging', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
])

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

if (task.enableContextLogging) {
console.log('Enabling context logging')
env.DEPOT_ENABLE_CONTEXT_LOGGING = '1'
}

if (task.resolverConcurrency) {
console.log(`Setting resolver concurrency to ${task.resolverConcurrency}`)
env.DEPOT_RESOLVER_CONCURRENCY = task.resolverConcurrency.toString()
Expand Down

0 comments on commit 052061c

Please sign in to comment.