[4/4] Add CI workflow for Step Functions benchmark triggers#78
Closed
ericc59 wants to merge 17 commits into
Closed
[4/4] Add CI workflow for Step Functions benchmark triggers#78ericc59 wants to merge 17 commits into
ericc59 wants to merge 17 commits into
Conversation
…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
…ERMANENT handling
…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
c20e949 to
e9a65e9
Compare
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
This reverts commit 0a7c252.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes