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

Finish parallelizing materialization of Process inputs #18469

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Mar 11, 2023

For a long time, the:

  1. symlinks for immutable inputs, named caches, or the JDK
  2. parent directories of output paths

... have been created synchronously in prepare_workdir before the call to materialize_directory for the input digest.

As described in the TODO on prepare_workdir, that prevented validation of collisions between those paths, and also meant that it was less parallel than it could be.

This change switches to using the new symlinks-in-Digests support that @thejcannon added to create a Digest that fully describes the sandbox, and then materialize that.

@stuhood
Copy link
Sponsor Member Author

stuhood commented Mar 11, 2023

This was previously landed as part of #18225 (which was reverted): now broken out independently.

@@ -709,89 +735,44 @@ pub async fn prepare_workdir(
if let Some(working_directory) = &req.working_directory {
executable_path = working_directory.as_ref().join(executable_path)
}
Some(executable_path)
Some(workdir_path.join(executable_path))
Copy link
Member

Choose a reason for hiding this comment

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

Was this a bug-fix picked up along the way? Afaict this is new over and above the shuffle on the LHS.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

Not a bug fix: we have a good test for this. I just pushed up the joining of the workdir_path to avoid an unnecessary clone.

@stuhood stuhood enabled auto-merge (squash) March 11, 2023 04:07
@stuhood stuhood merged commit f8cc00b into pantsbuild:main Mar 11, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants