Skip to content

[4/4] Add CI workflow for Step Functions benchmark triggers#78

Closed
ericc59 wants to merge 17 commits into
mainfrom
aws-integration-pr4-ci
Closed

[4/4] Add CI workflow for Step Functions benchmark triggers#78
ericc59 wants to merge 17 commits into
mainfrom
aws-integration-pr4-ci

Conversation

@ericc59
Copy link
Copy Markdown
Contributor

@ericc59 ericc59 commented Jan 29, 2026

Summary

  • Add GitHub Actions workflow to trigger Step Functions on models.yml changes
  • Add config change detection script with full test coverage
  • Support automatic triggers on push and manual workflow_dispatch

Changes

  • .github/workflows/benchmark.yml - CI workflow
  • scripts/detect_config_changes.py - Config detection
  • tests/test_detect_config_changes.py - 35 tests

…iting, environment detection

- DynamoDBProgressManager for distributed task coordination with atomic claim/complete/fail operations
- DistributedRateLimiter using DynamoDB with rate/period interface and exponential backoff on contention
- ExecutionContext detection for LOCAL/EC2/FARGATE/BATCH environments (handles IMDSv2)
- FAILED_PERMANENT status prevents exhausted-retry tasks from re-queuing
- Run-level cost/token aggregate rollups
- boto3 moved to [aws] extras, moto to [test] extras
Implements the batch worker that runs inside AWS Batch containers to
process individual ARC benchmark tasks. Integrates with the AWS
infrastructure layer from PR 1/3.

Core components:
- BatchWorkerConfig: Loads configuration from environment variables
  (RUN_ID, TASK_ID, CONFIG_NAME, S3_BUCKET, DYNAMODB_* table names)
- BatchWorker: Main orchestration class with lazy-loaded S3, DynamoDB,
  and rate limiter connections
- GracefulShutdown: Signal handler for clean container termination

Workflow:
1. Claim task atomically via DynamoDB conditional update
2. Load task data from S3
3. Execute test pairs with distributed rate limiting
4. Save submission to S3
5. Mark task completed/failed in DynamoDB

Also includes:
- Dockerfile for building the batch worker container image
- AWS deployment artifacts (job definition, IAM policies, DynamoDB schemas)
- Comprehensive test suite using moto for AWS mocking
- CLI entry point: arc-batch-worker
- Add test script that sets up DynamoDB tables, S3 bucket, and task
  records in LocalStack, then runs the batch worker against it
- Update aws/README.md with LocalStack testing instructions
Implements Lambda handlers invoked by AWS Step Functions to orchestrate
benchmark runs:

- initialize: Creates run record in DynamoDB, initializes task records
  for all tasks to be processed, returns run_id and task_ids

- handle_error: Handles task failures from Batch jobs, manages retry
  logic (up to MAX_RETRIES), marks tasks as FAILED after exhausting
  retries

- aggregate: Queries all task records, calculates metrics (accuracy,
  cost, completion rate), stores aggregated results in S3

- complete: Marks run as COMPLETED/COMPLETED_WITH_ERRORS/FAILED based
  on task outcomes, publishes final metrics to CloudWatch

Also includes:
- Comprehensive test suite using moto (8 tests)
- README with deployment instructions and state machine flow diagram
- Support for LocalStack testing via AWS_ENDPOINT_URL
@ericc59 ericc59 changed the title Add CI workflow for Step Functions benchmark triggers (PR 4/4) [4/4] Add CI workflow for Step Functions benchmark triggers Jan 29, 2026
…anges

- Add benchmark.yml workflow with automatic (push to main) and manual triggers
- Add detect_config_changes.py script for robust YAML-based config detection
- Use github.event.before/sha for multi-commit push range coverage
- Strict YAML parsing with fail-fast on errors (--lenient escape hatch)
- Handle null SHA for first push to repo/branch
- Collision-resistant execution naming: bm-{run_id}-{attempt}-{config+hash}
- Add 35 tests for config detection logic
- Document setup, secrets, OIDC, and naming scheme in README
…guards

- Parse models.yml list structure (models: [{name: ...}, ...])
- Use exact 40-zero SHA match for null detection (not prefix)
- Add set -euo pipefail and fail on empty task list in workflow
- Update tests for list format and null SHA handling
@ericc59 ericc59 force-pushed the aws-integration-pr4-ci branch from c20e949 to e9a65e9 Compare January 29, 2026 17:58
When models.yml changes on push to main, now runs benchmarks
against both evaluation and private task datasets using a matrix.

- Add data_source matrix: [evaluation, private]
- Use matrix.data_source for S3 task path and Step Functions input
- Include data source abbreviation in execution name (ev/pr) to avoid conflicts
- Show data source in GitHub step summary
When a worker dies mid-task, the task stays IN_PROGRESS forever.
This adds stale task detection to prevent task lockout:

- get_pending_tasks() now returns IN_PROGRESS tasks that haven't
  been updated within stale_timeout_seconds (default 15 minutes)
- claim_task() allows reclaiming stale IN_PROGRESS tasks
- Timeout configurable, set to 0 to disable
@ericc59 ericc59 closed this Jan 30, 2026
@ericc59 ericc59 deleted the aws-integration-pr4-ci branch January 30, 2026 16:49
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.

1 participant