Skip to content

Non-deterministic selection of Lambda image #8602

@jakob-keller

Description

@jakob-keller

At aiobotocore, we use moto as part of our test suite. We recently started to run CI on arm64 runners and noticed frequent failures due to docker related issues, triggered by moto-backed tests performing Lambda invokations. It turned out that the outdated lambci/lambda images are not available for arm64 and thus causing the failures.

Unfortunately, it appears to be impossible to force moto to reliably pick mlupin/docker-lambda due to the way moto determines the Lambda image to use:

moto/moto/awslambda/models.py

Lines 1025 to 1033 in fc7bcea

# We'll cycle through all of them - when we find the repo that contains our image, we use it
image_repos = set(
[
settings.moto_lambda_image(),
"mlupin/docker-lambda",
"lambci/lambda",
]
)
for image_repo in image_repos:

The order in which images are picked in non-deterministic, due to the Python set being used. I would suggest to make this deterministic and will provide a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions