provisioning/docs/src/development/dev-workspace-management.md

1 line
26 KiB
Markdown
Raw Normal View History

# Workspace Management Guide\n\nThis document provides comprehensive guidance on setting up and using development workspaces, including the path resolution system, testing\ninfrastructure, and workspace tools usage.\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Workspace Architecture](#workspace-architecture)\n3. [Setup and Initialization](#setup-and-initialization)\n4. [Path Resolution System](#path-resolution-system)\n5. [Configuration Management](#configuration-management)\n6. [Extension Development](#extension-development)\n7. [Runtime Management](#runtime-management)\n8. [Health Monitoring](#health-monitoring)\n9. [Backup and Restore](#backup-and-restore)\n10. [Troubleshooting](#troubleshooting)\n\n## Overview\n\nThe workspace system provides isolated development environments for the provisioning project, enabling:\n\n- **User Isolation**: Each developer has their own workspace with isolated runtime data\n- **Configuration Cascading**: Hierarchical configuration from workspace to core system\n- **Extension Development**: Template-based extension development with testing\n- **Path Resolution**: Smart path resolution with workspace-aware fallbacks\n- **Health Monitoring**: Comprehensive health checks with automatic repairs\n- **Backup/Restore**: Complete workspace backup and restore capabilities\n\n**Location**: `/workspace/`\n**Main Tool**: `workspace/tools/workspace.nu`\n\n## Workspace Architecture\n\n### Directory Structure\n\n```\nworkspace/\n├── config/ # Development configuration\n│ ├── dev-defaults.toml # Development environment defaults\n│ ├── test-defaults.toml # Testing environment configuration\n│ ├── local-overrides.toml.example # User customization template\n│ └── {user}.toml # User-specific configurations\n├── extensions/ # Extension development\n│ ├── providers/ # Custom provider extensions\n│ │ ├── template/ # Provider development template\n│ │ └── {user}/ # User-specific providers\n│ ├── taskservs/ # Custom task service extensions\n│ │ ├── template/ # Task service template\n│ │ └── {user}/ # User-specific task services\n│ └── clusters/ # Custom cluster extensions\n│ ├── template/ # Cluster template\n│ └── {user}/ # User-specific clusters\n├── infra/ # Development infrastructure\n│ ├── examples/ # Example infrastructures\n│ │ ├── minimal/ # Minimal learning setup\n│ │ ├── development/ # Full development environment\n│ │ └── testing/ # Testing infrastructure\n│ ├── local/ # Local development setups\n│ └── {user}/ # User-specific infrastructures\n├── lib/ # Workspace libraries\n│ └── path-resolver.nu # Path resolution system\n├── runtime/ # Runtime data (per-user isolation)\n│ ├── workspaces/{user}/ # User workspace data\n│ ├── cache/{user}/ # User-specific cache\n│ ├── state/{user}/ # User state management\n│ ├── logs/{user}/ # User application logs\n│ └── data/{user}/ # User database files\n└── tools/ # Workspace management tools\n ├── workspace.nu # Main workspace interface\n ├── init-workspace.nu # Workspace initialization\n ├── workspace-health.nu # Health monitoring\n ├── backup-workspace.nu # Backup management\n ├── restore-workspace.nu # Restore functionality\n ├──