Skip to content

Commit

Permalink
rust: add tonic-reflection dependency (#4871)
Browse files Browse the repository at this point in the history
Summary:
The [`tonic-reflection`] crate implements the gRPC reflection protocol,
and will enable us to significantly simplify `grpc_cli` usage.

Reflection was released in Tonic v0.4.1, so this patch also upgrades the
rest of our Tonic stack to the latest versions.

[`tonic-reflection`]: https://crates.io/crates/tonic-reflection

Test Plan:
It builds: `bazel build //tensorboard/data/server/cargo:tonic_reflection`.

wchargin-branch: rust-dep-tonic-reflection
  • Loading branch information
wchargin authored Apr 16, 2021
1 parent bf22c49 commit ec3d6cb
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 42 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ jobs:
with:
toolchain: ${{ matrix.rust_version }}
default: true
components: rustfmt
- name: 'Install Python packaging deps'
run: |
python -m pip install -U pip
Expand Down
34 changes: 25 additions & 9 deletions tensorboard/data/server/Cargo.lock

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

15 changes: 13 additions & 2 deletions tensorboard/data/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ serde_json = "1.0.59"
thiserror = "1.0.21"
tokio = { version = "1.0.2", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1.2", features = ["net"] }
tonic = "0.4.0"
tonic = "0.4.2"
tonic-reflection = "0.1.0"
walkdir = "2.3.1"

[dev-dependencies]
prost-build = "0.7.0"
tempfile = "3.1.0"
tonic-build = "0.4.0"
tonic-build = "0.4.2"

[[bin]]
name = "rustboard"
Expand Down Expand Up @@ -113,3 +114,13 @@ additional_flags = [

[package.metadata.raze.crates.prost-build.'0.7.0']
gen_buildrs = true

[package.metadata.raze.crates.tonic-reflection.'0.1.0']
gen_buildrs = true
build_data_dependencies = ["@com_google_protobuf//:protoc"]

[package.metadata.raze.crates.tonic-reflection.'0.1.0'.buildrs_additional_environment_variables]
PROTOC = "$(execpath @com_google_protobuf//:protoc)"
# We don't have easy access to a rustfmt binary, so make it a no-op.
# https://github.com/bazelbuild/rules_rust/issues/87
RUSTFMT = "/bin/true"
13 changes: 11 additions & 2 deletions tensorboard/data/server/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ alias(

alias(
name = "tonic",
actual = "@raze__tonic__0_4_0//:tonic",
actual = "@raze__tonic__0_4_2//:tonic",
tags = [
"cargo-raze",
"manual",
Expand All @@ -239,7 +239,16 @@ alias(

alias(
name = "tonic_build",
actual = "@raze__tonic_build__0_4_0//:tonic_build",
actual = "@raze__tonic_build__0_4_2//:tonic_build",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "tonic_reflection",
actual = "@raze__tonic_reflection__0_1_0//:tonic_reflection",
tags = [
"cargo-raze",
"manual",
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/data/server/tensorboard.data.pb.rs

Large diffs are not rendered by default.

50 changes: 30 additions & 20 deletions third_party/rust/crates.bzl

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

2 changes: 1 addition & 1 deletion third_party/rust/remote/BUILD.h2-0.3.0.bazel

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

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

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

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

95 changes: 95 additions & 0 deletions third_party/rust/remote/BUILD.tonic-reflection-0.1.0.bazel

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

Loading

0 comments on commit ec3d6cb

Please sign in to comment.