Blobserve is a service that provides static assets from OCI (Open Container Initiative) images. It serves as a specialized content delivery mechanism for container images, allowing efficient access to static content within those images.
The primary purpose of Blobserve is to:
- Extract and serve static content from container images
- Provide efficient access to image layers
- Handle authentication with container registries
- Serve HTTP requests for blob content
Blobserve operates as an HTTP server that:
- Connects to container registries
- Retrieves image content
- Extracts and caches static assets
- Serves these assets via HTTP
main.go: Entry point that calls the Execute function from the cmd packagecmd/root.go: Defines the root command and basic service configurationcmd/run.go: Implements the main server functionalitypkg/blobserve: Contains the core implementation of the blob serving functionality
components/common-go:lib: Common Go utilities used across Gitpodcomponents/registry-facade-api/go:lib: API definitions for registry facadecomponents/registry-facade:lib: Library for interacting with container registries
containerd/containerd: For container image handlingdocker/cli: For Docker configuration handlingprometheus: For metrics and monitoringspf13/cobra: For command-line interface
Blobserve is configured via a JSON configuration file that includes:
- Authentication configuration for container registries
- HTTP server settings
- Repository mappings
- Caching parameters
- Monitoring endpoints
Blobserve integrates with:
- Container Registries: Connects to registries like Docker Hub, ECR, GCR
- Prometheus: Exposes metrics for monitoring
- Health Checking: Provides readiness probes for Kubernetes
- Requires proper IAM permissions when using cloud-based container registries (e.g., AWS ECR)
- Handles authentication credentials for private registries
- Monitors file changes for authentication configuration updates
Blobserve is typically used to:
- Serve static content from workspace images
- Provide efficient access to container image layers
- Cache frequently accessed content for performance
Blobserve exposes several Prometheus metrics:
http_client_requests_total: Counter of outgoing HTTP requestshttp_client_requests_duration_seconds: Histogram of outgoing HTTP request durationshttp_server_requests_total: Counter of incoming HTTP requestshttp_server_requests_duration_seconds: Histogram of incoming HTTP request durations
- Requires specific IAM permissions when using cloud-based container registries
- Authentication configuration must be properly set up for private registries
- Registry Facade: Works closely with Blobserve to provide access to container images
- Workspace Manager: May use Blobserve to access workspace image content