Skip to content

Commit 64fb9ad

Browse files
Adds object storage client for Swift OpenStack (#2440)
* Implement swift storage client. Signed-off-by: Cyril Tovena <[email protected]> Signed-off-by: Marco Pracucci <[email protected]> * Pass nil registrerer. Signed-off-by: Peter Štibraný <[email protected]> * Make lint happy. Signed-off-by: Peter Štibraný <[email protected]> Co-authored-by: Peter Štibraný <[email protected]>
1 parent 397bfca commit 64fb9ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+7497
-0
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ jobs:
155155
docker pull shopify/bigtable-emulator:0.1.0
156156
docker pull rinscy/cassandra:3.11.0
157157
docker pull memcached:1.6.1
158+
docker pull bouncestorage/swift-aio:55ba4331
158159
- run:
159160
name: Integration Tests
160161
command: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* [CHANGE] Slow query log has a different output now. Previously used `url` field has been replaced with `host` and `path`, and query parameters are logged as individual log fields with `qs_` prefix. #2520
2323
* [CHANGE] Experimental WAL: WAL and checkpoint compression is now disabled. #2436
2424
* [FEATURE] Ruler: The `-ruler.evaluation-delay` flag was added to allow users to configure a default evaluation delay for all rules in cortex. The default value is 0 which is the current behavior. #2423
25+
* [FEATURE] Experimental: Added a new object storage client for OpenStack Swift. #2440
2526
* [ENHANCEMENT] Experimental TSDB: sample ingestion errors are now reported via existing `cortex_discarded_samples_total` metric. #2370
2627
* [ENHANCEMENT] Failures on samples at distributors and ingesters return the first validation error as opposed to the last. #2383
2728
* [ENHANCEMENT] Experimental TSDB: Added `cortex_querier_blocks_meta_synced`, which reflects current state of synced blocks over all tenants. #2392

docs/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The blocks storage doesn't require a dedicated storage backend for the index. Th
6262
* [Google Cloud Storage](https://cloud.google.com/storage/)
6363
* [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/)
6464
* [Local Filesystem](https://thanos.io/storage.md/#filesystem) (single node only)
65+
* [OpenStack Swift](https://wiki.openstack.org/wiki/Swift) (experimental)
6566

6667
For more information, please check out the [Blocks storage](operations/blocks-storage.md) documentation.
6768

docs/configuration/config-file-reference.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,66 @@ storage:
819819
# CLI flag: -ruler.storage.s3.force-path-style
820820
[s3forcepathstyle: <boolean> | default = false]
821821

822+
swift:
823+
# Openstack authentication URL.
824+
# CLI flag: -ruler.storage.swift.auth-url
825+
[auth_url: <string> | default = ""]
826+
827+
# Openstack username for the api.
828+
# CLI flag: -ruler.storage.swift.username
829+
[username: <string> | default = ""]
830+
831+
# Openstack user's domain name.
832+
# CLI flag: -ruler.storage.swift.user-domain-name
833+
[user_domain_name: <string> | default = ""]
834+
835+
# Openstack user's domain id.
836+
# CLI flag: -ruler.storage.swift.user-domain-id
837+
[user_domain_id: <string> | default = ""]
838+
839+
# Openstack userid for the api.
840+
# CLI flag: -ruler.storage.swift.user-id
841+
[user_id: <string> | default = ""]
842+
843+
# Openstack api key.
844+
# CLI flag: -ruler.storage.swift.password
845+
[password: <string> | default = ""]
846+
847+
# Openstack user's domain id.
848+
# CLI flag: -ruler.storage.swift.domain-id
849+
[domain_id: <string> | default = ""]
850+
851+
# Openstack user's domain name.
852+
# CLI flag: -ruler.storage.swift.domain-name
853+
[domain_name: <string> | default = ""]
854+
855+
# Openstack project id (v2,v3 auth only).
856+
# CLI flag: -ruler.storage.swift.project-id
857+
[project_id: <string> | default = ""]
858+
859+
# Openstack project name (v2,v3 auth only).
860+
# CLI flag: -ruler.storage.swift.project-name
861+
[project_name: <string> | default = ""]
862+
863+
# Id of the project's domain (v3 auth only), only needed if it differs the
864+
# from user domain.
865+
# CLI flag: -ruler.storage.swift.project-domain-id
866+
[project_domain_id: <string> | default = ""]
867+
868+
# Name of the project's domain (v3 auth only), only needed if it differs
869+
# from the user domain.
870+
# CLI flag: -ruler.storage.swift.project-domain-name
871+
[project_domain_name: <string> | default = ""]
872+
873+
# Openstack Region to use eg LON, ORD - default is use first region (v2,v3
874+
# auth only)
875+
# CLI flag: -ruler.storage.swift.region-name
876+
[region_name: <string> | default = ""]
877+
878+
# Name of the Swift container to put chunks in.
879+
# CLI flag: -ruler.storage.swift.container-name
880+
[container_name: <string> | default = "cortex"]
881+
822882
# file path to store temporary rule files for the prometheus rule managers
823883
# CLI flag: -ruler.rule-path
824884
[rule_path: <string> | default = "/rules"]
@@ -1601,6 +1661,66 @@ filesystem:
16011661
# CLI flag: -local.chunk-directory
16021662
[directory: <string> | default = ""]
16031663

1664+
swift:
1665+
# Openstack authentication URL.
1666+
# CLI flag: -swift.auth-url
1667+
[auth_url: <string> | default = ""]
1668+
1669+
# Openstack username for the api.
1670+
# CLI flag: -swift.username
1671+
[username: <string> | default = ""]
1672+
1673+
# Openstack user's domain name.
1674+
# CLI flag: -swift.user-domain-name
1675+
[user_domain_name: <string> | default = ""]
1676+
1677+
# Openstack user's domain id.
1678+
# CLI flag: -swift.user-domain-id
1679+
[user_domain_id: <string> | default = ""]
1680+
1681+
# Openstack userid for the api.
1682+
# CLI flag: -swift.user-id
1683+
[user_id: <string> | default = ""]
1684+
1685+
# Openstack api key.
1686+
# CLI flag: -swift.password
1687+
[password: <string> | default = ""]
1688+
1689+
# Openstack user's domain id.
1690+
# CLI flag: -swift.domain-id
1691+
[domain_id: <string> | default = ""]
1692+
1693+
# Openstack user's domain name.
1694+
# CLI flag: -swift.domain-name
1695+
[domain_name: <string> | default = ""]
1696+
1697+
# Openstack project id (v2,v3 auth only).
1698+
# CLI flag: -swift.project-id
1699+
[project_id: <string> | default = ""]
1700+
1701+
# Openstack project name (v2,v3 auth only).
1702+
# CLI flag: -swift.project-name
1703+
[project_name: <string> | default = ""]
1704+
1705+
# Id of the project's domain (v3 auth only), only needed if it differs the
1706+
# from user domain.
1707+
# CLI flag: -swift.project-domain-id
1708+
[project_domain_id: <string> | default = ""]
1709+
1710+
# Name of the project's domain (v3 auth only), only needed if it differs from
1711+
# the user domain.
1712+
# CLI flag: -swift.project-domain-name
1713+
[project_domain_name: <string> | default = ""]
1714+
1715+
# Openstack Region to use eg LON, ORD - default is use first region (v2,v3
1716+
# auth only)
1717+
# CLI flag: -swift.region-name
1718+
[region_name: <string> | default = ""]
1719+
1720+
# Name of the Swift container to put chunks in.
1721+
# CLI flag: -swift.container-name
1722+
[container_name: <string> | default = "cortex"]
1723+
16041724
# Cache validity for active index entries. Should be no higher than
16051725
# -ingester.max-chunk-idle.
16061726
# CLI flag: -store.index-cache-validity

docs/configuration/v1-guarantees.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ Currently experimental features are:
4545
- Memcached client DNS-based service discovery.
4646
- Delete series APIs.
4747
- In-memory (FIFO) and Redis cache.
48+
- Openstack Swift storage.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ require (
3434
github.com/json-iterator/go v1.1.9
3535
github.com/lib/pq v1.3.0
3636
github.com/mitchellh/go-wordwrap v1.0.0
37+
github.com/ncw/swift v1.0.50
3738
github.com/oklog/ulid v1.3.1
3839
github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02
3940
github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+
600600
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
601601
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
602602
github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA=
603+
github.com/ncw/swift v1.0.50 h1:E01b5bVIssNhx2KnzAjMWEXkKrb8ytTqCDWY7lqmWjA=
604+
github.com/ncw/swift v1.0.50/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
603605
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
604606
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
605607
github.com/oklog/ulid v0.0.0-20170117200651-66bb6560562f/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=

0 commit comments

Comments
 (0)