Repository navigation
feat(storage): add shared DynamoDB runner storage - #5279
edersonbrilhante wants to merge 13 commits into
Conversation
Dependency ReviewThe following issues were found:
License Issueslambdas/functions/webhook/package.json
OpenSSF ScorecardScorecard details
Scanned Files
|
0150fb2 to
365ec35
Compare
365ec35 to
ccdd653
Compare
guicaulada
left a comment
There was a problem hiding this comment.
Overall looks good!
One suggestion on scale-down related to orphan runners: it would be nice if we could retry cleanup. Could be a subject for a follow-up PR.
Another point is related to KMS, I don't think the Lambda and runner roles have access to KMS to read encrypted tables.
Feel free to correct me if I'm missing something here!
| } | ||
| } else { | ||
| await unMarkOrphan(runner.id, computeProvider); | ||
| await unMarkOrphan(runner, computeProvider); |
There was a problem hiding this comment.
A runner can get stuck if scale-down sets its state to terminating and then crashes before removing it from GitHub. On the next run, the runner is still registered in GitHub, so this branch calls unMarkOrphan. That function does not clear terminating, and normal scale-down skips runners in that state—even after the termination claim expires.
Please let a later scale-down run take over an expired termination claim and retry cleanup. Before removing the runner, check whether it is now busy so we do not interrupt a job.
I reproduced this with an online, idle runner whose termination claim was one hour old: scale-down never called beginTermination to retry cleanup.
ccdd653 to
1e91aa2
Compare
0563c7c to
2c05467
Compare
08afbd2 to
97d9141
Compare
97d9141 to
1d9fa0e
Compare
|
Nice work on this , the One question on the isolation model: On extensibility: this scope/id design also seems like a natural fit for replacing per-instance tagging (job context, etc.) with DynamoDB attributes on the same runner-state row, and eventually giving runners a place to read their own operational metadata back. If that's on the roadmap, it might be worth keeping the secret JIT-config item and any future metadata item under separate For instance, internally we have a similar setup which we protect using IAM policies with something like this: This way the instance itself is only able to read it's own data. |
1d9fa0e to
045a518
Compare
045a518 to
9a9c2cc
Compare
9a9c2cc to
2564213
Compare
…ig store The DynamoDB runner config store keys one-time registration/JIT config on the compute identity so that IAM can restrict each runner to its own record. Add an optional getRunnerConfigAccessScope hook to StartRunnerConfigOptions and have the EC2 provider supply the instance ARN from EC2_INSTANCE_ARN_PREFIX (set by the DynamoDB wiring). SSM deployments never set it and keep writing the same record. Based on the accessScope handling in github-aws-runners#5279. Signed-off-by: tehlers320 <[email protected]>
Prerequisite contract for the DynamoDB runner config store ported from github-aws-runners#5279/github-aws-runners#5458 (see review on github-aws-runners#5458: core lacked RunnerConfigRecord.accessScope). Optional, so the SSM provider is unaffected. Signed-off-by: tehlers320 <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ders Compose the DynamoDB runner config, runner group cache and GitHub App credentials stores when RUNNER_CONFIG_STORAGE_PROVIDER=aws_dynamodb, and make RunnerConfigStorage.consumer optional (EC2 runners consume their own config in the instance bootstrap, the control plane never calls it). Builds on github-aws-runners#5279 / github-aws-runners#5458 (edersonbrilhante) and github-aws-runners#5266 (wadherv). Signed-off-by: tehlers320 <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ig store The DynamoDB runner config store keys one-time registration/JIT config on the compute identity so that IAM can restrict each runner to its own record. Add an optional getRunnerConfigAccessScope hook to StartRunnerConfigOptions and have the EC2 provider supply the instance ARN from EC2_INSTANCE_ARN_PREFIX (set by the DynamoDB wiring). SSM deployments never set it and keep writing the same record. Based on the accessScope handling in github-aws-runners#5279. Signed-off-by: tehlers320 <[email protected]>
Description
Adds an opt-in
aws_dynamodbrunner-config storage provider for experimental multi-runner v2 deployments.<prefix>-configfor durable global and entry-scoped configuration, including GitHub App credentials, webhook secret, matcher config, runner bootstrap config, and runner-group cache.<prefix>-runner-statefor TTL-backed one-time runner configuration plus provider-neutral runner lifecycle/inventory records.scopeandidkeys to isolate global, runner-entry, lifecycle, and compute-resource records without creating a table per runner entry.aws_ssm. The termination watcher intentionally remains on SSM in this PR.DynamoDB selection requires direct GitHub App values; externally managed
*_ssmreferences continue using the SSM provider so Terraform does not copy those external SecureStrings into state.Test Plan
tsc --noEmit: control-plane, storage-providers, and webhook passed.terraform validate: storage provider, multi-runner, and webhook modules passed.terraform fmt -check -recursiveandgit diff --checkpassed.Related Issues
Credits to @wadherv ##5266