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

Implement layout="zip" for Lambda/GCF, skipping lambdex #19022

Merged
merged 10 commits into from
May 20, 2023
Prev Previous commit
Next Next commit
Review: docs: artefact -> artifact, recommend layout=zip
  • Loading branch information
huonw committed May 18, 2023
commit 82399f79b7c6e8be25142db8f37d208fe8a2a226
15 changes: 8 additions & 7 deletions src/python/pants/backend/python/util_rules/faas.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,17 @@ class PythonFaaSLayoutField(StringField):

help = help_text(
"""
The layout used for the function artefact.
The layout used for the function artifact.

With the `lambdex` layout (default), the artefact is created as a Lambdex, which is a normal
With the `lambdex` layout (default), the artifact is created as a Lambdex, which is a normal
PEX that's been adjusted to include a shim file for the handler. This requires dynamically
choosing dependencies on start-up.

With the `zip` layout, the artefact contains first and third party code at the top level,
similar to building with `pip install --target=...`. This layout chooses the appropriate
versions of dependencies at build time, and so at most one platform can be specified via
`runtime` or `complete_platforms`.
With the `zip` layout (recommended), the artifact contains first and third party code at the
top level, similar to building with `pip install --target=...`. This layout chooses the
appropriate versions of dependencies at build time, and so at most one platform can be
specified via `runtime` or `complete_platforms`. This matches the layout recommended by
cloud providers.

"""
)
Expand Down Expand Up @@ -523,7 +524,7 @@ async def build_python_faas(
platforms=pex_platforms,
complete_platforms=complete_platforms,
output_path=Path(output_filename),
description=f"Build {request.target_name} artefact for {request.address}",
description=f"Build {request.target_name} artifact for {request.address}",
),
)

Expand Down