Compare commits

..

No commits in common. "f9443f1ea5c7c0649895ff70a0760da86437ee16" and "22244bd21a1952dc7978f06ad0e353d96de8d2d6" have entirely different histories.

16 changed files with 35 additions and 162 deletions

View File

@ -14,7 +14,7 @@ repos:
language: system language: system
types: [rust] types: [rust]
pass_filenames: false pass_filenames: false
stages: [pre-commit] stages: [pre-push]
- id: rust-clippy - id: rust-clippy
name: Rust linting (cargo clippy) name: Rust linting (cargo clippy)
@ -22,7 +22,7 @@ repos:
language: system language: system
types: [rust] types: [rust]
pass_filenames: false pass_filenames: false
stages: [pre-commit] stages: [pre-push]
# NOTE: Disabled - cargo test blocks git push. Tests should run in CI/CD. # NOTE: Disabled - cargo test blocks git push. Tests should run in CI/CD.
# - id: rust-test # - id: rust-test

View File

@ -61,7 +61,7 @@ nickel export --format toml provisioning/schemas/infrastructure/systemd.ncl
Define service configuration once, generate multiple infrastructure outputs: Define service configuration once, generate multiple infrastructure outputs:
```plaintext ```
orchestrator.ncl (Platform Service Schema) orchestrator.ncl (Platform Service Schema)
Infrastructure Schemas (Docker, Kubernetes, Nginx, etc.) Infrastructure Schemas (Docker, Kubernetes, Nginx, etc.)
@ -123,7 +123,7 @@ nickel export --format yaml provisioning/schemas/infrastructure/kubernetes.ncl \
## File Structure ## File Structure
```plaintext ```
infrastructure/ infrastructure/
├── README.md # This file ├── README.md # This file
├── docker-compose.ncl # Docker Compose schema (232 lines) ├── docker-compose.ncl # Docker Compose schema (232 lines)
@ -273,7 +273,6 @@ oci_registry_config # Zot backend with filesystem storage
- Other services: 0.25-0.5 CPU, 256-512M RAM - Other services: 0.25-0.5 CPU, 256-512M RAM
**Export to JSON**: **Export to JSON**:
```bash ```bash
nickel export --format json provisioning/schemas/infrastructure/examples-solo-deployment.ncl nickel export --format json provisioning/schemas/infrastructure/examples-solo-deployment.ncl
# Output: 198 lines of configuration # Output: 198 lines of configuration
@ -299,7 +298,6 @@ oci_registry_config # Harbor backend with S3 replication
- Services scale appropriately for production load - Services scale appropriately for production load
**Export to JSON**: **Export to JSON**:
```bash ```bash
nickel export --format json provisioning/schemas/infrastructure/examples-enterprise-deployment.ncl nickel export --format json provisioning/schemas/infrastructure/examples-enterprise-deployment.ncl
# Output: 313 lines of configuration # Output: 313 lines of configuration
@ -308,7 +306,7 @@ nickel export --format json provisioning/schemas/infrastructure/examples-enterpr
### Example Comparison ### Example Comparison
| Aspect | Solo | Enterprise | | Aspect | Solo | Enterprise |
| -------- | ------ | ----------- | |--------|------|-----------|
| **Services** | 5 | 6 | | **Services** | 5 | 6 |
| **Orchestrator CPU** | 1.0 | 4.0 | | **Orchestrator CPU** | 1.0 | 4.0 |
| **Orchestrator Memory** | 1024M | 4096M | | **Orchestrator Memory** | 1024M | 4096M |
@ -397,7 +395,7 @@ Infrastructure schemas are independent from platform config schemas:
ConfigLoader automatically loads platform configs. Infrastructure configs are generated separately and deployed via infrastructure tools: ConfigLoader automatically loads platform configs. Infrastructure configs are generated separately and deployed via infrastructure tools:
```plaintext ```
Platform Schema (Nickel) Platform Schema (Nickel)
↓ nickel export → TOML ↓ nickel export → TOML
↓ ConfigLoader → Service reads config ↓ ConfigLoader → Service reads config

View File

@ -1,7 +1,6 @@
# TypeDialog + Nickel Configuration System for Platform Services # TypeDialog + Nickel Configuration System for Platform Services
Complete configuration system for provisioning platform services (orchestrator, control-center, mcp-server, vault-service, Complete configuration system for provisioning platform services (orchestrator, control-center, mcp-server, vault-service, extension-registry, rag, ai-service, provisioning-daemon) across multiple deployment modes (solo, multiuser, cicd, enterprise).
extension-registry, rag, ai-service, provisioning-daemon) across multiple deployment modes (solo, multiuser, cicd, enterprise).
## Architecture Overview ## Architecture Overview
@ -16,7 +15,7 @@ This system implements a **TypeDialog + Nickel configuration workflow** that pro
## Directory Structure ## Directory Structure
```plaintext ```
provisioning/.typedialog/provisioning/platform/ provisioning/.typedialog/provisioning/platform/
├── constraints/ # Single source of truth for validation limits ├── constraints/ # Single source of truth for validation limits
├── schemas/ # Nickel type contracts (services + common + deployment modes) ├── schemas/ # Nickel type contracts (services + common + deployment modes)
@ -49,7 +48,7 @@ nu scripts/configure.nu orchestrator solo --backend web
### 2. Configuration Composition ### 2. Configuration Composition
```plaintext ```
Base Defaults (defaults/*.ncl) Base Defaults (defaults/*.ncl)
+ Mode Overlay (defaults/deployment/{mode}-defaults.ncl) + Mode Overlay (defaults/deployment/{mode}-defaults.ncl)
@ -250,7 +249,7 @@ nu provisioning/.typedialog/provisioning/platform/scripts/install-services.nu so
## Configuration Loading Hierarchy (Rust Services) ## Configuration Loading Hierarchy (Rust Services)
```plaintext ```
1. Environment variables (ORCHESTRATOR_*) 1. Environment variables (ORCHESTRATOR_*)
2. User config (values/{service}.{mode}.ncl → TOML) 2. User config (values/{service}.{mode}.ncl → TOML)
3. Mode-specific defaults (configs/{service}.{mode}.toml) 3. Mode-specific defaults (configs/{service}.{mode}.toml)
@ -260,7 +259,6 @@ nu provisioning/.typedialog/provisioning/platform/scripts/install-services.nu so
## Constraint Interpolation Example ## Constraint Interpolation Example
**constraints.toml**: **constraints.toml**:
```toml ```toml
[orchestrator.queue.concurrent_tasks] [orchestrator.queue.concurrent_tasks]
min = 1 min = 1
@ -268,7 +266,6 @@ max = 100
``` ```
**Form element** (fragments/orchestrator-queue-section.toml): **Form element** (fragments/orchestrator-queue-section.toml):
```toml ```toml
[[elements]] [[elements]]
name = "max_concurrent_tasks" name = "max_concurrent_tasks"
@ -279,7 +276,6 @@ nickel_path = ["orchestrator", "queue", "max_concurrent_tasks"]
``` ```
**Jinja2 template** (orchestrator-config.ncl.j2): **Jinja2 template** (orchestrator-config.ncl.j2):
```nickel ```nickel
orchestrator = { orchestrator = {
queue = { queue = {
@ -293,19 +289,16 @@ orchestrator = {
## Getting Started ## Getting Started
1. **Run configuration wizard**: 1. **Run configuration wizard**:
```bash ```bash
nu provisioning/.typedialog/provisioning/platform/scripts/configure.nu orchestrator solo nu provisioning/.typedialog/provisioning/platform/scripts/configure.nu orchestrator solo
``` ```
2. **Generate TOML configs**: 2. **Generate TOML configs**:
```bash ```bash
nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu orchestrator solo nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu orchestrator solo
``` ```
3. **Deploy services**: 3. **Deploy services**:
```bash ```bash
nu provisioning/.typedialog/provisioning/platform/scripts/install-services.nu solo nu provisioning/.typedialog/provisioning/platform/scripts/install-services.nu solo
``` ```
@ -325,7 +318,7 @@ orchestrator = {
## Key Files ## Key Files
| File | Purpose | | File | Purpose |
| ------ | --------- | |------|---------|
| `constraints/constraints.toml` | Single source of truth for validation limits | | `constraints/constraints.toml` | Single source of truth for validation limits |
| `schemas/orchestrator.ncl` | Orchestrator type schema | | `schemas/orchestrator.ncl` | Orchestrator type schema |
| `defaults/orchestrator-defaults.ncl` | Orchestrator default values | | `defaults/orchestrator-defaults.ncl` | Orchestrator default values |

View File

@ -13,7 +13,7 @@ Configurations are **automatically generated** by composing:
## File Organization ## File Organization
```plaintext ```
configs/ configs/
├── README.md # This file ├── README.md # This file
├── orchestrator.solo.ncl # Orchestrator solo mode ├── orchestrator.solo.ncl # Orchestrator solo mode
@ -56,7 +56,6 @@ let validators = import "../validators/orchestrator-validator.ncl" in
## Example Configuration ## Example Configuration
### Base Defaults ### Base Defaults
```nickel ```nickel
# defaults/orchestrator-defaults.ncl # defaults/orchestrator-defaults.ncl
orchestrator = { orchestrator = {
@ -77,7 +76,6 @@ orchestrator = {
``` ```
### Solo Mode Override ### Solo Mode Override
```nickel ```nickel
# defaults/deployment/solo-defaults.ncl # defaults/deployment/solo-defaults.ncl
services.orchestrator = { services.orchestrator = {
@ -88,7 +86,6 @@ services.orchestrator = {
``` ```
### Generated Config ### Generated Config
```nickel ```nickel
# configs/orchestrator.solo.ncl (auto-generated) # configs/orchestrator.solo.ncl (auto-generated)
{ {
@ -122,7 +119,6 @@ services.orchestrator = {
### Regenerating Configs ### Regenerating Configs
#### Via TypeDialog (Recommended) #### Via TypeDialog (Recommended)
```bash ```bash
nu provisioning/.typedialog/provisioning/platform/scripts/configure.nu orchestrator solo nu provisioning/.typedialog/provisioning/platform/scripts/configure.nu orchestrator solo
``` ```
@ -134,7 +130,6 @@ Automatically:
4. Generates updated config 4. Generates updated config
#### Manual Rebuild #### Manual Rebuild
```bash ```bash
# (Future) Script to rebuild all configs from sources # (Future) Script to rebuild all configs from sources
nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu orchestrator solo nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu orchestrator solo
@ -171,7 +166,7 @@ nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu or
## Configuration Values Hierarchy ## Configuration Values Hierarchy
```plaintext ```
1. Explicit user customization (values/{service}.{mode}.ncl) 1. Explicit user customization (values/{service}.{mode}.ncl)
2. Mode-specific defaults (defaults/deployment/{mode}-defaults.ncl) 2. Mode-specific defaults (defaults/deployment/{mode}-defaults.ncl)
3. Service base defaults (defaults/{service}-defaults.ncl) 3. Service base defaults (defaults/{service}-defaults.ncl)
@ -184,14 +179,12 @@ Configurations are validated at three levels:
### 1. Schema Validation ### 1. Schema Validation
Type checking when config is evaluated: Type checking when config is evaluated:
```
```plaintext
| schemas.OrchestratorConfig | schemas.OrchestratorConfig
``` ```
### 2. Constraint Validation ### 2. Constraint Validation
Range checking via validators: Range checking via validators:
```nickel ```nickel
max_concurrent_tasks = validators.ValidConcurrentTasks 5 max_concurrent_tasks = validators.ValidConcurrentTasks 5
``` ```
@ -211,7 +204,6 @@ nu provisioning/.typedialog/provisioning/platform/scripts/generate-configs.nu or
``` ```
Rust services load the TOML: Rust services load the TOML:
```rust ```rust
let config_path = "provisioning/platform/config/orchestrator.solo.toml"; let config_path = "provisioning/platform/config/orchestrator.solo.toml";
let config = Config::from_file(config_path)?; let config = Config::from_file(config_path)?;

View File

@ -4,10 +4,9 @@ Complete documentation of the configuration pipeline that transforms interactive
## Overview ## Overview
The provisioning platform uses a **four-stage configuration workflow** that leverages TypeDialog for interactive configuration, The provisioning platform uses a **four-stage configuration workflow** that leverages TypeDialog for interactive configuration, Nickel for type-safe composition, and TOML for service consumption:
Nickel for type-safe composition, and TOML for service consumption:
```plaintext ```
┌─────────────────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────────────┐
│ Stage 1: User Interaction (TypeDialog) │ │ Stage 1: User Interaction (TypeDialog) │
│ - Can use Nickel configuration as default values │ │ - Can use Nickel configuration as default values │
@ -420,7 +419,7 @@ level = "debug"
### Output Location ### Output Location
```plaintext ```
provisioning/platform/config/ provisioning/platform/config/
├── orchestrator.solo.toml # Exported from configs/orchestrator.solo.ncl ├── orchestrator.solo.toml # Exported from configs/orchestrator.solo.ncl
├── orchestrator.multiuser.toml # Exported from configs/orchestrator.multiuser.ncl ├── orchestrator.multiuser.toml # Exported from configs/orchestrator.multiuser.ncl
@ -802,7 +801,7 @@ ORCHESTRATOR_CONFIG=provisioning/platform/config/orchestrator.solo.toml cargo ru
### Component Interactions ### Component Interactions
```plaintext ```
TypeDialog Forms Nickel Schemas TypeDialog Forms Nickel Schemas
(forms/*.toml) ←shares→ (schemas/*.ncl) (forms/*.toml) ←shares→ (schemas/*.ncl)
│ │ │ │

View File

@ -16,7 +16,7 @@ These constraints are used by:
## File Structure ## File Structure
```plaintext ```
constraints/ constraints/
└── constraints.toml # All validation constraints in TOML format └── constraints.toml # All validation constraints in TOML format
``` ```
@ -26,7 +26,6 @@ constraints/
### 1. Define Constraint ### 1. Define Constraint
**constraints.toml**: **constraints.toml**:
```toml ```toml
[orchestrator.queue.concurrent_tasks] [orchestrator.queue.concurrent_tasks]
min = 1 min = 1
@ -36,7 +35,6 @@ max = 100
### 2. Reference in Validator ### 2. Reference in Validator
**validators/orchestrator-validator.ncl**: **validators/orchestrator-validator.ncl**:
```nickel ```nickel
let constraints = import "../constraints/constraints.toml" in let constraints = import "../constraints/constraints.toml" in
@ -54,7 +52,6 @@ let constraints = import "../constraints/constraints.toml" in
### 3. Reference in Form ### 3. Reference in Form
**forms/fragments/orchestrator-queue-section.toml**: **forms/fragments/orchestrator-queue-section.toml**:
```toml ```toml
[[elements]] [[elements]]
name = "max_concurrent_tasks" name = "max_concurrent_tasks"
@ -110,7 +107,6 @@ When changing constraint bounds:
### Example: Increase Max Queue Tasks ### Example: Increase Max Queue Tasks
**Before**: **Before**:
```toml ```toml
[orchestrator.queue.concurrent_tasks] [orchestrator.queue.concurrent_tasks]
min = 1 min = 1
@ -118,7 +114,6 @@ max = 100
``` ```
**After**: **After**:
```toml ```toml
[orchestrator.queue.concurrent_tasks] [orchestrator.queue.concurrent_tasks]
min = 1 min = 1

View File

@ -12,7 +12,7 @@ Defaults provide:
## File Organization ## File Organization
```plaintext ```
defaults/ defaults/
├── README.md # This file ├── README.md # This file
├── common/ # Shared defaults ├── common/ # Shared defaults
@ -36,7 +36,7 @@ defaults/
Configuration is built from layers: Configuration is built from layers:
```plaintext ```
Base Defaults (service-defaults.ncl) Base Defaults (service-defaults.ncl)
+ Mode Overlay (deployment/{mode}-defaults.ncl) + Mode Overlay (deployment/{mode}-defaults.ncl)
@ -49,7 +49,6 @@ Base Defaults (service-defaults.ncl)
``` ```
Example: Example:
```nickel ```nickel
# configs/orchestrator.solo.ncl # configs/orchestrator.solo.ncl
let defaults = import "../defaults/orchestrator-defaults.ncl" in let defaults = import "../defaults/orchestrator-defaults.ncl" in
@ -69,7 +68,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
### 1. Service Base Defaults ### 1. Service Base Defaults
**orchestrator-defaults.ncl**: **orchestrator-defaults.ncl**:
```nickel ```nickel
{ {
orchestrator = { orchestrator = {
@ -99,7 +97,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
### 2. Mode-Specific Overrides ### 2. Mode-Specific Overrides
**deployment/solo-defaults.ncl**: **deployment/solo-defaults.ncl**:
```nickel ```nickel
{ {
resources = { resources = {
@ -117,7 +114,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
``` ```
**deployment/enterprise-defaults.ncl**: **deployment/enterprise-defaults.ncl**:
```nickel ```nickel
{ {
resources = { resources = {
@ -138,7 +134,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
## Common Defaults ## Common Defaults
### server-defaults.ncl ### server-defaults.ncl
```nickel ```nickel
{ {
server = { server = {
@ -152,7 +147,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
``` ```
### database-defaults.ncl ### database-defaults.ncl
```nickel ```nickel
{ {
database = { database = {
@ -165,7 +159,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
``` ```
### security-defaults.ncl ### security-defaults.ncl
```nickel ```nickel
{ {
security = { security = {
@ -179,7 +172,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
``` ```
### monitoring-defaults.ncl ### monitoring-defaults.ncl
```nickel ```nickel
{ {
monitoring = { monitoring = {
@ -226,7 +218,6 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
### Changing a Base Default ### Changing a Base Default
**orchestrator-defaults.ncl**: **orchestrator-defaults.ncl**:
```nickel ```nickel
# Before # Before
queue = { queue = {
@ -247,7 +238,6 @@ queue = {
### Changing Mode Override ### Changing Mode Override
**deployment/solo-defaults.ncl**: **deployment/solo-defaults.ncl**:
```nickel ```nickel
# Before # Before
orchestrator = { orchestrator = {

View File

@ -68,7 +68,6 @@ nickel export --format toml full-platform-enterprise.ncl > platform.toml
- No audit logging - No audit logging
**Usage**: **Usage**:
```bash ```bash
# Export to TOML and run # Export to TOML and run
nickel export --format toml orchestrator-solo.ncl > orchestrator.solo.toml nickel export --format toml orchestrator-solo.ncl > orchestrator.solo.toml
@ -79,7 +78,6 @@ nu ../../scripts/configure.nu orchestrator solo --backend cli
``` ```
**Customization Examples**: **Customization Examples**:
```nickel ```nickel
# Increase concurrency for testing (still development-friendly) # Increase concurrency for testing (still development-friendly)
queue.max_concurrent_tasks = 5 queue.max_concurrent_tasks = 5
@ -143,14 +141,12 @@ workspace.path = "/path/to/my/workspace"
- Network isolation and load balancing setup required - Network isolation and load balancing setup required
**Environment Variables Required**: **Environment Variables Required**:
```bash ```bash
export JWT_SECRET="<secure-random-256-bit-string>" export JWT_SECRET="<secure-random-256-bit-string>"
export SURREALDB_PASSWORD="<database-password>" export SURREALDB_PASSWORD="<database-password>"
``` ```
**Usage**: **Usage**:
```bash ```bash
# Deploy standalone with SurrealDB # Deploy standalone with SurrealDB
nickel export --format toml orchestrator-enterprise.ncl > orchestrator.enterprise.toml nickel export --format toml orchestrator-enterprise.ncl > orchestrator.enterprise.toml
@ -162,7 +158,6 @@ kubectl apply -f provisioning/platform/infrastructure/kubernetes/*.yaml
``` ```
**Customization Examples**: **Customization Examples**:
```nickel ```nickel
# Adjust concurrency for your specific infrastructure # Adjust concurrency for your specific infrastructure
queue.max_concurrent_tasks = 50 # Scale down if resource-constrained queue.max_concurrent_tasks = 50 # Scale down if resource-constrained
@ -227,14 +222,12 @@ security.rate_limit.requests_per_second = 20000
- RBAC requires careful role definition - RBAC requires careful role definition
**Environment Variables Required**: **Environment Variables Required**:
```bash ```bash
export DB_PASSWORD="<postgresql-password>" export DB_PASSWORD="<postgresql-password>"
export JWT_SECRET="<secure-random-string>" export JWT_SECRET="<secure-random-string>"
``` ```
**Usage**: **Usage**:
```bash ```bash
# Generate and deploy # Generate and deploy
nickel export --format toml control-center-multiuser.ncl > control-center.multiuser.toml nickel export --format toml control-center-multiuser.ncl > control-center.multiuser.toml
@ -249,16 +242,14 @@ docker-compose -f docker-compose.multiuser.yml up -d
``` ```
**RBAC Quick Reference**: **RBAC Quick Reference**:
| Role | Intended Users | Key Permissions | | Role | Intended Users | Key Permissions |
| ------ | ---------------- | ----------------- | |------|----------------|-----------------|
| admin | Infrastructure leads | All operations: full access | | admin | Infrastructure leads | All operations: full access |
| operator | Operations engineers | Execute workflows, manage tasks, view policies | | operator | Operations engineers | Execute workflows, manage tasks, view policies |
| developer | Application developers | View workflows, view policies (read-only) | | developer | Application developers | View workflows, view policies (read-only) |
| viewer | Non-technical (PM, QA) | View workflows only (minimal read) | | viewer | Non-technical (PM, QA) | View workflows only (minimal read) |
**Customization Examples**: **Customization Examples**:
```nickel ```nickel
# Require MFA globally for higher security # Require MFA globally for higher security
mfa.required = true mfa.required = true
@ -321,7 +312,6 @@ policies.password = {
- 100 RPS rate limiting with 20-request burst - 100 RPS rate limiting with 20-request burst
**Global Configuration**: **Global Configuration**:
```nickel ```nickel
let deployment_mode = "enterprise" let deployment_mode = "enterprise"
let namespace = "provisioning" let namespace = "provisioning"
@ -366,7 +356,6 @@ let environment = "production"
- Network setup complexity (TLS, CORS, rate limiting) - Network setup complexity (TLS, CORS, rate limiting)
**Environment Variables Required**: **Environment Variables Required**:
```bash ```bash
# Database credentials # Database credentials
export DB_PASSWORD="<postgresql-password>" export DB_PASSWORD="<postgresql-password>"
@ -386,8 +375,7 @@ export TLS_KEY="<key-path>"
``` ```
**Architecture Diagram**: **Architecture Diagram**:
```
```plaintext
┌───────────────────────────────────────────────┐ ┌───────────────────────────────────────────────┐
│ Nginx Load Balancer (TLS, CORS, RateLimit) │ │ Nginx Load Balancer (TLS, CORS, RateLimit) │
│ https://orchestrator.example.com │ │ https://orchestrator.example.com │
@ -416,7 +404,6 @@ export TLS_KEY="<key-path>"
``` ```
**Usage**: **Usage**:
```bash ```bash
# Export complete configuration # Export complete configuration
nickel export --format toml full-platform-enterprise.ncl > platform.toml nickel export --format toml full-platform-enterprise.ncl > platform.toml
@ -437,7 +424,6 @@ docker-compose -f docker-compose.enterprise.yml up -d
``` ```
**Customization Examples**: **Customization Examples**:
```nickel ```nickel
# Adjust deployment domain # Adjust deployment domain
let domain = "my-company.com" let domain = "my-company.com"
@ -464,7 +450,7 @@ mcp_server.performance.cache_ttl = 7200
## Deployment Mode Comparison Matrix ## Deployment Mode Comparison Matrix
| Feature | Solo | MultiUser | Enterprise | | Feature | Solo | MultiUser | Enterprise |
| --------- | ------ | ----------- | ----------- | |---------|------|-----------|-----------|
| **Ideal For** | Dev | Team/Staging | Production | | **Ideal For** | Dev | Team/Staging | Production |
| **Storage** | Filesystem | PostgreSQL | SurrealDB Cluster | | **Storage** | Filesystem | PostgreSQL | SurrealDB Cluster |
| **Replicas** | 1 | 1 | 3+ (HA) | | **Replicas** | 1 | 1 | 3+ (HA) |
@ -629,7 +615,6 @@ ORCHESTRATOR_CONFIG=orchestrator.solo.toml timeout 5 cargo run --bin orchestrato
### Port Already in Use ### Port Already in Use
**Fix**: Change the port in your configuration: **Fix**: Change the port in your configuration:
```nickel ```nickel
server.port = 9999 # Instead of 9090 server.port = 9999 # Instead of 9090
``` ```
@ -645,7 +630,6 @@ server.port = 9999 # Instead of 9090
### Import Not Found ### Import Not Found
**Fix**: Ensure all relative paths in imports are correct: **Fix**: Ensure all relative paths in imports are correct:
```nickel ```nickel
# Correct (relative to examples/) # Correct (relative to examples/)
let defaults = import "../defaults/orchestrator-defaults.ncl" in let defaults = import "../defaults/orchestrator-defaults.ncl" in
@ -712,13 +696,11 @@ nickel export --format toml orchestrator-custom.ncl > orchestrator.custom.toml
## Using Examples ## Using Examples
### View Example ### View Example
```bash ```bash
cat provisioning/.typedialog/provisioning/platform/examples/orchestrator-solo.ncl cat provisioning/.typedialog/provisioning/platform/examples/orchestrator-solo.ncl
``` ```
### Copy and Customize ### Copy and Customize
```bash ```bash
# Start with solo example # Start with solo example
cp examples/orchestrator-solo.ncl values/orchestrator.solo.ncl cp examples/orchestrator-solo.ncl values/orchestrator.solo.ncl
@ -731,7 +713,6 @@ nu scripts/validate-config.nu values/orchestrator.solo.ncl
``` ```
### Generate from Example ### Generate from Example
```bash ```bash
# Use example as base, regenerate with TypeDialog # Use example as base, regenerate with TypeDialog
nu scripts/configure.nu orchestrator solo --backend web nu scripts/configure.nu orchestrator solo --backend web
@ -788,13 +769,11 @@ Each example is a complete Nickel configuration:
## Creating New Examples ## Creating New Examples
### 1. Start with Existing Example ### 1. Start with Existing Example
```bash ```bash
cp examples/orchestrator-solo.ncl examples/orchestrator-custom.ncl cp examples/orchestrator-solo.ncl examples/orchestrator-custom.ncl
``` ```
### 2. Modify for Your Use Case ### 2. Modify for Your Use Case
```toml ```toml
# Update configuration values # Update configuration values
orchestrator.server.workers = 8 # More workers orchestrator.server.workers = 8 # More workers
@ -802,7 +781,6 @@ orchestrator.queue.max_concurrent_tasks = 20 # Higher concurrency
``` ```
### 3. Validate Configuration ### 3. Validate Configuration
```bash ```bash
nickel typecheck examples/orchestrator-custom.ncl nickel typecheck examples/orchestrator-custom.ncl
nickel eval examples/orchestrator-custom.ncl nickel eval examples/orchestrator-custom.ncl
@ -816,7 +794,6 @@ Add comments explaining:
- Customization needed - Customization needed
### 5. Save as Reference ### 5. Save as Reference
```bash ```bash
mv examples/orchestrator-custom.ncl examples/orchestrator-{scenario}.ncl mv examples/orchestrator-custom.ncl examples/orchestrator-{scenario}.ncl
``` ```

View File

@ -12,7 +12,7 @@ Schemas define:
## File Organization ## File Organization
```plaintext ```
schemas/ schemas/
├── README.md # This file ├── README.md # This file
├── common/ # Shared schemas (server, database, security, etc.) ├── common/ # Shared schemas (server, database, security, etc.)
@ -138,7 +138,6 @@ Log configuration:
### orchestrator.ncl ### orchestrator.ncl
Workflow orchestration: Workflow orchestration:
```nickel ```nickel
OrchestratorConfig = { OrchestratorConfig = {
workspace | WorkspaceConfig, workspace | WorkspaceConfig,
@ -154,7 +153,6 @@ OrchestratorConfig = {
### control-center.ncl ### control-center.ncl
Policy and RBAC: Policy and RBAC:
```nickel ```nickel
ControlCenterConfig = { ControlCenterConfig = {
workspace | WorkspaceConfig, workspace | WorkspaceConfig,
@ -168,7 +166,6 @@ ControlCenterConfig = {
### mcp-server.ncl ### mcp-server.ncl
MCP protocol server: MCP protocol server:
```nickel ```nickel
MCPServerConfig = { MCPServerConfig = {
workspace | WorkspaceConfig, workspace | WorkspaceConfig,
@ -189,7 +186,6 @@ Deployment schemas define resource constraints for each mode:
- **enterprise.ncl** - 16+ CPU, 32+ GB RAM, HA - **enterprise.ncl** - 16+ CPU, 32+ GB RAM, HA
Example: Example:
```nickel ```nickel
# schemas/deployment/solo.ncl # schemas/deployment/solo.ncl
{ {

View File

@ -12,7 +12,7 @@ Templates provide:
## File Organization ## File Organization
```plaintext ```
templates/ templates/
├── README.md # This file ├── README.md # This file
├── orchestrator-config.ncl.j2 # Nickel output template (Jinja2) ├── orchestrator-config.ncl.j2 # Nickel output template (Jinja2)
@ -133,7 +133,6 @@ typedialog-web nickel-roundtrip "$CONFIG" "forms/{service}-form.toml" --output "
### Key Jinja2 Patterns ### Key Jinja2 Patterns
**Conditional blocks** (only include if field is set): **Conditional blocks** (only include if field is set):
```nickel ```nickel
{%- if workspace_name %} {%- if workspace_name %}
name = "{{ workspace_name }}", name = "{{ workspace_name }}",
@ -141,7 +140,6 @@ name = "{{ workspace_name }}",
``` ```
**String values** (with quotes): **String values** (with quotes):
```nickel ```nickel
{%- if storage_backend %} {%- if storage_backend %}
backend = '{{ storage_backend }}, # Enum (atom syntax) backend = '{{ storage_backend }}, # Enum (atom syntax)
@ -149,7 +147,6 @@ backend = '{{ storage_backend }}, # Enum (atom syntax)
``` ```
**Numeric values** (no quotes): **Numeric values** (no quotes):
```nickel ```nickel
{%- if server_port %} {%- if server_port %}
port = {{ server_port }}, # Number port = {{ server_port }}, # Number
@ -157,7 +154,6 @@ port = {{ server_port }}, # Number
``` ```
**Boolean values** (lower case): **Boolean values** (lower case):
```nickel ```nickel
{%- if workspace_enabled is defined %} {%- if workspace_enabled is defined %}
enabled = {{ workspace_enabled | lower }}, # Boolean (true/false) enabled = {{ workspace_enabled | lower }}, # Boolean (true/false)
@ -165,7 +161,6 @@ enabled = {{ workspace_enabled | lower }}, # Boolean (true/false)
``` ```
**Comments** (for generated files): **Comments** (for generated files):
```nickel ```nickel
# Auto-generated by provisioning TypeDialog # Auto-generated by provisioning TypeDialog
# Edit via: nu scripts/configure.nu orchestrator {mode} # Edit via: nu scripts/configure.nu orchestrator {mode}
@ -300,19 +295,16 @@ let config = import "../../values/orchestrator.solo.ncl" in
## Rendering Templates ## Rendering Templates
### Render to JSON ### Render to JSON
```bash ```bash
nickel export --format json templates/orchestrator-config.ncl.j2 > config.json nickel export --format json templates/orchestrator-config.ncl.j2 > config.json
``` ```
### Render to YAML (via yq) ### Render to YAML (via yq)
```bash ```bash
nickel export --format json templates/kubernetes/orchestrator-deployment.yaml.ncl | yq -P > deployment.yaml nickel export --format json templates/kubernetes/orchestrator-deployment.yaml.ncl | yq -P > deployment.yaml
``` ```
### Render to TOML ### Render to TOML
```bash ```bash
nickel export --format toml templates/configs/orchestrator-config.toml.ncl > config.toml nickel export --format toml templates/configs/orchestrator-config.toml.ncl > config.toml
``` ```

View File

@ -158,7 +158,6 @@ max_connections = 512
### Database Configuration (Control Center) ### Database Configuration (Control Center)
**RocksDB** (solo, cicd modes): **RocksDB** (solo, cicd modes):
```toml ```toml
[database] [database]
backend = "rocksdb" backend = "rocksdb"
@ -171,7 +170,6 @@ compression = "snappy"
``` ```
**PostgreSQL** (multiuser, enterprise modes): **PostgreSQL** (multiuser, enterprise modes):
```toml ```toml
[database] [database]
backend = "postgres" backend = "postgres"
@ -188,7 +186,6 @@ ssl_mode = "require"
### Storage Configuration (Orchestrator) ### Storage Configuration (Orchestrator)
**Filesystem** (solo, cicd modes): **Filesystem** (solo, cicd modes):
```toml ```toml
[storage] [storage]
backend = "filesystem" backend = "filesystem"
@ -196,7 +193,6 @@ path = "/var/lib/provisioning/orchestrator/data"
``` ```
**SurrealDB Server** (multiuser mode): **SurrealDB Server** (multiuser mode):
```toml ```toml
[storage] [storage]
backend = "surrealdb_server" backend = "surrealdb_server"
@ -206,7 +202,6 @@ surrealdb_database = "orchestrator"
``` ```
**SurrealDB Cluster** (enterprise mode): **SurrealDB Cluster** (enterprise mode):
```toml ```toml
[storage] [storage]
backend = "surrealdb_cluster" backend = "surrealdb_cluster"

View File

@ -4,8 +4,7 @@ Nickel-based Docker Compose templates for deploying platform services across all
## Overview ## Overview
This directory contains Nickel templates that generate Docker Compose files for different deployment scenarios. This directory contains Nickel templates that generate Docker Compose files for different deployment scenarios. Each template imports configuration from `values/*.ncl` and expands to valid Docker Compose YAML.
Each template imports configuration from `values/*.ncl` and expands to valid Docker Compose YAML.
**Key Pattern**: Templates use **Nickel composition** to build service definitions dynamically based on configuration, allowing parameterized infrastructure-as-code. **Key Pattern**: Templates use **Nickel composition** to build service definitions dynamically based on configuration, allowing parameterized infrastructure-as-code.
@ -37,7 +36,6 @@ Each template imports configuration from `values/*.ncl` and expands to valid Doc
- Restart Policy: `unless-stopped` (survives host reboot) - Restart Policy: `unless-stopped` (survives host reboot)
**Usage**: **Usage**:
```bash ```bash
# Generate from Nickel template # Generate from Nickel template
nickel export --format json platform-stack.solo.yml.ncl | yq -P > docker-compose.solo.yml nickel export --format json platform-stack.solo.yml.ncl | yq -P > docker-compose.solo.yml
@ -53,7 +51,6 @@ docker-compose -f docker-compose.solo.yml down
``` ```
**Environment Variables** (recommended in `.env` file): **Environment Variables** (recommended in `.env` file):
```bash ```bash
ORCHESTRATOR_LOG_LEVEL=debug ORCHESTRATOR_LOG_LEVEL=debug
CONTROL_CENTER_LOG_LEVEL=info CONTROL_CENTER_LOG_LEVEL=info
@ -99,7 +96,6 @@ MCP_SERVER_LOG_LEVEL=info
- Logging: JSON format with rotation - Logging: JSON format with rotation
**Usage**: **Usage**:
```bash ```bash
# Generate from Nickel template # Generate from Nickel template
nickel export --format json platform-stack.multiuser.yml.ncl | yq -P > docker-compose.multiuser.yml nickel export --format json platform-stack.multiuser.yml.ncl | yq -P > docker-compose.multiuser.yml
@ -122,7 +118,6 @@ docker-compose exec postgres psql -U postgres -c "CREATE DATABASE provisioning;"
``` ```
**Database Initialization**: **Database Initialization**:
```bash ```bash
# Connect to PostgreSQL for schema creation # Connect to PostgreSQL for schema creation
docker-compose exec postgres psql -U provisioning -d provisioning docker-compose exec postgres psql -U provisioning -d provisioning
@ -135,7 +130,6 @@ docker-compose exec surrealdb surreal sql --auth root:password
``` ```
**Environment Variables** (in `.env.multiuser`): **Environment Variables** (in `.env.multiuser`):
```bash ```bash
# Database Credentials (CRITICAL - change before production) # Database Credentials (CRITICAL - change before production)
DB_PASSWORD=your-strong-password DB_PASSWORD=your-strong-password
@ -184,7 +178,6 @@ GITEA_ROOT_URL=http://localhost:3000/
- **Low Resource**: Minimal memory/CPU footprint - **Low Resource**: Minimal memory/CPU footprint
**Usage**: **Usage**:
```bash ```bash
# Generate from Nickel template # Generate from Nickel template
nickel export --format json platform-stack.cicd.yml.ncl | yq -P > docker-compose.cicd.yml nickel export --format json platform-stack.cicd.yml.ncl | yq -P > docker-compose.cicd.yml
@ -204,7 +197,6 @@ docker-compose -f docker-compose.cicd.yml down -v
``` ```
**CI/CD Integration Example**: **CI/CD Integration Example**:
```bash ```bash
# GitHub Actions workflow # GitHub Actions workflow
- name: Start Provisioning Stack - name: Start Provisioning Stack
@ -221,7 +213,6 @@ docker-compose -f docker-compose.cicd.yml down -v
``` ```
**Environment Variables** (minimal): **Environment Variables** (minimal):
```bash ```bash
# Logging (optional) # Logging (optional)
ORCHESTRATOR_LOG_LEVEL=warn ORCHESTRATOR_LOG_LEVEL=warn
@ -274,8 +265,7 @@ ORCHESTRATOR_LOG_LEVEL=warn
- Logging: JSON format with 500MB files, kept 30 versions - Logging: JSON format with 500MB files, kept 30 versions
**Architecture**: **Architecture**:
```
```plaintext
┌──────────────────────┐ ┌──────────────────────┐
│ External Client │ │ External Client │
│ (HTTPS, Port 443) │ │ (HTTPS, Port 443) │
@ -309,7 +299,6 @@ Observability Stack:
``` ```
**Usage**: **Usage**:
```bash ```bash
# Generate from Nickel template # Generate from Nickel template
nickel export --format json platform-stack.enterprise.yml.ncl | yq -P > docker-compose.enterprise.yml nickel export --format json platform-stack.enterprise.yml.ncl | yq -P > docker-compose.enterprise.yml
@ -363,7 +352,6 @@ curl -H "Host: orchestrator.example.com" http://localhost/health
- [ ] Configure external log aggregation (ELK stack, Splunk, etc.) - [ ] Configure external log aggregation (ELK stack, Splunk, etc.)
**Environment Variables** (in `.env.enterprise`): **Environment Variables** (in `.env.enterprise`):
```bash ```bash
# Database Credentials (CRITICAL) # Database Credentials (CRITICAL)
DB_PASSWORD=your-strong-password-32-chars-min DB_PASSWORD=your-strong-password-32-chars-min
@ -546,7 +534,6 @@ docker logs -f $(docker ps | grep orchestrator | awk '{print $1}')
**Error**: `bind: address already in use` **Error**: `bind: address already in use`
**Fix**: Change port in template or stop conflicting container: **Fix**: Change port in template or stop conflicting container:
```bash ```bash
# Find process using port # Find process using port
lsof -i :9090 lsof -i :9090
@ -562,7 +549,6 @@ ports:
### Service Fails to Start ### Service Fails to Start
**Check logs**: **Check logs**:
```bash ```bash
docker-compose logs orchestrator docker-compose logs orchestrator
``` ```
@ -577,7 +563,6 @@ docker-compose logs orchestrator
### Persistent Volume Issues ### Persistent Volume Issues
**Clean volumes** (WARNING: Deletes data): **Clean volumes** (WARNING: Deletes data):
```bash ```bash
docker-compose down -v docker-compose down -v
docker volume prune -f docker volume prune -f

View File

@ -221,7 +221,6 @@ kubectl describe service orchestrator -n provisioning
### Required ConfigMaps ### Required ConfigMaps
#### orchestrator-config #### orchestrator-config
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -236,7 +235,6 @@ data:
``` ```
#### control-center-config #### control-center-config
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -253,7 +251,6 @@ data:
``` ```
#### mcp-server-config #### mcp-server-config
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -275,7 +272,6 @@ data:
### Required Secrets ### Required Secrets
#### control-center-secrets #### control-center-secrets
```yaml ```yaml
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret

View File

@ -101,8 +101,7 @@ ORCHESTRATOR_CONFIG=provisioning/platform/config/orchestrator.solo.toml cargo ru
``` ```
**Expected Output**: **Expected Output**:
```
```plaintext
[INFO] Orchestrator starting... [INFO] Orchestrator starting...
[INFO] Server listening on 127.0.0.1:9090 [INFO] Server listening on 127.0.0.1:9090
[INFO] Storage backend: filesystem [INFO] Storage backend: filesystem
@ -128,7 +127,6 @@ curl -X POST http://localhost:9090/api/workflows \
To change configuration: To change configuration:
**Option A: Re-run Interactive Form** **Option A: Re-run Interactive Form**
```bash ```bash
cd provisioning/.typedialog/provisioning/platform cd provisioning/.typedialog/provisioning/platform
nu scripts/configure.nu orchestrator solo --backend cli nu scripts/configure.nu orchestrator solo --backend cli
@ -138,7 +136,6 @@ nu scripts/generate-configs.nu orchestrator solo
``` ```
**Option B: Edit TOML Directly** **Option B: Edit TOML Directly**
```bash ```bash
# Edit the file directly # Edit the file directly
vi provisioning/platform/config/orchestrator.solo.toml vi provisioning/platform/config/orchestrator.solo.toml
@ -147,7 +144,6 @@ vi provisioning/platform/config/orchestrator.solo.toml
``` ```
**Option C: Environment Variable Override** **Option C: Environment Variable Override**
```bash ```bash
# No file changes needed # No file changes needed
export ORCHESTRATOR_SERVER_PORT=9999 export ORCHESTRATOR_SERVER_PORT=9999
@ -219,7 +215,6 @@ docker-compose -f provisioning/platform/infrastructure/docker/docker-compose.mul
``` ```
**Verify Services**: **Verify Services**:
```bash ```bash
# Check all services are running # Check all services are running
docker-compose -f provisioning/platform/infrastructure/docker/docker-compose.multiuser.yml ps docker-compose -f provisioning/platform/infrastructure/docker/docker-compose.multiuser.yml ps
@ -471,7 +466,6 @@ kubectl apply -f provisioning/platform/infrastructure/kubernetes/prometheus-aler
### Change Configuration Value ### Change Configuration Value
**Without Service Restart** (Environment Variable): **Without Service Restart** (Environment Variable):
```bash ```bash
# Override specific value via environment variable # Override specific value via environment variable
export ORCHESTRATOR_LOG_LEVEL=debug export ORCHESTRATOR_LOG_LEVEL=debug
@ -482,7 +476,6 @@ ORCHESTRATOR_CONFIG=config.toml cargo run --bin orchestrator
``` ```
**With Service Restart** (TOML Edit): **With Service Restart** (TOML Edit):
```bash ```bash
# Edit TOML directly # Edit TOML directly
vi provisioning/platform/config/orchestrator.solo.toml vi provisioning/platform/config/orchestrator.solo.toml
@ -493,7 +486,6 @@ ORCHESTRATOR_CONFIG=config.toml cargo run --bin orchestrator
``` ```
**With Validation** (Regenerate from Form): **With Validation** (Regenerate from Form):
```bash ```bash
# Re-run interactive form to regenerate # Re-run interactive form to regenerate
cd provisioning/.typedialog/provisioning/platform cd provisioning/.typedialog/provisioning/platform
@ -508,7 +500,6 @@ nu scripts/generate-configs.nu orchestrator solo
### Add Team Member ### Add Team Member
**In Kubernetes PostgreSQL**: **In Kubernetes PostgreSQL**:
```bash ```bash
kubectl exec -it -n provisioning deployment/postgres -- psql -U provisioning -d provisioning kubectl exec -it -n provisioning deployment/postgres -- psql -U provisioning -d provisioning
@ -524,7 +515,6 @@ INSERT INTO role_assignments (user_id, role, granted_by, granted_at) VALUES
### Scale Service Replicas ### Scale Service Replicas
**In Kubernetes**: **In Kubernetes**:
```bash ```bash
# Scale orchestrator from 3 to 5 replicas # Scale orchestrator from 3 to 5 replicas
kubectl scale deployment orchestrator -n provisioning --replicas=5 kubectl scale deployment orchestrator -n provisioning --replicas=5
@ -588,7 +578,7 @@ ORCHESTRATOR_CONFIG=config.toml cargo run --bin orchestrator 2>&1 | grep -i "con
## Configuration File Locations ## Configuration File Locations
```plaintext ```
provisioning/.typedialog/provisioning/platform/ provisioning/.typedialog/provisioning/platform/
├── forms/ # User-facing interactive forms ├── forms/ # User-facing interactive forms
│ ├── orchestrator-form.toml │ ├── orchestrator-form.toml
@ -638,8 +628,7 @@ provisioning/.typedialog/provisioning/platform/
``` ```
TOML output location: TOML output location:
```
```plaintext
provisioning/platform/config/ provisioning/platform/config/
├── orchestrator.solo.toml # Consumed by orchestrator service ├── orchestrator.solo.toml # Consumed by orchestrator service
├── control-center.enterprise.toml # Consumed by control-center service ├── control-center.enterprise.toml # Consumed by control-center service

View File

@ -12,7 +12,7 @@ Validators provide:
## File Organization ## File Organization
```plaintext ```
validators/ validators/
├── README.md # This file ├── README.md # This file
├── common-validator.ncl # Ports, positive numbers, strings ├── common-validator.ncl # Ports, positive numbers, strings
@ -94,7 +94,6 @@ ValidRange = fun min max value =>
## Common Validators ## Common Validators
### common-validator.ncl ### common-validator.ncl
```nickel ```nickel
let constraints = import "../constraints/constraints.toml" in let constraints = import "../constraints/constraints.toml" in
@ -124,7 +123,6 @@ let constraints = import "../constraints/constraints.toml" in
``` ```
### resource-validator.ncl ### resource-validator.ncl
```nickel ```nickel
let constraints = import "../constraints/constraints.toml" in let constraints = import "../constraints/constraints.toml" in
let common = import "./common-validator.ncl" in let common = import "./common-validator.ncl" in
@ -145,7 +143,6 @@ let common = import "./common-validator.ncl" in
## Service-Specific Validators ## Service-Specific Validators
### orchestrator-validator.ncl ### orchestrator-validator.ncl
```nickel ```nickel
let constraints = import "../constraints/constraints.toml" in let constraints = import "../constraints/constraints.toml" in
let common = import "./common-validator.ncl" in let common = import "./common-validator.ncl" in
@ -181,7 +178,6 @@ let common = import "./common-validator.ncl" in
``` ```
### control-center-validator.ncl ### control-center-validator.ncl
```nickel ```nickel
{ {
# JWT token expiration # JWT token expiration
@ -199,7 +195,6 @@ let common = import "./common-validator.ncl" in
``` ```
### mcp-server-validator.ncl ### mcp-server-validator.ncl
```nickel ```nickel
{ {
# Max concurrent tool executions # Max concurrent tool executions
@ -286,7 +281,6 @@ nickel export --format toml provisioning/.typedialog/provisioning/platform/confi
## Adding a New Validator ## Adding a New Validator
1. **Create validator function** in appropriate file: 1. **Create validator function** in appropriate file:
```nickel ```nickel
ValidMyValue = fun value => ValidMyValue = fun value =>
if value < minimum then error "Too low" if value < minimum then error "Too low"
@ -295,7 +289,6 @@ nickel export --format toml provisioning/.typedialog/provisioning/platform/confi
``` ```
2. **Add constraint** to constraints.toml if needed: 2. **Add constraint** to constraints.toml if needed:
```toml ```toml
[service.feature.my_value] [service.feature.my_value]
min = 1 min = 1
@ -303,13 +296,11 @@ nickel export --format toml provisioning/.typedialog/provisioning/platform/confi
``` ```
3. **Use in config**: 3. **Use in config**:
```nickel ```nickel
my_value = validators.ValidMyValue 50, my_value = validators.ValidMyValue 50,
``` ```
4. **Add form constraint** (if interactive): 4. **Add form constraint** (if interactive):
```toml ```toml
[[elements]] [[elements]]
name = "my_value" name = "my_value"
@ -318,7 +309,6 @@ nickel export --format toml provisioning/.typedialog/provisioning/platform/confi
``` ```
5. **Test**: 5. **Test**:
```bash ```bash
nickel typecheck configs/service.mode.ncl nickel typecheck configs/service.mode.ncl
``` ```

View File

@ -12,7 +12,7 @@ The values directory stores:
## File Organization ## File Organization
```plaintext ```
values/ values/
├── .gitignore # Ignore *.ncl user configs ├── .gitignore # Ignore *.ncl user configs
├── README.md # This file ├── README.md # This file
@ -44,7 +44,6 @@ Each config file (`{service}.{mode}.ncl`) is:
- **Runtime data** - Created/updated by scripts and forms - **Runtime data** - Created/updated by scripts and forms
Example: Example:
```nickel ```nickel
# values/orchestrator.solo.ncl (auto-generated, user-editable) # values/orchestrator.solo.ncl (auto-generated, user-editable)
{ {
@ -69,7 +68,7 @@ Example:
## .gitignore Pattern ## .gitignore Pattern
```plaintext ```
# values/.gitignore # values/.gitignore
*.ncl # Ignore all Nickel config files (user-specific) *.ncl # Ignore all Nickel config files (user-specific)
!*.example.ncl # EXCEPT example files (tracked for documentation) !*.example.ncl # EXCEPT example files (tracked for documentation)
@ -151,7 +150,6 @@ This ensures:
## Configuration Workflow ## Configuration Workflow
### 1. Generate Initial Config ### 1. Generate Initial Config
```bash ```bash
nu scripts/configure.nu orchestrator solo nu scripts/configure.nu orchestrator solo
``` ```
@ -159,7 +157,6 @@ nu scripts/configure.nu orchestrator solo
Creates `values/orchestrator.solo.ncl` from form input. Creates `values/orchestrator.solo.ncl` from form input.
### 2. Edit Configuration ### 2. Edit Configuration
```bash ```bash
# Manually edit if needed # Manually edit if needed
vi values/orchestrator.solo.ncl vi values/orchestrator.solo.ncl
@ -169,13 +166,11 @@ nu scripts/configure.nu orchestrator solo --backend web
``` ```
### 3. Validate Configuration ### 3. Validate Configuration
```bash ```bash
nu scripts/validate-config.nu values/orchestrator.solo.ncl nu scripts/validate-config.nu values/orchestrator.solo.ncl
``` ```
### 4. Generate TOML for Services ### 4. Generate TOML for Services
```bash ```bash
nu scripts/generate-configs.nu orchestrator solo nu scripts/generate-configs.nu orchestrator solo
``` ```
@ -186,7 +181,7 @@ Exports to `provisioning/platform/config/orchestrator.solo.toml` (consumed by Ru
User configs are composed with defaults during generation: User configs are composed with defaults during generation:
```plaintext ```
defaults/orchestrator-defaults.ncl (base values) defaults/orchestrator-defaults.ncl (base values)
& &
values/orchestrator.solo.ncl (user customizations) values/orchestrator.solo.ncl (user customizations)
@ -210,7 +205,6 @@ provisioning/platform/config/orchestrator.solo.toml (Rust service config)
Since user configs are gitignored, sharing requires: Since user configs are gitignored, sharing requires:
### Option 1: Share via File ### Option 1: Share via File
```bash ```bash
# Export current config # Export current config
cat values/orchestrator.solo.ncl > /tmp/orchestrator-config.ncl cat values/orchestrator.solo.ncl > /tmp/orchestrator-config.ncl
@ -221,7 +215,6 @@ cp /tmp/orchestrator-config.ncl values/orchestrator.solo.ncl
### Option 2: Use Example Template ### Option 2: Use Example Template
Share setup instructions instead of raw config: Share setup instructions instead of raw config:
```bash ```bash
# Document the setup steps # Document the setup steps
cat > SETUP.md << EOF cat > SETUP.md << EOF
@ -234,7 +227,6 @@ EOF
### Option 3: Store in Separate Repo ### Option 3: Store in Separate Repo
For team configs, use a separate private repository: For team configs, use a separate private repository:
```bash ```bash
# Clone team configs # Clone team configs
git clone private-repo/provisioning-configs values/ git clone private-repo/provisioning-configs values/
@ -257,19 +249,16 @@ chmod 600 values/orchestrator.solo.ncl
If you accidentally delete a user config: If you accidentally delete a user config:
### Option 1: Regenerate from TypeDialog ### Option 1: Regenerate from TypeDialog
```bash ```bash
nu scripts/configure.nu orchestrator solo nu scripts/configure.nu orchestrator solo
``` ```
### Option 2: Copy from Backup ### Option 2: Copy from Backup
```bash ```bash
cp /backup/provisioning-values/orchestrator.solo.ncl values/ cp /backup/provisioning-values/orchestrator.solo.ncl values/
``` ```
### Option 3: Use Example as Base ### Option 3: Use Example as Base
```bash ```bash
cp examples/orchestrator-solo.ncl values/orchestrator.solo.ncl cp examples/orchestrator-solo.ncl values/orchestrator.solo.ncl
# Customize as needed # Customize as needed
@ -279,14 +268,12 @@ nu scripts/configure.nu orchestrator solo --backend web
## Troubleshooting ## Troubleshooting
### Config File Missing ### Config File Missing
```bash ```bash
# Regenerate from defaults # Regenerate from defaults
nu scripts/configure.nu orchestrator solo nu scripts/configure.nu orchestrator solo
``` ```
### Config Won't Validate ### Config Won't Validate
```bash ```bash
# Check for syntax errors # Check for syntax errors
nickel eval values/orchestrator.solo.ncl nickel eval values/orchestrator.solo.ncl
@ -296,7 +283,6 @@ diff examples/orchestrator-solo.ncl values/orchestrator.solo.ncl
``` ```
### Changes Not Taking Effect ### Changes Not Taking Effect
```bash ```bash
# Regenerate TOML from Nickel # Regenerate TOML from Nickel
nu scripts/generate-configs.nu orchestrator solo nu scripts/generate-configs.nu orchestrator solo