remote-apis-sdks icon indicating copy to clipboard operation
remote-apis-sdks copied to clipboard

Support node properties in the remote tool

Open ola-rozenfeld opened this issue 1 year ago • 1 comments

Problem

Node properties are a (relatively recent) part of the RE-API which is relied upon by Bazel's persistent remote workers feature: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/remote/merkletree/MerkleTree.java#L398 Bazel uses this to "mark" some files as tools that should persist on the remote worker. This is used by RE implementations (definitely by EngFlow, unsure about Google's RBE). However, https://github.com/bazelbuild/remote-apis-sdks doesn't support node properties at the moment, which, for example, makes it impossible to use the remotetool to debug actions that use remote persistent workers.

Suggested fix

Introduce optional node properties specification throughout the rexec client layer, starting with adding it to the command proto:

message InputSpec {
  ...
  map<string,NodeProperties> input_node_properties = 7;
}

// Either copied from [RE-API](https://github.com/bazelbuild/remote-apis/blob/main/build/bazel/remote/execution/v2/remote_execution.proto#L852) or introduce a proto dependency on it
message NodeProperties {
...
}

and then reading these in GetDirectoryTree, passing them through to rexec here, here and here.

Please let me know if you're okay with this plan, and I'll try to send a PR shortly.

Thank you!

ola-rozenfeld avatar Jun 08 '23 18:06 ola-rozenfeld

SGTM, thanks Ola!

ramymedhat avatar Jun 09 '23 16:06 ramymedhat