Skip to content

data_provider: add GetExperiment RPC #4750

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

Merged
merged 5 commits into from
Mar 9, 2021

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Mar 8, 2021

Summary:
This new RPC is intended to back both the data_location and the
experiment_metadata data provider methods (which really should be
combined into one). It takes an experiment ID and returns all available
metadata. If needed, we could add a fieldmask, but we leave that out
until we have a need for it.

The Rust implementation of the data server will only populate the data
location field, but we still include the rest to mirror the Python
interface.

This is the first use of google.protobuf.Timestamp or any of the
well-known types, so some build tweaks are needed.

Test Plan:
The protos and Rust code all build, and the newly updated instructions
in DEVELOPMENT.md for still work. With grpc_cli, the new RPC can be
seen to successfully return a non-OK "not yet implemented" status.

wchargin-branch: data-getexperiment-rpc

wchargin added 2 commits March 8, 2021 15:57
Summary:
The [`prost-types`] crate provides bindings for the [well-known types],
notably including `google.protobuf.Timestamp`. As with bindings for
other languages, some of these types have additional methods, like
`Timestamp::normalize`.

[`prost-types`]: https://crates.io/crates/prost-types
[well-known types]: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf

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

wchargin-branch: rust-dep-prost-types
wchargin-source: 6cdfa10ead9892fd794050779434b42ea9ce8b1a
Summary:
This new RPC is intended to back both the `data_location` and the
`experiment_metadata` data provider methods (which really should be
combined into one). It takes an experiment ID and returns all available
metadata. If needed, we could add a fieldmask, but we leave that out
until we have a need for it.

The Rust implementation of the data server will only populate the data
location field, but we still include the rest to mirror the Python
interface.

This is the first use of `google.protobuf.Timestamp` or any of the
well-known types, so some build tweaks are needed.

Test Plan:
The protos and Rust code all build, and the newly updated instructions
in `DEVELOPMENT.md` for still work. With `grpc_cli`, the new RPC can be
seen to successfully return a non-OK `"not yet implemented"` status.

wchargin-branch: data-getexperiment-rpc
wchargin-source: 0ae0da093f373565cb431620329bdc102d3c8336
@wchargin wchargin added the core:rustboard //tensorboard/data/server/... label Mar 8, 2021
@google-cla google-cla bot added the cla: yes label Mar 8, 2021
Comment on lines +60 to +67
// Time that the experiment was created.
//
// This does not necessarily have any relation to times of events within an
// experiment. A new experiment may contain old data, or data may be freshly
// written to an experiment after it is created.
//
// May be unset if no creation time is known.
google.protobuf.Timestamp creation_time = 4;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nfelt: Could you take a quick look at this use of Timestamp in light
of the build changes in this PR and its diffbase, #4749? I recall that
in #4314 you lobbied for using Timestamp rather than double, and in
this case I agree that it’s the right tradeoff as far as the proto
definition goes. It incurs a bit of build complexity; IMHO it’s worth
it, but I would also not mind just using double if we prefer that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with the build complexity since it seems fairly contained, although boy do I wish com_google_protobuf were a nicer structured Bazel dependency to have.

@wchargin wchargin requested a review from nfelt March 9, 2021 00:01
done
[ -n "$${f}" ] || die 'no well-known protos in fileset'
dir="$$(dirname "$${f}")"
while true; do
Copy link
Contributor

Choose a reason for hiding this comment

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

This while loop feels like a bit of a complicated way to effectively just remove the suffix /src/.*? and replace it with /src. Maybe consider just doing string munging for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hadn’t realized that ${f%/src/*} was a sufficient building block
here. Much nicer; thanks.

Comment on lines +60 to +67
// Time that the experiment was created.
//
// This does not necessarily have any relation to times of events within an
// experiment. A new experiment may contain old data, or data may be freshly
// written to an experiment after it is created.
//
// May be unset if no creation time is known.
google.protobuf.Timestamp creation_time = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with the build complexity since it seems fairly contained, although boy do I wish com_google_protobuf were a nicer structured Bazel dependency to have.

import "tensorboard/compat/proto/summary.proto";
import "tensorboard/compat/proto/tensor.proto";

option go_package = "github.com/tensorflow/tensorboard/tensorboard/data/proto/data_provider_proto";

service TensorBoardDataProvider {
// Get metadata about an experiment.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't object to evolving this interface a little away from Python DataProvider but FWIW we should anticipate that we might want to change this further depending on the outcome of experiment-ifying Python DataProvider as part of upcoming work.

Copy link
Contributor Author

@wchargin wchargin Mar 9, 2021

Choose a reason for hiding this comment

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

Yeah. I don’t mind it at all, since this moves it closer to what the
Python data provider should be. Happy to keep this interface malleable.

Base automatically changed from wchargin-rust-dep-prost-types to master March 9, 2021 01:34
wchargin added 3 commits March 8, 2021 17:34
wchargin-branch: data-getexperiment-rpc
wchargin-source: 075d525b0287c870d6cbb3ece1b61435c6b13d13
wchargin-branch: data-getexperiment-rpc
wchargin-source: 161842c20de3592839dbd9684e397d8b0dcfb7f4
wchargin-branch: data-getexperiment-rpc
wchargin-source: 161842c20de3592839dbd9684e397d8b0dcfb7f4
@wchargin wchargin merged commit 9f7981e into master Mar 9, 2021
@wchargin wchargin deleted the wchargin-data-getexperiment-rpc branch March 9, 2021 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes core:rustboard //tensorboard/data/server/...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants