Skip to content

ci(e2e): add VM integration tests on ephemeral AWS EC2 runner#477

Merged
DorianZheng merged 3 commits into
mainfrom
ci/e2e-runner
May 5, 2026
Merged

ci(e2e): add VM integration tests on ephemeral AWS EC2 runner#477
DorianZheng merged 3 commits into
mainfrom
ci/e2e-runner

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • Adds e2e-test.yml workflow that provisions an ephemeral AWS EC2 c8i.2xlarge instance per job to run VM-requiring integration tests
  • Uses GitHub OIDC → AWS STS authentication (no stored AWS credentials)
  • Includes scripts/ci/setup-ci-runner.sh for one-command infrastructure provisioning (AWS + GitHub)

Architecture

start-runner (ubuntu-latest) → e2e-tests (self-hosted EC2) → stop-runner (ubuntu-latest)

Safety

  • --ephemeral runner auto-deregisters after one job
  • if: always() ensures cleanup on failure/cancellation
  • 45-min self-destruct timer on instance (IAM-based)
  • instance-initiated-shutdown-behavior: terminate
  • 35-min job timeout

Cost

$0.09-0.14 per run ($0.34/hr for c8i.2xlarge, 15-25 min typical)

Test plan

  • Run ./scripts/ci/setup-ci-runner.sh to provision AWS infra
  • Trigger workflow manually via Actions tab
  • Verify EC2 instance creates, tests run, instance terminates
  • Verify no orphaned instances: aws ec2 describe-instances --filters "Name=tag:Purpose,Values=boxlite-e2e"

GitHub-hosted runners do not support /dev/kvm, preventing VM-based
integration tests from running in CI. This adds an e2e-test workflow
that launches an ephemeral AWS EC2 c8i.2xlarge instance (Intel Nitro
with nested KVM) per job, runs all integration test suites, and
terminates the instance afterward.

Authentication uses GitHub OIDC → AWS STS (no stored AWS credentials).
A setup script (scripts/ci/setup-aws-oidc.sh) provisions all required
AWS resources: OIDC provider, IAM roles, instance profile, and SG.

Safety: 5-layer defense against orphaned instances (ephemeral runner,
always-cleanup job, 45-min self-destruct via IAM, API deregistration,
35-min job timeout, instance-initiated-shutdown-behavior=terminate).

Triggers: push to main (path-filtered), PR with 'e2e' label, manual.
Cost: ~$0.09-0.14 per run (~$0.34/hr for c8i.2xlarge).
Comment thread .github/workflows/e2e-test.yml Fixed
Comment thread .github/workflows/e2e-test.yml Fixed
DorianZheng and others added 2 commits May 5, 2026 18:24
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@DorianZheng DorianZheng merged commit 2b0d5cb into main May 5, 2026
10 checks passed
@DorianZheng DorianZheng deleted the ci/e2e-runner branch May 5, 2026 10:24
DorianZheng added a commit that referenced this pull request May 5, 2026
Replaces the initial e2e-test.yml (merged in #477) with the complete
implementation including:
- GitHub App authentication (no PAT needed)
- OIDC for AWS (no stored AWS credentials)
- Automated setup script with manifest flow (one-click app creation)
- Multi-remote support, port reuse, proper error reporting

Setup: ./scripts/ci/setup-ci-runner.sh (auto-detects everything)
Cost: ~$0.09-0.14 per run (~$0.34/hr for c8i.2xlarge)
DorianZheng added a commit that referenced this pull request May 5, 2026
Replaces the initial e2e-test.yml (merged in #477) with the complete
implementation including:
- GitHub App authentication (no PAT needed)
- OIDC for AWS (no stored AWS credentials)
- Automated setup script with manifest flow (one-click app creation)
- Multi-remote support, port reuse, proper error reporting

Setup: ./scripts/ci/setup-ci-runner.sh (auto-detects everything)
Cost: ~$0.09-0.14 per run (~$0.34/hr for c8i.2xlarge)
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