Skip to content

Add Alibaba Cloud OSS storage backend - #7907

Open
yuminn-k wants to merge 2 commits into
cortexproject:masterfrom
yuminn-k:oss-storage-backend
Open

yuminn-k wants to merge 2 commits into
cortexproject:masterfrom
yuminn-k:oss-storage-backend

Conversation

@yuminn-k

@yuminn-k yuminn-k commented Oct 31, 2026 •

Copy link
Copy Markdown

What this PR does:

Adds Alibaba Cloud OSS as a storage backend for blocks, ruler, and alertmanager. It wraps the OSS provider that Thanos objstore already ships (objstore/providers/oss). Select it with backend: oss and configure it with the -<prefix>.oss.* flags (endpoint, bucket, access-key-id, access-key-secret). The secret is stored as a flagext.Secret, the same way the other backends store theirs.

  • pkg/storage/bucket/oss/config.go: config struct and flags
  • pkg/storage/bucket/oss/bucket_client.go: thin wrapper around oss.NewBucketWithConfig. It passes the hedged round tripper through.
  • pkg/storage/bucket/client.go: backend registration (constant, SupportedBackends, config field, flag registration, NewClient case)
  • Docs and the JSON schema were regenerated with the doc generator (make doc). v1-guarantees.md lists OSS as experimental.

The OCI backend (#7718) set the structure, and this PR follows it. Ruler, alertmanager, and blocks storage all validate against bucket.SupportedBackends, so OSS works for all three without extra wiring. No vendoring was needed: github.com/aliyun/aliyun-oss-go-sdk and objstore/providers/oss are already in vendor/, and go mod tidy && go mod vendor produce no diff.

Testing:

  • Unit tests for YAML config parsing, plus client construction (missing endpoint/bucket error, and a valid config that needs no network).
  • go build ./..., go test ./pkg/storage/bucket/..., and golangci-lint run ./pkg/storage/bucket/... (v2.13.1) all pass.
  • I have not tested against a real Alibaba Cloud OSS bucket because I don't have an account. Data-path behavior (upload, list, get, delete) comes from the upstream Thanos provider unchanged.

Which issue(s) this PR fixes:
Fixes #7594

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

AI disclosure: most of this change was written with AI assistance (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

Add Alibaba Cloud OSS as a storage backend for blocks, ruler, and
alertmanager storage, wrapping the existing Thanos objstore OSS provider.
Select it with `backend: oss` and configure it via `-<prefix>.oss.*`
flags.

Fixes cortexproject#7594

Assisted-by: Claude Opus 5.5
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
@yuminn-k
yuminn-k requested a review from a team as a code owner October 31, 2026 02:44
@yuminn-k
yuminn-k requested a review from friedrichg October 31, 2026 02:44
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
Assisted-by: Claude Opus 5.5

@alanprot alanprot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

THanks.. LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Alibaba Cloud OSS storage backend

2 participants