2026-01-14 02:59:52 +00:00
|
|
|
# Templates\n\nJinja2 and Nickel templates for configuration and deployment generation.\n\n## Purpose\n\nTemplates provide:\n- **Nickel output generation** - Jinja2 templates for TypeDialog nickel-roundtrip\n- **Docker Compose generation** - Infrastructure-as-code for containerized deployment\n- **Kubernetes manifests** - Declarative deployment manifests\n- **TOML export** - Service configuration generation for Rust codebase\n\n## File Organization\n\n```\ntemplates/\n├── README.md # This file\n├── orchestrator-config.ncl.j2 # Nickel output template (Jinja2)\n├── control-center-config.ncl.j2 # Nickel output template (Jinja2)\n├── mcp-server-config.ncl.j2 # Nickel output template (Jinja2)\n├── installer-config.ncl.j2 # Nickel output template (Jinja2)\n├── docker-compose/ # Docker Compose templates\n│ ├── platform-stack.solo.yml.ncl\n│ ├── platform-stack.multiuser.yml.ncl\n│ ├── platform-stack.cicd.yml.ncl\n│ └── platform-stack.enterprise.yml.ncl\n├── kubernetes/ # Kubernetes templates\n│ ├── orchestrator-deployment.yaml.ncl\n│ ├── orchestrator-service.yaml.ncl\n│ ├── control-center-deployment.yaml.ncl\n│ ├── control-center-service.yaml.ncl\n│ └── platform-ingress.yaml.ncl\n└── configs/ # Service config templates (optional)\n ├── orchestrator-config.toml.ncl\n ├── control-center-config.toml.ncl\n └── mcp-server-config.toml.ncl\n```\n\n## Jinja2 Config Templates\n\n**Critical for TypeDialog nickel-roundtrip workflow**:\n\n```\ntypedialog-web nickel-roundtrip "$CONFIG" "forms/{service}-form.toml" --output "$CONFIG" --template "templates/{service}-config.ncl.j2"\n```\n\n### Template Pattern: orchestrator-config.ncl.j2\n\n```\n# Orchestrator Configuration - Nickel Format\n# Auto-generated by provisioning TypeDialog\n# Edit via: nu scripts/configure.nu orchestrator {mode}\n\n{\n orchestrator = {\n # Workspace Configuration\n workspace = {\n {%- if workspace_name %}\n name = "{{ workspace_name }}",\n {%- endif %}\n {%- if workspace_path %}\n path = "{{ workspace_path }}",\n {%- endif %}\n {%- if workspace_enabled is defined %}\n enabled = {{ workspace_enabled | lower }},\n {%- endif %}\n {%- if multi_workspace is defined %}\n multi_workspace = {{ multi_workspace | lower }},\n {%- endif %}\n },\n\n # Server Configuration\n server = {\n {%- if server_host %}\n host = "{{ server_host }}",\n {%- endif %}\n {%- if server_port %}\n port = {{ server_port }},\n {%- endif %}\n {%- if server_workers %}\n workers = {{ server_workers }},\n {%- endif %}\n {%- if server_keep_alive %}\n keep_alive = {{ server_keep_alive }},\n {%- endif %}\n },\n\n # Storage Configuration\n storage = {\n {%- if storage_backend %}\n backend = '{{ storage_backend }},\n {%- endif %}\n {%- if storage_path %}\n path = "{{ storage_path }}",\n {%- endif %}\n {%- if surrealdb_url %}\n surrealdb_url = "{{ surrealdb_url }}",\n {%- endif %}\n },\n\n # Queue Configuration\n queue = {\n {%- if max_concurrent_tasks %}\n max_concurrent_tasks = {{ max_concurrent_tasks }},\n {%- endif %}\n {%- if retry_attempts %}\n retry_attempts = {{ retry_attempts }},\n {%- endif %}\n {%- if retry_delay %}\n retry_delay = {{ retry_delay }},\n {%- endif %}\n {%- if task_timeout %}\n task_timeout = {{ task_timeout }},\n {%- endif %}\n },\n\n # Monitoring Configuration (optional)\n {%- if enable_monitoring is defined and enable_monitoring %}\n monitoring = {\n enabled = true,\n {%- if metrics_interval %}\n metrics_interval = {{ metrics_interval }},\n {%- endif %}\n {%- if health_check_interval %}\n heal
|