Skip to content

Commit 6f20f45

Browse files
committed
objstore : implement Baidu BOS
Signed-off-by: yahaa <1477765176@qq.com>
1 parent aa148f8 commit 6f20f45

File tree

12 files changed

+465
-7
lines changed

12 files changed

+465
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- run:
3636
name: "Run unit tests."
3737
environment:
38-
THANOS_TEST_OBJSTORE_SKIP: AZURE,COS,ALIYUNOSS
38+
THANOS_TEST_OBJSTORE_SKIP: AZURE,COS,ALIYUNOSS,BOS
3939
# Variables for Swift testing.
4040
OS_AUTH_URL: http://127.0.0.1:5000/v2.0
4141
OS_PASSWORD: s3cr3t

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
1313
### Added
1414
- [#4453](https://github.com/thanos-io/thanos/pull/4453) Tools: Add flag `--selector.relabel-config-file` / `--selector.relabel-config` / `--max-time` / `--min-time` to filter served blocks.
1515
- [#4482](https://github.com/thanos-io/thanos/pull/4482) COS: Add http_config for cos object store client.
16+
- [#4506](https://github.com/thanos-io/thanos/pull/4506) `Baidu BOS` object storage, see [documents](docs/storage.md#baidu-bos) for further information.
1617

1718
### Fixed
1819

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ test: export THANOS_TEST_PROMETHEUS_PATHS= $(PROMETHEUS_ARRAY)
218218
test: export THANOS_TEST_ALERTMANAGER_PATH= $(ALERTMANAGER)
219219
test: check-git install-deps
220220
@echo ">> install thanos GOOPTS=${GOOPTS}"
221-
@echo ">> running unit tests (without /test/e2e). Do export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS if you want to skip e2e tests against all real store buckets. Current value: ${THANOS_TEST_OBJSTORE_SKIP}"
221+
@echo ">> running unit tests (without /test/e2e). Do export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS,BOS if you want to skip e2e tests against all real store buckets. Current value: ${THANOS_TEST_OBJSTORE_SKIP}"
222222
@go test $(shell go list ./... | grep -v /vendor/ | grep -v /test/e2e);
223223

224224
.PHONY: test-local
225225
test-local: ## Runs test excluding tests for ALL object storage integrations.
226-
test-local: export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS
226+
test-local: export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS,BOS
227227
test-local:
228228
$(MAKE) test
229229

@@ -241,7 +241,7 @@ test-e2e: docker
241241

242242
.PHONY: test-e2e-local
243243
test-e2e-local: ## Runs all thanos e2e tests locally.
244-
test-e2e-local: export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS
244+
test-e2e-local: export THANOS_TEST_OBJSTORE_SKIP=GCS,S3,AZURE,SWIFT,COS,ALIYUNOSS,BOS
245245
test-e2e-local:
246246
$(MAKE) test-e2e
247247

docs/storage.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,23 @@ config:
418418

419419
Use --objstore.config-file to reference to this configuration file.
420420

421+
#### Baidu BOS
422+
423+
In order to use Baidu BOS object storage, you should apply a Baidu Account to create an object storage bucket at first. Note that detailed from Baidu Cloud Documents:[https://cloud.baidu.com/doc/BOS/index.html](https://cloud.baidu.com/doc/BOS/index.html) for more detail.
424+
425+
To use Baidu BOS object storage, please specify following yaml configuration file in `objstore.config*` flag.
426+
427+
```yaml mdox-exec="go run scripts/cfggen/main.go --name=bos.Config"
428+
type: BOS
429+
config:
430+
bucket: ""
431+
endpoint: ""
432+
access_key: ""
433+
secret_key: ""
434+
```
435+
436+
Use --objstore.config-file to reference to this configuration file.
437+
421438
#### Filesystem
422439

423440
This storage type is used when user wants to store and access the bucket in the local filesystem. We treat filesystem the same way we would treat object storage, so all optimization for remote bucket applies even though, we might have the files locally.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/NYTimes/gziphandler v1.1.1
1010
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15
1111
github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible
12+
github.com/baidubce/bce-sdk-go v0.9.81
1213
github.com/blang/semver/v4 v4.0.0
1314
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
1415
github.com/cespare/xxhash v1.1.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ github.com/aws/aws-sdk-go v1.38.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zK
182182
github.com/aws/aws-sdk-go v1.38.35 h1:7AlAO0FC+8nFjxiGKEmq0QLpiA8/XFr6eIxgRTwkdTg=
183183
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
184184
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
185+
github.com/baidubce/bce-sdk-go v0.9.81 h1:n8KfThLG9fvGv3A+RtTt/jKhg/FPPRpo+iNnS2r+iPI=
186+
github.com/baidubce/bce-sdk-go v0.9.81/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg=
185187
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
186188
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
187189
github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg=

0 commit comments

Comments
 (0)