-
-
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
Include complete platforms for FaaS environments for more reliable building #19253
Merged
huonw
merged 4 commits into
pantsbuild:main
from
huonw:feature/18195-auto-complete-platforms
Jun 13, 2023
Merged
Include complete platforms for FaaS environments for more reliable building #19253
huonw
merged 4 commits into
pantsbuild:main
from
huonw:feature/18195-auto-complete-platforms
Jun 13, 2023
Conversation
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
benjyw
approved these changes
Jun 6, 2023
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.
Excellent!
I don't know how to find out the exact GCF runtime short of actually running a live function to do so?
I'm going to merge this as is, with Lambda support, but keep #18195 open to cover adding it for GCF too. |
This was referenced Jun 13, 2023
huonw
added a commit
that referenced
this pull request
Jun 14, 2023
This updates `changelog.py` to write the (non-internal) changes to the relevant release notes file directly, rather than requiring a human to copy-paste it in. For now, the file is just mutated, without committing. The internal changes are still printed for the human to deal with. For instance, `pants run src/python/pants_release/changelog.py -- --prior 2.18.0.dev1 --new 2.18.0.dev2` adds a new section to `src/python/pants/notes/2.18.x.md`: ```diff diff --git a/src/python/pants/notes/2.18.x.md b/src/python/pants/notes/2.18.x.md index e648a4525c..d6668a24b1 100644 --- a/src/python/pants/notes/2.18.x.md +++ b/src/python/pants/notes/2.18.x.md @@ -1,5 +1,35 @@ # 2.18.x Release Series +## 2.18.0.dev2 (Jun 14, 2023) + +### New Features + +* Include complete platforms for FaaS environments for more reliable building ([#19253](#19253)) + +* Add experimental support for Rustfmt ([#18842](#18842)) + +* Helm deployment chart field ([#19234](#19234)) + +### Plugin API Changes + +* Replace `include_special_cased_deps` flag with `should_traverse_deps_predicate` ([#19272](#19272)) + +### Bug Fixes + +* Raise an error if isort can't read a config file ([#19294](#19294)) + +* Improve handling of additional files in Helm unit tests ([#19263](#19263)) + +* Add taplo to the release ([#19258](#19258)) + +* Handle `from foo import *` wildcard imports in Rust dep inference parser ([#19249](#19249)) + +* Support usage of `scala_artifact` addresses in `scalac_plugin` targets ([#19205](#19205)) + +### Performance + +* `scandir` returns `Stat`s relative to its directory. ([#19246](#19246)) + ## 2.18.0.dev1 (Jun 02, 2023) ### New Features ``` This also moves it into the new `pants_release` root, adds some basic tests, and has it fetch the relevant branch directly, rather than prompting the user to do so. It also pulls out a `git.py` support module with helpers for exec-ing `git` as an external process. The commits are individually reviewable. This is a step towards automating more of the "start release" process, per #19279. After this core refactoring of the functionality, I think the next step is to combine it with the CONTRIBUTORS update and version bumping, and then after that string it all together on CI so that starting a release is fully automated.
huonw
added a commit
that referenced
this pull request
Aug 20, 2023
This adds a cached complete platform JSON file for the new support for Python 3.11 in Lambda https://aws.amazon.com/blogs/compute/python-3-11-runtime-now-available-in-aws-lambda/ As a bit of a drive-by, this also updates the other files based on what seems to be upstream changes to the builder images. As a reminder, #19253 set up this infrastructure for pre-baked complete-platform JSON files for the AWS Lambda environment, which enables Pants 2.18 to build lambdas that pick the right wheels more reliably than just approximating via the `--platform` "incomplete" platform summary.
huonw
added a commit
that referenced
this pull request
Aug 7, 2024
This updates the Lambda and GCF docs (very belatedly) for the "new" behaviours related to choosing platform specific code, like inference of the `runtime` field (#19314), and associated complete platforms (#19253). This includes stripping out the `runtime` field from the "main" flow, and adding an separate subsection for how to specify the runtime explicitly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changes the behaviour of the
runtime
field of thepython_aws_lambda_function
,python_aws_lambda_layer
andpython_google_cloud_function
FaaS targets to be translated into a Pants-provided complete platform (if known), rather than using the less specific--platform
argument.For example, when building a target like
python_aws_lambda_function(..., runtime="python3.10")
, Pants will pull out an appropriate complete platform resource and use that when building the Lambda function, to choose the correct wheels.This is motivated by:
runtime
/--platform
often fails and users have to switch to using complete platforms themselves, and, one can still usecomplete_platforms
manually, so this is not worse.layout = "zip"
means that passing bothruntime="..."
andcomplete_platforms=[...]
will fail, as only one--platform=...
or--complete-platform=...
argument can be passed to the underlying PEX call.The moving parts are:
build-support/bin/generate_faas_complete_platforms.py
that reads information about each FaaS system, including runtime docker repo and the tags for each 'known runtime', and shells out to docker to extra a complete platform JSON filecomplete_platforms
isn't specified, convert theruntime
a complete platform argument (if it's known), or continue falling back to the naive--platform
styleNotes:
runtime
andcomplete_platforms
field:runtime
is now totally ignored, but, per point 3 of the motivation above, this would fail anyway)complete_platforms=[]
is now permitted, and, I hope, means the PEX calls will use the ambient interpreter, e.g. if running in a compatible docker imagelayout = "zip"
, aslayout = "lambdex"
will be removed soon.==3.10.*
, inferruntime="python3.10"
), so that a minimal FaaS target can bepython_aws_lambda_function(name="foo", handler="./foo.py:handler")
.)Fixes #18195