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

Integrate upstream changes #23

Merged
merged 28 commits into from
Oct 18, 2023
Merged

Integrate upstream changes #23

merged 28 commits into from
Oct 18, 2023

Conversation

joe4dev
Copy link
Member

@joe4dev joe4dev commented Oct 16, 2023

Motivation

The official AWS lambda-runtime-init received some upstream updates (typically merged in big blobs from their internal repository). We should update our customized localstack version to support the latest features (e.g., response streaming) and updates (e.g., the new Golang version). Beyond smaller doc updates, the main updates were:

Background

Internal docs: https://www.notion.so/localstack/Update-RIE-with-upstream-changes-for-response-streaming-18a303b503c54f958cfbee5841ef5402?pvs=4

Changes

Integrates the upstream changes from the AWS lambda-runtime-init repo and adjusts the API accordingly (see documented commit log for details).

👉 Custom LocalStack changes git diff 8b003ee53ffe758979cf64f43f6ae58363efcc2d..integrate-upstream-changes

Testing

Test against the LocalStack test suite.

🧪 The localstack branch integrate-lambda-init-upstream-changes contains some improved tests for the request_id propagation issue. For example: tests.aws.services.lambda_.test_lambda.TestRequestIdHandling.test_request_id_invoke

I tested other categories including:

  • tests.aws.services.lambda_.test_lambda.TestLambdaBaseFeatures
  • tests.aws.services.lambda_.test_lambda.TestRequestIdHandling

TODO

  • Fix failing snapshot test due to uuid not being replaced in the test tests.aws.services.lambda_.test_lambda.TestLambdaFeatures.test_invocation_with_qualifier
  • Resolve TODOs (mostly coding out some logs, error handling etc)
  • Rebase after merging the permission PR Fix filesystem permission parity #22 => Merged the localstack branch back as a quickfix because rebasing again is terrible with so many conflicts 😢

Callum Bodels and others added 23 commits January 4, 2023 10:19
Removing the trailing whitespace in the README.md to improve the formatting and readability of the file.
Add Shield.io badges for Go version and GitHub release.
Useful for displaying important information in a visually appealing and easily accessible way at a glance.

Updated the license badge to standard Shield.io format.
As it appears it was incorrect pointing to the badge for 'aws-sam-local'.
Add content table to README.md, making it more convenient for users to find the information they need and enabling them to quickly jump to specific sections.
Add markup to environment variable for better browsing
The content for some bullet points are not correctly indented or spaced.
This causes text and code blocks to not be displayed properly, causing confusion for customers.

This change indents the content of the bullet points so it is now correctly displayed increasing readability.
* Add missing backslash in docker command

* Remove stray "`" from command

* Covert code snippet to code block for consistency

* Remove extraneous newline

* Fix invalid italics and use "_" for consistency

* Change (invalid) italics to header

Make it consistent with the preceding section that says:
"To build the emulator into your image"

Also, the stray whitespace before the final asterisk was incorrect.

* Add syntax highlighting to code blocks

* Add header to content table
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.1.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](golang/net@v0.1.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…am-changes

Integrate upstream changes. Notable conflicts:

* Makefile: simply upgrade Go version to 1.19 from upstream and use LocalStack changes
* go.mod: merge dependency updates from upstream and keep LocalStack changes
* go.sum: re-generate
* lambda/rapi/server.go: new interop import from upstream (?), otherwise not really conflicts just API updates and by-1-line-neighboring updates
@joe4dev joe4dev marked this pull request as ready for review October 17, 2023 14:48
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.

It's rather hard to get through everything, but our changes look good. Let's see if the LS tests pass :)

@joe4dev
Copy link
Member Author

joe4dev commented Oct 17, 2023

Fixed the error reporting to use the new dedicated callback for SendInitErrorResponse

Other issues discovered during testing:

  • It appears the test TestLambdaRuntimesCommon.test_introspection_invoke fails for for the runtimes python3_7, java8, java8_al2, java11, java17, go1_x, provided, provided_al2 due the two missing environment variables PWD=/var/task and SHLVL=0. These are part of CustomerEnvironmentVariables but just not available anymore for some runtimes 🙃 I also updated the snapshots but nothing has changed at real AWS.
  • go1.x runtime tests fail for me locally but that might be an issue with the ARM build. Both the previous init and these changes yield an error 2023-10-17 21:20:08 time="2023-10-17T19:20:08Z" level=warning msg="Process 19(bootstrap) exited: Runtime exited with error: signal: trace/breakpoint trap" func="go.amzn.com/lambda/core.(*Watchdog).GoWait.func1" file="/home/runner/work/lambda-runtime-init/lambda-runtime-init/lambda/core/watchdog.go:67"
  • Several more tests fail on macOS, most of them due to port in use when using multiple Lambda functions. Including: test_lambda_different_iam_keys_environment, test_runtime_introspection_arm (due to different debug env), test_lambda_concurrency_block, test_provisioned_concurrency, test_reserved_concurrency_async_queue, test_lambda_versions_with_code_changes, test_lambda_alias_moving, test_alias_routingconfig

@joe4dev
Copy link
Member Author

joe4dev commented Oct 17, 2023

It's rather hard to get through everything, but our changes look good. Let's see if the LS tests pass :)

Yeah, I think we just need to release an imperfect "-dev" version to get a good overview from a LocalStack CI run. (we could consider short-lived feature-branch artifacts in the future if velocity becomes a challenge)

@joe4dev joe4dev merged commit 0064e07 into localstack Oct 18, 2023
1 check passed
@joe4dev joe4dev deleted the integrate-upstream-changes branch October 18, 2023 09:04
@joe4dev joe4dev restored the integrate-upstream-changes branch October 18, 2023 12:54
@joe4dev joe4dev mentioned this pull request Oct 18, 2023
3 tasks
@joe4dev joe4dev deleted the integrate-upstream-changes branch October 18, 2023 14:02
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.

6 participants