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 sandbox code #19719

Closed
wants to merge 2 commits into from

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 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

@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:55
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Local-Exec Issues and PRs for the Execution (Local) team labels Oct 4, 2023
@fmeum
Copy link
Collaborator Author

fmeum commented Oct 4, 2023

@larsrc-google Could you review this PR? Happy to provide more context.

Could you perhaps also provide an update on #18159 (comment)? Multiplexed sandboxing support for the Javac worker would allow path mapping to work with default Bazel settings. Is there anything I can do to help with this effort? Could it be enabled for Bazel but not Blaze if there are remaining Google-internal issues?

Copy link
Contributor

@gregestren gregestren left a comment

Choose a reason for hiding this comment

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

How are inputs handled with sandboxing?

i.e. I just see references to outputs in this diff.

@fmeum
Copy link
Collaborator Author

fmeum commented Oct 4, 2023

Inputs are handled centrally in SpawnInputExpander, so that's already covered by the other PR.

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
@meisterT
Copy link
Member

meisterT commented Oct 6, 2023

@larsrc-google Could you review this PR? Happy to provide more context.

Could you perhaps also provide an update on #18159 (comment)? Multiplexed sandboxing support for the Javac worker would allow path mapping to work with default Bazel settings. Is there anything I can do to help with this effort? Could it be enabled for Bazel but not Blaze if there are remaining Google-internal issues?

@larsrc-google has moved projects, and is currently OOO. Unfortunately, the other person who knows the current state best is also on leave (probably until mid Dec).

@hvadehra might have some context on what is blocking multiplexed sandboxing suport but my high-level understanding is that plugins are an issue since they are using absolute paths. When trying to work around that (see code in https://bazel-review.googlesource.com/c/bazel/+/179090), Lars got stuck on the goodtime plugin. Hemanshu might be able to suggest a path forward.

@fmeum
Copy link
Collaborator Author

fmeum commented Oct 6, 2023

Thanks for the update, I will take a look at the PR. Fortunately multiplexed sandboxing for Javac isn't really a hard blocker for the path mapping feature, it would just make it easier to use and probably more efficien.

@meisterT Could you review this PR as Lars isn't available?

@meisterT meisterT requested a review from tjgq October 6, 2023 11:15
@meisterT
Copy link
Member

meisterT commented Oct 6, 2023

Tiago thankfully agreed to have a look.

`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.
@fmeum fmeum force-pushed the 6526-wire-up-sandboxoutputs branch from 01cc169 to f5848b9 Compare October 7, 2023 17:21
@fmeum fmeum requested a review from tjgq October 7, 2023 17:21
@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 copybara-service bot closed this in bfc2772 Oct 9, 2023
@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 9, 2023
@fmeum fmeum deleted the 6526-wire-up-sandboxoutputs branch October 9, 2023 18:52
copybara-service bot pushed a commit that referenced this pull request Oct 16, 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 `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

Closes #19721.

PiperOrigin-RevId: 573806130
Change-Id: Ibbd4ff641eb301d78f5ec54813e65788d786fcea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants