2 lines
5.9 KiB
Markdown
Raw Normal View History

# Provisioning Platform Bootstrap\n\nSimple, flexible bootstrap script for provisioning platform installation.\n\n**No Rust compilation required** - uses pure Bash + Nushell.\n\n## Quick Start\n\n### From Git Repository\n\n```\ngit clone https://github.com/provisioning/provisioning.git\ncd provisioning\n\n# Run bootstrap\n./provisioning/bootstrap/install.sh\n```\n\n### What it Does (7 Stages)\n\n1. **System Detection** - Detects OS, CPU, RAM, architecture\n2. **Dependency Check** - Validates Docker, Rust, Nushell installed\n3. **Directory Structure** - Creates workspace directories\n4. **Configuration Validation** - Validates Nickel config syntax\n5. **Export Configuration** - Exports config.ncl → TOML for services\n6. **Initialize Orchestrator** - Starts orchestrator service\n7. **Verification** - Confirms all files created and services running\n\n## Usage\n\n### Standard Bootstrap (Interactive)\n\n```\n./provisioning/bootstrap/install.sh\n```\n\n### Nushell Direct\n\n```\nnu provisioning/bootstrap/install.nu $(pwd)\n```\n\n## Requirements\n\n**Minimum**:\n\n- Nushell 0.109.0+ (auto-installed if missing)\n- Docker (for containers)\n- Rust + Cargo (for building services)\n- Git (for cloning)\n\n**Recommended**:\n\n- 2+ GB RAM\n- 10+ GB disk\n- macOS, Linux, or WSL2\n\n## What Gets Created\n\nAfter bootstrap, your workspace has:\n\n```\nworkspace_librecloud/\n├── config/\n│ ├── config.ncl ← Master config (Nickel)\n│ └── generated/ ← Auto-exported TOML\n│ ├── workspace.toml\n│ ├── providers/\n│ │ ├── upcloud.toml\n│ │ └── local.toml\n│ └── platform/\n│ └── orchestrator.toml\n├── .orchestrator/data/queue/ ← Orchestrator data\n├── .kms/ ← KMS data\n├── .providers/ ← Provider state\n├── .taskservs/ ← Task service data\n└── .clusters/ ← Cluster data\n```\n\n## Differences from Rust Installer\n\n| Feature | Rust Installer | Bash+Nushell Bootstrap |\n| --------- | ----------------- | ------------------------ |\n| **Requires compilation** | ✅ Yes (5+ min) | ❌ No |\n| **Flexible** | ⚠️ Limited | ✅ Fully scriptable |\n| **Source code** | ❌ Binary | ✅ Clear scripts |\n| **Easy to modify** | ❌ Recompile | ✅ Edit script |\n| **Integrates with TypeDialog** | ❌ Hard | ✅ Easy |\n| **Deployable everywhere** | ✅ Binary | ✅ Script |\n| **TUI Interface** | ✅ Ratatui | ⚠️ Text menus |\n\n## Troubleshooting\n\n### "Nushell not found"\n\n```\n# Install Nushell manually:\n# macOS:\nbrew install nushell\n\n# Linux (Debian):\nsudo apt install nushell\n\n# Linux (RHEL):\nsudo yum install nushell\n\n# Or: https://nushell.sh/book/installation.html\n```\n\n### "Docker not installed"\n\n```\n# https://docs.docker.com/get-docker/\n```\n\n### "Rust not installed"\n\n```\n# https://rustup.rs/\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nrustup default stable\n```\n\n### "Configuration validation failed"\n\n```\n# Check Nickel syntax\nnickel typecheck workspace_librecloud/config/config.ncl\n\n# Fix errors in config.ncl\nvim workspace_librecloud/config/config.ncl\n\n# Re-run bootstrap\n./provisioning/bootstrap/install.sh\n```\n\n### "Orchestrator didn't start"\n\n```\n# Check logs\ntail -f workspace_librecloud/.orchestrator/logs/orchestrator.log\n\n# Manual start\ncd provisioning/platform/orchestrator\n./scripts/start-orchestrator.nu --background\n\n# Check health\ncurl http://localhost:9090/health\n```\n\n## After Bootstrap\n\nOnce complete:\n\n1. **Verify orchestrator**:\n\n ```bash\n curl http://localhost:9090/health\n ```\n\n1. **Update configuration** (optional):\n\n ```bash\n provisioning config platform orchestrator\n ```\n\n2. **Start provisioning**:\n\n ```bash\n provisioning server create --infra sgoyol --name web-01\n ```\n\n3. **Monitor progress**:\n\n ```bash\n provisioning workflow monit