fix(deploy): bypass ssh host verification and fix remote health check endpoint
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 7s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Deploy to Production / Build Release Package (push) Failing after 19s
Deploy to Production / Deploy to Production Server (push) Has been skipped
Deploy to Production / Post-Deployment Checks (push) Has been skipped
Snapshot Admin Deployment / build-and-deploy (push) Failing after 35s

This commit is contained in:
2026-06-29 11:37:45 +09:00
parent 84ef22e148
commit c5372ef488
2 changed files with 19 additions and 22 deletions
+13 -13
View File
@@ -110,7 +110,7 @@ jobs:
- name: Create Backup - name: Create Backup
run: | run: |
echo "📦 Creating backup of current deployment..." echo "📦 Creating backup of current deployment..."
ssh -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF'
set -e set -e
BACKUP_DIR="/home/kjh2064/quantengine_backup" BACKUP_DIR="/home/kjh2064/quantengine_backup"
BACKUP_NAME="quantengine_$(date +%Y%m%d_%H%M%S)" BACKUP_NAME="quantengine_$(date +%Y%m%d_%H%M%S)"
@@ -142,11 +142,11 @@ jobs:
ARCHIVE_NAME=$(ls -1 quant-engine-release-*.tar.gz | head -1) ARCHIVE_NAME=$(ls -1 quant-engine-release-*.tar.gz | head -1)
# Create temporary directory on remote # Create temporary directory on remote
ssh -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \
"mkdir -p /tmp/quant-deploy && chmod 777 /tmp/quant-deploy" "mkdir -p /tmp/quant-deploy && chmod 777 /tmp/quant-deploy"
# Transfer archive # Transfer archive
scp -i ~/.ssh/id_ed25519 "$ARCHIVE_NAME" \ scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 "$ARCHIVE_NAME" \
${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}:/tmp/quant-deploy/ ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}:/tmp/quant-deploy/
echo "✅ Package transferred" echo "✅ Package transferred"
@@ -154,7 +154,7 @@ jobs:
- name: Extract and Install - name: Extract and Install
run: | run: |
echo "📦 Extracting and installing..." echo "📦 Extracting and installing..."
ssh -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF'
set -e set -e
DEPLOY_PATH="${{ env.DEPLOY_PATH }}" DEPLOY_PATH="${{ env.DEPLOY_PATH }}"
@@ -182,7 +182,7 @@ jobs:
- name: Restart Service - name: Restart Service
run: | run: |
echo "🔄 Restarting quantengine service to apply changes (Downtime minimal)..." echo "🔄 Restarting quantengine service to apply changes (Downtime minimal)..."
ssh -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF' ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} << 'EOF'
set -e set -e
# Restart service # Restart service
@@ -203,15 +203,15 @@ jobs:
- name: Health Check - name: Health Check
run: | run: |
echo "🧪 Running health checks..." echo "🧪 Running health checks on remote host..."
# Wait for service to be ready (localhost:5000/quant/ through Nginx/Kestrel) # Wait for service to be ready (localhost:5000/quant/ through Kestrel inside remote host)
for i in {1..30}; do for i in {1..30}; do
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ HTTP_CODE=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \
"http://127.0.0.1:5000/quant/" || echo "000") "curl -s -o /dev/null -w \"%{http_code}\" http://127.0.0.1:5000/quant/" || echo "000")
if [ "$HTTP_CODE" = "200" ]; then if [ "$HTTP_CODE" = "200" ]; then
echo "✅ Health check passed (HTTP $HTTP_CODE at localhost:5000/quant/)" echo "✅ Health check passed (HTTP $HTTP_CODE inside remote host)"
break break
fi fi
@@ -222,7 +222,7 @@ jobs:
if [ "$HTTP_CODE" != "200" ]; then if [ "$HTTP_CODE" != "200" ]; then
echo "❌ Health check failed after 60 seconds" echo "❌ Health check failed after 60 seconds"
echo "Service logs:" echo "Service logs:"
ssh -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \
"sudo journalctl -u ${{ env.SERVICE_NAME }} -n 20" || true "sudo journalctl -u ${{ env.SERVICE_NAME }} -n 20" || true
exit 1 exit 1
fi fi
@@ -333,11 +333,11 @@ jobs:
steps: steps:
- name: Performance Baseline - name: Performance Baseline
run: | run: |
echo "📈 Collecting performance metrics..." echo "📈 Collecting performance metrics via Public IP..."
# Page load time # Page load time
START=$(date +%s%N) START=$(date +%s%N)
curl -s http://${{ env.DEPLOY_HOST }}/quant/ > /dev/null curl -s http://178.104.200.7/quant/ > /dev/null
END=$(date +%s%N) END=$(date +%s%N)
LOAD_TIME=$(( (END - START) / 1000000 )) LOAD_TIME=$(( (END - START) / 1000000 ))
+6 -9
View File
@@ -39,20 +39,17 @@ jobs:
run: | run: |
echo "[deploy] setting up SSH and deploying shadow copy" echo "[deploy] setting up SSH and deploying shadow copy"
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519 echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
wc -c ~/.ssh/id_ed25519
md5sum ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 178.104.200.7 >> ~/.ssh/known_hosts
# Upload artifact and deploy script to host # Upload artifact and deploy script to host
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "mkdir -p /home/kjh2064/tmp" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "mkdir -p /home/kjh2064/tmp"
scp -i ~/.ssh/id_ed25519 quantengine.tar.gz kjh2064@178.104.200.7:/home/kjh2064/tmp/quantengine.tar.gz scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 quantengine.tar.gz kjh2064@178.104.200.7:/home/kjh2064/tmp/quantengine.tar.gz
# Execute hot deploy script # Execute hot deploy script
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh 2>/dev/null || true" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh 2>/dev/null || true"
scp -i ~/.ssh/id_ed25519 tools/deploy_quantengine.sh kjh2064@178.104.200.7:/home/kjh2064/tmp/deploy.sh scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 tools/deploy_quantengine.sh kjh2064@178.104.200.7:/home/kjh2064/tmp/deploy.sh
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh && /home/kjh2064/tmp/deploy.sh" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh && /home/kjh2064/tmp/deploy.sh"
- name: Verify Public Routes - name: Verify Public Routes
run: | run: |