Some checks failed
Docker Build and Push / build-and-push (push) Failing after 31s
API Docs (Node.js Express) / test (20) (push) Successful in 3m56s
API Docs (Node.js Express) / test (16) (push) Successful in 4m4s
API Docs (Node.js Express) / test (18) (push) Successful in 4m10s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 1m22s
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m2s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 2m39s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 2m45s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 3m21s
Frontend (React) / test (16) (push) Failing after 1m46s
LabFusion CI/CD Pipeline / frontend (push) Failing after 1m59s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
Frontend (React) / test (18) (push) Failing after 1m50s
Integration Tests / integration-tests (push) Failing after 49s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 1m7s
Frontend (React) / test (20) (push) Failing after 2m30s
Frontend (React) / build (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 1m43s
Frontend (React) / lighthouse (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 1m2s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 1m43s
Service Adapters (Python FastAPI) / build (push) Has been skipped
API Docs (Node.js Express) / build (push) Successful in 59s
- Update all runner configuration files with cache networking fixes: - config_docker.yaml - config_heavy.yaml - config_light.yaml - config_security.yaml - Remove separate config_cache_fixed.yaml file - Update troubleshooting scripts to use updated configs - Update documentation to reference existing config files All runner configs now have: - Fixed cache host: host.docker.internal - Fixed cache port: 44029 - Host networking for better container connectivity This provides a cleaner approach by updating existing configs instead of maintaining a separate fixed configuration file.
180 lines
6.7 KiB
PowerShell
180 lines
6.7 KiB
PowerShell
# Cache Troubleshooting and Fix Script for LabFusion CI/CD
|
|
# This script helps diagnose and fix common cache timeout issues
|
|
|
|
Write-Host "🔧 LabFusion Cache Troubleshooting Script" -ForegroundColor Cyan
|
|
Write-Host "==========================================" -ForegroundColor Cyan
|
|
|
|
# Function to check if running in Docker
|
|
function Test-Docker {
|
|
if (Test-Path "/.dockerenv") {
|
|
Write-Host "🐳 Running inside Docker container" -ForegroundColor Green
|
|
return $true
|
|
} else {
|
|
Write-Host "🖥️ Running on host system" -ForegroundColor Yellow
|
|
return $false
|
|
}
|
|
}
|
|
|
|
# Function to check cache service status
|
|
function Test-CacheService {
|
|
Write-Host "📊 Checking cache service status..." -ForegroundColor Cyan
|
|
|
|
# Check if act_runner process is running
|
|
$processes = Get-Process -Name "act_runner" -ErrorAction SilentlyContinue
|
|
if ($processes) {
|
|
Write-Host "✅ act_runner process found" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "❌ act_runner process not found" -ForegroundColor Red
|
|
return $false
|
|
}
|
|
|
|
# Check cache directory
|
|
$cacheDir = "$env:USERPROFILE\.cache\actcache"
|
|
if (Test-Path $cacheDir) {
|
|
Write-Host "✅ Cache directory exists: $cacheDir" -ForegroundColor Green
|
|
$size = (Get-ChildItem $cacheDir -Recurse | Measure-Object -Property Length -Sum).Sum
|
|
Write-Host " Size: $([math]::Round($size / 1MB, 2)) MB" -ForegroundColor Gray
|
|
} else {
|
|
Write-Host "⚠️ Cache directory not found: $cacheDir" -ForegroundColor Yellow
|
|
Write-Host " Creating cache directory..." -ForegroundColor Yellow
|
|
New-Item -ItemType Directory -Path $cacheDir -Force | Out-Null
|
|
}
|
|
|
|
return $true
|
|
}
|
|
|
|
# Function to test network connectivity
|
|
function Test-NetworkConnectivity {
|
|
Write-Host "🌐 Testing network connectivity..." -ForegroundColor Cyan
|
|
|
|
# Test basic connectivity
|
|
try {
|
|
$ping = Test-Connection -ComputerName "8.8.8.8" -Count 1 -Quiet
|
|
if ($ping) {
|
|
Write-Host "✅ Internet connectivity OK" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "❌ Internet connectivity failed" -ForegroundColor Red
|
|
}
|
|
} catch {
|
|
Write-Host "❌ Internet connectivity test failed: $($_.Exception.Message)" -ForegroundColor Red
|
|
}
|
|
|
|
# Test Docker daemon
|
|
try {
|
|
docker info | Out-Null
|
|
Write-Host "✅ Docker daemon accessible" -ForegroundColor Green
|
|
} catch {
|
|
Write-Host "❌ Docker daemon not accessible" -ForegroundColor Red
|
|
}
|
|
}
|
|
|
|
# Function to fix common cache issues
|
|
function Fix-CacheIssues {
|
|
Write-Host "🔧 Applying cache fixes..." -ForegroundColor Cyan
|
|
|
|
# Create cache directory with proper permissions
|
|
$cacheDir = "$env:USERPROFILE\.cache\actcache"
|
|
New-Item -ItemType Directory -Path $cacheDir -Force | Out-Null
|
|
|
|
# Set proper environment variables
|
|
$env:ACTIONS_CACHE_URL = "http://host.docker.internal:44029/"
|
|
$env:ACTIONS_RUNTIME_URL = "http://host.docker.internal:44029/"
|
|
|
|
Write-Host "✅ Cache directory created and configured" -ForegroundColor Green
|
|
Write-Host "✅ Environment variables set" -ForegroundColor Green
|
|
}
|
|
|
|
# Function to restart cache service
|
|
function Restart-CacheService {
|
|
Write-Host "🔄 Restarting cache service..." -ForegroundColor Cyan
|
|
|
|
# Stop existing runners
|
|
Get-Process -Name "act_runner" -ErrorAction SilentlyContinue | Stop-Process -Force
|
|
Start-Sleep -Seconds 2
|
|
|
|
# Start with updated configuration
|
|
if (Test-Path "config_docker.yaml") {
|
|
Write-Host "✅ Using updated Docker configuration" -ForegroundColor Green
|
|
Start-Process -FilePath ".\act_runner.exe" -ArgumentList "daemon", "--config", "config_docker.yaml" -WindowStyle Hidden
|
|
} elseif (Test-Path "config_heavy.yaml") {
|
|
Write-Host "✅ Using updated heavy configuration" -ForegroundColor Green
|
|
Start-Process -FilePath ".\act_runner.exe" -ArgumentList "daemon", "--config", "config_heavy.yaml" -WindowStyle Hidden
|
|
} else {
|
|
Write-Host "⚠️ Updated configuration not found, using default" -ForegroundColor Yellow
|
|
Start-Process -FilePath ".\act_runner.exe" -ArgumentList "daemon" -WindowStyle Hidden
|
|
}
|
|
|
|
Start-Sleep -Seconds 5
|
|
|
|
$processes = Get-Process -Name "act_runner" -ErrorAction SilentlyContinue
|
|
if ($processes) {
|
|
Write-Host "✅ Cache service restarted successfully" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "❌ Failed to restart cache service" -ForegroundColor Red
|
|
return $false
|
|
}
|
|
|
|
return $true
|
|
}
|
|
|
|
# Function to test cache functionality
|
|
function Test-CacheFunctionality {
|
|
Write-Host "🧪 Testing cache functionality..." -ForegroundColor Cyan
|
|
|
|
# Create a test cache entry
|
|
$testKey = "test-cache-$(Get-Date -Format 'yyyyMMddHHmmss')"
|
|
$testValue = "test-value-$(Get-Date -Format 'yyyyMMddHHmmss')"
|
|
|
|
Write-Host " Creating test cache entry: $testKey" -ForegroundColor Gray
|
|
$testValue | Out-File -FilePath "C:\temp\cache-test.txt" -Force
|
|
|
|
# Try to test cache service (this will fail but we can check the error)
|
|
Write-Host " Testing cache service response..." -ForegroundColor Gray
|
|
try {
|
|
$response = Invoke-WebRequest -Uri "http://host.docker.internal:44029/cache/$testKey" -TimeoutSec 5 -ErrorAction SilentlyContinue
|
|
Write-Host "✅ Cache service responding" -ForegroundColor Green
|
|
} catch {
|
|
Write-Host "❌ Cache service not responding: $($_.Exception.Message)" -ForegroundColor Yellow
|
|
Write-Host " This is expected if no cache entry exists" -ForegroundColor Gray
|
|
}
|
|
|
|
# Clean up
|
|
Remove-Item "C:\temp\cache-test.txt" -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
# Main execution
|
|
function Main {
|
|
Write-Host "Starting cache troubleshooting..." -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
Test-Docker
|
|
Write-Host ""
|
|
|
|
Test-CacheService
|
|
Write-Host ""
|
|
|
|
Test-NetworkConnectivity
|
|
Write-Host ""
|
|
|
|
Fix-CacheIssues
|
|
Write-Host ""
|
|
|
|
Restart-CacheService
|
|
Write-Host ""
|
|
|
|
Test-CacheFunctionality
|
|
Write-Host ""
|
|
|
|
Write-Host "🎉 Cache troubleshooting complete!" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "Next steps:" -ForegroundColor Yellow
|
|
Write-Host "1. Check runner logs in the current directory" -ForegroundColor White
|
|
Write-Host "2. Test a workflow to see if cache issues are resolved" -ForegroundColor White
|
|
Write-Host "3. If issues persist, check Docker networking configuration" -ForegroundColor White
|
|
Write-Host ""
|
|
Write-Host "For more help, see: https://gitea.com/gitea/act_runner/src/branch/main/docs/configuration.md" -ForegroundColor Cyan
|
|
}
|
|
|
|
# Run main function
|
|
Main
|