Skip to content

Add Google Cloud Storage (GCS) backend support#13

Merged
richardartoul merged 2 commits intorichardartoul:mainfrom
aleclerc-cio:add-gcs-backend
Mar 13, 2026
Merged

Add Google Cloud Storage (GCS) backend support#13
richardartoul merged 2 commits intorichardartoul:mainfrom
aleclerc-cio:add-gcs-backend

Conversation

@aleclerc-cio
Copy link
Contributor

Summary

  • Adds a new gcs backend type powered by the Google Cloud Storage Go SDK, implementing Get, Put, Close, and Clear operations with full parity to the existing S3 backend
  • Uses storage.WithJSONReads() for GCS Anywhere Cache compatibility, enabling single-digit-ms zonal read latency comparable to S3 Express One Zone
  • Wires GCS flags (-gcs-bucket, -gcs-prefix) and GOBUILDCACHE_GCS_BUCKET / GOBUILDCACHE_GCS_PREFIX environment variables through all commands (server, clear, clear-local, clear-remote)
  • Includes comprehensive README documentation: quick-start for GCS, authentication methods (service account, metadata service, gcloud CLI), Anywhere Cache setup guide, GCS lifecycle policy, credentials permissions, and FAQ additions
  • Adds a GitHub Actions example for GCS (examples/github_actions_gcs.yml) and integration tests (integrationtests/integration_gcs_test.go)

Test plan

  • Verify gobuildcache --backend=gcs --gcs-bucket=<bucket> works end-to-end against a real GCS bucket
  • Verify gobuildcache clear-remote --backend=gcs --gcs-bucket=<bucket> clears objects
  • Verify environment variable configuration (GOBUILDCACHE_GCS_BUCKET, GOBUILDCACHE_GCS_PREFIX) works
  • Run integration tests: go test ./integrationtests/ -run TestGCS -tags=integration
  • Confirm existing S3 and disk backends are unaffected

- Implement GCS backend with full Backend interface support
- Add GCS configuration flags and environment variables
- Include integration tests for GCS backend
- Document GCS usage, authentication, and Anywhere Cache setup
- Update README with GCS performance guidance and best practices

GCS backend provides a GCP-native alternative to S3, with optional
Anywhere Cache support for improved read performance.
Made-with: Cursor
Copy link
Owner

@richardartoul richardartoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@richardartoul richardartoul merged commit 964f99b into richardartoul:main Mar 13, 2026
1 check failed
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