Compare commits
2 Commits
22244bd21a
...
f9443f1ea5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9443f1ea5 | ||
|
|
b4eee821f5 |
@ -14,7 +14,7 @@ repos:
|
|||||||
language: system
|
language: system
|
||||||
types: [rust]
|
types: [rust]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-push]
|
stages: [pre-commit]
|
||||||
|
|
||||||
- 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-push]
|
stages: [pre-commit]
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
@ -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,6 +273,7 @@ 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
|
||||||
@ -298,6 +299,7 @@ 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
|
||||||
@ -306,7 +308,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 |
|
||||||
@ -395,7 +397,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
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# 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, extension-registry, rag, ai-service, provisioning-daemon) across multiple deployment modes (solo, multiuser, cicd, enterprise).
|
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).
|
||||||
|
|
||||||
## Architecture Overview
|
## Architecture Overview
|
||||||
|
|
||||||
@ -15,7 +16,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)
|
||||||
@ -48,7 +49,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)
|
||||||
@ -249,7 +250,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)
|
||||||
@ -259,6 +260,7 @@ 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
|
||||||
@ -266,6 +268,7 @@ 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"
|
||||||
@ -276,6 +279,7 @@ 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 = {
|
||||||
@ -289,16 +293,19 @@ 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
|
||||||
```
|
```
|
||||||
@ -318,7 +325,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 |
|
||||||
|
|||||||
@ -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,6 +56,7 @@ 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 = {
|
||||||
@ -76,6 +77,7 @@ orchestrator = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Solo Mode Override
|
### Solo Mode Override
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
# defaults/deployment/solo-defaults.ncl
|
# defaults/deployment/solo-defaults.ncl
|
||||||
services.orchestrator = {
|
services.orchestrator = {
|
||||||
@ -86,6 +88,7 @@ services.orchestrator = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Generated Config
|
### Generated Config
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
# configs/orchestrator.solo.ncl (auto-generated)
|
# configs/orchestrator.solo.ncl (auto-generated)
|
||||||
{
|
{
|
||||||
@ -119,6 +122,7 @@ 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
|
||||||
```
|
```
|
||||||
@ -130,6 +134,7 @@ 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
|
||||||
@ -166,7 +171,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)
|
||||||
@ -179,12 +184,14 @@ 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
|
||||||
```
|
```
|
||||||
@ -204,6 +211,7 @@ 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)?;
|
||||||
|
|||||||
@ -4,9 +4,10 @@ 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, Nickel for type-safe composition, and TOML for service consumption:
|
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:
|
||||||
|
|
||||||
```
|
```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 │
|
||||||
@ -419,7 +420,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
|
||||||
@ -801,7 +802,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)
|
||||||
│ │
|
│ │
|
||||||
|
|||||||
@ -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,6 +26,7 @@ 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
|
||||||
@ -35,6 +36,7 @@ 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
|
||||||
|
|
||||||
@ -52,6 +54,7 @@ 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"
|
||||||
@ -107,6 +110,7 @@ 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
|
||||||
@ -114,6 +118,7 @@ max = 100
|
|||||||
```
|
```
|
||||||
|
|
||||||
**After**:
|
**After**:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[orchestrator.queue.concurrent_tasks]
|
[orchestrator.queue.concurrent_tasks]
|
||||||
min = 1
|
min = 1
|
||||||
|
|||||||
@ -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,6 +49,7 @@ 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
|
||||||
@ -68,6 +69,7 @@ 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 = {
|
||||||
@ -97,6 +99,7 @@ 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 = {
|
||||||
@ -114,6 +117,7 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
|
|||||||
```
|
```
|
||||||
|
|
||||||
**deployment/enterprise-defaults.ncl**:
|
**deployment/enterprise-defaults.ncl**:
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
resources = {
|
resources = {
|
||||||
@ -134,6 +138,7 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
|
|||||||
## Common Defaults
|
## Common Defaults
|
||||||
|
|
||||||
### server-defaults.ncl
|
### server-defaults.ncl
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
server = {
|
server = {
|
||||||
@ -147,6 +152,7 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
|
|||||||
```
|
```
|
||||||
|
|
||||||
### database-defaults.ncl
|
### database-defaults.ncl
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
database = {
|
database = {
|
||||||
@ -159,6 +165,7 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
|
|||||||
```
|
```
|
||||||
|
|
||||||
### security-defaults.ncl
|
### security-defaults.ncl
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
security = {
|
security = {
|
||||||
@ -172,6 +179,7 @@ let solo_defaults = import "../defaults/deployment/solo-defaults.ncl" in
|
|||||||
```
|
```
|
||||||
|
|
||||||
### monitoring-defaults.ncl
|
### monitoring-defaults.ncl
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
monitoring = {
|
monitoring = {
|
||||||
@ -218,6 +226,7 @@ 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 = {
|
||||||
@ -238,6 +247,7 @@ queue = {
|
|||||||
### Changing Mode Override
|
### Changing Mode Override
|
||||||
|
|
||||||
**deployment/solo-defaults.ncl**:
|
**deployment/solo-defaults.ncl**:
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
# Before
|
# Before
|
||||||
orchestrator = {
|
orchestrator = {
|
||||||
|
|||||||
@ -68,6 +68,7 @@ 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
|
||||||
@ -78,6 +79,7 @@ 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
|
||||||
@ -141,12 +143,14 @@ 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
|
||||||
@ -158,6 +162,7 @@ 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
|
||||||
@ -222,12 +227,14 @@ 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
|
||||||
@ -242,14 +249,16 @@ 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
|
||||||
@ -312,6 +321,7 @@ 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"
|
||||||
@ -356,6 +366,7 @@ 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>"
|
||||||
@ -375,7 +386,8 @@ 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 │
|
||||||
@ -404,6 +416,7 @@ 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
|
||||||
@ -424,6 +437,7 @@ 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"
|
||||||
@ -450,7 +464,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) |
|
||||||
@ -615,6 +629,7 @@ 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
|
||||||
```
|
```
|
||||||
@ -630,6 +645,7 @@ 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
|
||||||
@ -696,11 +712,13 @@ 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
|
||||||
@ -713,6 +731,7 @@ 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
|
||||||
@ -769,11 +788,13 @@ 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
|
||||||
@ -781,6 +802,7 @@ 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
|
||||||
@ -794,6 +816,7 @@ 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
|
||||||
```
|
```
|
||||||
|
|||||||
@ -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,6 +138,7 @@ Log configuration:
|
|||||||
|
|
||||||
### orchestrator.ncl
|
### orchestrator.ncl
|
||||||
Workflow orchestration:
|
Workflow orchestration:
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
OrchestratorConfig = {
|
OrchestratorConfig = {
|
||||||
workspace | WorkspaceConfig,
|
workspace | WorkspaceConfig,
|
||||||
@ -153,6 +154,7 @@ OrchestratorConfig = {
|
|||||||
|
|
||||||
### control-center.ncl
|
### control-center.ncl
|
||||||
Policy and RBAC:
|
Policy and RBAC:
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
ControlCenterConfig = {
|
ControlCenterConfig = {
|
||||||
workspace | WorkspaceConfig,
|
workspace | WorkspaceConfig,
|
||||||
@ -166,6 +168,7 @@ ControlCenterConfig = {
|
|||||||
|
|
||||||
### mcp-server.ncl
|
### mcp-server.ncl
|
||||||
MCP protocol server:
|
MCP protocol server:
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
MCPServerConfig = {
|
MCPServerConfig = {
|
||||||
workspace | WorkspaceConfig,
|
workspace | WorkspaceConfig,
|
||||||
@ -186,6 +189,7 @@ 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
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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,6 +133,7 @@ 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 }}",
|
||||||
@ -140,6 +141,7 @@ 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)
|
||||||
@ -147,6 +149,7 @@ 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
|
||||||
@ -154,6 +157,7 @@ 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)
|
||||||
@ -161,6 +165,7 @@ 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}
|
||||||
@ -295,16 +300,19 @@ 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
|
||||||
```
|
```
|
||||||
|
|||||||
@ -158,6 +158,7 @@ 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"
|
||||||
@ -170,6 +171,7 @@ compression = "snappy"
|
|||||||
```
|
```
|
||||||
|
|
||||||
**PostgreSQL** (multiuser, enterprise modes):
|
**PostgreSQL** (multiuser, enterprise modes):
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[database]
|
[database]
|
||||||
backend = "postgres"
|
backend = "postgres"
|
||||||
@ -186,6 +188,7 @@ 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"
|
||||||
@ -193,6 +196,7 @@ path = "/var/lib/provisioning/orchestrator/data"
|
|||||||
```
|
```
|
||||||
|
|
||||||
**SurrealDB Server** (multiuser mode):
|
**SurrealDB Server** (multiuser mode):
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[storage]
|
[storage]
|
||||||
backend = "surrealdb_server"
|
backend = "surrealdb_server"
|
||||||
@ -202,6 +206,7 @@ surrealdb_database = "orchestrator"
|
|||||||
```
|
```
|
||||||
|
|
||||||
**SurrealDB Cluster** (enterprise mode):
|
**SurrealDB Cluster** (enterprise mode):
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[storage]
|
[storage]
|
||||||
backend = "surrealdb_cluster"
|
backend = "surrealdb_cluster"
|
||||||
|
|||||||
@ -4,7 +4,8 @@ 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. Each template imports configuration from `values/*.ncl` and expands to valid Docker Compose YAML.
|
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.
|
||||||
|
|
||||||
**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.
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ This directory contains Nickel templates that generate Docker Compose files for
|
|||||||
- 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
|
||||||
@ -51,6 +53,7 @@ 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
|
||||||
@ -96,6 +99,7 @@ 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
|
||||||
@ -118,6 +122,7 @@ 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
|
||||||
@ -130,6 +135,7 @@ 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
|
||||||
@ -178,6 +184,7 @@ 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
|
||||||
@ -197,6 +204,7 @@ 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
|
||||||
@ -213,6 +221,7 @@ 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
|
||||||
@ -265,7 +274,8 @@ 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) │
|
||||||
@ -299,6 +309,7 @@ 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
|
||||||
@ -352,6 +363,7 @@ 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
|
||||||
@ -534,6 +546,7 @@ 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
|
||||||
@ -549,6 +562,7 @@ ports:
|
|||||||
### Service Fails to Start
|
### Service Fails to Start
|
||||||
|
|
||||||
**Check logs**:
|
**Check logs**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose logs orchestrator
|
docker-compose logs orchestrator
|
||||||
```
|
```
|
||||||
@ -563,6 +577,7 @@ 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
|
||||||
|
|||||||
@ -221,6 +221,7 @@ kubectl describe service orchestrator -n provisioning
|
|||||||
### Required ConfigMaps
|
### Required ConfigMaps
|
||||||
|
|
||||||
#### orchestrator-config
|
#### orchestrator-config
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -235,6 +236,7 @@ data:
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### control-center-config
|
#### control-center-config
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -251,6 +253,7 @@ data:
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### mcp-server-config
|
#### mcp-server-config
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
@ -272,6 +275,7 @@ data:
|
|||||||
### Required Secrets
|
### Required Secrets
|
||||||
|
|
||||||
#### control-center-secrets
|
#### control-center-secrets
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
|||||||
@ -101,7 +101,8 @@ 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
|
||||||
@ -127,6 +128,7 @@ 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
|
||||||
@ -136,6 +138,7 @@ 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
|
||||||
@ -144,6 +147,7 @@ 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
|
||||||
@ -215,6 +219,7 @@ 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
|
||||||
@ -466,6 +471,7 @@ 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
|
||||||
@ -476,6 +482,7 @@ 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
|
||||||
@ -486,6 +493,7 @@ 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
|
||||||
@ -500,6 +508,7 @@ 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
|
||||||
|
|
||||||
@ -515,6 +524,7 @@ 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
|
||||||
@ -578,7 +588,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
|
||||||
@ -628,7 +638,8 @@ 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
|
||||||
|
|||||||
@ -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,6 +94,7 @@ 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
|
||||||
|
|
||||||
@ -123,6 +124,7 @@ 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
|
||||||
@ -143,6 +145,7 @@ 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
|
||||||
@ -178,6 +181,7 @@ let common = import "./common-validator.ncl" in
|
|||||||
```
|
```
|
||||||
|
|
||||||
### control-center-validator.ncl
|
### control-center-validator.ncl
|
||||||
|
|
||||||
```nickel
|
```nickel
|
||||||
{
|
{
|
||||||
# JWT token expiration
|
# JWT token expiration
|
||||||
@ -195,6 +199,7 @@ 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
|
||||||
@ -281,6 +286,7 @@ 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"
|
||||||
@ -289,6 +295,7 @@ 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
|
||||||
@ -296,11 +303,13 @@ 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"
|
||||||
@ -309,6 +318,7 @@ 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
|
||||||
```
|
```
|
||||||
|
|||||||
@ -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,6 +44,7 @@ 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)
|
||||||
{
|
{
|
||||||
@ -68,7 +69,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)
|
||||||
@ -150,6 +151,7 @@ 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
|
||||||
```
|
```
|
||||||
@ -157,6 +159,7 @@ 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
|
||||||
@ -166,11 +169,13 @@ 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
|
||||||
```
|
```
|
||||||
@ -181,7 +186,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)
|
||||||
@ -205,6 +210,7 @@ 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
|
||||||
@ -215,6 +221,7 @@ 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
|
||||||
@ -227,6 +234,7 @@ 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/
|
||||||
@ -249,16 +257,19 @@ 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
|
||||||
@ -268,12 +279,14 @@ 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
|
||||||
@ -283,6 +296,7 @@ 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user