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

Optimize get_expanded_specs for StreamingWorkunit plugins #16106

Merged
merged 4 commits into from
Jul 11, 2022

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Jul 8, 2022

StreamingWorkunit plugins can use get_expanded_specs to capture the addresses associated with the input CLI specs for a run. But in cases with large numbers of input roots, this results in engine requests proportional to the number of targets in the repository.

This change adjusts the algorithm for building the mapping from unexpanded addresses to expanded targets, and cleans up the Scheduler.execute API to allow for making requests with different product types in parallel.

[ci skip-rust]
[ci skip-build-wheels]

@stuhood stuhood added needs-cherrypick category:bugfix Bug fixes for released features labels Jul 8, 2022
@stuhood stuhood added this to the 2.13.x milestone Jul 8, 2022
@stuhood stuhood requested review from tdyas and Eric-Arellano July 8, 2022 23:43
@stuhood
Copy link
Member Author

stuhood commented Jul 8, 2022

Commits are useful to review independently.

src/python/pants/engine/streaming_workunit_handler.py Outdated Show resolved Hide resolved
src/python/pants/bsp/protocol.py Outdated Show resolved Hide resolved
stuhood added 3 commits July 10, 2022 14:51
…nt subjects.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@stuhood stuhood force-pushed the stuhood/optimize-expand-specs branch 3 times, most recently from cb6d6f6 to 1cb5c30 Compare July 10, 2022 22:40
[ci skip-rust]

[ci skip-build-wheels]
@stuhood stuhood force-pushed the stuhood/optimize-expand-specs branch from 1cb5c30 to 9cce6e0 Compare July 11, 2022 16:16
@stuhood stuhood enabled auto-merge (squash) July 11, 2022 16:16
@stuhood stuhood disabled auto-merge July 11, 2022 16:31
@stuhood stuhood merged commit 9ca84b5 into pantsbuild:main Jul 11, 2022
@stuhood stuhood deleted the stuhood/optimize-expand-specs branch July 11, 2022 17:28
stuhood added a commit to stuhood/pants that referenced this pull request Jul 12, 2022
…uild#16106)

`StreamingWorkunit` plugins can use `get_expanded_specs` to capture the addresses associated with the input CLI specs for a run. But in cases with large numbers of input roots, this results in engine requests proportional to the number of targets in the repository.

This change adjusts the algorithm for building the mapping from unexpanded addresses to expanded targets, and cleans up the `Scheduler.execute` API to allow for making requests with different product types in parallel.

[ci skip-rust]
[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Jul 12, 2022
…-pick of #16106) (#16147)

`StreamingWorkunit` plugins can use `get_expanded_specs` to capture the addresses associated with the input CLI specs for a run. But in cases with large numbers of input roots, this results in engine requests proportional to the number of targets in the repository.

This change adjusts the algorithm for building the mapping from unexpanded addresses to expanded targets, and cleans up the `Scheduler.execute` API to allow for making requests with different product types in parallel.

[ci skip-rust]
[ci skip-build-wheels]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants