- Go: Used for system-level services, performance-critical components, and Kubernetes integration
- TypeScript: Used for user-facing services, dashboard, and IDE integration
- Java: Used for JetBrains IDE integration
- Shell Scripts: Used for automation, build scripts, and development tools
- React: Frontend dashboard UI
- gRPC: Service-to-service communication
- Protocol Buffers: Data serialization
- Kubernetes API: Workspace orchestration
- Docker API: Container management
- Leeway: Custom build system for managing component dependencies
- Kubernetes: Container orchestration platform
- Docker: Containerization technology
- MySQL: Primary database for persistent data
- Redis: Caching and ephemeral data storage
- Helm: Kubernetes package management
- Terraform: Infrastructure as code for deployment
- VS Code: Primary IDE for TypeScript/JavaScript development
- GoLand/IntelliJ: IDE for Go development
- pre-commit: Git hooks for code quality
- ESLint/Prettier: Code formatting and linting
- Werft: CI/CD system
The project uses a Gitpod-based development workflow (dogfooding), with the following key aspects:
- Gitpod Workspace: Development occurs in Gitpod workspaces defined by
.gitpod.yml
- Component-Based: Each component can be developed and tested independently
- Leeway Build System: Manages dependencies between components
- Dev Containers: Development occurs in containers that mirror production
Gitpod uses two primary approaches for building components:
Components are built directly in the workspace using language-specific tools:
-
TypeScript/JavaScript Components:
- Commands are defined in each component's
package.json
- Common commands:
yarn build
: Compiles the componentyarn test
: Runs unit testsyarn lint
: Checks code styleyarn watch
: Watches for changes and rebuilds automatically
- Example (from server component):
cd components/server yarn build # Build the component yarn test:unit # Run unit tests yarn test:db # Run database tests
- Commands are defined in each component's
-
Go Components:
- Use standard Go tools
- Common commands:
go build
: Compiles the componentgo test
: Runs testsgo run
: Builds and runs the component
- Example:
cd components/ws-daemon go build ./... # Build all packages go test ./... # Test all packages
Leeway is a custom build tool that:
- Copies relevant sources into a separate file tree
- Manages complex dependencies between components
- Generates build artifacts for CI/CD pipelines
- Can also be run from inside the workspace
Common Leeway commands:
leeway build components/server:app # Build a specific component
leeway build -D components/server:app # Build with dependencies
leeway exec --package components/server:app -- yarn test # Run a command for a package
- Docker Images: Components are packaged as Docker images using
leeway.Dockerfile
files - Helm Charts: Deployment configurations are managed as Helm charts for Kubernetes deployment
- Unit Tests: Component-level tests for individual functions and classes
- Integration Tests: Tests for interactions between components
- End-to-End Tests: Tests for complete user workflows
- Preview Environments: Dedicated test environments for feature validation
- Workspace Startup Time: Workspaces should start in under 10 seconds when prebuilt
- IDE Responsiveness: IDE should maintain low latency even over internet connections
- Resource Efficiency: Efficient use of cluster resources to maximize density
- Workspace Isolation: Strong isolation between user workspaces
- Least Privilege: Components operate with minimal required permissions
- Data Protection: Secure handling of user code and credentials
- Network Security: Controlled network access between components
- Horizontal Scaling: All components must support horizontal scaling
- Multi-Cluster Support: Support for distributing workspaces across multiple clusters
- Resource Limits: Enforced limits on workspace resource consumption
- GDPR Compliance: Proper handling of user data
- SOC2 Compliance: Security and availability controls
- Data Residency: Support for region-specific data storage
- Git Providers: GitHub, GitLab, Bitbucket, Azure DevOps
- Container Registries: Docker Hub, GCR, ECR
- Cloud Providers: GCP, AWS, Azure (for self-hosted deployments)
- IDE Platforms: VS Code, JetBrains IDEs
The system has several internal dependencies between components:
-
Workspace Manager depends on:
- Kubernetes API
- Image Builder
- Content Service
-
Dashboard depends on:
- Auth Service
- Workspace Manager
- Content Service
-
IDE Service depends on:
- Workspace Manager
- Content Service
- Supervisor
-
Content Service depends on:
- Git providers
- Storage systems
-
Supervisor depends on:
- IDE Service
- Content Service
Key third-party libraries and their purposes:
- Kubernetes Client Libraries: Interaction with Kubernetes API
- Docker Client Libraries: Container management
- Database Drivers: MySQL, Redis connectivity
- gRPC/Protocol Buffers: Service communication
- React and UI Libraries: Dashboard frontend
- Authentication Libraries: OAuth, JWT handling
- Feature Planning: Features are planned and designed
- Implementation: Code is written and tested locally
- Code Review: Changes are reviewed through pull requests
- CI/CD: Automated testing and deployment
- Preview: Features are tested in preview environments
- Release: Changes are deployed to production
- Component Coupling: Some components have tight coupling that could be improved
- Test Coverage: Certain areas lack comprehensive test coverage
- Documentation: Some internal APIs lack detailed documentation
- Legacy Components: Some older components need modernization
- Build System Complexity: The custom build system has a learning curve