memory-bank/components/ws-manager-bridge-api.md
The Workspace Manager Bridge API defines the gRPC interfaces for the Workspace Manager Bridge service, which enables dynamic management of workspace clusters within the Gitpod platform. This API allows for the registration, updating, and deregistration of workspace clusters, facilitating multi-cluster deployments and cluster lifecycle management.
This API provides a standardized interface for:
The Workspace Manager Bridge API is implemented as a gRPC service defined in Protocol Buffer files. These definitions are used to generate client and server code in Go and TypeScript for use by the workspace manager bridge and other components in the system.
Provides methods for managing workspace clusters:
Register: Registers a new workspace clusterUpdate: Modifies properties of an already registered workspace clusterDeregister: Removes a workspace cluster from available clustersList: Returns the currently registered workspace clustersRepresents the current status of a workspace cluster:
Contains TLS configuration for secure communication with a cluster:
Provides hints for cluster registration:
Defines constraints for workspace admission to a cluster:
The API uses Protocol Buffers version 3 (proto3) syntax, which provides forward and backward compatibility features. The service is designed to allow for the addition of new cluster management features without breaking existing clients.
The Workspace Manager Bridge API uses Protocol Buffers and gRPC for defining interfaces. When changes are made to the .proto files, the corresponding code in Go and TypeScript needs to be regenerated.
To regenerate the code:
Navigate to the ws-manager-bridge-api directory:
cd components/ws-manager-bridge-api
Run the generate script:
./generate.sh
This script performs the following actions:
buf.gen.yamlThe buf.gen.yaml file configures the code generation:
After regenerating the code, you may need to rebuild components that depend on the Workspace Manager Bridge API. This typically involves:
For Go components:
cd <component-directory>
go build ./...
For TypeScript components:
cd <component-directory>
yarn install
yarn build
Using Leeway (for CI/CD):
leeway build -D components/<component-name>:app
The Workspace Manager Bridge API is primarily used by the ws-manager-bridge component, which bridges between workspace managers and the rest of the platform. It plays a critical role in multi-cluster deployments by enabling dynamic management of workspace clusters, facilitating load balancing, and providing a unified interface for cluster operations.