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

Add endpoint to expose lambda init binary, increase fidelity of the kubernetes dev script #10828

Merged
merged 6 commits into from
May 22, 2024

Conversation

dfangl
Copy link
Member

@dfangl dfangl commented May 15, 2024

Motivation

We are working on several features which need to download the init binary from LocalStack on demand.
This necessitated the inclusion of an endpoint to expose the init binary.

Also, the kubernetes dev script had some shortcomings, like the pro image not automatically selected, unable to automatically add environment variables, and not exposing a port by default.
For increased usability, I added those features.

Lastly, we now have a check if docker is available before trying to pull / inspect, to avoid needlessly verbose error messages.

Changes

  • LocalStack now exposes its init binary over the <localstack_host>/_aws/lambda/init endpoint (GET)
  • python -m localstack.dev.kubernetes now has new parameters and automatically determines the correct image (although the community image might still be broken and needs more fixing)
  • Deploying an image lambda without the docker socket mount now only throws a single warning instead of multiple quite verbose errors.

@dfangl dfangl added aws:lambda AWS Lambda semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels May 15, 2024
@dfangl dfangl self-assigned this May 15, 2024
@dfangl dfangl requested a review from simonrw May 15, 2024 14:30
Copy link

github-actions bot commented May 15, 2024

LocalStack Community integration with Pro

    2 files      2 suites   1h 41m 26s ⏱️
2 981 tests 2 675 ✅ 306 💤 0 ❌
2 983 runs  2 675 ✅ 308 💤 0 ❌

Results for commit 13c80a0.

♻️ This comment has been updated with latest results.

@dfangl dfangl force-pushed the kubernetes-image-executor branch 2 times, most recently from 65ba56b to 2f07712 Compare May 16, 2024 13:55
@dfangl dfangl marked this pull request as ready for review May 16, 2024 13:55
@dfangl dfangl force-pushed the kubernetes-image-executor branch from 2f07712 to 99beca1 Compare May 17, 2024 11:06
Copy link
Contributor

@simonrw simonrw left a comment

Choose a reason for hiding this comment

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

I won't speak of the Lambda changes, but these seem reasonable, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for making these improvements!

@dfangl dfangl force-pushed the kubernetes-image-executor branch from 99beca1 to a57c7ed Compare May 21, 2024 08:13
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

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

The changes look good to me, but I have not tested them. For such PRs, it would be helpful to have a "Testing" section with suggested steps to test.

The K8 dev script is great. Unfortunately, it did not work yet as expected:

  • It prints "Generated file: configuration.yml" but does not actually generate a file (I had to manually copy/paste the output; maybe that's intended and the output is misleading)
  • k3d cluster create ... prints INFO[0003] Prep: Network and then nothing happens 🤔 A subsequent helm upgrade ... fails with cluster unreachable.

I didn't investigate further ...

localstack/services/lambda_/custom_endpoints.py Outdated Show resolved Hide resolved
localstack/services/lambda_/custom_endpoints.py Outdated Show resolved Hide resolved
localstack/services/lambda_/invocation/lambda_service.py Outdated Show resolved Hide resolved
localstack/services/lambda_/packages.py Show resolved Hide resolved
@dfangl
Copy link
Member Author

dfangl commented May 22, 2024

  1. I agree the terminology is misleading, but there is a --write flag you need to provide to write the files. I did not touch that part of the code, but good input for a follow up.
  2. Not sure about that, it works fine on my linux machine. I have not tested the kubernetes dev script on macos either, however I am not sure it is related to my changes.

@dfangl dfangl merged commit a9c5803 into master May 22, 2024
30 checks passed
@dfangl dfangl deleted the kubernetes-image-executor branch May 22, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:lambda AWS Lambda semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants