Skip to content

Commit

Permalink
fix(tvix/store): restore v1alpha reflection endpoint
Browse files Browse the repository at this point in the history
tonic-reflection 0.12.x moved from the v1alpha to v1 of the reflection
protocol.

However, most clients, like Postman, Kreya and evans don't support that
one yet.

Bump tonic-reflection to 0.12.2, which re-introduces v1alpha support
alongside the v1 version of it, registering both services.

This fixes the example documented in tvix/store/README.md, it was
previously failing as evans couldn't find the v1alpha reflection
service.

See hyperium/tonic#1888 for details.

Change-Id: I55438877317f82dc39face13afeb9594cda07a4e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12353
Autosubmit: flokli <[email protected]>
Tested-by: BuildkiteCI
Reviewed-by: Ilan Joselevich <[email protected]>
  • Loading branch information
flokli authored and clbot committed Aug 27, 2024
1 parent 402bde1 commit 078b961
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14692,9 +14692,9 @@ rec {
};
"tonic-reflection" = rec {
crateName = "tonic-reflection";
version = "0.12.1";
version = "0.12.2";
edition = "2021";
sha256 = "0wy1vdj4fj90j6zjqs78c2fvwcl9krxiz6709idspsbksqxchhmp";
sha256 = "1zwrm9zzahipsrmaqfp4vk0w31qymf740fsp0yczh16vxrsbhmkv";
libName = "tonic_reflection";
authors = [
"James Nugent <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mimalloc = "0.1.43"

[dependencies.tonic-reflection]
optional = true
version = "0.12.0"
version = "0.12.2"

[build-dependencies]
prost-build = "0.13.1"
Expand Down
17 changes: 12 additions & 5 deletions build/src/bin/tvix-build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {

#[cfg(feature = "tonic-reflection")]
{
let reflection_svc = tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build()?;
router = router.add_service(reflection_svc);
router = router.add_service(
tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1alpha()?,
);
router = router.add_service(
tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1()?,
);
}

info!(listen_address=%listen_address, "listening");
Expand Down
2 changes: 1 addition & 1 deletion castore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ optional = true

[dependencies.tonic-reflection]
optional = true
version = "0.12.0"
version = "0.12.2"

[dependencies.vhost]
optional = true
Expand Down
2 changes: 1 addition & 1 deletion store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mimalloc = "0.1.43"

[dependencies.tonic-reflection]
optional = true
version = "0.12.0"
version = "0.12.2"

[dependencies.bigtable_rs]
optional = true
Expand Down
17 changes: 12 additions & 5 deletions store/src/bin/tvix-store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,18 @@ async fn run_cli(cli: Cli) -> Result<(), Box<dyn std::error::Error + Send + Sync

#[cfg(feature = "tonic-reflection")]
{
let reflection_svc = tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build()?;
router = router.add_service(reflection_svc);
router = router.add_service(
tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1alpha()?,
);
router = router.add_service(
tonic_reflection::server::Builder::configure()
.register_encoded_file_descriptor_set(CASTORE_FILE_DESCRIPTOR_SET)
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1()?,
);
}

let listen_address = &listen_args.listen_address.unwrap_or_else(|| {
Expand Down

0 comments on commit 078b961

Please sign in to comment.