From d5ea65cd6e9f510837e161c747a439c9675cd18f Mon Sep 17 00:00:00 2001 From: BaoVu2k4 Date: Thu, 13 Aug 2026 11:56:39 +0700 Subject: [PATCH] Confirm docs-only changes no longer trigger a production deploy --- .github/workflows/deploy.yml | 11 ++++++++++ .github/workflows/migrate-qdrant-snapshot.yml | 21 ++++++++++++------- docs/README.md | 1 + .../medical-chatbot/templates/ai-service.yaml | 1 + infra/helm/medical-chatbot/values.yaml | 6 +++++- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index de700ce..4fe79b9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,17 @@ name: Deploy to production on: push: branches: [master] + paths: + # Everything the two Dockerfiles actually COPY into their images. + - apps/ai-service/** + - apps/web/** + - packages/** + - ingestion/data/verified/drug_entities.json + # docker-compose.prod.yml, docker-compose.observability.yml, + # Caddyfile, and the grafana/otel/prometheus/tempo configs it mounts. + - infra/docker/** + # Changes to the deploy logic itself should still be exercised. + - .github/workflows/deploy.yml workflow_dispatch: jobs: diff --git a/.github/workflows/migrate-qdrant-snapshot.yml b/.github/workflows/migrate-qdrant-snapshot.yml index 891ea31..2bc0dc7 100644 --- a/.github/workflows/migrate-qdrant-snapshot.yml +++ b/.github/workflows/migrate-qdrant-snapshot.yml @@ -23,17 +23,24 @@ jobs: chmod 600 ~/.ssh/prod.pem ssh-keyscan -H "${{ secrets.EC2_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null + - name: Report production Qdrant version + run: | + ssh -i ~/.ssh/prod.pem "ubuntu@${{ secrets.EC2_HOST }}" ' + sudo docker run --rm --network docker_default curlimages/curl -sf http://qdrant:6333/ + ' + - name: Snapshot Qdrant collections on production run: | ssh -i ~/.ssh/prod.pem "ubuntu@${{ secrets.EC2_HOST }}" ' set -e - sudo docker run --rm --network docker_default curlimages/curl -sf -X POST http://qdrant:6333/collections/duocthu_v1/snapshots > /dev/null - sudo docker run --rm --network docker_default curlimages/curl -sf -X POST http://qdrant:6333/collections/duocthu_v1__manifest/snapshots > /dev/null - sleep 3 - SNAP=$(sudo docker exec docker-qdrant-1 ls -t /qdrant/storage/snapshots/duocthu_v1/ | head -1) - SNAPM=$(sudo docker exec docker-qdrant-1 ls -t /qdrant/storage/snapshots/duocthu_v1__manifest/ | head -1) - sudo docker cp "docker-qdrant-1:/qdrant/storage/snapshots/duocthu_v1/${SNAP}" /tmp/duocthu_v1.snapshot - sudo docker cp "docker-qdrant-1:/qdrant/storage/snapshots/duocthu_v1__manifest/${SNAPM}" /tmp/duocthu_v1__manifest.snapshot + snap() { + collection="$1"; outfile="$2" + name=$(sudo docker run --rm --network docker_default curlimages/curl -sf -X POST "http://qdrant:6333/collections/${collection}/snapshots" | grep -oP "\"name\":\"\K[^\"]+") + test -n "$name" + sudo docker run --rm --network docker_default curlimages/curl -sf "http://qdrant:6333/collections/${collection}/snapshots/${name}" > "$outfile" + } + snap duocthu_v1 /tmp/duocthu_v1.snapshot + snap duocthu_v1__manifest /tmp/duocthu_v1__manifest.snapshot sudo chown ubuntu:ubuntu /tmp/duocthu_v1.snapshot /tmp/duocthu_v1__manifest.snapshot ls -la /tmp/*.snapshot ' diff --git a/docs/README.md b/docs/README.md index 7de13f2..e6975f0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -164,3 +164,4 @@ and `adr/0001`–`adr/0008` predate this set. They are kept for their reasoning and their empirical measurements. Where they describe current behaviour, they have drifted in places — the drift is listed in [26-known-limitations.md](26-known-limitations.md#documentationcode-discrepancies). + diff --git a/infra/helm/medical-chatbot/templates/ai-service.yaml b/infra/helm/medical-chatbot/templates/ai-service.yaml index dcc04db..2f0a85a 100644 --- a/infra/helm/medical-chatbot/templates/ai-service.yaml +++ b/infra/helm/medical-chatbot/templates/ai-service.yaml @@ -12,6 +12,7 @@ data: EMBEDDING_PROVIDER: {{ .Values.aiService.config.embeddingProvider | quote }} ANSWER_PROVIDER: {{ .Values.aiService.config.answerProvider | quote }} ANSWER_MODEL_ID: {{ .Values.aiService.config.answerModelId | quote }} + ENTITIES_PATH: {{ .Values.aiService.config.entitiesPath | quote }} METRICS_ENABLED: {{ .Values.aiService.config.metricsEnabled | quote }} OTEL_ENABLED: {{ and .Values.observability.enabled .Values.aiService.config.otelEnabled | quote }} OTEL_SERVICE_NAME: ai-service diff --git a/infra/helm/medical-chatbot/values.yaml b/infra/helm/medical-chatbot/values.yaml index 6dfc0c9..13f83b1 100644 --- a/infra/helm/medical-chatbot/values.yaml +++ b/infra/helm/medical-chatbot/values.yaml @@ -33,6 +33,10 @@ aiService: embeddingProvider: disabled answerProvider: disabled answerModelId: deepseek.v3.2 + # The Dockerfile bakes the catalog file in at this path; config.py's own + # repo-relative default only resolves inside a full monorepo checkout, + # not this flattened image layout. Matches apps/ai-service/.env.example. + entitiesPath: ./ingestion_data/drug_entities.json qdrantCollection: duocthu_v1 metricsEnabled: true otelEnabled: true @@ -79,7 +83,7 @@ qdrant: enabled: true # Set when using an external/managed Qdrant; empty uses the bundled Service. url: "" - image: qdrant/qdrant:v1.13.4 + image: qdrant/qdrant:v1.19.0 storage: 10Gi resources: requests: { cpu: 100m, memory: 256Mi }