-
Notifications
You must be signed in to change notification settings - Fork 527
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
Remove dependencies on thanos-io/thanos #3288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Massive work! LGTM! I just have a couple of comments I would be glad you to look at before merging:
- Could you also doing the package import replace in the new
tools/copyblocks/main.go
? - Could you update the
lint
Makefile target, removing all Thanosfaillint
rules and adding a single rule like `faillint -paths "github.com/thanos-io/thanos/pkg" ./pkg/... ./cmd/... ./tools/... ./integration/...
I also want to take a look at the tracing thing, cause looks like an issue we already have in |
Part of breaking Mimir dependency on Thanos
Part of breaking Mimir dependency on Thanos
Part of breaking Mimir dependency on Thanos. Needs a couple of extra metadata consts.
Part of breaking Mimir dependency on Thanos
Part of breaking Mimir dependency on Thanos
Part of breaking Mimir dependency on Thanos
bytes and dns packages are copied from Thanos; also the `DeleteAll` function in package runutil. Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos
Part of breaking Mimir dependency on Thanos
Add a `New()` function in `gate` package to simplify calling. Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Note there is no way to set up the tracing context now, hence tracing from the objstore package probably doesn't work. Part of breaking Mimir dependency on thanos-io/thanos
Part of breaking Mimir dependency on thanos-io/thanos.
Part of breaking Mimir dependency on Thanos.
Comments say never to call it.
Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Part of breaking Mimir dependency on Thanos.
Missed from original port. Part of breaking Mimir dependency on Thanos.
Note the previous rule had a typo. Part of breaking Mimir dependency on Thanos.
Prometheus client_go upstream has had this behaviour built in for 2 years. Part of breaking Mimir dependency on Thanos.
Should be less confusing in future. Part of breaking Mimir dependency on Thanos.
For consistency, and to reduce dependencies.
Believe I have done everything you suggested. |
Missed from earlier import. Needs a couple of changes elsewhere. Some tests removed, either because they test code that was not brought into Mimir, or because they add dependencies on multiple cloud SDKs.
For consistency, and to reduce dependencies.
Instead of the PR branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review, LGTM! 🚀
* Fork Thanos metadata package Part of breaking Mimir dependency on Thanos * Use Mimir copy of metadata package Part of breaking Mimir dependency on Thanos * Fix typo mimit->mimir * Fork Thanos block package Part of breaking Mimir dependency on Thanos. Needs a couple of extra metadata consts. * Use Mimir copy of block package Part of breaking Mimir dependency on Thanos * Remove unused code from block package * Fork Thanos extprom package Part of breaking Mimir dependency on Thanos * Use Mimir copy of extprom package Part of breaking Mimir dependency on Thanos * Import dskit with bytes and dns packages bytes and dns packages are copied from Thanos; also the `DeleteAll` function in package runutil. Part of breaking Mimir dependency on Thanos. * Use dskit/runutil instead of thanos/pkg/runutil Part of breaking Mimir dependency on Thanos. * Use MultiError from dskit instead of Thanos Part of breaking Mimir dependency on Thanos. * Simplify test values in bucket e2e test * Fork Thanos cache package Part of breaking Mimir dependency on Thanos * Fork Thanos cacheutil package Part of breaking Mimir dependency on Thanos * Make cacheutil package use local packages Add a `New()` function in `gate` package to simplify calling. Part of breaking Mimir dependency on Thanos. * Use Mimir fork of cacheutil package Part of breaking Mimir dependency on Thanos. * Use thanos-io/objstore/tracing Note there is no way to set up the tracing context now, hence tracing from the objstore package probably doesn't work. Part of breaking Mimir dependency on thanos-io/thanos * Use Bytes type from dskit/flagext Part of breaking Mimir dependency on thanos-io/thanos. * Fork Thanos strutil package Part of breaking Mimir dependency on Thanos. * Add a test for util.MergeSlices * Stop calling strings.Compare Comments say never to call it. * Use Mimir version of MergeSlices Part of breaking Mimir dependency on Thanos. * Use dns package from dnskit instead of Thanos Part of breaking Mimir dependency on Thanos. * Remove unused Memcached AutoDiscovery Part of breaking Mimir dependency on Thanos. * Fork Thanos pool package Part of breaking Mimir dependency on Thanos. * Use Mimir copy of pool package Part of breaking Mimir dependency on Thanos. * Fork Thanos shipper package Did not include shipper_e2e_test.go, because it drags in dependencies on lots of new cloud providers. Part of breaking Mimir dependency on Thanos. * Use Mimir copy of shipper package Part of breaking Mimir dependency on Thanos. * go mod tidy, update vendor * Use Mimir copy of packages in copyblocks tool Missed from original port. Part of breaking Mimir dependency on Thanos. * Check that thanos-io/thanos is not used as import Note the previous rule had a typo. Part of breaking Mimir dependency on Thanos. * go mod tidy, update vendor * Update thanos-io/thanos for tracing fix * Re-add tracing for thanos-io/objstore * Remove unnecessary extprom.WrapRegistererWith Prometheus client_go upstream has had this behaviour built in for 2 years. Part of breaking Mimir dependency on Thanos. * Rename model.Bytes to flagext.Bytes Should be less confusing in future. Part of breaking Mimir dependency on Thanos. * Fix lint warnings from thanos code * Use testify instead of Thanos testutil For consistency, and to reduce dependencies. * Bring in tests for Thanos block package Missed from earlier import. Needs a couple of changes elsewhere. Some tests removed, either because they test code that was not brought into Mimir, or because they add dependencies on multiple cloud SDKs. * tsdb/block: use testify instead of Thanos testutil For consistency, and to reduce dependencies. * Update grafana/dskit to main branch Instead of the PR branch.
* Fork Thanos metadata package Part of breaking Mimir dependency on Thanos * Use Mimir copy of metadata package Part of breaking Mimir dependency on Thanos * Fix typo mimit->mimir * Fork Thanos block package Part of breaking Mimir dependency on Thanos. Needs a couple of extra metadata consts. * Use Mimir copy of block package Part of breaking Mimir dependency on Thanos * Remove unused code from block package * Fork Thanos extprom package Part of breaking Mimir dependency on Thanos * Use Mimir copy of extprom package Part of breaking Mimir dependency on Thanos * Import dskit with bytes and dns packages bytes and dns packages are copied from Thanos; also the `DeleteAll` function in package runutil. Part of breaking Mimir dependency on Thanos. * Use dskit/runutil instead of thanos/pkg/runutil Part of breaking Mimir dependency on Thanos. * Use MultiError from dskit instead of Thanos Part of breaking Mimir dependency on Thanos. * Simplify test values in bucket e2e test * Fork Thanos cache package Part of breaking Mimir dependency on Thanos * Fork Thanos cacheutil package Part of breaking Mimir dependency on Thanos * Make cacheutil package use local packages Add a `New()` function in `gate` package to simplify calling. Part of breaking Mimir dependency on Thanos. * Use Mimir fork of cacheutil package Part of breaking Mimir dependency on Thanos. * Use thanos-io/objstore/tracing Note there is no way to set up the tracing context now, hence tracing from the objstore package probably doesn't work. Part of breaking Mimir dependency on thanos-io/thanos * Use Bytes type from dskit/flagext Part of breaking Mimir dependency on thanos-io/thanos. * Fork Thanos strutil package Part of breaking Mimir dependency on Thanos. * Add a test for util.MergeSlices * Stop calling strings.Compare Comments say never to call it. * Use Mimir version of MergeSlices Part of breaking Mimir dependency on Thanos. * Use dns package from dnskit instead of Thanos Part of breaking Mimir dependency on Thanos. * Remove unused Memcached AutoDiscovery Part of breaking Mimir dependency on Thanos. * Fork Thanos pool package Part of breaking Mimir dependency on Thanos. * Use Mimir copy of pool package Part of breaking Mimir dependency on Thanos. * Fork Thanos shipper package Did not include shipper_e2e_test.go, because it drags in dependencies on lots of new cloud providers. Part of breaking Mimir dependency on Thanos. * Use Mimir copy of shipper package Part of breaking Mimir dependency on Thanos. * go mod tidy, update vendor * Use Mimir copy of packages in copyblocks tool Missed from original port. Part of breaking Mimir dependency on Thanos. * Check that thanos-io/thanos is not used as import Note the previous rule had a typo. Part of breaking Mimir dependency on Thanos. * go mod tidy, update vendor * Update thanos-io/thanos for tracing fix * Re-add tracing for thanos-io/objstore * Remove unnecessary extprom.WrapRegistererWith Prometheus client_go upstream has had this behaviour built in for 2 years. Part of breaking Mimir dependency on Thanos. * Rename model.Bytes to flagext.Bytes Should be less confusing in future. Part of breaking Mimir dependency on Thanos. * Fix lint warnings from thanos code * Use testify instead of Thanos testutil For consistency, and to reduce dependencies. * Bring in tests for Thanos block package Missed from earlier import. Needs a couple of changes elsewhere. Some tests removed, either because they test code that was not brought into Mimir, or because they add dependencies on multiple cloud SDKs. * tsdb/block: use testify instead of Thanos testutil For consistency, and to reduce dependencies. * Update grafana/dskit to main branch Instead of the PR branch.
…t PUT on s3-compatible Object Storage. The grafana#3288 introduce `thanos-io/objstore` instead of `thanos-io/thanos` and brings along `github.com/minio/minio-go/v7 v7.0.37`. This version contains a bug who breaks the Multipart PUT on s3-compatible Object Storage (like the one at OVHcloud, Scaleway and Cloudflare). The error can be seen in the log as such: ``` upload chunks: upload file /data/mimir/tsdb/[redacted].mimir-continuous-test-100.eu/01GMV0ZR7740VNFM63DVMTQ25W/chunks/000001 as 01GMV0ZR7740VNFM63DVMTQ25W/chunks/000001: upload s3 object: The XML you provided was not well-formed or did not validate against our published schema ``` Related issues: * thanos-io/thanos#5857 * minio/minio-go#1702 Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
…t PUT on s3-compatible Object Storage. (#3802) The #3288 introduce `thanos-io/objstore` instead of `thanos-io/thanos` and brings along `github.com/minio/minio-go/v7 v7.0.37`. This version contains a bug who breaks the Multipart PUT on s3-compatible Object Storage (like the one at OVHcloud, Scaleway and Cloudflare). The error can be seen in the log as such: ``` upload chunks: upload file /data/mimir/tsdb/[redacted].mimir-continuous-test-100.eu/01GMV0ZR7740VNFM63DVMTQ25W/chunks/000001 as 01GMV0ZR7740VNFM63DVMTQ25W/chunks/000001: upload s3 object: The XML you provided was not well-formed or did not validate against our published schema ``` Related issues: * thanos-io/thanos#5857 * minio/minio-go#1702 Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com> Signed-off-by: Wilfried Roset <wilfriedroset@users.noreply.github.com>
What this PR does
Remove all dependencies on upstream project thanos-io/thanos, either by forking the necessary code into Mimir or by adding to upstream project dskit.
This makes it easier to adopt changes, for instance from Prometheus, that otherwise require synchronisation, local forks of Thanos, etc.
The PR is split into a number of commits which go package by package, to make it easier to follow the changes.
Builds on #2682 and #3222; needs upstream change grafana/dskit#228.
Notes
setupThanosTracing
has been temporarily removed; as far as I can see the required hook is absent fromthanos-io/objstore
and have reported a bug there.shipper_e2e_test.go
and its associated test utils; this brought in large amounts of new dependencies viathanos/objstore
to use different cloud providers that Mimir does not currently support.Some packages already had some indirection in Mimir, and would benefit from further rationalisation:
cache
pool
Checklist
CHANGELOG.md
updated - not a user-visible change.