container_builder

UV-based containerized Lambda layer builder.

UvLambdaLayerContainerBuilder orchestrates a Docker-based build that runs uv sync inside an official AWS SAM image.

See docs/source/99-Maintainer-Guide/03-Build-Lambda-Layer-using-UV-in-Container for the full architecture guide.

class aws_lbd_art_builder_uv.layer.container_builder.UvLambdaLayerContainerBuilder(verbose: bool = True, printer: ~typing.Callable[[str], None] = <built-in function print>, path_pyproject_toml: ~pathlib.Path = REQ, py_ver_major: int = REQ, py_ver_minor: int = REQ, is_arm: bool = REQ, path_script: ~pathlib.Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/aws-lbd-art-builder-uv/checkouts/stable/aws_lbd_art_builder_uv/layer/_build_in_container.py'), credentials: ~aws_lbd_art_builder_core.layer.foundation.Credentials | None = None, skip_prompt: bool = False)[source]

Build a Lambda layer using uv inside a Docker container.

Mount scheme: {project_root}/build/lambda/layer//var/task/

The container script (_build_in_container.py) is pure stdlib — no third-party packages are installed inside the container except uv.

step_1_2_check()[source]

Check that uv.lock exists before starting the build.

Container builds are slow and resource-heavy (pulling Docker images, spinning up a container). Failing early on a missing lock file saves minutes of wasted time. The local builder skips this check because local builds are fast enough that discovering the missing lock file at uv sync time is acceptable.

step_2_1_setup_build_dir()[source]

Delete build/lambda/layer/ and recreate the directory structure.

step_2_2_copy_build_script()[source]

Copy _build_in_container.pybuild/lambda/layer/build_lambda_layer_in_container.py.

step_2_3_setup_private_repository_credential()[source]

Dump credentials JSON to build/lambda/layer/private-repository-credentials.json for the container script to read.

step_2_4_prepare_uv_stuff()[source]

Copy pyproject.toml and uv.lock to build/lambda/layer/repo/.

step_4_finalize_artifacts()[source]

Move repo/.venv/lib/pythonX.Y/site-packages/artifacts/python/ on the host.