Add GCS storage backend with lighter dependencies#179
Open
andrew wants to merge 2 commits into
Open
Conversation
Register gocloud.dev/blob/gcsblob so gs:// URLs are accepted as a storage backend. Authentication uses Application Default Credentials, which makes GKE Workload Identity work out of the box; signed URLs (direct_serve) fall back to the IAM Credentials signBlob API when no private key is available. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative implementation for #167.
This keeps the GCS storage feature and docs from #167, but avoids the blank import of
gocloud.dev/blob/gcsblob. Instead it adds a narrowstorage.GCSbackend implemented against the Cloud Storage JSON API using ADC viagolang.org/x/oauth2/google.Dependency graph comparison:
The
gocloud.dev/blob/gcsblobimplementation in #167 adds 220 linked packages over base. That includescloud.google.com/go/storage,cloud.google.com/go/iam,cloud.google.com/go/monitoring, Google API clients, OpenTelemetry GCP instrumentation, grpc xDS packages, Envoy protobuf packages, SPIFFE, and related signing/auth packages. This PR avoids those extra storage/monitoring/xDS/Envoy paths.Binary size comparison using:
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /tmp/proxy ./cmd/proxy35,324,066bytesgcsblob52,822,178bytes35,651,746bytesThis version is
+327,680bytes over base, about+0.93%, and saves17,170,432bytes versus the current #167 implementation.The lighter backend supports:
gs://bucketstorage URLssignBlobREST APISTORAGE_EMULATOR_HOSTfor local/fake GCS testsValidation: