Gitpod follows a microservices architecture composed of several key components that work together to provide the complete development environment platform. The system is designed to be:
- Scalable: Handles many concurrent users and workspaces
- Resilient: Maintains availability despite component failures
- Extensible: Allows for adding new features and integrations
- Secure: Isolates workspaces and protects user data
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Git Platforms │ │ User Browser │ │ IDE Clients │
│ (GitHub, etc.) │ │ │ │ (VS Code, etc.)│
└────────┬────────┘ └────────┬────────┘ └────────┬────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ API Gateway │
└─────────────────────────────────────────────────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Auth Service │ │ Dashboard │ │ IDE Service │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────┬───────┴───────────────┬───────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ WS Manager │ │ Image Builder │ │ Content Service│
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ Kubernetes Infrastructure │
└─────────────────────────────────────────────────────────────────┘
-
Workspace Manager (ws-manager): Orchestrates workspace lifecycle, managing creation, starting, stopping, and deletion of workspaces.
-
Workspace Daemon (ws-daemon): Runs on each node, managing workspace resources, file system operations, and runtime aspects.
-
Image Builder: Builds Docker images for workspaces based on configuration and caches them for quick startup.
-
Content Service: Manages file content, including git operations, file synchronization, and backup.
-
IDE Service: Manages the IDE instances (VS Code, JetBrains) that run in workspaces.
-
Dashboard: Web UI for managing workspaces, projects, and user settings.
-
Auth Service: Handles authentication and authorization across the platform.
-
Proxy: Routes traffic to the appropriate services and workspaces.
-
Registry Facade: Provides efficient access to container images.
-
Blobserve: Serves static content from container images.
-
Supervisor: Runs inside each workspace, managing the workspace's internal services.
-
Public API: Provides programmatic access to Gitpod functionality.
Gitpod is built as a collection of loosely coupled services, each with a specific responsibility. This enables independent scaling, deployment, and maintenance of components.
Kubernetes is used to manage the deployment, scaling, and operation of application containers across clusters of hosts.
Components communicate through events for asynchronous operations, improving scalability and resilience.
A central API gateway routes requests to appropriate services, handling cross-cutting concerns like authentication.
Services implement circuit breakers to prevent cascading failures when downstream services are unavailable.
The Supervisor component runs alongside workspace applications as a sidecar, providing common functionality.
Workspaces are treated as immutable, with changes to configuration resulting in new environments rather than modifications to existing ones.
- User requests a workspace through the dashboard or Git integration
- Auth service validates the request
- Workspace Manager creates the workspace specification
- Image Builder ensures the required image is available
- Workspace Manager instructs Kubernetes to create the workspace pod
- Workspace Daemon initializes the workspace environment
- Supervisor starts within the workspace
- IDE Service connects the IDE to the workspace
- Proxy routes user traffic to the workspace
- User Code: Managed by Content Service, synchronized between workspace and git repositories
- Configuration: Stored in database, applied by Workspace Manager during workspace creation
- Build Artifacts: Cached by Image Builder for reuse in future workspaces
- User Data: Stored in database, accessed through Dashboard and API
-
Kubernetes-Based: Leveraging Kubernetes for container orchestration provides scalability and standardized infrastructure management.
-
Multi-IDE Support: Supporting multiple IDEs (VS Code, JetBrains) increases flexibility for users with different preferences.
-
Prebuild System: Prebuilding environments before they're needed significantly reduces startup times.
-
Workspace Pods: Each workspace runs in its own Kubernetes pod, providing isolation and resource management.
-
TypeScript and Go: Core services are implemented in TypeScript (user-facing) and Go (system-level), balancing developer productivity and performance.
-
gRPC Communication: Internal services communicate using gRPC for efficient, typed communication.
-
Leeway Build System: Custom build system for managing the complex dependencies between components.