Files
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

103 lines
3.9 KiB
YAML

name: Benchmark secret — seed GitHub repo secret into AWS Secrets Manager
# Manually-triggered workflow that copies a GitHub repo secret into AWS
# Secrets Manager at opensre-bench/llm/<secret>. The bench container reads
# its LLM API keys from Secrets Manager at runtime; this workflow is how
# you put them there without touching a developer laptop.
#
# The `secret` dropdown enforces which target is valid — must match one
# of the four IAM-granted secret ARNs in tests/benchmarks/cloudopsbench/infra/iam_oidc.tf
# (anthropic / openai / deepseek / hf_token).
#
# Why a workflow instead of a developer running `aws secretsmanager
# put-secret-value` locally: keeps keys off developer laptops + out of
# shell history, and centralizes rotation — rotate the value in the GH
# repo secret and re-run this workflow to propagate.
#
# Pre-reqs:
# - tests/benchmarks/cloudopsbench/infra/ Terraform has been applied (the secret resource exists)
# - Corresponding GitHub repo secret is set:
# ANTHROPIC_API_KEY / OPENAI_API_KEY / DEEPSEEK_API_KEY / HF_TOKEN
#
# Order of operations:
# 1. terraform-bench.yml (plan) on PR
# 2. terraform apply locally
# 3. this workflow (workflow_dispatch) — pick the secret to seed
# from the dropdown, repeat once per LLM provider key
on:
workflow_dispatch:
inputs:
secret:
description: Which secret to seed (must match the AWS resource name)
required: true
type: choice
options:
- anthropic_api_key
- openai_api_key
- deepseek_api_key
- hf_token
permissions:
contents: read
id-token: write # required for AWS OIDC role assumption
concurrency:
group: bench-seed-${{ inputs.secret }}
cancel-in-progress: false
jobs:
seed:
name: seed ${{ inputs.secret }}
if: github.repository == 'Tracer-Cloud/opensre'
runs-on: ubuntu-latest
env:
AWS_REGION: us-east-1
SECRET_ID: opensre-bench/llm/${{ inputs.secret }}
steps:
- name: Configure AWS credentials (OIDC role assumption)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/opensre-bench-github-actions
role-session-name: github-actions-seed-${{ inputs.secret }}-${{ github.run_id }}
aws-region: us-east-1
- name: Verify secret resource exists
run: |
if ! aws secretsmanager describe-secret --secret-id "$SECRET_ID" >/dev/null 2>&1; then
echo "::error::Secret $SECRET_ID not found. Run \`terraform apply\` in tests/benchmarks/cloudopsbench/infra/ first."
exit 1
fi
- name: Put secret value
# All four candidate values are bound at workflow level. The case
# statement picks the one matching the chosen target — unused
# values stay as masked env vars (GH redacts secret refs in logs).
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
TARGET: ${{ inputs.secret }}
run: |
case "$TARGET" in
anthropic_api_key) V="$ANTHROPIC_API_KEY" ;;
openai_api_key) V="$OPENAI_API_KEY" ;;
deepseek_api_key) V="$DEEPSEEK_API_KEY" ;;
hf_token) V="$HF_TOKEN" ;;
*)
echo "::error::Unknown target: $TARGET (dropdown should have prevented this)"
exit 1
;;
esac
if [ -z "$V" ]; then
echo "::error::GitHub repo secret for $TARGET is unset. Configure it under Settings > Secrets and variables > Actions."
exit 1
fi
aws secretsmanager put-secret-value \
--secret-id "$SECRET_ID" \
--secret-string "$V" >/dev/null
echo "Seeded $SECRET_ID (length=${#V})."