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

Show a warning message if versions are mismatched in Worker <-> Scheduler communication #1265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aleksdmladenovic
Copy link
Contributor

@aleksdmladenovic aleksdmladenovic commented Aug 16, 2024

Description

When Worker is connecting to the Scheduler, both sides should express which version of NativeLink they are using in the metadata and if they are not matched, they should throw a warning. WorkerAPI protobuf is updated to include version information for both Worker and Scheduler in the initial request and the response to that initial request. CARGO_PKG_VERSION environment varaible is used to get the current NativeLink version - which is how clap library gets version by itself. Notice that CARGO_PKG_VERSION environment variable is only set when the NativeLink is built with cargo not bazel.
Tests are updated to include version information for both Worker and Scheduler.

Fixes #1253

Type of change

Please delete options that aren't relevant.

  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please also list any relevant details for your test configuration

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

@aleksdmladenovic
Copy link
Contributor Author

I hope you to review this. cc: @MarcusSorealheis, @allada, @aaronmondal

When `Worker` is connecting to the `Scheduler`, both sides should express which version of NativeLink they are
using in the metadata and if they are not matched, they should throw a warning.
WorkerAPI protobuf is updated to include version information for both `Worker` and `Scheduler` in the initial
request and the response to that initial request. `CARGO_PKG_VERSION` environment varaible is used to get the
current NativeLink version - which is how `clap` library gets version by itself.
Notice that `CARGO_PKG_VERSION` environment variable is only set when the NativeLink is built with `cargo` not
`bazel`.
Tests are updated to include version information for both `Worker` and `Scheduler`.
@aleksdmladenovic aleksdmladenovic force-pushed the handle-version-mismatch branch from c666cd7 to dd3ae91 Compare August 16, 2024 13:17
@aleksdmladenovic
Copy link
Contributor Author

FYI, just shortened this commit message to follow the contribution rules.

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

Overall I like this approach, however I'm currently working on a PR to invert the direction of Worker<->Scheduler communication, which will make this proto to be completely be removed.

Reviewable status: 0 of 2 LGTMs obtained, and 0 of 15 files reviewed, and pending CI: windows-2022 / stable

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.

Worker<->Scheduler communication should throw a warning if versions are mismatched
2 participants