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

Wire up PathMapper in RemoteExecutionService #19721

Closed

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Oct 4, 2023

PathMappers rewrite paths in command lines to make them more cache friendly, which requires executor support to stage files at the rewritten paths. This commit wires up the PathMapper used by a given Spawn in RemoteExecutionService, which ensures that paths of inputs and outputs are correctly mapped before being sent off to the remote executor and mapped back to the correct local paths when downloading the results.

An end-to-end test will be added in #18155, but requires #19718, #19719, and #19721.

Work towards #6526

@fmeum
Copy link
Collaborator Author

fmeum commented Oct 4, 2023

cc @gregestren @aranguyen

@fmeum fmeum marked this pull request as ready for review October 4, 2023 10:56
@fmeum fmeum requested a review from a team as a code owner October 4, 2023 10:56
@fmeum fmeum requested review from tjgq and removed request for a team October 4, 2023 10:56
@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 Oct 4, 2023
copybara-service bot pushed a commit that referenced this pull request Oct 5, 2023
`PathMapper`s rewrite paths in command lines to make them more cache friendly, which requires executor support to stage files at the rewritten paths. This commit wires up the `PathMapper` used by a given `Spawn` in `SpawnInputsExpander`, which takes care of this for inputs to `Spawn`s executed in a sandbox or remotely.

Constructs specific to Blaze, filesets and archived tree artifacts, are not covered by this change.

An end-to-end test will be added in #18155, but requires #19718, #19719, and #19721.

Work towards #6526

Closes #19718.

PiperOrigin-RevId: 571109361
Change-Id: Ia38464011f658178ab2a1981a3ddaf5aead7c8fa
Copy link
Contributor

@tjgq tjgq left a comment

Choose a reason for hiding this comment

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

Can you please add two tests:

  1. One to verify that buildRemoteAction maps both inputs and outputs correctly.
  2. One to verify that downloadOutputs correctly downloads bazel-out/xxx/bin/foo even when it gets path-stripped into bazel-out/bin/foo (pass a custom RemoteOutputChecker into the RemoteExecutionService).

@fmeum fmeum force-pushed the 6526-wire-up-remoteexecutionservice branch 2 times, most recently from 2a468b6 to cadb5ef Compare October 7, 2023 11:02
@fmeum fmeum requested a review from tjgq October 7, 2023 11:03
@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 Oct 9, 2023
copybara-service bot pushed a commit that referenced this pull request Oct 9, 2023
`PathMapper`s rewrite paths in command lines to make them more cache friendly, which requires executor support to stage files at the rewritten paths. This commit wires up the `PathMapper` used by a given `Spawn` with sandbox outputs logic for sandboxed and worker sandboxed execution.

An end-to-end test will be added in #18155, but requires #19718, #19719, and #19721.

Work towards #6526

Closes #19719.

PiperOrigin-RevId: 571950903
Change-Id: I4a9d15da578da11f8677279b09e0864b8c33e9fc
`PathMapper`s rewrite paths in command lines to make them more cache
friendly, which requires executor support to stage files at the
rewritten paths. This commit wires up the `PathMapper` used by a given
`Spawn` in `RemoteExecutionService`, which ensures that paths of inputs
and outputs are correctly mapped before being sent off to the remote
executor and mapped back to the correct local paths when downloading the
results.

Work towards bazelbuild#6526
@fmeum fmeum force-pushed the 6526-wire-up-remoteexecutionservice branch from cadb5ef to d54bc88 Compare October 9, 2023 18:56
@fmeum
Copy link
Collaborator Author

fmeum commented Oct 9, 2023

I resolved the merge conflicts.

@fmeum fmeum requested a review from tjgq October 9, 2023 19:38
@Pavank1992 Pavank1992 added awaiting-review PR is awaiting review from an assigned reviewer and removed awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally labels Oct 11, 2023
@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 Oct 11, 2023
@fmeum
Copy link
Collaborator Author

fmeum commented Oct 16, 2023

@tjgq Is this still on track for getting merged? Happy to look into any issues it causes.

@tjgq
Copy link
Contributor

tjgq commented Oct 16, 2023

@tjgq Is this still on track for getting merged? Happy to look into any issues it causes.

Sorry for the delay. It should be merged in today!

@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Oct 16, 2023
@fmeum fmeum deleted the 6526-wire-up-remoteexecutionservice branch October 16, 2023 14:42
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.

None yet

4 participants