Skip to content

Commit 8f406ce

Browse files
author
DeanLuus22021994
committed
docs(devcontainer): add comprehensive volume, health check, and GPU documentation
MEDIUM PRIORITY openai#6, openai#7, openai#8: COMPLETED Volume Documentation: - Added cleanup column to volume table - Documented each volume's purpose and safety - Added volume management commands (view sizes, clean caches) - Marked dangerous operations (database volumes) - Provided docker-compose down -v cleanup instructions Health Check Documentation: - Added comprehensive health check table (interval, timeout, retries, start period) - Documented health check commands (ps, inspect, logs) - Provided tuning guidance for slower systems - Explained why app-dev has no health check (uses sleep infinity) GPU Support Documentation: - Comprehensive requirements section (hardware, drivers, Docker Desktop) - Configuration examples from docker-compose.yml - Verification commands (nvidia-smi, torch.cuda) - Troubleshooting guide: * WSL2 GPU support setup * Docker Desktop settings * Graceful CPU fallback * How to disable GPU reservation - Usage notes (optional, graceful degradation, performance benefits) All MEDIUM priority documentation items now complete!
1 parent c8289b2 commit 8f406ce

File tree

1 file changed

+195
-9
lines changed

1 file changed

+195
-9
lines changed

.devcontainer/README.md

Lines changed: 195 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,68 @@ Press `Ctrl+Shift+P` → `Tasks: Run Task` to use these.
7777

7878
### Volumes
7979

80-
| Volume | Purpose | Mount Point |
81-
|--------|---------|-------------|
82-
| `vscode-extensions` | VS Code extensions persistence | `/home/vscode/.vscode-server` |
83-
| `python-cache` | Python package cache | `/opt/python-cache` |
84-
| `pytest-cache` | Pytest cache | `/opt/pytest-cache` |
85-
| `mypy-cache` | Type checking cache | `/opt/mypy-cache` |
86-
| `ruff-cache` | Ruff linter cache | `/opt/ruff-cache` |
87-
| `postgres-data` | PostgreSQL data persistence | `/var/lib/postgresql/data` |
88-
| `redis-data` | Redis data persistence | `/data` |
80+
| Volume | Purpose | Mount Point | Cleanup |
81+
|--------|---------|-------------|---------|
82+
| `vscode-extensions` | VS Code extensions persistence | `/home/vscode/.vscode-server` | Safe to delete if corrupted |
83+
| `python-cache` | Python package cache (pip/uv) | `/opt/python-cache` | Improves dependency install speed |
84+
| `pytest-cache` | Pytest test result cache | `/opt/pytest-cache` | Speeds up test execution |
85+
| `mypy-cache` | Type checking cache | `/opt/mypy-cache` | Reduces mypy analysis time |
86+
| `ruff-cache` | Ruff linter/formatter cache | `/opt/ruff-cache` | Speeds up linting/formatting |
87+
| `postgres-data` | PostgreSQL database persistence | `/var/lib/postgresql/data` | ⚠️ Contains all database data |
88+
| `redis-data` | Redis persistence (RDB/AOF) | `/data` | ⚠️ Contains state/pub-sub data |
89+
90+
**Volume Management**:
91+
92+
```bash
93+
# View volume sizes
94+
docker system df -v
95+
96+
# Clean development caches (safe - will rebuild)
97+
docker volume rm openai-agents-python_python-cache
98+
docker volume rm openai-agents-python_pytest-cache
99+
docker volume rm openai-agents-python_mypy-cache
100+
docker volume rm openai-agents-python_ruff-cache
101+
102+
# ⚠️ DANGER: Remove database volumes (deletes all data!)
103+
docker volume rm openai-agents-python_postgres-data
104+
docker volume rm openai-agents-python_redis-data
105+
106+
# Clean all volumes (requires recreating containers)
107+
docker-compose down -v
108+
```
109+
110+
### Health Checks
111+
112+
Services are configured with health checks optimized for development:
113+
114+
| Service | Interval | Timeout | Retries | Start Period | Notes |
115+
|---------|----------|---------|---------|--------------|-------|
116+
| **redis** | 5s | 3s | 5 | 10s | Fast startup, reliable |
117+
| **postgres** | 5s | 3s | 5 | 10s | Database initialization time |
118+
| **app-dev** | None | - | - | - | Uses `sleep infinity` in dev |
119+
120+
**Health Check Commands**:
121+
122+
```bash
123+
# Check all service health
124+
docker-compose ps
125+
126+
# View specific service health
127+
docker inspect openai-agents-redis --format='{{.State.Health.Status}}'
128+
129+
# View health check logs
130+
docker inspect openai-agents-postgres --format='{{range .State.Health.Log}}{{.Output}}{{end}}'
131+
```
132+
133+
**Tuning for Development**:
134+
The default 5s intervals are suitable for development. For slower systems, increase in `docker-compose.yml`:
135+
136+
```yaml
137+
healthcheck:
138+
interval: 10s # Reduce overhead on slower systems
139+
timeout: 5s
140+
retries: 3
141+
```
89142
90143
## Docker Debug Integration
91144
@@ -427,6 +480,139 @@ if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path
427480

428481
Check if shell integration is active:
429482

483+
```powershell
484+
# Check environment variable (PowerShell 7+ only)
485+
if ($env:VSCODE_SHELL_INTEGRATION) {
486+
Write-Host "Shell integration is active!" -ForegroundColor Green
487+
}
488+
```
489+
490+
## GPU Support
491+
492+
NVIDIA GPU support is **optionally configured** for both development and production containers.
493+
494+
### Requirements
495+
496+
- **Hardware**: NVIDIA GPU (GTX/RTX series or Tesla)
497+
- **Windows**: NVIDIA drivers + WSL2 with GPU support
498+
- **Linux**: NVIDIA drivers + NVIDIA Container Toolkit
499+
- **Docker Desktop**: Latest version with GPU support enabled
500+
501+
### Configuration
502+
503+
GPU reservation is defined in `docker-compose.yml`:
504+
505+
```yaml
506+
deploy:
507+
resources:
508+
reservations:
509+
devices:
510+
- driver: nvidia
511+
capabilities: [gpu]
512+
count: all # Use all available GPUs
513+
```
514+
515+
### Verification
516+
517+
**Check GPU availability**:
518+
519+
```bash
520+
# From host (Windows with NVIDIA GPU)
521+
nvidia-smi
522+
523+
# Inside DevContainer
524+
docker-compose exec app-dev nvidia-smi
525+
526+
# Or use Python
527+
docker-compose exec app-dev python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}, Devices: {torch.cuda.device_count()}')"
528+
```
529+
530+
### Troubleshooting
531+
532+
**GPU not detected?**
533+
534+
1. **Windows WSL2**: Ensure NVIDIA drivers are updated and WSL2 has GPU support
535+
```powershell
536+
wsl --update
537+
nvidia-smi # Should work in WSL2
538+
```
539+
540+
2. **Docker Desktop**: Enable GPU support in Settings → Resources → WSL Integration
541+
542+
3. **No GPU available**: Application will gracefully fall back to CPU
543+
- OpenAI Agents SDK works fine without GPU
544+
- GPU primarily benefits local model inference (if used)
545+
546+
4. **Disable GPU reservation**: Comment out the `deploy.resources.reservations` section in `docker-compose.yml`:
547+
```yaml
548+
# deploy:
549+
# resources:
550+
# reservations:
551+
# devices:
552+
# - driver: nvidia
553+
# capabilities: [gpu]
554+
# count: all
555+
```
556+
557+
### GPU Usage Notes
558+
559+
- **Optional**: GPU support is not required for the OpenAI Agents SDK
560+
- **Graceful Degradation**: Application automatically uses CPU if GPU unavailable
561+
- **Performance**: Benefits local model inference and training (if implemented)
562+
- **Resource Limits**: Production container has memory/CPU limits; adjust as needed
563+
564+
---
565+
566+
## Terminal Shell Integration
567+
568+
VS Code terminal shell integration provides enhanced terminal features including command navigation, decorations, IntelliSense, and debugging capabilities.
569+
570+
### Features
571+
572+
- **Command Navigation**: Navigate commands with Ctrl/Cmd+Up/Down
573+
- **Command Decorations**: Visual success/failure indicators with exit codes
574+
- **Quick Fixes**: Automatic suggestions for common errors (git, ports, etc.)
575+
- **IntelliSense**: Context-aware completions for files, commands, and arguments
576+
- **Run Recent Command**: Quick access to history (Ctrl+Alt+R)
577+
- **Go to Recent Directory**: Quick cd navigation (Ctrl+G)
578+
- **Sticky Scroll**: Shows current command at viewport top
579+
- **Enhanced Accessibility**: Command navigation in accessible buffer, audio cues
580+
581+
### Configuration Status
582+
583+
Shell integration is **enabled** via `.vscode/settings.json`:
584+
585+
```json
586+
{
587+
"terminal.integrated.shellIntegration.enabled": true,
588+
"terminal.integrated.enablePersistentSessions": true
589+
}
590+
```
591+
592+
### Supported Shells
593+
594+
- **PowerShell 7+** (pwsh): Full support with Rich quality
595+
- **Windows PowerShell 5.1**: Not supported (automatic injection disabled)
596+
- **Bash/Zsh** (Linux): Full support with Rich quality
597+
598+
### Setup for PowerShell 7+
599+
600+
If using PowerShell 7+ (recommended), run the automated setup:
601+
602+
```powershell
603+
.\scripts\setup-shell-integration.ps1
604+
```
605+
606+
Or manually add to your PowerShell profile (`code $Profile`):
607+
608+
```powershell
609+
if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }
610+
```
611+
612+
### Verify Integration
613+
614+
Check if shell integration is active:
615+
430616
```powershell
431617
# Check environment variable (PowerShell 7+ only)
432618
if ($env:VSCODE_SHELL_INTEGRATION) {

0 commit comments

Comments
 (0)