-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
feat: update docker images and add support for different architectures #1755
feat: update docker images and add support for different architectures #1755
Conversation
1a3b0da
to
7390daa
Compare
676f9fd
to
8be74c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sorta works using java11 runtime after changing this import line, but still not 100% on first run.
On first run, calling some REST API, the runtime gives an error ✖ Failed to fetch from http://localhost:50257/2018-06-01/ping with Not Found
But when I request the same REST API, it works (and all subsequently requests)
@@ -0,0 +1,33 @@ | |||
import { supportedRuntimesArquitecture } from "../../config/index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not run because of this line, it should be changed to
import { supportedRuntimesArquitecture } from "../../../config/supportedRuntimes.js"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just changed this, sorry for the issue.
On this aws docker images i could find ping endpoint, so i remove ping function. |
Tested with a project using golang, provided.al2, and an M1 Mac and it seems to work well. No errors found so far. |
I am testing in Go and it works! |
Tested this using python3.10 functions on linux and works great, thank you for this fix! |
@dnalborczyk i just fix the lint error, can run again the actions workflow? |
src/lambda/__tests__/fixtures/Lambda/LambdaFunctionThatReturnsJSONObject-fixture.js
Outdated
Show resolved
Hide resolved
src/lambda/__tests__/fixtures/Lambda/LambdaFunctionThatReturnsNativeString-fixture.js
Outdated
Show resolved
Hide resolved
thank you for the PR @BenjaminBergerM ! I just de-activated the docker tests because of the failures. I suppose we should activate those again. could you do this in this PR? 0e883f7 |
async request(event) { | ||
const url = `http://${this.#dockerOptions.host}:${this.#port}/2015-03-31/functions/${this.#functionKey}/invocations` | ||
const url = `http://${this.#dockerOptions.host}:${this.#port}/2015-03-31/functions/function/invocations` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is ${this.#functionKey} not working here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the aws images, to invoke a function is no need to use the function key.
https://docs.aws.amazon.com/lambda/latest/dg/go-image.html#go-image-clients
Heres an example on the documentation.
![Screenshot 2024-02-10 at 18 50 03](https://private-user-images.githubusercontent.com/50329833/303867707-86872523-7e8c-44d1-bbdd-a411fda811bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTg5NTMsIm5iZiI6MTczOTQxODY1MywicGF0aCI6Ii81MDMyOTgzMy8zMDM4Njc3MDctODY4NzI1MjMtN2U4Yy00NGQxLWJiZGQtYTQxMWZkYTgxMWJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzNTA1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhNWRkMjdmYjQ5NGNiYWExMzQwY2YxMTAyZmQzZDExMjUyMmVkYjUyZTE2M2RiZmMzODA3MzM1NjE4ZmU4NmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.y38uDJnpPpAxyaEGR7Qv9k4nYSPASNj3x66mBzCyPYg)
Hello everyone! I want to express my appreciation for your PR contributions. While deploying the code to the cloud seems to be successful, I've encountered an error locally: '/lambda-entrypoint.sh: line 14: /var/runtime/bootstrap: No such file or directory.' Interestingly, I can see that the zip file was unpacked, and for each invocation, I can locate it at a path similar to '../.serverless-offline/...../fe9fdf79-23ca-49d6-9d1c-162876a7960b/code/bootstrap.' Any insights on what might be causing this issue? |
There are some issues on ubuntu:
Maybe this issue is related, it's hard to say (I need to dig deeper) -> aws/aws-lambda-base-images#26 There is also another alternative to lambci/lambda images (but they are not official docker images) -> https://github.com/mLupine/docker-lambda |
Okay, it should be fixed now. I will wait for tests and probably merge it. Thank you @BenjaminBergerM |
Description
Since https://github.com/lambci/docker-lambda lambda docker images are deprecated, serverless offline using docker was not working with many languages. So I changes de docker image source from
lambci/docker-lambda
topublic.ecr.aws/lambda/{runtime}
.Also added support to diffrent architectures, now works with all runtimes and architectures that aws has a public image con ecr.
Also change docker configuration so it could be run with the new images.
Follow serverless/serverless#10797 (comment) this instructions.
Motivation and Context
I have many services running with Serverless and Golang, i use this plugin to run them locally and since 29 of January i want able to run muy code.
Related issues: #1754 #1750
How Has This Been Tested?
I run all test, and also imported the package to deferent serverless applications i have using docker.
Screenshots (if appropriate):