Skip to content

Commit

Permalink
chore: update tonic, prost, and proxy-api (linkerd#1868)
Browse files Browse the repository at this point in the history
This branch updates `tonic` (and `tonic-build`) to v0.8, `prost` (and
`prost-types`) to v0.11, and `linkerd2-proxy-api` to v0.7.

Unfortunately, the current approach of regenerating protobuf generated
code in tests does not work in cases where there's a breaking change in
`tonic` that breaks compatibility with protos compiled by the previous
version. The crate itself needs to be compiled before its tests are
compiled, and if the crate doesn't build, the tests won't run.

Therefore, I've also added a little script in a crate *outside* the
`opencensus-proto` crate that can be run to manually rebuild the
generated code, for cases like this.

Closes linkerd#1873

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw authored Aug 5, 2022
1 parent 691d66b commit f336b2a
Show file tree
Hide file tree
Showing 38 changed files with 231 additions and 88 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkerd2-proxy",
"image": "ghcr.io/linkerd/dev:v22",
"image": "ghcr.io/linkerd/dev:v23",
"extensions": [
"DavidAnson.vscode-markdownlint",
"NathanRidley.autotrim",
Expand Down Expand Up @@ -29,4 +29,4 @@
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
actionlint:
runs-on: ubuntu-20.04
timeout-minutes: 10
container: ghcr.io/linkerd/dev:v22-tools
container: ghcr.io/linkerd/dev:v23-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run actionlint
Expand All @@ -25,7 +25,7 @@ jobs:
devcontainer-versions:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-tools
container: ghcr.io/linkerd/dev:v23-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Scan workflows for other Devcontainer image versions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
timeout-minutes: 20
continue-on-error: true
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
check-all:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-each.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
needs: list-changed-crates
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
strategy:
matrix:
crate: ${{ fromJson(needs.list-changed-crates.outputs.crates) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: docker://ghcr.io/linkerd/dev:v22-rust
image: docker://ghcr.io/linkerd/dev:v23-rust
options: --security-opt seccomp=unconfined # 🤷
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
deprecated:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
clippy:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand All @@ -30,15 +30,15 @@ jobs:
fmt:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just check-fmt

docs:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
timeout-minutes: 20
continue-on-error: true
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
meshtls:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand All @@ -42,7 +42,7 @@ jobs:
unit:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-rust
container: ghcr.io/linkerd/dev:v23-rust
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- run: just fetch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
workflows:
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v22-tools
container: ghcr.io/linkerd/dev:v23-tools
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- shell: bash
Expand Down
38 changes: 22 additions & 16 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ dependencies = [
"ipnet",
"linkerd-http-route",
"linkerd2-proxy-api",
"prost-types",
"quickcheck",
"thiserror",
]
Expand Down Expand Up @@ -1700,9 +1701,9 @@ dependencies = [

[[package]]
name = "linkerd2-proxy-api"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6af1b0893c92d50e1af9a9342df7bd1ba73b9ef2abce700e170f2b2d4c84ac72"
checksum = "9461e1bf61263ffa493117f2177c15a470b4b66f6b58c74e548401293f9ea639"
dependencies = [
"h2",
"http",
Expand Down Expand Up @@ -1977,23 +1978,21 @@ dependencies = [

[[package]]
name = "prost"
version = "0.10.4"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e"
checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7"
dependencies = [
"bytes",
"prost-derive",
]

[[package]]
name = "prost-build"
version = "0.10.4"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab"
checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb"
dependencies = [
"bytes",
"cfg-if",
"cmake",
"heck",
"itertools",
"lazy_static",
Expand All @@ -2009,9 +2008,9 @@ dependencies = [

[[package]]
name = "prost-derive"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df35198f0777b75e9ff669737c6da5136b59dba33cf5a010a6d1cc4d56defc6f"
checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364"
dependencies = [
"anyhow",
"itertools",
Expand All @@ -2022,9 +2021,9 @@ dependencies = [

[[package]]
name = "prost-types"
version = "0.10.0"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "926681c118ae6e512a3ccefd4abbe5521a14f4cc1e207356d4d00c0b7f2006fd"
checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e"
dependencies = [
"bytes",
"prost",
Expand Down Expand Up @@ -2472,9 +2471,9 @@ dependencies = [

[[package]]
name = "tonic"
version = "0.7.2"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be9d60db39854b30b835107500cf0aca0b0d14d6e1c3de124217c23a29c2ddb"
checksum = "498f271adc46acce75d66f639e4d35b31b2394c295c82496727dafa16d465dd2"
dependencies = [
"async-stream",
"async-trait",
Expand All @@ -2497,9 +2496,9 @@ dependencies = [

[[package]]
name = "tonic-build"
version = "0.7.2"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9263bf4c9bfaae7317c1c2faf7f18491d2fe476f70c414b73bf5d445b00ffa1"
checksum = "2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c"
dependencies = [
"prettyplease",
"proc-macro2",
Expand All @@ -2508,6 +2507,13 @@ dependencies = [
"syn",
]

[[package]]
name = "tools"
version = "0.1.0"
dependencies = [
"tonic-build",
]

[[package]]
name = "tower"
version = "0.4.13"
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ members = [
"linkerd/transport-metrics",
"linkerd2-proxy",
"opencensus-proto",
"tools"
]

# Debug symbols end up chewing up several GB of disk space, so better to just
Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ regex = "1"
thiserror = "1"
tokio = { version = "1", features = ["rt"] }
tokio-stream = { version = "0.1", features = ["time", "sync"] }
tonic = { version = "0.7", default-features = false, features = ["prost"] }
tonic = { version = "0.8", default-features = false, features = ["prost"] }
tower = "0.4"
tracing = "0.1"
2 changes: 1 addition & 1 deletion linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ serde_json = "1"
thiserror = "1"
tokio = { version = "1", features = ["macros", "sync", "parking_lot"] }
tokio-stream = { version = "0.1", features = ["time"] }
tonic = { version = "0.7", default-features = false, features = ["prost"] }
tonic = { version = "0.8", default-features = false, features = ["prost"] }
tracing = "0.1"
parking_lot = "0.12"
pin-project = "1"
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/inbound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ linkerd-cache = { path = "../../cache" }
linkerd-http-access-log = { path = "../../http-access-log" }
linkerd-server-policy = { path = "../../server-policy", features = ["proto"] }
linkerd-tonic-watch = { path = "../../tonic-watch" }
linkerd2-proxy-api = { version = "0.6", features = ["inbound"] }
linkerd2-proxy-api = { version = "0.7", features = ["inbound"] }
once_cell = "1"
parking_lot = "0.12"
thiserror = "1"
tokio = { version = "1", features = ["sync"] }
tonic = { version = "0.7", default-features = false }
tonic = { version = "0.8", default-features = false }
tower = { version = "0.4", features = ["util"] }
tracing = "0.1"

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ hyper = { version = "0.14", features = [
linkerd-app = { path = "..", features = ["allow-loopback"] }
linkerd-app-core = { path = "../core" }
linkerd-metrics = { path = "../../metrics", features = ["test_util"] }
linkerd2-proxy-api = { version = "0.6", features = [
linkerd2-proxy-api = { version = "0.7", features = [
"destination",
"arbitrary",
] }
Expand All @@ -47,7 +47,7 @@ tokio-stream = { version = "0.1", features = ["sync"] }
tokio-rustls = "0.23"
rustls-pemfile = "1.0"
tower = { version = "0.4", default-features = false }
tonic = { version = "0.7", default-features = false }
tonic = { version = "0.8", default-features = false }
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = [
"fmt",
Expand Down
10 changes: 8 additions & 2 deletions linkerd/app/integration/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,11 @@ pub fn retry_budget(
retry_ratio: f32,
min_retries_per_second: u32,
) -> pb::RetryBudget {
let ttl = ttl
.try_into()
.expect("retry budget TTL duration cannot be converted to protobuf");
pb::RetryBudget {
ttl: Some(ttl.into()),
ttl: Some(ttl),
retry_ratio,
min_retries_per_second,
}
Expand Down Expand Up @@ -607,7 +610,10 @@ impl RouteBuilder {
}

pub fn timeout(mut self, dur: Duration) -> Self {
self.route.timeout = Some(dur.into());
let dur = dur
.try_into()
.expect("timeout duration cannot be converted to protobuf");
self.route.timeout = Some(dur);
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion linkerd/http-route/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tracing = "0.1"
url = "2"

[dependencies.linkerd2-proxy-api]
version = "0.6"
version = "0.7"
features = ["http-route", "grpc-route"]
optional = true

Expand Down
2 changes: 1 addition & 1 deletion linkerd/opencensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ http-body = "0.4"
linkerd-error = { path = "../error" }
linkerd-metrics = { path = "../metrics" }
opencensus-proto = { path = "../../opencensus-proto" }
tonic = { version = "0.7", default-features = false, features = ["prost", "codegen"] }
tonic = { version = "0.8", default-features = false, features = ["prost", "codegen"] }
tokio = { version = "1", features = ["macros", "sync", "time"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tracing = "0.1"
6 changes: 3 additions & 3 deletions linkerd/proxy/api-resolve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ async-stream = "0.3"
futures = { version = "0.3", default-features = false }
linkerd-addr = { path = "../../addr" }
linkerd-error = { path = "../../error" }
linkerd2-proxy-api = { version = "0.6", features = ["destination"] }
linkerd2-proxy-api = { version = "0.7", features = ["destination"] }
linkerd-proxy-core = { path = "../core" }
linkerd-stack = { path = "../../stack" }
linkerd-tls = { path = "../../tls" }
http = "0.2"
http-body = "0.4"
pin-project = "1"
prost = "0.10"
tonic = { version = "0.7", default-features = false }
prost = "0.11"
tonic = { version = "0.8", default-features = false }
tower = { version = "0.4", default-features = false }
tracing = "0.1"
4 changes: 2 additions & 2 deletions linkerd/proxy/identity-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false

[dependencies]
futures = { version = "0.3", default-features = false }
linkerd2-proxy-api = { version = "0.6", features = ["identity"] }
linkerd2-proxy-api = { version = "0.7", features = ["identity"] }
linkerd-error = { path = "../../error" }
linkerd-identity = { path = "../../identity" }
linkerd-metrics = { path = "../../metrics" }
Expand All @@ -17,6 +17,6 @@ parking_lot = "0.12"
pin-project = "1"
thiserror = "1"
tokio = { version = "1", features = ["time", "sync"] }
tonic = { version = "0.7", default-features = false }
tonic = { version = "0.8", default-features = false }
tracing = "0.1"
http-body = "0.4"
Loading

0 comments on commit f336b2a

Please sign in to comment.