Skip to content

docs: Add ADR for migrating CI orchestration to GitHub Actions#3280

Open
kukushking wants to merge 2 commits intomainfrom
feat/github-actions-ci
Open

docs: Add ADR for migrating CI orchestration to GitHub Actions#3280
kukushking wants to merge 2 commits intomainfrom
feat/github-actions-ci

Conversation

@kukushking
Copy link
Copy Markdown
Contributor

@kukushking kukushking commented Mar 15, 2026

Feature or Bugfix

  • Feature

Detail

Proposes consolidating CI from a separate private CodeBuild/CDK repository into GitHub Actions workflows that trigger a single CodeBuild project via aws-actions/aws-codebuild-run-build. Includes security analysis showing the migration does not weaken security posture.

  • GitHub Actions orchestrates test matrix and triggers a single CodeBuild project via aws-actions/aws-codebuild-run-build
  • CodeBuild continues to execute tests inside the VPC (no change to security posture)
  • All infrastructure moves into test_infra/ in this repo, retiring the private repository
  • Replaces custom AL2 Docker image, batch builds, webhook management, and internal CI deploy pipeline

Security

Detailed analysis in the ADR. Key points:

  • Test execution stays on CodeBuild (VPC isolation, ephemeral containers)
  • GitHub Actions OIDC role is narrowly scoped (can only start builds and read logs)
  • Fork PR protections via pull_request_target + environment approval gates
  • Removes attack surface: long-lived OAuth token, S3 artifacts bucket, multiple IAM roles
  • CDK code contains no secrets; existing test infrastructure stacks are already public

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Proposes consolidating CI from a separate private CodeBuild/CDK repository
into GitHub Actions workflows that trigger a single CodeBuild project via
aws-actions/aws-codebuild-run-build. Includes security analysis showing
the migration does not weaken security posture.
@kukushking
Copy link
Copy Markdown
Contributor Author

AWS CodeBuild CI Report

  • CodeBuild project: GitHubDistributedCodeBuild6-jWcl5DLmvupS
  • Commit ID: be86f3a
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@kukushking
Copy link
Copy Markdown
Contributor Author

AWS CodeBuild CI Report

  • CodeBuild project: GitHubCodeBuild8756EF16-4rfo0GHQ0u9a
  • Commit ID: be86f3a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Proposed

## Context

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would focus on the unit tests to start. Others are rarely run and would just add complexity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, layers build I would also migrate as it's a release dependency


## Decision

Migrate CI orchestration from standalone CodeBuild webhooks to GitHub Actions workflows that trigger a single CodeBuild project via `aws-actions/aws-codebuild-run-build`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please double check if that action is ok with the OSS team. They might have a different suggesiton

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### Ray load test infrastructure

The load tests stack in the private repository provisions infrastructure for remote Ray cluster tests: an EC2 instance profile for Ray workers, security groups for cluster communication, and an auto-terminate Lambda that cleans up orphaned instances. All of this moves into `./test_infra/`. The execution model is unchanged.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't run this in a long time, not even sure it's still working

3. **The existing test resource stacks are already public.** `./test_infra/stacks/` — which defines the VPC, databases, security groups, OpenSearch domains, and IAM roles — is already in the public repository. The CI stack follows the same pattern and exposes no additional sensitive information.
4. **Comparable AWS open-source projects do this.** AWS Powertools for Lambda (Python) publishes all CI and infrastructure configuration in their public repository, including IAM role definitions and OIDC trust policies.

**What to verify before merging:** audit the CDK stack to confirm no account IDs, resource ARNs, IP ranges, or other environment-specific values are hardcoded. All such values should come from SSM parameters, CDK context, or environment variables at deploy time.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would double check this - a full audit before the fist commit

Switch from aws-actions/aws-codebuild-run-build to CodeBuild-hosted
runner approach. Workflow steps run directly on CodeBuild — no buildspecs,
no OIDC trigger role needed. Simpler architecture with same security model.
@kukushking
Copy link
Copy Markdown
Contributor Author

AWS CodeBuild CI Report

  • CodeBuild project: GitHubDistributedCodeBuild6-jWcl5DLmvupS
  • Commit ID: 77c9fc7
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@kukushking
Copy link
Copy Markdown
Contributor Author

AWS CodeBuild CI Report

  • CodeBuild project: GitHubCodeBuild8756EF16-4rfo0GHQ0u9a
  • Commit ID: 77c9fc7
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants