Configure Docker registry integration for CHORUS Services

Registry Configuration:
- Updated docker-compose.yml to use registry.home.deepblack.cloud images
- Created build-and-push.sh script for automated image building/pushing
- Enhanced chorus.sh with registry operations (login, build, pull)
- Added docker-compose.dev.yml for development with local builds
- Added docker-compose.swarm.yml for production deployment

Production Features:
- Docker Swarm deployment with Traefik integration
- All services available at *.home.deepblack.cloud domains
- Production-grade resource limits and placement constraints
- SSL/TLS certificates via Let's Encrypt
- Load balancing and high availability

Development Features:
- ./chorus.sh dev - Local builds with live reloading
- ./chorus.sh build - Build and push to registry
- ./chorus.sh deploy - Production swarm deployment
- Registry authentication with credentials

Images stored at:
- registry.home.deepblack.cloud/tony/chorus-whoosh-backend:latest
- registry.home.deepblack.cloud/tony/chorus-whoosh-frontend:latest
- registry.home.deepblack.cloud/tony/chorus-bzzz-coordinator:latest
- registry.home.deepblack.cloud/tony/chorus-slurp-api:latest
- registry.home.deepblack.cloud/tony/chorus-slurp-rl-tuner:latest

Ready for both development and production deployment.
This commit is contained in:
tony
2025-08-01 09:23:26 +10:00
parent 2090a94f58
commit ecca86b0fe
6 changed files with 619 additions and 33 deletions

107
chorus.sh
View File

@@ -45,11 +45,16 @@ show_usage() {
echo " status Show status of all services"
echo " logs Show logs from all services"
echo " logs [service] Show logs from specific service"
echo " build Build all docker images"
echo " build Build and push all docker images to registry"
echo " pull Pull latest images from registry"
echo " update Update all submodules to latest"
echo " init Initialize submodules (first time setup)"
echo " clean Clean up docker resources"
echo " health Check health of all services"
echo " login Login to Docker registry"
echo " deploy Deploy to Docker Swarm (production)"
echo " undeploy Remove from Docker Swarm"
echo " dev Start in development mode with local builds"
echo ""
echo "Services:"
echo " - whoosh-backend : Orchestration API (port 8087)"
@@ -78,27 +83,24 @@ update_submodules() {
print_success "Submodules updated"
}
# Build all docker images
# Build and push all docker images
build_images() {
print_info "Building CHORUS Services docker images..."
# Build each service
print_info "Building WHOOSH backend..."
docker-compose build whoosh-backend
print_info "Building WHOOSH frontend..."
docker-compose build whoosh-frontend
print_info "Building BZZZ coordinator..."
docker-compose build bzzz-coordinator
print_info "Building SLURP API..."
docker-compose build slurp-api
print_info "Building SLURP RL Tuner..."
docker-compose build slurp-rl-tuner
print_success "All images built successfully"
print_info "Building and pushing CHORUS Services docker images to registry..."
./build-and-push.sh
print_success "All images built and pushed successfully"
}
# Pull latest images from registry
pull_images() {
print_info "Pulling latest CHORUS Services images from registry..."
docker-compose pull
print_success "All images pulled successfully"
}
# Login to Docker registry
docker_login() {
print_info "Logging into Docker registry..."
./build-and-push.sh login
}
# Start all services
@@ -120,6 +122,54 @@ start_services() {
echo " - Prometheus: http://localhost:9092"
}
# Start in development mode
start_dev() {
print_info "Starting CHORUS Services in development mode..."
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
print_info "Waiting for services to start..."
sleep 15
print_success "CHORUS Services started in development mode"
print_info "Development features enabled:"
echo " - Live code reloading"
echo " - Debug logging enabled"
echo " - Local builds (no registry required)"
}
# Deploy to Docker Swarm
deploy_swarm() {
print_info "Deploying CHORUS Services to Docker Swarm..."
# Check if we're in a swarm
if ! docker info --format '{{.Swarm.LocalNodeState}}' | grep -q active; then
print_error "Docker Swarm is not active. Please initialize or join a swarm first."
return 1
fi
docker stack deploy -c docker-compose.swarm.yml chorus
print_info "Waiting for stack to deploy..."
sleep 20
print_success "CHORUS Services deployed to swarm"
print_info "Production access points:"
echo " - WHOOSH Dashboard: https://chorus.home.deepblack.cloud"
echo " - WHOOSH API: https://chorus-api.home.deepblack.cloud"
echo " - BZZZ Coordinator: https://chorus-bzzz.home.deepblack.cloud"
echo " - SLURP API: https://chorus-slurp.home.deepblack.cloud"
echo " - COOEE RL Tuner: https://chorus-cooee.home.deepblack.cloud"
echo " - Grafana: https://chorus-grafana.home.deepblack.cloud"
echo " - Prometheus: https://chorus-prometheus.home.deepblack.cloud"
}
# Remove from Docker Swarm
undeploy_swarm() {
print_info "Removing CHORUS Services from Docker Swarm..."
docker stack rm chorus
print_success "CHORUS Services removed from swarm"
}
# Stop all services
stop_services() {
print_info "Stopping CHORUS Services..."
@@ -212,6 +262,9 @@ case "$1" in
build)
build_images
;;
pull)
pull_images
;;
update)
update_submodules
;;
@@ -224,6 +277,18 @@ case "$1" in
health)
check_health
;;
login)
docker_login
;;
deploy)
deploy_swarm
;;
undeploy)
undeploy_swarm
;;
dev)
start_dev
;;
*)
show_usage
exit 1