Single-node infrastructure for quantitative research and backtesting on OCI.
| Generation | Role today | Path |
|---|---|---|
| Version 2 | Current target — Terraform → Ansible → Argo CD clean-room deploy | docs/V2_CLEAN_ROOM_DEPLOYMENT.md |
| Version 1 | Historical / fallback — Bash bootstrap on an existing VM | scripts/, VERSION_1_BASELINE.md |
V2 ownership:
Terraform → OCI network, compute, scratch volume, instance-principal IAM
Ansible → host baseline, scratch filesystem, MicroK8s, Argo CD bootstrap,
optional private runtime materialization
Argo CD → long-lived Kubernetes desired state (apps + oci-secrets)
GitHub Actions → static validation only
Start here for a fresh environment: docs/V2_CLEAN_ROOM_DEPLOYMENT.md.
That runbook is the canonical operator contract. Remaining Phase-A scopes are the first live clean-room deployment and post-proof V1 cleanup. Cloud Shell operator prerequisites are partially live validated (APIKey authentication and backend bootstrap). The first V2 clean-room deployment is not yet executed. It is not live-validated merely because CI passes.
The historical in-place SecretProviderClass handoff document
(docs/RUNTIME_SPC_OWNERSHIP_CUTOVER.md)
is a fallback procedure, not the primary V2 path.
- Terraform-managed OCI reference infrastructure (network, compute, scratch storage, IAM)
- Ansible-managed host bootstrap (baseline, scratch mount, MicroK8s, Argo CD)
- GitOps-driven application reconciliation from manifests in this repository
- OCI Vault-backed secret delivery through Secrets Store CSI + OCI provider
- Predefined workloads: PostgreSQL, MLflow, monitoring stack, Argo Workflows, and scratch PVC overlays
- Legacy V1 Bash bootstrap scripts retained as historical fallback until V2 clean-room proof
See docs/V2_CLEAN_ROOM_DEPLOYMENT.md for the
deterministic operator sequence (Terraform outputs → Ansible inventory →
site.yml → Argo → private runtime → acceptance).
scripts/bootstrap-cluster.sh runs these stages in order:
01-system.sh: flushes host iptables rules and sets ACCEPT policies02-microk8s.sh: installs MicroK8s (1.29/stable) via snap and enables addons03-storage.sh: validates/formats/mounts/dev/oracleoci/oraclevdsat/mnt/scratch04-secrets.sh: installs Secrets Store CSI Driver and OCI provider manifests05-monitoring.sh: installs Prometheus Operator CRDs06-argocd.sh: installs Argo CD and enables--enable-helmin Argo CD Kustomize build options07-apps.sh: applies all Argo CD Application manifests fromargocd/08-runtime.sh: historical V1 runtime injection only (not part of the V2 clean-room path)
Argo CD reconciles component manifests and Helm-based Kustomizations from:
apps/
argocd/
.
├── apps/ # Component manifests and Kustomize overlays
│ ├── argo/ # Argo Workflows Helm chart config
│ ├── mlflow/ # MLflow deployment + service + secrets bundle
│ ├── monitoring/ # kube-prometheus-stack Helm config + pushgateway
│ ├── postgres/ # PostgreSQL deployment/pvc/service + DB init job
│ └── scratch/ # scratch PVC overlays for dev/prod
├── argocd/ # Argo CD Application definitions
├── infrastructure/
│ └── oci-provider/ # OCI CSI provider DaemonSet/RBAC
├── scripts/ # Bootstrap and runtime-injection scripts
├── VERSION_1_BASELINE.md # Version 1 ownership, limits, and V2 direction
├── CONTRIBUTING.md
├── SECURITY.md
└── README.md
- Ubuntu VM with sudo privileges
snapavailable (used to install MicroK8s)- Outbound network access from the VM to pull:
- snap packages
- Helm charts
- container images
- remote CRD/manifests (Prometheus Operator and Argo CD install URLs)
- OCI block device available at
/dev/oracleoci/oraclevds - OCI Vault containing all required secret names (see Required OCI Vault secrets)
- OCI IAM configured so the instance principal can read those vault secrets
Copy and edit environment variables:
cp .env.example .envLoad values into the current shell before bootstrap:
set -a
source .env
set +a| Variable | Required | Purpose | Used by |
|---|---|---|---|
VAULT_ID |
Yes | OCI Vault OCID used in SecretProviderClass patches |
.env.example, scripts/inject-runtime-values.sh |
OCI_REGION |
Yes | Region value injected as AWS_DEFAULT_REGION into MLflow deployment patch |
.env.example, scripts/inject-runtime-values.sh |
ARGO_NS |
No (default: default) |
Namespace where Argo CD Application resources are patched |
scripts/inject-runtime-values.sh |
The following secret names are referenced directly by SecretProviderClass manifests and must exist in OCI Vault before bootstrap.
| Secret name | Used by | Purpose / expected value type | Source manifest |
|---|---|---|---|
postgresdb-naming |
PostgreSQL | PostgreSQL database name (string) | apps/postgres/overlays/v1/secrets.yaml |
postgres-user |
PostgreSQL | PostgreSQL username (string) | apps/postgres/overlays/v1/secrets.yaml |
postgres-password |
PostgreSQL | PostgreSQL password (secret string) | apps/postgres/overlays/v1/secrets.yaml |
mlflowdb-naming |
PostgreSQL init job | MLflow database name in PostgreSQL (string) | apps/postgres/overlays/v1/secrets.yaml |
mlflow-user |
PostgreSQL init job | MLflow DB user (string) | apps/postgres/overlays/v1/secrets.yaml |
mlflow-password |
PostgreSQL init job | MLflow DB user password (secret string) | apps/postgres/overlays/v1/secrets.yaml |
mlflow-db-uri |
MLflow | Full backend store URI (secret string/URI) | apps/mlflow/overlays/v1/secrets.yaml |
grafana-login-user |
Monitoring / Grafana | Grafana admin username (string) | apps/monitoring/overlays/v1/secrets.yaml |
grafana-login-password |
Monitoring / Grafana | Grafana admin password (secret string) | apps/monitoring/overlays/v1/secrets.yaml |
Do not commit secret values to Git.
All SecretProviderClass resources in this repository use authType: instance. The OCI provider DaemonSet also sets OCI_RESOURCE_PRINCIPAL_VERSION, indicating instance principal authentication.
This repository does not include OCI IAM policy text. You must configure OCI IAM policies so the instance principal can read the required vault secrets.
For new V2 deployments, use the canonical clean-room runbook:
docs/V2_CLEAN_ROOM_DEPLOYMENT.md
The script-based bootstrap below is retained only as the historical V1 / fallback path until V2 clean-room validation is complete. It is not the primary setup path and is not claimed live-validated as the V2 workflow.
V1 bootstrap is intended for a fresh VM under the legacy model. Re-running on an existing cluster is not supported by this repository flow.
Run (V1 fallback only):
chmod +x scripts/*
./scripts/bootstrap-cluster.shImportant operational behavior during bootstrap:
01-system.shflushes iptables and sets default ACCEPT policies03-storage.shmay format/dev/oracleoci/oraclevdsif it has no filesystem03-storage.shappends an/etc/fstabmount entry for the scratch device07-apps.shwaits only for Argo CDApplicationobjectspostgresandmlflowto exist (not all applications to become healthy)
After bootstrap, Argo CD reconciles from the repoURL, targetRevision, and path in argocd/*.yaml, not from uncommitted local files.
Current repository values in all Argo CD Application manifests:
repoURL:https://github.com/TradingChassis/infrastructuretargetRevision:main
If you operate from a fork or a different repository, update argocd/*.yaml before relying on Argo CD reconciliation.
Also verify repoURL matches the repository you intend to deploy in your environment.
| Application | Source path | Destination namespace | Purpose |
|---|---|---|---|
postgres |
apps/postgres |
postgres |
PostgreSQL backend and MLflow DB init job |
mlflow |
apps/mlflow |
mlflow |
MLflow tracking server |
monitoring |
apps/monitoring |
monitoring |
kube-prometheus-stack + pushgateway |
argo |
apps/argo |
argo |
Argo Workflows |
scratch-storage |
apps/scratch/platform |
kube-system (cluster-scoped) |
Scratch StorageClass + static PVs for /mnt/scratch |
scratch-dev |
apps/scratch/dev |
dev |
Scratch PVC overlay for dev namespace |
scratch-prod |
apps/scratch/prod |
prod |
Scratch PVC overlay for prod namespace |
oci-secrets |
Oracle chart / Argo Helm values | kube-system |
Secrets Store CSI Driver + OCI provider |
| Component | NodePort | Source |
|---|---|---|
| Grafana | 30007 |
apps/monitoring/base/helm-values.yaml |
| Argo Workflows server | 32120 |
apps/argo/helm-values.yaml |
| Prometheus | 30090 |
apps/monitoring/base/helm-values.yaml |
| MLflow | 30500 |
apps/mlflow/base/service.yaml |
Access is typically done through SSH local port forwarding. Cloud firewall exposure is configured outside this repository, so verify your OCI NSG/Security List settings.
V2 (Ansible bootstrap): Argo CD and Application CRs live in namespace argocd
(ansible/roles/argocd_bootstrap, argocd/*.yaml).
V1 (historical Bash bootstrap): Application objects were commonly managed in
namespace default (scripts/inject-runtime-values.sh defaults ARGO_NS=default).
Check where argocd-server service exists:
sudo microk8s kubectl get svc -A | rg argocd-serverV2 port-forward example:
sudo microk8s kubectl -n argocd port-forward svc/argocd-server 8080:443Historical V1 example if the server is still in default:
sudo microk8s kubectl -n default port-forward svc/argocd-server 8080:443Open https://localhost:8080 while the port-forward is active.
Terraform → OCI scratch block volume (default 150 GB) + attachment
Ansible → mount at /mnt/scratch; create /mnt/scratch/dev and /mnt/scratch/prod
Argo CD → StorageClass tradingchassis-scratch + static hostPath PVs + namespace PVCs
- Application
scratch-storageowns cluster-scopedStorageClass/PersistentVolumeobjects underapps/scratch/platform - Applications
scratch-dev/scratch-prodown namespacedscratch-pvcclaims only - PVCs use
storageClassName: tradingchassis-scratchwith deterministicvolumeNamebinding - Requests are
70Gi+70Giaccounting capacity with headroom on the shared filesystem (not a quota) - PostgreSQL remains on
microk8s-hostpathand is intentionally out of this contract
Legacy Bash scripts/03-storage.sh mounted /mnt/scratch while scratch PVCs used microk8s-hostpath. That gap is closed in the V2 Git manifests above and still requires live clean-room validation.
Run these checks after bootstrap:
sudo microk8s status
sudo microk8s kubectl get applications -A
sudo microk8s kubectl get pods -A
sudo microk8s kubectl get svc -A
sudo microk8s kubectl get pvc -AWhat to verify:
- MicroK8s reports ready status
- Argo CD
Applicationresources exist for all six apps listed above - Pods are created in namespaces:
default,postgres,mlflow,monitoring,argo,dev,prod - Expected NodePorts are present (
30007,32120,30090,30500) - PVCs exist for
postgres-pvcandscratch-pvc(dev/prod)
- Edit manifests under
apps/orargocd/ - Commit and push to the repository/branch referenced by Argo CD Applications
- Argo CD reconciles automatically (
automated.prune=true,selfHeal=true)
sudo snap remove microk8s --purge
sudo rm -rf /var/snap/microk8s/
sudo rm -rf ~/.kube/After reset, also review manually:
/etc/fstabentries added for/dev/oracleoci/oraclevds- whether
/mnt/scratchshould be unmounted/cleaned - whether attached block volume data should be preserved or re-formatted
From CONTRIBUTING.md:
kustomize buildshould succeed- YAML should be valid
Repository-specific build examples:
kustomize build apps/postgres
kustomize build apps/mlflow
kustomize build --enable-helm apps/monitoring
kustomize build --enable-helm apps/argo
kustomize build apps/scratch/dev
kustomize build apps/scratch/prod--enable-helm is required for components that use helmCharts in Kustomization.
- No secrets are stored in Git
- Secret retrieval is done via OCI Vault + CSI provider
- Instance principal authentication is expected by current manifests
- Public network exposure rules are configured in OCI, not in this repository
- CI Security validation scans for credential leaks and operator/live metadata hygiene; see
docs/REPOSITORY_SECURITY.md
For vulnerability reporting and security policy, see SECURITY.md.
- Multi-node Kubernetes production setups
- Managed Kubernetes providers
- Public service exposure configuration
- Application business logic and trade execution systems
- Vault lifecycle and Vault secret values (referenced by Terraform / consumed via CSI; not provisioned as secret contents here)
Additional Version 1 limitations and evidence gaps are listed in VERSION_1_BASELINE.md.
V2 clean-room status and remaining blockers are listed in docs/V2_CLEAN_ROOM_DEPLOYMENT.md.
This repository includes Cursor and agent guardrails for AI-assisted work. Start at AGENTS.md. The human-facing workflow is docs/AI_AGENT_WORKFLOW.md. These guardrails are an additional protection layer; they do not replace OS sandboxing, operating-system permissions, manual confirmation, or Git review.
docs/V2_CLEAN_ROOM_DEPLOYMENT.md— canonical V2 clean-room operator runbookdocs/REPOSITORY_SECURITY.md— repository security CI and metadata hygienedocs/RUNTIME_SPC_OWNERSHIP_CUTOVER.md— historical in-place SPC handoff (fallback only)terraform/README.md/ansible/README.md/argocd/README.md— layer ownershipVERSION_1_BASELINE.mdfor Version 1 ownership, limitations, and Version 2 directionAGENTS.mdfor the cross-agent safety entry pointdocs/AI_AGENT_WORKFLOW.mdfor the Cursor/AI-assisted implementation and review workflowCONTRIBUTING.mdfor contribution workflowSECURITY.mdfor vulnerability reporting and security modelCHANGELOG.mdfor tracked changes