Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 2.21 KB

File metadata and controls

69 lines (47 loc) · 2.21 KB

Docker Build and Push Instructions

This document provides instructions for building and pushing the Docker image for the AWS Batch job.

Prerequisites

  • Docker Desktop installed and running
  • AWS CLI installed and configured with appropriate credentials
  • Access to the AWS ECR repository

Building and Pushing the Docker Image

  1. Make sure Docker Desktop is running
  2. Open a terminal and navigate to the project root directory
  3. Run the following commands:
# Build the Docker image
docker build -t inspect-evals-scoring:local -f dind.Dockerfile .

# Get your AWS account ID
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
AWS_REGION=$(aws configure get region)

# Create the ECR repository if it doesn't exist
aws ecr create-repository --repository-name inspect-evals-scoring || true

# Log in to ECR
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com

# Tag and push the image
docker tag inspect-evals-scoring:local $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/inspect-evals-scoring:local
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/inspect-evals-scoring:local

Registering the Job Definition

After pushing the Docker image, register the job definition:

# Navigate to the project root directory
cd /Users/matt/Developer/inspect_ai/inspect_evals_scoring

# Register the job definition
.venv/bin/python aws/register_job_definition.py

Running the AWS Batch Job

After registering the job definition, run the AWS Batch job:

# Navigate to the project root directory
cd /Users/matt/Developer/inspect_ai/inspect_evals_scoring

# Run the AWS Batch job
.venv/bin/inspect-evals-scoring aws --model=openai/gpt-4o-mini --limit=2 --tasks=inspect_evals/pubmedqa

Troubleshooting

If you encounter any issues:

  1. Check that Docker Desktop is running
  2. Verify your AWS credentials are correctly configured
  3. Make sure you have the necessary permissions to push to the ECR repository
  4. Check the logs for any error messages

For more detailed information, refer to the AWS Batch documentation: https://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html