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
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:
@@ -110,7 +110,7 @@ jobs:
|
||||
- name: Create Backup
|
||||
run: |
|
||||
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
|
||||
BACKUP_DIR="/home/kjh2064/quantengine_backup"
|
||||
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)
|
||||
|
||||
# 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"
|
||||
|
||||
# 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/
|
||||
|
||||
echo "✅ Package transferred"
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
- name: Extract and Install
|
||||
run: |
|
||||
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
|
||||
|
||||
DEPLOY_PATH="${{ env.DEPLOY_PATH }}"
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
- name: Restart Service
|
||||
run: |
|
||||
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
|
||||
|
||||
# Restart service
|
||||
@@ -203,15 +203,15 @@ jobs:
|
||||
|
||||
- name: Health Check
|
||||
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
|
||||
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
"http://127.0.0.1:5000/quant/" || echo "000")
|
||||
HTTP_CODE=$(ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/id_ed25519 ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }} \
|
||||
"curl -s -o /dev/null -w \"%{http_code}\" http://127.0.0.1:5000/quant/" || echo "000")
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
@@ -222,7 +222,7 @@ jobs:
|
||||
if [ "$HTTP_CODE" != "200" ]; then
|
||||
echo "❌ Health check failed after 60 seconds"
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
@@ -333,11 +333,11 @@ jobs:
|
||||
steps:
|
||||
- name: Performance Baseline
|
||||
run: |
|
||||
echo "📈 Collecting performance metrics..."
|
||||
echo "📈 Collecting performance metrics via Public IP..."
|
||||
|
||||
# Page load time
|
||||
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)
|
||||
LOAD_TIME=$(( (END - START) / 1000000 ))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user