8000 Add lambda config to ignore architecture by joe4dev · Pull Request #7890 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Add lambda config to ignore architecture #7890

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

Merged
merged 5 commits into from
Mar 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make pulled images cache platform-aware
  • Loading branch information
joe4dev committed Mar 20, 2023
commit 31522e519de98cd0c271f6c7fe3469d2dc043645
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
COPY code/ /var/task
"""

PULLED_IMAGES: set[str] = set()
PULLED_IMAGES: set[(str, DockerPlatform)] = set()

HOT_RELOADING_ENV_VARIABLE = "LOCALSTACK_HOT_RELOADING_PATHS"

Expand Down Expand Up @@ -380,9 +380,11 @@ def prepare_version(cls, function_version: FunctionVersion) -> None:
if function_version.config.code:
function_version.config.code.prepare_for_execution()
image_name = resolver.get_image_for_runtime(function_version.config.runtime)
if image_name not in PULLED_IMAGES:
CONTAINER_CLIENT.pull_image(image_name)
PULLED_IMAGES.add(image_name)
platform = docker_platform(function_version.config.architectures[0])
# Pull image for a given platform upon function creation such that invocations do not time out.
if (image_name, platform) not in PULLED_IMAGES:
CONTAINER_CLIENT.pull_image(image_name, platform)
PULLED_IMAGES.add((image_name, platform))
if config.LAMBDA_PREBUILD_IMAGES:
target_path = function_version.config.code.get_unzipped_code_location()
prepare_image(target_path, function_version)
Expand Down
0