Skip to content

Commit 421aca4

Browse files
authored
[BE] Improve autoscaler logging about how many instances are being provisioned (#6619)
The original log could result in lines like: `Available (0) runners will be below minimum 10. Will provision 0 extra runners` which sounds like it's not going to provision any instances, but actually what it's trying to say that the autoscaler will not be overprovisioning any bonus buffer instances beyond whatever the incoming request was for (i.e. if 5 instances were requested, we'll only be provisioning 5, not more than 5) Edited the logs to: 1. Clarify that line 2. Only emit that line if we're actually provisioning extra buffer runners 3. Also emit a log line about the actual number of runners we intend to provision This was detected as part of the Chaos Storm testing: pytorch/pytorch#153155
1 parent bcdd9d4 commit 421aca4

File tree

1 file changed

+10
-4
lines changed
  • terraform-aws-github-runner/modules/runners/lambdas/runners/src/scale-runners

1 file changed

+10
-4
lines changed

terraform-aws-github-runner/modules/runners/lambdas/runners/src/scale-runners/scale-up.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,12 @@ export function _calculateScaleUpAmount(
366366
// Never proactively scale up above the minimum limit
367367
extraScaleUp = Math.min(extraScaleUp, minRunnersUnderprovisionCount);
368368

369-
console.info(
370-
`Available (${availableCount}) runners will be below minimum ${minRunners}. ` +
371-
`Will provision ${extraScaleUp} extra runners`,
372-
);
369+
if (extraScaleUp > 0) {
370+
console.info(
371+
`Available (${availableCount}) runners will be below minimum ${minRunners}. ` +
372+
`Will provision ${extraScaleUp} additional runners above the requested amount to serve as a buffer.`,
373+
);
374+
}
373375
}
374376

375377
let scaleUpAmount = extraNeededToAcceptRequests + extraScaleUp;
@@ -382,5 +384,9 @@ export function _calculateScaleUpAmount(
382384
scaleUpAmount = maxScaleUp;
383385
}
384386

387+
console.info(
388+
`Will provision a total of ${scaleUpAmount} runners to handle the requested amount of ${requestedCount} runners.`,
389+
);
390+
385391
return scaleUpAmount;
386392
}

0 commit comments

Comments
 (0)