memory-bank/components/registry-facade-api.md
The Registry Facade API defines the gRPC interfaces and data structures for the Registry Facade service, which provides a container registry interface that dynamically assembles workspace images on-demand. This API enables the specification and retrieval of composite container images that combine base images, IDE layers, and workspace content.
This API provides a standardized interface for:
The Registry Facade API is implemented as a set of gRPC services and message definitions in Protocol Buffer files. These definitions are used to generate client and server code in Go for use by the registry facade and other components in the system.
Provides methods for retrieving image specifications:
GetImageSpec: Retrieves the image specification for a particular ID (typically a workspace instance ID)Defines the composition of a workspace image:
base_ref: Reference to the base image in another registryide_ref: Reference to the IDE image to usecontent_layer: Layers that provide the workspace's contentsupervisor_ref: Reference to the supervisor image to useide_layer_ref: Layers needed by the IDERepresents a layer that provides workspace content, which can be one of:
RemoteContentLayer: Content that can be downloaded from a remote URLDirectContentLayer: Content provided directly as bytesDefines a layer that can be downloaded from a remote URL:
Contains the bytes of an uncompressed tar file that is served directly as a layer.
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 image specification options without breaking existing clients.
The Registry Facade API uses Protocol Buffers and gRPC for defining interfaces. When changes are made to the .proto files, the corresponding code in Go needs to be regenerated.
To regenerate the code:
Navigate to the registry-facade-api directory:
cd components/registry-facade-api
Run the generate script:
./generate.sh
This script performs the following actions:
protoc-gen-go and protoc-gen-go-grpcThe Registry Facade API is relatively simple compared to other APIs, focusing primarily on defining the structure of image specifications rather than complex service interactions.
After regenerating the code, you may need to rebuild components that depend on the Registry Facade API. This typically involves:
For Go components:
cd <component-directory>
go build ./...
Using Leeway (for CI/CD):
leeway build -D components/<component-name>:app
The Registry Facade API is primarily used by the registry-facade component, which provides a container registry interface that dynamically assembles workspace images on-demand.