Skip to content

Add option to customize images used for lambda execution#7317

Merged
dominikschubert merged 5 commits intomasterfrom
feat_lambda-runtime-config
Dec 13, 2022
Merged

Add option to customize images used for lambda execution#7317
dominikschubert merged 5 commits intomasterfrom
feat_lambda-runtime-config

Conversation

@dominikschubert
Copy link
Member

Adds a RuntimeImageResolver class and a corresponding new config variable LAMBDA_RUNTIME_IMAGE_MAPPING

Copied doc from the class:

Resolves Lambda runtimes to corresponding docker images
The default behavior resolves based on a prefix (including the repository) and a suffix (per runtime).

This can be customized via the LAMBDA_RUNTIME_IMAGE_MAPPING config in 2 distinct ways:

Option A: use a pattern string for the config variable that includes the "" string
e.g. "myrepo/lambda:-custom" would resolve the runtime "python3.9" to "myrepo/lambda:python3.9-custom"

Option B: use a JSON dict string for the config variable, mapping the runtime to the full image name & tag
e.g. {"python3.9": "myrepo/lambda:python3.9-custom", "python3.8": "myotherrepo/pylambda:3.8"}

  Note that with Option B this will only apply to the runtimes included in the dict.
  All other (non-included) runtimes will fall back to the default behavior.

sample configurations:

  • LAMBDA_RUNTIME_IMAGE_MAPPING="customrepo/lambda-<runtime>:2022"
  • LAMBDA_RUNTIME_IMAGE_MAPPING='{"python3.9": "customrepo/lambda-py-thon:3.9"}'

@dominikschubert dominikschubert temporarily deployed to localstack-ext-tests December 13, 2022 09:03 — with GitHub Actions Inactive
Copy link
Member

@whummer whummer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - thanks for jumping on this one! 🚀

Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! nice clean config + implementation

Copy link
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dominikschubert dominikschubert temporarily deployed to localstack-ext-tests December 13, 2022 09:33 — with GitHub Actions Inactive
@dominikschubert dominikschubert temporarily deployed to localstack-ext-tests December 13, 2022 09:33 — with GitHub Actions Inactive
@dominikschubert dominikschubert temporarily deployed to localstack-ext-tests December 13, 2022 10:05 — with GitHub Actions Inactive
@github-actions
Copy link

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   1h 19m 53s ⏱️ - 4m 11s
1 559 tests ±0  1 292 ✔️ ±0  267 💤 ±0  0 ±0 
2 191 runs  ±0  1 660 ✔️ ±0  531 💤 ±0  0 ±0 

Results for commit eb36803. ± Comparison against base commit c7cc6d5.

@dominikschubert dominikschubert merged commit 423c93c into master Dec 13, 2022
@dominikschubert dominikschubert deleted the feat_lambda-runtime-config branch December 13, 2022 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants