Skip to content

Commit aad73a5

Browse files
fix: Simplify Docker configuration for CLI tool usage
- Remove unnecessary port exposure and health checks from Dockerfile - Simplify docker-compose.yml for CLI tool (remove Redis, ports, health checks) - Update DOCKER.md with CLI-focused usage examples - Fix README.md Docker example to show proper CLI usage - Add more API key environment variables (Cohere, Mistral, Google) Co-authored-by: openhands <[email protected]>
1 parent a8860ff commit aad73a5

File tree

4 files changed

+40
-56
lines changed

4 files changed

+40
-56
lines changed

DOCKER.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,44 @@ This guide explains how to build, run, and deploy the Haerae Evaluation Toolkit
2020
### 2. Run the Container
2121

2222
```bash
23-
# Basic run
23+
# Basic run (shows help)
2424
docker run -it --rm haerae-evaluation-toolkit:latest
2525

26-
# Run with environment variables
26+
# Run with environment variables and volume mounts
2727
docker run -it --rm \
2828
-e OPENAI_API_KEY=your_key_here \
2929
-e WANDB_API_KEY=your_wandb_key \
30+
-v $(pwd)/data:/app/data \
31+
-v $(pwd)/configs:/app/configs \
32+
-v $(pwd)/results:/app/results \
3033
haerae-evaluation-toolkit:latest
3134

32-
# Run with volume mounts
35+
# Run specific evaluation
3336
docker run -it --rm \
37+
-e OPENAI_API_KEY=your_key_here \
3438
-v $(pwd)/data:/app/data \
3539
-v $(pwd)/configs:/app/configs \
36-
-p 8000:8000 \
37-
haerae-evaluation-toolkit:latest
40+
haerae-evaluation-toolkit:latest \
41+
python run_eval.py --config configs/your_config.yaml
42+
43+
# Interactive shell
44+
docker run -it --rm \
45+
-v $(pwd):/workspace \
46+
haerae-evaluation-toolkit:latest \
47+
bash
3848
```
3949

4050
### 3. Using Docker Compose
4151

4252
```bash
43-
# Start all services
44-
docker-compose up -d
53+
# Start container (interactive mode)
54+
docker-compose up
4555

46-
# View logs
47-
docker-compose logs -f
56+
# Run in background and execute commands
57+
docker-compose up -d
58+
docker-compose exec hret python run_eval.py --help
4859

49-
# Stop services
60+
# Stop container
5061
docker-compose down
5162
```
5263

@@ -88,6 +99,9 @@ The container supports the following environment variables:
8899
|----------|-------------|---------|
89100
| `OPENAI_API_KEY` | OpenAI API key | - |
90101
| `ANTHROPIC_API_KEY` | Anthropic API key | - |
102+
| `COHERE_API_KEY` | Cohere API key | - |
103+
| `MISTRAL_API_KEY` | Mistral API key | - |
104+
| `GOOGLE_API_KEY` | Google API key | - |
91105
| `WANDB_API_KEY` | Weights & Biases API key | - |
92106
| `HRET_HOME` | Application home directory | `/app` |
93107
| `PYTHONPATH` | Python path | `/app` |
@@ -96,20 +110,18 @@ The container supports the following environment variables:
96110

97111
Recommended volume mounts:
98112

99-
- `/app/data` - For datasets and evaluation results
113+
- `/app/data` - For datasets and input data
100114
- `/app/logs` - For application logs
101115
- `/app/configs` - For configuration files
102-
103-
## Ports
104-
105-
- `8000` - FastAPI web server (if running web interface)
116+
- `/app/results` - For evaluation results and outputs
106117

107118
## Docker Compose Configuration
108119

109120
The `docker-compose.yml` includes:
110121

111-
- **hret**: Main application container
112-
- **redis**: Optional Redis cache (commented out by default)
122+
- **hret**: Main application container with interactive mode
123+
- **Volume Mounts**: For persistent data and configuration
124+
- **Environment Variables**: For API keys and configuration
113125

114126
### Environment File
115127

Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,5 @@ RUN mkdir -p /app/data /app/logs /app/configs && \
6464
# Switch to non-root user
6565
USER hret
6666

67-
# Expose port for FastAPI
68-
EXPOSE 8000
69-
70-
# Health check
71-
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
72-
CMD curl -f http://localhost:8000/health || exit 1
73-
7467
# Default command - can be overridden
7568
CMD ["python", "run_eval.py", "--help"]

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ cd haerae-evaluation-toolkit
8585
docker run -it --rm \
8686
-e OPENAI_API_KEY=your_key_here \
8787
-v $(pwd)/data:/app/data \
88-
haerae-evaluation-toolkit:latest
88+
-v $(pwd)/configs:/app/configs \
89+
haerae-evaluation-toolkit:latest \
90+
python run_eval.py --help
8991
```
9092

9193
For detailed Docker usage, see [DOCKER.md](DOCKER.md).

docker-compose.yml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,21 @@ services:
77
dockerfile: Dockerfile
88
image: haerae-evaluation-toolkit:latest
99
container_name: hret-container
10-
ports:
11-
- "8000:8000"
1210
environment:
1311
- PYTHONPATH=/app
1412
- HRET_HOME=/app
1513
- WANDB_API_KEY=${WANDB_API_KEY:-}
1614
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
1715
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
16+
- COHERE_API_KEY=${COHERE_API_KEY:-}
17+
- MISTRAL_API_KEY=${MISTRAL_API_KEY:-}
18+
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
1819
volumes:
1920
- ./data:/app/data
2021
- ./logs:/app/logs
2122
- ./configs:/app/configs
22-
networks:
23-
- hret-network
24-
restart: unless-stopped
25-
healthcheck:
26-
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
27-
interval: 30s
28-
timeout: 10s
29-
retries: 3
30-
start_period: 40s
31-
32-
# Optional: Redis for caching (if needed)
33-
redis:
34-
image: redis:7-alpine
35-
container_name: hret-redis
36-
ports:
37-
- "6379:6379"
38-
networks:
39-
- hret-network
40-
restart: unless-stopped
41-
command: redis-server --appendonly yes
42-
volumes:
43-
- redis-data:/data
44-
45-
networks:
46-
hret-network:
47-
driver: bridge
48-
49-
volumes:
50-
redis-data:
23+
- ./results:/app/results
24+
working_dir: /app
25+
# Keep container running for interactive use
26+
tty: true
27+
stdin_open: true

0 commit comments

Comments
 (0)