Initial monorepo scaffold for Duoc Thu RAG medical chatbot
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# ArgoCD (GitOps deployment)
|
||||
|
||||
Deployment uses the **team's existing ArgoCD instance** (not self-hosted by
|
||||
this project) rather than a custom push-based CD pipeline. See
|
||||
`docs/adr/0002-argocd-gitops.md` for the rationale.
|
||||
|
||||
## Flow
|
||||
|
||||
1. CI (`infra/ci/github-actions/*-ci.yml`) builds and pushes a container image
|
||||
per app on merge to main, then bumps that app's image tag in
|
||||
`infra/helm/medical-chatbot/values-<env>.yaml` (or a per-app values file)
|
||||
and pushes that commit back to the repo. CI never runs `kubectl apply` or
|
||||
`helm upgrade` directly.
|
||||
2. ArgoCD (team-managed, pointed at this repo) watches `infra/argocd/applications/<env>/`
|
||||
and `infra/helm/medical-chatbot/`, detects the values-file change, and
|
||||
syncs the cluster to match — this is the actual deploy step, owned by
|
||||
ArgoCD, not by our CI.
|
||||
3. Promotion between environments (dev -> staging -> prod) is a Git operation
|
||||
(merge/PR that changes the target values file or image tag for that env),
|
||||
not a manual `kubectl`/`helm` command.
|
||||
|
||||
## Files
|
||||
|
||||
- `applications/dev/app.yaml`, `applications/staging/app.yaml`,
|
||||
`applications/prod/app.yaml` — one ArgoCD `Application` CR per environment,
|
||||
each pointing at this repo + the `infra/helm/medical-chatbot` chart with
|
||||
that environment's values file.
|
||||
|
||||
## TODO once the team's ArgoCD instance details are known
|
||||
|
||||
- Fill in `spec.destination.server` (target cluster API server / context name)
|
||||
in each `app.yaml` — currently a placeholder.
|
||||
- Confirm which ArgoCD `project` (RBAC scoping) these Applications should
|
||||
belong to, instead of the placeholder `default`.
|
||||
- Confirm the repo URL placeholder in each `app.yaml` once the GitHub repo
|
||||
exists (filled in as part of the initial scaffold commit/push).
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: medical-chatbot-dev
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default # TODO: confirm the team's ArgoCD project/RBAC scope for this app
|
||||
source:
|
||||
repoURL: https://github.com/BaoVu2k4/vsf-duocthu.git # TODO: confirm once repo is created
|
||||
targetRevision: main
|
||||
path: infra/helm/medical-chatbot
|
||||
helm:
|
||||
valueFiles:
|
||||
- values.yaml
|
||||
- values-dev.yaml
|
||||
destination:
|
||||
server: https://kubernetes.default.svc # TODO: point at the team's target cluster/context
|
||||
namespace: medical-chatbot-dev
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: medical-chatbot-prod
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default # TODO: confirm the team's ArgoCD project/RBAC scope for this app
|
||||
source:
|
||||
repoURL: https://github.com/BaoVu2k4/vsf-duocthu.git # TODO: confirm once repo is created
|
||||
targetRevision: main
|
||||
path: infra/helm/medical-chatbot
|
||||
helm:
|
||||
valueFiles:
|
||||
- values.yaml
|
||||
- values-prod.yaml
|
||||
destination:
|
||||
server: https://kubernetes.default.svc # TODO: point at the team's target cluster/context
|
||||
namespace: medical-chatbot-prod
|
||||
syncPolicy: {} # intentionally NOT automated — prod sync requires manual approval in the ArgoCD UI/CLI
|
||||
@@ -0,0 +1,24 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: medical-chatbot-staging
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default # TODO: confirm the team's ArgoCD project/RBAC scope for this app
|
||||
source:
|
||||
repoURL: https://github.com/BaoVu2k4/vsf-duocthu.git # TODO: confirm once repo is created
|
||||
targetRevision: main
|
||||
path: infra/helm/medical-chatbot
|
||||
helm:
|
||||
valueFiles:
|
||||
- values.yaml
|
||||
- values-staging.yaml
|
||||
destination:
|
||||
server: https://kubernetes.default.svc # TODO: point at the team's target cluster/context
|
||||
namespace: medical-chatbot-staging
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
@@ -0,0 +1,14 @@
|
||||
# CI workflows (placeholder)
|
||||
|
||||
Not yet functional — filled in during Phase 6. Deployment is GitOps via the
|
||||
team's existing ArgoCD instance (see `infra/argocd/` and
|
||||
`docs/adr/0002-argocd-gitops.md`) — CI never runs `kubectl`/`helm` against a
|
||||
cluster directly. Planned workflows:
|
||||
|
||||
- `ai-service-ci.yml` — lint/test/build/push image for `apps/ai-service`
|
||||
- `node-services-ci.yml` — lint/test/build for the NestJS services
|
||||
- `web-ci.yml` — lint/test/build for `apps/web`
|
||||
- `ingestion-ci.yml` — lint/test for the `ingestion` pipeline
|
||||
- `bump-image-tag.yml` — on image push, updates the image tag in the
|
||||
relevant `infra/helm/medical-chatbot/values-<env>.yaml` and commits/pushes
|
||||
that change; ArgoCD picks it up from there
|
||||
@@ -0,0 +1,68 @@
|
||||
# Local development topology. App services are commented out until their
|
||||
# Dockerfiles exist (Phase 5) — infra services can be started standalone
|
||||
# today for Phase 1 (ingestion) development, e.g.:
|
||||
# docker compose up postgres qdrant redis
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: duoc_thu
|
||||
POSTGRES_PASSWORD: duoc_thu
|
||||
POSTGRES_DB: duoc_thu
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
|
||||
qdrant:
|
||||
image: qdrant/qdrant:latest
|
||||
ports:
|
||||
- "6333:6333"
|
||||
- "6334:6334"
|
||||
volumes:
|
||||
- qdrant-data:/qdrant/storage
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
|
||||
# ai-service:
|
||||
# build: ../../apps/ai-service
|
||||
# env_file: ../../apps/ai-service/.env
|
||||
# ports: ["8000:8000"]
|
||||
# depends_on: [qdrant]
|
||||
#
|
||||
# api-gateway:
|
||||
# build: ../../apps/api-gateway
|
||||
# env_file: ../../apps/api-gateway/.env
|
||||
# ports: ["3000:3000"]
|
||||
# depends_on: [auth-service, user-service, chat-service]
|
||||
#
|
||||
# auth-service:
|
||||
# build: ../../apps/auth-service
|
||||
# env_file: ../../apps/auth-service/.env
|
||||
# depends_on: [postgres]
|
||||
#
|
||||
# user-service:
|
||||
# build: ../../apps/user-service
|
||||
# env_file: ../../apps/user-service/.env
|
||||
# depends_on: [postgres]
|
||||
#
|
||||
# chat-service:
|
||||
# build: ../../apps/chat-service
|
||||
# env_file: ../../apps/chat-service/.env
|
||||
# depends_on: [postgres, ai-service]
|
||||
#
|
||||
# web:
|
||||
# build: ../../apps/web
|
||||
# ports: ["3001:3000"]
|
||||
# depends_on: [api-gateway]
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
qdrant-data:
|
||||
redis-data:
|
||||
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: medical-chatbot
|
||||
description: Umbrella Helm chart for the Duoc Thu RAG medical chatbot platform
|
||||
type: application
|
||||
version: 0.0.0
|
||||
appVersion: "0.0.0"
|
||||
@@ -0,0 +1 @@
|
||||
# dev environment overrides (TBD, Phase 6)
|
||||
@@ -0,0 +1 @@
|
||||
# prod environment overrides (TBD, Phase 6)
|
||||
@@ -0,0 +1 @@
|
||||
# staging environment overrides (TBD, Phase 6)
|
||||
@@ -0,0 +1,2 @@
|
||||
# Base values — filled in during Phase 6. Overridden per-environment by
|
||||
# values-dev.yaml / values-staging.yaml / values-prod.yaml.
|
||||
@@ -0,0 +1,14 @@
|
||||
# Terraform (cloud-agnostic scaffold)
|
||||
|
||||
**Cloud provider decision is pending** (AWS vs GCP vs Azure). Modules below are
|
||||
placeholder interfaces — the concrete resource implementations (EKS/GKE/AKS,
|
||||
managed Postgres, object storage, secrets manager) get filled in once the
|
||||
provider is chosen, in Phase 6 of the build roadmap. Directory shape is
|
||||
provider-agnostic so no restructuring is needed once decided.
|
||||
|
||||
- `modules/k8s-cluster` — managed Kubernetes cluster
|
||||
- `modules/networking` — VPC/subnets/ingress networking
|
||||
- `modules/managed-postgres` — managed Postgres instance
|
||||
- `modules/object-storage` — bucket for PDF/raw artifacts, index backups
|
||||
- `modules/secrets` — secrets manager integration
|
||||
- `envs/{dev,staging,prod}` — per-environment root modules wiring the above
|
||||
Reference in New Issue
Block a user