Skip to content

Conversation

@thespags
Copy link

From @avdasCrusoe Description:

This PR adds support for using Google Cloud Storage as a remote cache backend alongside the existing S3 support.

Key Changes

New Components

  • gcsutil package: GCS client wrapper for operations
  • GCSCache implementation: Build cache backed by GCS
  • Storage abstraction layer: CacheClient interface supporting both S3 and GCS
  • Adapter pattern: S3Adapter and GCSAdapter implementing unified interface

Command-Line Interface

  • --storage - Choose backend: s3 or gcs
  • --gcs-bucket - GCS bucket name
  • --gcs-key-file - Path to GCS service account key file
  • --gcs-concurrency - Maximum concurrency for GCS uploads

Code Organization

  • Renamed lib/gobuild/gobuild.golib/gobuild/s3.go for clarity
  • Refactored modproxy and revproxy to use storage abstraction

Implementation Details

The GCS implementation follows the same patterns as S3:

  • Concurrent uploads with configurable concurrency
  • ETag-based duplicate detection to avoid redundant uploads
  • Minimum upload size threshold support
  • Comprehensive metrics for cache hits/misses/uploads

Backward Compatibility

  • All existing S3 functionality preserved
  • Existing S3 flags unchanged (--s3-bucket, --s3-region, etc.)
  • No breaking changes to existing deployments

Testing

  • Builds successfully with both S3 and GCS backends
  • Tested with real GCS bucket and workloads
  • Metrics reporting working correctly

avdasCrusoe and others added 2 commits January 14, 2026 16:16
This commit adds support for using Google Cloud Storage as a remote
cache backend alongside the existing S3 support.

Key changes:
- Add gcsutil package for GCS operations
- Add GCSCache implementation for build cache
- Refactor storage backend to support both S3 and GCS
- Add storage abstraction layer (CacheClient interface)
- Add command-line flags for GCS configuration:
  --storage (s3|gcs)
  --gcs-bucket
  --gcs-key-file
  --gcs-concurrency
- Rename lib/gobuild/gobuild.go to lib/gobuild/s3.go for clarity

The implementation follows the same patterns as S3 support:
- Concurrent uploads with configurable concurrency
- ETag-based duplicate detection
- Minimum upload size threshold
- Metrics for cache hits/misses/uploads
  Add GCS (Google Cloud Storage) backend support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants