Update CI workflows to utilize self-hosted runners with specific labels for API Docs, API Gateway, Service Adapters, Frontend, and Integration Tests; enhance progress documentation to reflect changes in runner configurations
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 33s
Docker Build and Push / security-scan (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 35s
Integration Tests / performance-tests (push) Has been skipped
Docker Build and Push / deploy-staging (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
API Docs (Node.js Express) / test (16) (push) Failing after 2m42s
API Docs (Node.js Express) / test (20) (push) Failing after 6s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Failing after 5s
Frontend (React) / test (16) (push) Failing after 7s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 7s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
Frontend (React) / test (18) (push) Failing after 6s
Frontend (React) / build (push) Has been skipped
Frontend (React) / security (push) Has been skipped
Frontend (React) / lighthouse (push) Has been skipped
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 52s
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
API Docs (Node.js Express) / test (18) (push) Failing after 6s
LabFusion CI/CD Pipeline / frontend (push) Failing after 5s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 3m10s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 5s
Frontend (React) / test (20) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 5s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 6s
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 33s
Docker Build and Push / security-scan (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 35s
Integration Tests / performance-tests (push) Has been skipped
Docker Build and Push / deploy-staging (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
API Docs (Node.js Express) / test (16) (push) Failing after 2m42s
API Docs (Node.js Express) / test (20) (push) Failing after 6s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Failing after 5s
Frontend (React) / test (16) (push) Failing after 7s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 7s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
Frontend (React) / test (18) (push) Failing after 6s
Frontend (React) / build (push) Has been skipped
Frontend (React) / security (push) Has been skipped
Frontend (React) / lighthouse (push) Has been skipped
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 52s
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
API Docs (Node.js Express) / test (18) (push) Failing after 6s
LabFusion CI/CD Pipeline / frontend (push) Failing after 5s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 3m10s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 5s
Frontend (React) / test (20) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 5s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 6s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 6s
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
This commit is contained in:
209
scripts/manage-runners.sh
Normal file
209
scripts/manage-runners.sh
Normal file
@@ -0,0 +1,209 @@
|
||||
#!/bin/bash
|
||||
|
||||
# LabFusion Gitea Runners Management Script
|
||||
# Usage: ./scripts/manage-runners.sh [start|stop|restart|status|logs|clean]
|
||||
|
||||
set -e
|
||||
|
||||
COMPOSE_FILE="docker-compose.runners.yml"
|
||||
ENV_FILE=".env.runners"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Helper functions
|
||||
log_info() {
|
||||
echo -e "${BLUE}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
# Check if .env.runners exists
|
||||
check_env_file() {
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
log_error "Environment file $ENV_FILE not found!"
|
||||
log_info "Please copy env.runners.example to $ENV_FILE and configure it:"
|
||||
log_info " cp env.runners.example $ENV_FILE"
|
||||
log_info " # Edit $ENV_FILE with your Gitea instance URL and runner token"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Start runners
|
||||
start_runners() {
|
||||
log_info "Starting LabFusion Gitea runners..."
|
||||
check_env_file
|
||||
|
||||
docker-compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d
|
||||
|
||||
log_success "Runners started successfully!"
|
||||
log_info "Runners:"
|
||||
log_info " - Heavy (Java/Python): labfusion-runner-heavy"
|
||||
log_info " - Light (Node.js/Frontend): labfusion-runner-light"
|
||||
log_info " - Docker (Integration): labfusion-runner-docker"
|
||||
log_info " - Security (Scans): labfusion-runner-security"
|
||||
|
||||
# Wait a moment for health checks
|
||||
sleep 5
|
||||
show_status
|
||||
}
|
||||
|
||||
# Stop runners
|
||||
stop_runners() {
|
||||
log_info "Stopping LabFusion Gitea runners..."
|
||||
|
||||
docker-compose -f "$COMPOSE_FILE" down
|
||||
|
||||
log_success "Runners stopped successfully!"
|
||||
}
|
||||
|
||||
# Restart runners
|
||||
restart_runners() {
|
||||
log_info "Restarting LabFusion Gitea runners..."
|
||||
stop_runners
|
||||
sleep 2
|
||||
start_runners
|
||||
}
|
||||
|
||||
# Show runner status
|
||||
show_status() {
|
||||
log_info "LabFusion Gitea Runners Status:"
|
||||
echo
|
||||
|
||||
# Check if compose file exists
|
||||
if [ ! -f "$COMPOSE_FILE" ]; then
|
||||
log_error "Docker Compose file $COMPOSE_FILE not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Show container status
|
||||
docker-compose -f "$COMPOSE_FILE" ps
|
||||
|
||||
echo
|
||||
log_info "Runner Health Status:"
|
||||
|
||||
# Check each runner's health
|
||||
for runner in labfusion-runner-heavy labfusion-runner-light labfusion-runner-docker labfusion-runner-security; do
|
||||
if docker ps --format "table {{.Names}}\t{{.Status}}" | grep -q "$runner"; then
|
||||
status=$(docker inspect --format='{{.State.Health.Status}}' "$runner" 2>/dev/null || echo "unknown")
|
||||
case $status in
|
||||
"healthy")
|
||||
log_success "$runner: $status"
|
||||
;;
|
||||
"unhealthy")
|
||||
log_error "$runner: $status"
|
||||
;;
|
||||
"starting")
|
||||
log_warning "$runner: $status"
|
||||
;;
|
||||
*)
|
||||
log_warning "$runner: $status"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
log_error "$runner: not running"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Show logs
|
||||
show_logs() {
|
||||
local runner=${2:-""}
|
||||
|
||||
if [ -n "$runner" ]; then
|
||||
log_info "Showing logs for $runner..."
|
||||
docker-compose -f "$COMPOSE_FILE" logs -f "$runner"
|
||||
else
|
||||
log_info "Showing logs for all runners..."
|
||||
docker-compose -f "$COMPOSE_FILE" logs -f
|
||||
fi
|
||||
}
|
||||
|
||||
# Clean up runners and data
|
||||
clean_runners() {
|
||||
log_warning "This will remove all runners and their data. Are you sure? (y/N)"
|
||||
read -r response
|
||||
|
||||
if [[ "$response" =~ ^[Yy]$ ]]; then
|
||||
log_info "Cleaning up runners and data..."
|
||||
|
||||
# Stop and remove containers
|
||||
docker-compose -f "$COMPOSE_FILE" down -v
|
||||
|
||||
# Remove volumes
|
||||
docker volume rm $(docker volume ls -q | grep runner-data) 2>/dev/null || true
|
||||
docker volume rm shared-cache 2>/dev/null || true
|
||||
|
||||
log_success "Cleanup completed!"
|
||||
else
|
||||
log_info "Cleanup cancelled."
|
||||
fi
|
||||
}
|
||||
|
||||
# Show help
|
||||
show_help() {
|
||||
echo "LabFusion Gitea Runners Management Script"
|
||||
echo
|
||||
echo "Usage: $0 [COMMAND]"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " start Start all runners"
|
||||
echo " stop Stop all runners"
|
||||
echo " restart Restart all runners"
|
||||
echo " status Show runner status and health"
|
||||
echo " logs Show logs for all runners"
|
||||
echo " logs [runner] Show logs for specific runner"
|
||||
echo " clean Remove all runners and data (destructive)"
|
||||
echo " help Show this help message"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " $0 start"
|
||||
echo " $0 status"
|
||||
echo " $0 logs labfusion-runner-heavy"
|
||||
echo " $0 clean"
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
case "${1:-help}" in
|
||||
start)
|
||||
start_runners
|
||||
;;
|
||||
stop)
|
||||
stop_runners
|
||||
;;
|
||||
restart)
|
||||
restart_runners
|
||||
;;
|
||||
status)
|
||||
show_status
|
||||
;;
|
||||
logs)
|
||||
show_logs "$@"
|
||||
;;
|
||||
clean)
|
||||
clean_runners
|
||||
;;
|
||||
help|--help|-h)
|
||||
show_help
|
||||
;;
|
||||
*)
|
||||
log_error "Unknown command: $1"
|
||||
echo
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user