Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OCI Object Storage Bucket support #15

Merged

Conversation

aarontams
Copy link
Contributor

@aarontams aarontams commented Jul 17, 2022

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Add Oracle Cloud Infrastructure (OCI) Object Storage Bucket support

OCI Object Storage supports three different providers, default, instance principle, and raw. A lot of OCI users like to use Instance principle to security. It is very important to support instance principle for the OCI users. S3 doesn't support OCI instance principle.

Support multiple prometheus instances with a single bucket

By default, like other clients, this new Thanos OCI Object Storage client will storage the data from a single prometheus instance to the top directory of the bucket. This means each bucket can only store one prometheus instance data.

In OCI, a lot of users like to put different type of data in a single bucket.
To support multiple prometheus instances with a single bucket, a new object_base_path option is introduced in this OCI Object Storage client. If defined, the value will be used as the prefix of the prometheus data in OCI bucket.

For example, if you want to use the same bucket for 2 prometheus instances, you can define object_base_path as /path/for/prometheus1 for the first prometheus instance, and /path/for/prometheus2 for the second prometheus instance.

Three tests are included here to demo how the object_base_path work.

Verification

From original PR: Running similar OCI client against 3 prometheus instances for over 50 days without any issue.
For each prometheus instance

  • average 4.5GB (2GB in chunks and 2.5G index) per 2-hour prometheus block
  • over 50GB per day
  • over 2TB prometheus data uploaded to OCI Object Storage

oci storage 1

oci storage 2

Testing from this PR

export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS,BOS
// export OCI_* required variables
$ make test
go test ./...
ok  	github.com/thanos-io/objstore	(cached)
?   	github.com/thanos-io/objstore/client	[no test files]
ok  	github.com/thanos-io/objstore/clientutil	(cached)
?   	github.com/thanos-io/objstore/errutil	[no test files]
ok  	github.com/thanos-io/objstore/exthttp	(cached)
ok  	github.com/thanos-io/objstore/objtesting	123.749s
ok  	github.com/thanos-io/objstore/providers/azure	(cached)
?   	github.com/thanos-io/objstore/providers/bos	[no test files]
ok  	github.com/thanos-io/objstore/providers/cos	(cached)
ok  	github.com/thanos-io/objstore/providers/filesystem	(cached)
ok  	github.com/thanos-io/objstore/providers/gcs	(cached)
?   	github.com/thanos-io/objstore/providers/oci	[no test files]
?   	github.com/thanos-io/objstore/providers/oss	[no test files]
ok  	github.com/thanos-io/objstore/providers/s3	(cached)
ok  	github.com/thanos-io/objstore/providers/swift	(cached)
?   	github.com/thanos-io/objstore/scripts/cfggen	[no test files]
?   	github.com/thanos-io/objstore/test/e2e/e2ethanos	[no test files]
?   	github.com/thanos-io/objstore/tracing	[no test files]

See the test steps in README.md under OCI section.

image

Original PR: thanos-io/thanos#4661

@aarontams
Copy link
Contributor Author

aarontams commented Jul 17, 2022

^^^ @kakkoyun @yeya24 @GiedriusS @wiardvanrij @Djelibeybi

Copy link
Member

@wiardvanrij wiardvanrij left a comment

Choose a reason for hiding this comment

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

lgtm, just add a changelog and we should be good to go.

@aarontams aarontams force-pushed the add-oci-object-storage-bucket-support branch from 9192332 to bddbe9a Compare July 18, 2022 02:21
@aarontams
Copy link
Contributor Author

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the hard work and patience 🤗

@kakkoyun kakkoyun enabled auto-merge (squash) July 18, 2022 07:11
@kakkoyun kakkoyun merged commit 045c8d7 into thanos-io:main Jul 18, 2022
@GiedriusS
Copy link
Member

🎉

@aarontams
Copy link
Contributor Author

OMG. I can't believe it.
Thanks everyone !!!

Go Thanos !!!

@wiardvanrij
Copy link
Member

Yea thanks @aarontams :)

@wiardvanrij
Copy link
Member

@kakkoyun
Copy link
Member

We haven't actually discussed the cadence of the updates of objstore among Thanos maintainers (assuming at the very least before each major release), however, if you want to immediately have this on Thanos main branch, @aarontams you should send another PR to Thanos main repo to bump up the dependency version.

phillebaba pushed a commit to phillebaba/objstore that referenced this pull request Jul 27, 2022
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.

4 participants