Phase Plan: - 05-PLAN.md: Combined execution plan for efficiency - 05-RESEARCH.md: Domain research on volumes and MinIO Test Scripts (4): - 01-volumes-test.sh: Volume persistence verification - 02-minio-test.sh: MinIO S3 API testing - 03-persistence-test.sh: Database persistence verification - 99-final-verification.sh: End-to-end verification Documentation (6 files): Tutorial: Docker volumes, MinIO S3 How-to: Manage volumes Reference: Volume syntax Explanation: Storage↔S3 parallels Infrastructure: - docker-compose.yml: MinIO S3 + PostgreSQL + test container - Named volumes: minio-data, db-data, test-data (INF-04 compliant) Key concepts: - Named volumes = EBS volumes - MinIO = S3 bucket (100% API compatible) - Data persistence across container lifecycle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
1.0 KiB
Bash
Executable File
30 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Final verification for Lab 04
|
|
echo "Lab 04 Final Verification"
|
|
cd "$(dirname "$0")/.."
|
|
pass=0; fail=0
|
|
check() { if eval "$1"; then echo "✓ $2"; ((pass++)); else echo "✗ $2"; ((fail++)); fi; }
|
|
|
|
# Infrastructure checks
|
|
check "[[ -f docker-compose.yml ]]" "docker-compose.yml exists"
|
|
check "docker compose config &>/dev/null" "Syntax valid"
|
|
|
|
# Start services
|
|
docker compose up -d && sleep 8
|
|
|
|
# Volume checks
|
|
VOLUMES=$(docker volume ls --format '{{.Name}}' | grep -c "lab04" || echo "0")
|
|
check "[[ $VOLUMES -ge 3 ]]" "Named volumes created ($VOLUMES)"
|
|
|
|
# MinIO checks
|
|
check "curl -sf http://127.0.0.1:9000/minio/health/live" "MinIO API accessible"
|
|
check "curl -sf http://127.0.0.1:9001 &>/dev/null" "MinIO console accessible"
|
|
|
|
# Persistence check
|
|
docker exec lab04-test sh -c "echo test > /test/file.txt"
|
|
docker compose restart test && sleep 3
|
|
check "docker exec lab04-test cat /test/file.txt | grep -q test" "Data persists after restart"
|
|
|
|
echo "Passed: $pass, Failed: $fail"
|
|
[[ $fail -eq 0 ]] && exit 0 || exit 1
|