Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump prost to 0.9.0, tonic to 0.6.2, tonic-reflection to 0.3.0 #5755

Merged
merged 1 commit into from Jun 13, 2022

Conversation

bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Jun 10, 2022

Note: This subsumes #5738, which just attempted to update prost-types to 0.8.0.

For Reviewers: The only file I modified by hand is Cargo.toml. Everything else is auto-generated from subsequent commands (cargo update, cargo raze, bazel run //tensorboard/data/server:update_protos)

#5738 attempted to update prost-types from 0.7.0 to 0.8.0. This did not work out-of-the-box for several reasons, the most important of which is that we could not successfully build and run the server with mixed versions of prost (0.7.0), prost-types (0.8.0), and prost-build (0.7.0).

This PR attempts to upgrade all three of prost, prost-types, and prost-build to the same version at the same time. We also upgrade tonic, tonic-reflection, and tonic-build so that they, too, depend on the same prost version and we don't have multiple prost crates of different versions.

We choose to upgrade prost to 0.9.0 because, why not? We attempted to upgrade to 0.10.* (the latest version) but these versions of prost have a dependency on cmake, which seems to assume cmake is installed on your machine, which it typically is not within Google. There seems to be some work to further refine the dependency on cmake (tokio-rs/prost#620, tokio-rs/prost#657) so hopefully this gets resolved in a future release of prost and a future upgrade to, say, 0.11 will not have the cmake problems.

The upgrade was not straightforward for me, a rust and rustboard newb. Several other edits had to be made and commands had to be run to get it to work. This was the incantation that finally worked for me:

  • Edit Cargo.toml to update versions of prost, prost-types, prost-build, tonic, tonic-reflection, tonic-build and to update any related raze metadata entries.
  • Run cargo update -p prost -p prost-types -p prost-build -p tonic -p tonic-reflection -p tonic-build
  • Inspect Cargo.lock and compare to raze metadata entries in Cargo.toml. If any of the versions changed (indexmap) then update the associated raze metadata entry. If any of the crates were removed (none were) then remove the associated raze metadata entry. Also, libc version didn't change but I updated its raze metadata anyway since its version seems to have changed in the past.
  • Run cargo raze
  • Run bazel test //tensorboard/data/server:update_protos_test (especially since this is updating proto-related libraries) and witness it FAIL and then run bazel run //tensorboard/data/server:update_protos.
  • Confirm server works with bazel run -c opt //tensorboard/data/server -- --logdir <some logdir>

@bmd3k bmd3k changed the title build(deps): bump prost* to 0.9.0, tonic to 0.6.2, tonic-reflection to 0.3.0 build(deps): bump prost to 0.9.0, tonic to 0.6.2, tonic-reflection to 0.3.0 Jun 10, 2022
@bmd3k bmd3k requested a review from nfelt June 10, 2022 20:35
Copy link
Collaborator

@nfelt nfelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on, and for the detailed explanation in the PR description!

The upgrade was not straightforward for me, a rust and rustboard newb. Several other edits had to be made and commands had to be run to get it to work. This was the incantation that finally worked for me:

Just wondering, were you starting from the process here? https://github.com/tensorflow/tensorboard/blob/master/tensorboard/data/server/DEVELOPMENT.md#adding-third-party-dependencies

If there are additional steps that you discovered were needed (e.g. cargo update rather than cargo fetch), maybe it would be worthwhile to update that doc so it matches what you needed to do?

@bmd3k
Copy link
Contributor Author

bmd3k commented Jun 13, 2022

Just wondering, were you starting from the process here? https://github.com/tensorflow/tensorboard/blob/master/tensorboard/data/server/DEVELOPMENT.md#adding-third-party-dependencies

If there are additional steps that you discovered were needed (e.g. cargo update rather than cargo fetch), maybe it would be worthwhile to update that doc so it matches what you needed to do?

I did start from there. It was helpful. Given the final set of dependencies I updated, cargo fetch may have actualy been sufficient. However, while I was iterating and trying to figure out the right set of dependencies to upgrade, cargo update seemed to offer more flexibility and precision.

I will attempt to update the documentation.

@bmd3k bmd3k merged commit b23b3da into tensorflow:master Jun 13, 2022
bmd3k added a commit that referenced this pull request Jun 15, 2022
Update instructions about how to update Rust dependencies, based on my experiences with #5755.

Notably:
* Recommend using `cargo update -p <dependency name>` instead of `cargo fetch` when updating an existing dependency. `cargo fetch` will work when updating a dependency to a new major release but will not work when updating a dependency to a new minor release.
* Recommend updating crate-specific metadata versions in `Cargo.toml` based on the update to crate versions in `Cargo.lock`. Do this before running `cargo raze` to avoid unnecessary confusion.
* The targets to test are actually in `//tensorboard/data/server/cargo`. There do not appear to be valid targets in `//third_party/rust`.
* Run `bazel test tensorboard/data/server:update_protos_test` to determine if the proto source files need to be updated. It's best to run this test first before attempting to test, build, and run the rest of the server, otherwise the error messages can be quite confusing.
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Mar 27, 2023
…o 0.3.0 (tensorflow#5755)

Note: This subsumes tensorflow#5738, which just attempted to update prost-types to 0.8.0.

For Reviewers: The only file I modified by hand is Cargo.toml. Everything else is auto-generated from subsequent commands (`cargo update`, `cargo raze`, `bazel run //tensorboard/data/server:update_protos`)

tensorflow#5738 attempted to update prost-types from 0.7.0 to 0.8.0. This did not work out-of-the-box for several reasons, the most important of which is that we could not successfully build and run the server with mixed versions of prost (0.7.0), prost-types (0.8.0), and prost-build (0.7.0).

This PR attempts to upgrade all three of prost, prost-types, and prost-build to the same version at the same time. We also upgrade tonic, tonic-reflection, and tonic-build so that they, too, depend on the same prost version and we don't have multiple prost crates of different versions.

* https://crates.io/crates/prost/0.9.0 
* https://crates.io/crates/prost-types/0.9.0 
* https://crates.io/crates/prost-build/0.9.0 
* https://crates.io/crates/tonic/0.6.2 
* https://crates.io/crates/tonic-build/0.6.2 
* https://crates.io/crates/tonic-reflection/0.3.0 

We choose to upgrade prost to 0.9.0 because, why not? We attempted to upgrade to 0.10.* (the latest version) but these versions of prost have a dependency on cmake, which seems to assume cmake is installed on your machine, which it typically is not within Google. There seems to be some work to further refine the dependency on cmake (tokio-rs/prost#620, tokio-rs/prost#657) so hopefully this gets resolved in a future release of prost and a future upgrade to, say, 0.11 will not have the cmake problems.

The upgrade was not straightforward for me, a rust and rustboard newb. Several other edits had to be made and commands had to be run to get it to work. This was the incantation that finally worked for me:
* Edit Cargo.toml to update versions of prost, prost-types, prost-build, tonic, tonic-reflection, tonic-build and to update any related raze metadata entries.
* Run `cargo update -p prost -p prost-types -p prost-build -p tonic -p tonic-reflection -p tonic-build`
* Inspect Cargo.lock and compare to raze metadata entries in Cargo.toml. If any of the versions changed (indexmap) then update the associated raze metadata entry. If any of the crates were removed (none were) then remove the associated raze metadata entry. Also, libc version didn't change but I updated its raze metadata anyway since its version seems to have changed in the past.
* Run `cargo raze`
* Run `bazel test //tensorboard/data/server:update_protos_test` (especially since this is updating proto-related libraries) and witness it FAIL and then run `bazel run //tensorboard/data/server:update_protos`.
* Confirm server works with `bazel run -c opt //tensorboard/data/server -- --logdir <some logdir>`
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Mar 27, 2023
…#5757)

Update instructions about how to update Rust dependencies, based on my experiences with tensorflow#5755.

Notably:
* Recommend using `cargo update -p <dependency name>` instead of `cargo fetch` when updating an existing dependency. `cargo fetch` will work when updating a dependency to a new major release but will not work when updating a dependency to a new minor release.
* Recommend updating crate-specific metadata versions in `Cargo.toml` based on the update to crate versions in `Cargo.lock`. Do this before running `cargo raze` to avoid unnecessary confusion.
* The targets to test are actually in `//tensorboard/data/server/cargo`. There do not appear to be valid targets in `//third_party/rust`.
* Run `bazel test tensorboard/data/server:update_protos_test` to determine if the proto source files need to be updated. It's best to run this test first before attempting to test, build, and run the rest of the server, otherwise the error messages can be quite confusing.
dna2github pushed a commit to dna2fork/tensorboard that referenced this pull request May 1, 2023
…o 0.3.0 (tensorflow#5755)

Note: This subsumes tensorflow#5738, which just attempted to update prost-types to 0.8.0.

For Reviewers: The only file I modified by hand is Cargo.toml. Everything else is auto-generated from subsequent commands (`cargo update`, `cargo raze`, `bazel run //tensorboard/data/server:update_protos`)

tensorflow#5738 attempted to update prost-types from 0.7.0 to 0.8.0. This did not work out-of-the-box for several reasons, the most important of which is that we could not successfully build and run the server with mixed versions of prost (0.7.0), prost-types (0.8.0), and prost-build (0.7.0).

This PR attempts to upgrade all three of prost, prost-types, and prost-build to the same version at the same time. We also upgrade tonic, tonic-reflection, and tonic-build so that they, too, depend on the same prost version and we don't have multiple prost crates of different versions.

* https://crates.io/crates/prost/0.9.0 
* https://crates.io/crates/prost-types/0.9.0 
* https://crates.io/crates/prost-build/0.9.0 
* https://crates.io/crates/tonic/0.6.2 
* https://crates.io/crates/tonic-build/0.6.2 
* https://crates.io/crates/tonic-reflection/0.3.0 

We choose to upgrade prost to 0.9.0 because, why not? We attempted to upgrade to 0.10.* (the latest version) but these versions of prost have a dependency on cmake, which seems to assume cmake is installed on your machine, which it typically is not within Google. There seems to be some work to further refine the dependency on cmake (tokio-rs/prost#620, tokio-rs/prost#657) so hopefully this gets resolved in a future release of prost and a future upgrade to, say, 0.11 will not have the cmake problems.

The upgrade was not straightforward for me, a rust and rustboard newb. Several other edits had to be made and commands had to be run to get it to work. This was the incantation that finally worked for me:
* Edit Cargo.toml to update versions of prost, prost-types, prost-build, tonic, tonic-reflection, tonic-build and to update any related raze metadata entries.
* Run `cargo update -p prost -p prost-types -p prost-build -p tonic -p tonic-reflection -p tonic-build`
* Inspect Cargo.lock and compare to raze metadata entries in Cargo.toml. If any of the versions changed (indexmap) then update the associated raze metadata entry. If any of the crates were removed (none were) then remove the associated raze metadata entry. Also, libc version didn't change but I updated its raze metadata anyway since its version seems to have changed in the past.
* Run `cargo raze`
* Run `bazel test //tensorboard/data/server:update_protos_test` (especially since this is updating proto-related libraries) and witness it FAIL and then run `bazel run //tensorboard/data/server:update_protos`.
* Confirm server works with `bazel run -c opt //tensorboard/data/server -- --logdir <some logdir>`
dna2github pushed a commit to dna2fork/tensorboard that referenced this pull request May 1, 2023
…#5757)

Update instructions about how to update Rust dependencies, based on my experiences with tensorflow#5755.

Notably:
* Recommend using `cargo update -p <dependency name>` instead of `cargo fetch` when updating an existing dependency. `cargo fetch` will work when updating a dependency to a new major release but will not work when updating a dependency to a new minor release.
* Recommend updating crate-specific metadata versions in `Cargo.toml` based on the update to crate versions in `Cargo.lock`. Do this before running `cargo raze` to avoid unnecessary confusion.
* The targets to test are actually in `//tensorboard/data/server/cargo`. There do not appear to be valid targets in `//third_party/rust`.
* Run `bazel test tensorboard/data/server:update_protos_test` to determine if the proto source files need to be updated. It's best to run this test first before attempting to test, build, and run the rest of the server, otherwise the error messages can be quite confusing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants