Organize docker-compose files and fix test output paths
- Move docker-compose.prod.yml and docker-compose.homelab-secure.yml to deployments/ - Create deployments/README.md with usage instructions - Update test scripts to use new deployment paths - Fix performance regression detection to output to tests/bin/ - All test outputs now properly organized in tests/bin/
This commit is contained in:
parent
b90cb610c1
commit
03cead6319
7 changed files with 58 additions and 53 deletions
23
Makefile
23
Makefile
|
|
@ -224,19 +224,19 @@ load-test:
|
|||
# CPU profiling for HTTP LoadTestSuite (MediumLoad only for speed)
|
||||
profile-load:
|
||||
@echo "CPU profiling MediumLoad HTTP load test..."
|
||||
go test ./tests/load -run TestLoadProfile_Medium -count=1 -cpuprofile cpu_load.out
|
||||
@echo "✓ CPU profile written to cpu_load.out (inspect with: go tool pprof cpu_load.out)"
|
||||
go test ./tests/load -run TestLoadProfile_Medium -count=1 -cpuprofile tests/bin/cpu_load.out
|
||||
@echo "✓ CPU profile written to cpu_load.out (inspect with: go tool pprof tests/bin/cpu_load.out)"
|
||||
|
||||
profile-load-norate:
|
||||
@echo "CPU profiling MediumLoad HTTP load test (no rate limiting)..."
|
||||
go test ./tests/load -run TestLoadProfile_Medium -count=1 -cpuprofile cpu_load.out -v -args -profile-norate
|
||||
@echo "✓ CPU profile written to cpu_load.out (inspect with: go tool pprof cpu_load.out)"
|
||||
go test ./tests/load -run TestLoadProfile_Medium -count=1 -cpuprofile tests/bin/cpu_load.out -v -args -profile-norate
|
||||
@echo "✓ CPU profile written to cpu_load.out (inspect with: go tool pprof tests/bin/cpu_load.out)"
|
||||
|
||||
# CPU profiling for WebSocket → Redis queue → worker path
|
||||
profile-ws-queue:
|
||||
@echo "CPU profiling WebSocket queue integration test..."
|
||||
go test ./tests/integration -run WebSocketQueue -count=5 -cpuprofile cpu_ws.out
|
||||
@echo "✓ CPU profile written to cpu_ws.out (inspect with: go tool pprof cpu_ws.out)"
|
||||
go test ./tests/integration -run WebSocketQueue -count=5 -cpuprofile tests/bin/cpu_ws.out
|
||||
@echo "✓ CPU profile written to cpu_ws.out (inspect with: go tool pprof tests/bin/cpu_ws.out)"
|
||||
|
||||
# Chaos engineering tests
|
||||
chaos-test:
|
||||
|
|
@ -252,14 +252,13 @@ profile-tools:
|
|||
# Performance regression detection
|
||||
detect-regressions:
|
||||
@echo "Detecting performance regressions..."
|
||||
@if [ ! -f "baseline.json" ]; then \
|
||||
@if [ ! -f "tests/bin/baseline.json" ]; then \
|
||||
echo "Creating baseline performance metrics..."; \
|
||||
go test -bench=. -benchmem ./tests/benchmarks/... | tee baseline.json; \
|
||||
else \
|
||||
echo "Analyzing current performance against baseline..."; \
|
||||
go test -bench=. -benchmem ./tests/benchmarks/... | tee current.json; \
|
||||
echo "Use tools/performance_regression_detector to analyze results"; \
|
||||
go test -bench=. -benchmem ./tests/benchmarks/... | tee tests/bin/baseline.json; \
|
||||
fi
|
||||
@echo "Analyzing current performance against baseline..."
|
||||
go test -bench=. -benchmem ./tests/benchmarks/... | tee tests/bin/current.json; \
|
||||
echo "Use tools/performance_regression_detector to analyze results"; \
|
||||
|
||||
# Technical excellence suite (runs all performance tests)
|
||||
tech-excellence: benchmark load-test chaos-test profile-tools
|
||||
|
|
|
|||
34
deployments/README.md
Normal file
34
deployments/README.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Docker Compose Deployments
|
||||
|
||||
This directory contains Docker Compose configurations for different deployment environments.
|
||||
|
||||
## Files
|
||||
|
||||
- `docker-compose.homelab-secure.yml` - Secure homelab deployment with TLS and authentication
|
||||
- `docker-compose.prod.yml` - Production deployment configuration
|
||||
|
||||
## Usage
|
||||
|
||||
### Development
|
||||
```bash
|
||||
# Use the main docker-compose.yml in project root
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Homelab (Secure)
|
||||
```bash
|
||||
docker-compose -f deployments/docker-compose.homelab-secure.yml up -d
|
||||
```
|
||||
|
||||
### Production
|
||||
```bash
|
||||
docker-compose -f deployments/docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Each deployment may require specific environment variables. Refer to the individual compose files for requirements.
|
||||
|
||||
## Monitoring
|
||||
|
||||
Performance monitoring configurations are in `monitoring/docker-compose.performance.yml`
|
||||
|
|
@ -7,7 +7,7 @@ echo "Starting Homelab Secure Production Environment..."
|
|||
|
||||
# Clean up any existing containers
|
||||
echo "Cleaning up existing containers..."
|
||||
docker-compose -f docker-compose.homelab-secure.yml down -v
|
||||
docker-compose -f deployments/docker-compose.homelab-secure.yml down -v
|
||||
|
||||
# Create necessary directories with proper permissions
|
||||
echo "Creating directories..."
|
||||
|
|
@ -16,7 +16,7 @@ chmod 750 data logs
|
|||
|
||||
# Build and start services
|
||||
echo "Building and starting services..."
|
||||
docker-compose -f docker-compose.homelab-secure.yml up --build -d
|
||||
docker-compose -f deployments/docker-compose.homelab-secure.yml up --build -d
|
||||
|
||||
# Wait for services to be healthy
|
||||
echo "Waiting for services to be healthy..."
|
||||
|
|
@ -24,7 +24,7 @@ sleep 20
|
|||
|
||||
# Check service health
|
||||
echo "Checking service health..."
|
||||
docker-compose -f docker-compose.homelab-secure.yml ps
|
||||
docker-compose -f deployments/docker-compose.homelab-secure.yml ps
|
||||
|
||||
# Test API server with TLS
|
||||
echo "Testing API server..."
|
||||
|
|
@ -72,8 +72,9 @@ echo " ./cli/zig-out/bin/ml queue homelab-secure-test"
|
|||
echo " ./cli/zig-out/bin/ml status"
|
||||
echo ""
|
||||
echo "To view logs:"
|
||||
echo " docker-compose -f docker-compose.homelab-secure.yml logs -f api-server"
|
||||
echo " docker-compose -f docker-compose.homelab-secure.yml logs -f worker"
|
||||
echo " docker-compose -f deployments/docker-compose.homelab-secure.yml logs -f api-server"
|
||||
echo " docker-compose -f deployments/docker-compose.homelab-secure.yml logs -f worker"
|
||||
echo " docker-compose -f deployments/docker-compose.homelab-secure.yml down"
|
||||
echo ""
|
||||
echo "To stop:"
|
||||
echo " docker-compose -f docker-compose.homelab-secure.yml down"
|
||||
echo " docker-compose -f deployments/docker-compose.homelab-secure.yml down"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ echo "Starting Full Production Test Environment with Podman and SQLite..."
|
|||
|
||||
# Clean up any existing containers
|
||||
echo "Cleaning up existing containers..."
|
||||
docker-compose -f docker-compose.prod.yml down -v
|
||||
docker-compose -f deployments/docker-compose.prod.yml down -v
|
||||
|
||||
# Create necessary directories
|
||||
echo "Creating directories..."
|
||||
|
|
@ -15,7 +15,7 @@ mkdir -p data logs
|
|||
|
||||
# Build and start services
|
||||
echo "Building and starting services..."
|
||||
docker-compose -f docker-compose.prod.yml up --build -d
|
||||
docker-compose -f deployments/docker-compose.prod.yml up --build -d
|
||||
|
||||
# Wait for services to be healthy
|
||||
echo "Waiting for services to be healthy..."
|
||||
|
|
@ -23,7 +23,7 @@ sleep 15
|
|||
|
||||
# Check service health
|
||||
echo "Checking service health..."
|
||||
docker-compose -f docker-compose.prod.yml ps
|
||||
docker-compose -f deployments/docker-compose.prod.yml ps
|
||||
|
||||
# Test API server
|
||||
echo "Testing API server..."
|
||||
|
|
@ -59,7 +59,8 @@ echo " ./cli/zig-out/bin/ml queue prod-test-job"
|
|||
echo " ./cli/zig-out/bin/ml status"
|
||||
echo ""
|
||||
echo "To view logs:"
|
||||
echo " docker-compose -f docker-compose.prod.yml logs -f worker"
|
||||
echo " docker-compose -f deployments/docker-compose.prod.yml logs -f worker"
|
||||
echo " docker-compose -f deployments/docker-compose.prod.yml down"
|
||||
echo ""
|
||||
echo "To stop:"
|
||||
echo " docker-compose -f docker-compose.prod.yml down"
|
||||
echo " docker-compose -f deployments/docker-compose.prod.yml down"
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
# Test Binaries
|
||||
|
||||
This directory contains compiled test binaries and output files used during development and testing.
|
||||
|
||||
## Files
|
||||
|
||||
- `integration.test` - Compiled Go integration test binary
|
||||
- `load.test` - Compiled Go load test binary
|
||||
- `cpu_ws.out` - WebSocket CPU profiling output
|
||||
- `cpu_load.out` - CPU load test output
|
||||
|
||||
## Usage
|
||||
|
||||
These files are generated during test runs and can be used for:
|
||||
- Running integration tests locally
|
||||
- Performance profiling
|
||||
- Debugging test failures
|
||||
|
||||
## Cleanup
|
||||
|
||||
These files can be safely deleted. They are excluded from git via `.gitignore`.
|
||||
|
||||
To regenerate:
|
||||
```bash
|
||||
# Integration tests
|
||||
go test -c ./tests/integration/ -o tests/binaries/integration.test
|
||||
|
||||
# Load tests
|
||||
go test -c ./tests/load/ -o tests/binaries/load.test
|
||||
```
|
||||
Loading…
Reference in a new issue