Files
tracer-cloud--opensre/tests/benchmarks/cloudopsbench/infra/AWS_BENCH_SETUP.md
T
wehub-resource-sync 4b6817381b
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
CI / coverage-report (push) Has been cancelled
CI / test-kubernetes (push) Has been cancelled
CI / should-run-thorough (push) Has been cancelled
CI / test-thorough (cloudwatch-demo) (push) Has been cancelled
CI / test-thorough (flink-ecs) (push) Has been cancelled
CI / test-thorough (upstream-lambda) (push) Has been cancelled
CI / test-thorough (prefect-ecs-fargate) (push) Has been cancelled
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Has been cancelled
Benchmark image — build + push to ECR (any adapter) / build + push (push) Has been cancelled
CI / quality (ubuntu-latest) (push) Has been cancelled
CI / test (tools-runtime) (push) Has been cancelled
CI / test (e2e-general) (push) Has been cancelled
CI / test (cli-runtime) (push) Has been cancelled
CI / test (e2e-provider-and-openclaw) (push) Has been cancelled
CI / test (integrations-and-misc) (push) Has been cancelled
Release / verify (push) Has been cancelled
Release / build-python-dist (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Has been cancelled
Release / publish-release (push) Has been cancelled
Release / publish-main-release (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Has been cancelled
Release / prepare (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:45 +08:00

3.7 KiB

Setting up AWS bench (one-time)

The benchmark runs on AWS Fargate so you don't tie up your laptop or a GitHub-hosted runner for hours. This is the six-step setup before Benchmark — run on Fargate can launch anything. Do each step once; re-runs of the actual benchmark only need step 6.

Whenever the upstream HF dataset gets a new revision, re-run step 5 (mirror to S3) AND bump corpus_hf_revision in tests/benchmarks/cloudopsbench/infra/variables.tf (or pass it as -var=corpus_hf_revision=<new-sha> to terraform apply).

1. Apply Terraform

Provisions the ECS cluster, S3 artifact bucket, Secrets Manager entries, IAM roles, CloudWatch log group, and OIDC trust for the GitHub Actions roles.

cd tests/benchmarks/cloudopsbench/infra/
terraform init
terraform apply

See README.md for backend bucket

  • DynamoDB lock requirements.

2. Seed the LLM API keys into AWS Secrets Manager

The container reads keys from Secrets Manager at runtime — never from the workflow. Add ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, HF_TOKEN as GitHub repo secrets (Settings → Secrets and variables → Actions → Secrets), then run the seeding workflow once per key:

gh workflow run benchmark-seed-secret.yml -f secret=anthropic_api_key
gh workflow run benchmark-seed-secret.yml -f secret=openai_api_key
gh workflow run benchmark-seed-secret.yml -f secret=deepseek_api_key
gh workflow run benchmark-seed-secret.yml -f secret=hf_token

3. Build and push the bench container image to ECR

gh workflow run benchmark-image.yml

This also runs automatically on changes to bench code or the Dockerfile.

4. Set the four repo variables

These live under Settings → Secrets and variables → Actions → Variables (not Secrets — they're not sensitive). Grab the values from Terraform:

cd tests/benchmarks/cloudopsbench/infra/
echo "BENCH_ECS_CLUSTER             = $(terraform output -raw ecs_cluster_name)"
echo "BENCH_TASK_DEFINITION_FAMILY  = $(terraform output -raw task_definition_family)"
echo "BENCH_SUBNET_IDS              = $(terraform output -json subnet_ids | jq -r 'join(",")')"
echo "BENCH_SECURITY_GROUP_ID       = $(terraform output -raw security_group_id)"

Paste each value into a new repo variable with the matching name. AWS_ACCOUNT_ID is already set (the seed-secret workflow uses it).

5. Mirror the Cloud-OpsBench corpus to S3

The Fargate task pulls the corpus from S3 at startup (not from Hugging Face — same-region S3 sync is ~30 s vs ~10 min HF rate-limited download). Seed the S3 prefix once from a developer machine:

# From the repo root
export HF_TOKEN=hf_...           # see tests/benchmarks/README.md
make download-cloudopsbench-hf   # local copy of the dataset
make mirror-cloudopsbench-s3     # auto-detects HF revision SHA + uploads
                                 # to s3://cloud-ops-bench-dataset/<sha>/

The output prints the HF revision SHA. If it differs from the default in tests/benchmarks/cloudopsbench/infra/variables.tf (corpus_hf_revision), update the default or override per apply: terraform apply -var=corpus_hf_revision=<sha>.

The corpus bucket needs to exist before this step. Create it once if you don't have it: aws s3 mb s3://cloud-ops-bench-dataset --region us-east-1.

6. Launch a benchmark

gh workflow run benchmark-run.yml \
    -f config=tests/benchmarks/cloudopsbench/configs/cloudopsbench_smoke.yml \
    -f dev_mode=true

Or use the GitHub UI: Actions → Benchmark — run on Fargate → Run workflow.

The workflow exits as soon as the task launches. Watch live logs with:

aws logs tail /ecs/opensre-bench --follow

Artifacts land in the bench S3 bucket under runs/<date>-<sha>/ when the task finishes.