This document covers common tasks and workflows for contributing to the homelab.
This is a GitOps monorepo where related code and deployment configuration live together.
| Directory | Purpose |
|---|---|
projects/ |
All services, operators, websites — colocated with deploy configs |
projects/platform/ |
Cluster-critical infrastructure (ArgoCD, Linkerd, SigNoz, etc.) |
projects/agent_platform/ |
Agent services (Context Forge, MCP servers, orchestrator, etc.) |
projects/home-cluster/ |
Auto-generated root kustomization that discovers all deploy/ directories |
bazel/ |
Build infrastructure (Helm rules, tools, images, semgrep, wrangler) |
docs/ |
Design docs, ADRs, and plans |
Colocation principle: Each service's deployment configuration (ArgoCD Application, Helm values) lives next to its source code, not in a separate overlays directory. This makes it easy to understand what belongs together.
┌─────────────────────────────────────────────────────────────────────┐
│ Step 1: Create Helm Chart (if needed) │
│ projects/<service>/chart/ (custom chart) │
│ — or use an upstream chart via Chart.yaml dependencies │
└────────────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Step 2: Create deploy/ Directory │
│ projects/<service>/deploy/ │
│ ├── application.yaml (ArgoCD Application manifest) │
│ ├── kustomization.yaml (makes app discoverable) │
│ └── values.yaml (Helm value overrides) │
└────────────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Step 3: Auto-Discovery │
│ Run: format │
│ This runs bazel/images/generate-home-cluster.sh which scans │
│ projects/ for deploy/ dirs containing application.yaml and │
│ regenerates projects/home-cluster/kustomization.yaml │
└────────────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Step 4: ArgoCD Auto-Discovery │
│ projects/home-cluster/kustomization.yaml lists all deploy/ dirs. │
│ │
│ The "canada" Application is the root app-of-apps. │
│ ArgoCD runs "kustomize build" and discovers all │
│ Application manifests automatically. │
└────────────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ Step 5: ArgoCD Syncs Application │
│ - Renders Helm chart with value files │
│ - Applies manifests to cluster │
│ - Monitors health and sync status │
└─────────────────────────────────────────────────────────────────────┘
projects/
├── platform/ # Core infrastructure (flat layout: chart + deploy in same dir)
│ ├── argocd/
│ │ ├── Chart.yaml
│ │ ├── application.yaml
│ │ ├── kustomization.yaml
│ │ └── values.yaml
│ ├── linkerd/
│ ├── kyverno/
│ └── kustomization.yaml ← references all platform services
│
├── agent_platform/ # Agent services
│ ├── orchestrator/deploy/
│ ├── context_forge/deploy/
│ └── kustomization.yaml ← references all agent services
│
├── grimoire/ # Individual project with colocated deploy/
│ ├── chart/ # Custom Helm chart
│ ├── deploy/ # ArgoCD Application + values
│ │ ├── application.yaml
│ │ ├── kustomization.yaml
│ │ └── values.yaml
│ └── api/ # Source code lives alongside
│
└── home-cluster/ # Auto-generated root (DO NOT EDIT)
└── kustomization.yaml ← lists all deploy/ dirs
- Create Helm chart in
projects/<service>/chart/with default values (or use an upstream chart via Chart.yaml dependencies) - Create a
deploy/directory colocated with your service source:projects/<service>/deploy/application.yaml- ArgoCD Application pointing to your chartprojects/<service>/deploy/kustomization.yaml- Reference to application.yamlprojects/<service>/deploy/values.yaml- Helm value overrides
- Run
formatto regenerate the root kustomization and format code - Add health checks and observability to the chart
- Test the complete deployment path:
helm template <service> projects/<service>/chart/ --namespace <namespace>to verify rendering- Commit and push to Git
- ArgoCD automatically discovers and syncs the new application to the cluster
Run before committing changes:
formatThis command:
- Formats code (Go, Python, JavaScript, Shell, Starlark)
- Updates apko lock files (container image definitions)
- Updates Python lock files (from pyproject.toml)
- Validates apko configurations
- Regenerates
projects/home-cluster/kustomization.yaml - Runs in parallel using Bazel for fast builds
Note: Helm manifests are rendered by ArgoCD at deploy time, not committed to the repo.
When adding a new Python dependency to pyproject.toml:
# 1. Add dependency to pyproject.toml
# 2. Regenerate lock files (included in format command)
format- Make changes in feature branch (via worktree)
- Run
formatto format code and update lock files - Verify deployment works end-to-end
- Check observability - metrics, logs, traces
- Create PR - BuildBuddy CI runs format check +
bazel test //... - Merge - ArgoCD automatically syncs changes to production cluster
We test actual behavior, not implementation details:
Good Tests:
- Deploy the actual service to a test cluster
- Verify the service responds correctly via HTTP
- Confirm metrics are exported and observable
- Test the complete user journey
Bad Tests:
- Unit tests that mock everything
- Tests that verify internal implementation
- Tests that don't exercise real deployment paths