refactor(tvix/castore): introduce "cloud" feature flag

This controls whether tvix-castore has support for various cloud
backends or not.

Use this to control the set of feature flags for the object_store
backend, and only enable the aws, azure and gcp ones if it's set.
In the future this can be used to enable/disable other cloud backends
too.

Without feature flags, `object_store` already supports the `InMemory`
and `LocalFilesystem` backends, and we also want to unconditionally
enable the `http` one. Make sure at least the construction of these
services is covered in the tests.

Similarly, the tvix-store crate, which provides the tvix-store CLI has a
`cloud` feature flag too (defaulting to enabled).

Change-Id: I9fb9c87b740e7dc83f8ff7a0862905d036d513f2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11204
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-03-19 11:46:12 +02:00 committed by clbot
parent 591edf0d5b
commit 2798803f76
4 changed files with 34 additions and 14 deletions

View file

@ -53,7 +53,8 @@ tempfile = "3.3.0"
tokio-retry = "0.3.0"
[features]
default = ["fuse", "otlp", "tonic-reflection"]
default = ["cloud", "fuse", "otlp", "tonic-reflection"]
cloud = ["tvix-castore/cloud"]
fuse = ["tvix-castore/fuse"]
otlp = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry_sdk"]
tonic-reflection = ["dep:tonic-reflection", "tvix-castore/tonic-reflection"]