feat(storage): add shared DynamoDB runner storage - #5279
feat(storage): add shared DynamoDB runner storage#5279edersonbrilhante wants to merge 3 commits into
Conversation
Dependency ReviewThe following issues were found:
License Issueslambdas/functions/webhook/package.json
OpenSSF ScorecardScorecard details
Scanned Files
|
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.
| Statement = [ | ||
| local.github_app_read_statement, | ||
| local.entry_runner_group_statements[entry_id], | ||
| local.runner_config_write_statements[entry_id], | ||
| local.runner_state_write_statements[entry_id], | ||
| ] |
There was a problem hiding this comment.
The generated policies allow DynamoDB access but do not grant access to the configured table KMS keys. With a key policy that delegates permissions to IAM, the Lambda and runner roles can fail to read the encrypted tables.
Please include scoped KMS permissions for each table’s consumers and add policy tests using non-null custom key ARNs.
0563c7c to
2c05467
Compare
08afbd2 to
97d9141
Compare
97d9141 to
1d9fa0e
Compare
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