-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Clarify runtime vs. complete_platforms for serverless. #18001
Merged
jsirois
merged 1 commit into
pantsbuild:main
from
jsirois:serverless/complete-platforms/clarify
Jan 15, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,13 +103,13 @@ def generate_pex_arg_list(self) -> Iterator[str]: | |
|
||
|
||
@rule | ||
async def digest_complete_platforms( | ||
complete_platforms: PexCompletePlatformsField, | ||
async def digest_complete_platform_addresses( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I threw up my hands with rule graph errors, unions and the like. This refactor works but its a bit clunky in that the subclassing backends each need to add a ~throwaway rule to link in. Let me know if there is a better way to do all this. The basic chain is:
|
||
addresses: UnparsedAddressInputs, | ||
) -> CompletePlatforms: | ||
original_file_targets = await Get( | ||
Targets, | ||
UnparsedAddressInputs, | ||
complete_platforms.to_unparsed_address_inputs(), | ||
addresses, | ||
) | ||
original_files_sources = await MultiGet( | ||
Get( | ||
|
@@ -124,6 +124,15 @@ async def digest_complete_platforms( | |
return CompletePlatforms.from_snapshot(snapshot) | ||
|
||
|
||
@rule | ||
async def digest_complete_platforms( | ||
complete_platforms: PexCompletePlatformsField, | ||
) -> CompletePlatforms: | ||
return await Get( | ||
CompletePlatforms, UnparsedAddressInputs, complete_platforms.to_unparsed_address_inputs() | ||
) | ||
|
||
|
||
@frozen_after_init | ||
@dataclass(unsafe_hash=True) | ||
class PexRequest(EngineAwareParameter): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens today if you specify both? I assume we'd want to error? And wouldn't that error message be sufficient??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, like any other PEX, multiplatform is supported and all platforms and complete_platforms are additive. So you can make a PEX that can be deployed to >1 lambda runtime. A separate step could be the whole deprecation procedure to restrict this down to one, which would include transitioning to platform XOR complete_platforms and making complete_platforms singular.