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

RemoteExecutionService: support output_symlinks in ActionResult #18198

Closed
wants to merge 2 commits into from

Conversation

sluongng
Copy link
Contributor

Since Remote API v2.1, both

  • output_file_symlinks
  • output_directory_symlinks
    were marked as deprecated in favor of output_symlinks.

However, Bazel downloadOutputs has only support the 2 deprecated fields
and not output_symlinks.

Add support for output_symlinks.

@sluongng sluongng requested a review from a team as a code owner April 24, 2023 16:22
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Apr 24, 2023
@sluongng
Copy link
Contributor Author

cc: @fmeum as we discussed about this on Slack

Copy link
Collaborator

@fmeum fmeum left a comment

Choose a reason for hiding this comment

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

@sluongng https://github.com/bazelbuild/remote-apis/blob/35aee1c4a4250d3df846f7ba3e4a4e66cb014ecd/build/bazel/remote/execution/v2/remote_execution.proto#L1054 reads as if servers could add the same symlinks to both the old fields and the new one, which would cause the current implementation to throw.

@sluongng sluongng force-pushed the sluongng/output-symlinks branch from d06846c to 8135beb Compare April 24, 2023 19:48
@sluongng
Copy link
Contributor Author

which would cause the current implementation to throw.

I switched from using an Iterable to a Set so I think it should work...
I added a test to demonstrate compatibility just in case.

@fmeum what am I missing? 🤔

Since Remote API v2.1, both
  - output_file_symlinks
  - output_directory_symlinks
were marked as deprecated in favor of output_symlinks.

However, Bazel downloadOutputs has only support the 2 deprecated fields
and not output_symlinks.

Add support for output_symlinks.
@sluongng sluongng force-pushed the sluongng/output-symlinks branch from 8135beb to 602a302 Compare April 24, 2023 19:53
sluongng added a commit to sluongng/bazel that referenced this pull request Apr 24, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.
@fmeum
Copy link
Collaborator

fmeum commented Apr 24, 2023

@sluongng Sorry, I missed the fact that you are now building a set. I still see a problem though: The set will deduplicate OutputSymlink messages by equality, but that could mean having different targets or node_properties per path with latest wins semantics. Instead, how about collecting the instances in a map keyed by path and throwing an error if two unequal instances share a key?

@sluongng
Copy link
Contributor Author

@fmeum I think throwing an error could be a bit hostile toward both users and remote execution server implementations.

The difference between throwing an error vs the current approach should only be how hard is it to deprecate and remove the old fields. In my mind, I would imagine the following steps are required:

So I would push back and say the current approach of accepting both old and new fields without throwing errors, should be more friendly toward the current ecosystem.

@fmeum
Copy link
Collaborator

fmeum commented Apr 25, 2023

We may be misunderstanding each other: I fully agree that Bazel should ideally support a mix of both the old and the new fields as long as the values in both fields don't contradict each other.

What I am worried about is a situation where e.g. output_symlinks says that pkg/file should point to foo, whereas output_file_symlinks says that it should point to bar. Within a single field, latest wins semantics may be okay, but across fields, this would potentially introduce discrepancies in behavior between clients. That's why I would find this safer if OutputSymlink instances with identical paths but different other properties across old and new fields would result in an error.

@sluongng Do you have a better understanding of my point now?

@sluongng
Copy link
Contributor Author

Oh I see 🤔

I don't expect that to happen in reality, but perhaps it would not hurt to do a check for it.
Let me see to it

sluongng added a commit to sluongng/bazel that referenced this pull request Apr 25, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.
sluongng added a commit to sluongng/bazel that referenced this pull request Apr 25, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.
@sluongng sluongng force-pushed the sluongng/output-symlinks branch from eb5f259 to 429ffd5 Compare April 25, 2023 16:01
@sluongng
Copy link
Contributor Author

Failed MacOS Android test seems to be unrelated to this PR

@tjgq PTAL

@tjgq tjgq added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Apr 26, 2023
sluongng added a commit to sluongng/bazel that referenced this pull request Apr 27, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.
@Pavank1992 Pavank1992 removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Apr 27, 2023
copybara-service bot pushed a commit that referenced this pull request Apr 27, 2023
This is a follow-up to #18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.

Closes #18202.

PiperOrigin-RevId: 527560509
Change-Id: I14c80d69aa9a5e9bf29a8c5694412ecd58ea17bf
@sluongng
Copy link
Contributor Author

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label May 17, 2023
@iancha1992
Copy link
Member

@bazel-io fork 6.3.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label May 17, 2023
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request May 17, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.

Closes bazelbuild#18202.

PiperOrigin-RevId: 527560509
Change-Id: I14c80d69aa9a5e9bf29a8c5694412ecd58ea17bf
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request May 17, 2023
Since Remote API v2.1, both
  - output_file_symlinks
  - output_directory_symlinks
were marked as deprecated in favor of output_symlinks.

However, Bazel downloadOutputs has only support the 2 deprecated fields
and not output_symlinks.

Add support for output_symlinks.

Closes bazelbuild#18198.

PiperOrigin-RevId: 527511382
Change-Id: I350ab77a5d30ab06dab4118cf76f0b0e7650a739
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
Since Remote API v2.1, both
  - output_file_symlinks
  - output_directory_symlinks
were marked as deprecated in favor of output_symlinks.

However, Bazel downloadOutputs has only support the 2 deprecated fields
and not output_symlinks.

Add support for output_symlinks.

Closes bazelbuild#18198.

PiperOrigin-RevId: 527511382
Change-Id: I350ab77a5d30ab06dab4118cf76f0b0e7650a739
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
This is a follow-up to bazelbuild#18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.

Closes bazelbuild#18202.

PiperOrigin-RevId: 527560509
Change-Id: I14c80d69aa9a5e9bf29a8c5694412ecd58ea17bf
iancha1992 added a commit that referenced this pull request Jun 6, 2023
Since Remote API v2.1, both
  - output_file_symlinks
  - output_directory_symlinks
were marked as deprecated in favor of output_symlinks.

However, Bazel downloadOutputs has only support the 2 deprecated fields
and not output_symlinks.

Add support for output_symlinks.

Closes #18198.

PiperOrigin-RevId: 527511382
Change-Id: I350ab77a5d30ab06dab4118cf76f0b0e7650a739

Co-authored-by: Son Luong Ngoc <[email protected]>
iancha1992 added a commit that referenced this pull request Jun 6, 2023
This is a follow-up to #18198

Make Bazel compatible with newer version of Remote Api by setting
output_paths along-side output_directories and output_files. The latter
2 are deprecated in newer REAPI specification.

Closes #18202.

PiperOrigin-RevId: 527560509
Change-Id: I14c80d69aa9a5e9bf29a8c5694412ecd58ea17bf

Co-authored-by: Son Luong Ngoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants