Helm charts deployment#572
Conversation
| shutil.copyfile(prompt_file, dst_file) | ||
| logger.debug(f"Copied default prompt: {prompt_type}/{prompt_file.name}") | ||
|
|
||
| def _helm_render_default_prompts(self, context: TemplateContext) -> None: |
There was a problem hiding this comment.
I think the helm path only handles default prompts. Do we have a method to handle the prompt that user will set to a custom path? e.g.
services:
prompts:
chat_prompt: /path/to/my/custom.prompt
condense_prompt: /path/to/my/condense.prompt
Code reviewFound 4 issues:
archi/src/cli/utils/service_builder.py Lines 95 to 106 in b62ed09
archi/src/cli/templates/helm/templates/data-manager/deployment.yaml Lines 39 to 41 in b62ed09 archi/src/cli/templates/helm/templates/postgres/deployment.yaml Lines 40 to 42 in b62ed09
archi/src/cli/managers/templates_manager.py Lines 489 to 496 in b62ed09 archi/src/cli/managers/deployment_manager.py Lines 228 to 232 in b62ed09
Lines 685 to 705 in b62ed09 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
|
By all means, 👎 the claude reviewer if you feel the need. 😄 If you want me to have claude fix the bugs, gimme a 👍 I have not had a chance to run it with minikube yet. I'm happy to do that, just need a bit more time. |
There was a problem hiding this comment.
Pull request overview
Adds a Helm-based Kubernetes deployment path to archi, alongside existing Compose/Podman flows, including template generation for core services and runtime extension injection (extra agents/tools) via filesystem scanning.
Changes:
- Introduces
archi installCLI command to generate Helm charts (and optionally deploy viahelm upgrade --install). - Adds Helm chart templates (Chart/values + Deployments/Services/PVCs/ConfigMaps/Secrets) and updates template/volume/secret managers to render them.
- Adds dynamic discovery/loading of extra agents and tools at runtime from fixed container paths.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/utils/service_builder.py | Adds Helm-specific volume discovery and a Helm deployment plan builder. |
| src/cli/utils/helpers.py | Adds Helm template prefix constant. |
| src/cli/templates/helm/values.yaml | New Helm values template for core services and resource defaults. |
| src/cli/templates/helm/templates/secrets.yaml | New Secret manifest template generated from .env secrets. |
| src/cli/templates/helm/templates/pvc.yaml | Placeholder/Helm PVC template path (file added). |
| src/cli/templates/helm/templates/postgres/service.yaml | New Postgres Service Helm template. |
| src/cli/templates/helm/templates/postgres/pvc.yaml | New Postgres PVC Helm template. |
| src/cli/templates/helm/templates/postgres/deployment.yaml | New Postgres Deployment Helm template. |
| src/cli/templates/helm/templates/postgres/configmap.yaml | New ConfigMap template for Postgres init SQL. |
| src/cli/templates/helm/templates/data-manager/service.yaml | New data-manager Service Helm template. |
| src/cli/templates/helm/templates/data-manager/pvc.yaml | New data-manager PVC Helm template. |
| src/cli/templates/helm/templates/data-manager/deployment.yaml | New data-manager Deployment Helm template (optional selenium sidecar). |
| src/cli/templates/helm/templates/data-manager/configmap.yaml | New data-manager ConfigMap template for input lists/weblists. |
| src/cli/templates/helm/templates/config-seed.yaml | New Helm hook Job to seed config/data into Postgres. |
| src/cli/templates/helm/templates/chatbot/service.yaml | New chatbot Service Helm template. |
| src/cli/templates/helm/templates/chatbot/pvc.yaml | New chatbot PVC Helm template. |
| src/cli/templates/helm/templates/chatbot/deployment.yaml | New chatbot Deployment Helm template + mounts for prompts/agents/tools/skills. |
| src/cli/templates/helm/templates/chatbot/configmap.yaml | Generic ConfigMap template used to emit configs/agents/skills/prompts/tools. |
| src/cli/templates/helm/templates/_helpers.tpl | Adds standard Helm name/fullname helpers. |
| src/cli/templates/helm/Chart.yaml | New chart metadata template written by the CLI. |
| src/cli/templates/dockerfiles/Dockerfile-postgres-universal | Adds a universal Postgres image build (pgvector + pg_textsearch). |
| src/cli/templates/dockerfiles/Dockerfile-grafana-universal | Adds a universal Grafana image build. |
| src/cli/templates/dockerfiles/Dockerfile-data-manager-universal | Adds a universal data-manager image build (incl. Firefox/Geckodriver). |
| src/cli/templates/dockerfiles/Dockerfile-chat-universal | Adds a universal chatbot image build (incl. Firefox/Geckodriver). |
| src/cli/templates/base-config.yaml | Adds tools_dir to chat_app config template. |
| src/cli/managers/volume_manager.py | Adds Helm PVC-template generation based on required volumes. |
| src/cli/managers/templates_manager.py | Adds Helm rendering workflow (Chart/values/config-seed/tools + configmaps). |
| src/cli/managers/secrets_manager.py | Adds Kubernetes Secret template generation with base64 encoding. |
| src/cli/managers/deployment_manager.py | Adds Helm deployment template generation and helm upgrade --install execution. |
| src/cli/cli_main.py | Introduces install CLI command to drive Helm chart generation/deployment. |
| src/archi/pipelines/agents/tools/init.py | Adds dynamic loading/injection of extra tool functions/classes from filesystem. |
| src/archi/pipelines/init.py | Adds dynamic loading/registration of extra pipeline agents from filesystem. |
| src/archi/archi.py | Consolidates pipeline init debug logging. |
| .gitignore | Un-ignores the Helm secrets.yaml template file under templates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up: deploy-blocking bug found while testing on a live clusterI deployed this branch end-to-end (minikube + Root cause: in the chatbot volumes, archi/src/cli/templates/helm/templates/chatbot/deployment.yaml Lines 88 to 103 in b62ed09 All four configMap volumes ( Fix is to nest - configMap:
name: {{ name }}-chat-skills
optional: true
name: {{ name }}-chat-skillsAfter applying that, the chatbot pod schedules and the app boots normally. Note this compounds with the earlier finding that empty list-derived ConfigMaps (weblists, and here skills/tools) aren't rendered at all -- either always emit an empty ConfigMap or rely on a correctly-placed 🤖 Generated with Claude Code |
|
Thanks for the comments @Viphava280444 and @swinney ! I have already implemented them. For the |
📝 Summary
This PR introduces support for Kubernetes Helm-based deployments to archi, complementing the existing Docker Compose/Podman setups. It also adds a mechanism to dynamically discover and inject runtime resources (extra_agents and extra_tools) into the pipeline environments via local filesystem scanning.
🛠 Key Changes
⚙️ Core Logic & Dynamism
🖥️ CLI & Infrastructure Deployment
🌐 Docker images
You can test first the template generation using:
templates_dirbeing the directory where the helm charts will be created. Once you're confident about the templates you can run the installation command without the--dry-runflag or manually runhelm install.