lambda-runtime | Version router with multiple AZ for redundancy | Function As A Service library
kandi X-RAY | lambda-runtime Summary
kandi X-RAY | lambda-runtime Summary
Simple package to allow versioning in AWS Lambdas as well as basic fallback.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lambda-runtime
lambda-runtime Key Features
lambda-runtime Examples and Code Snippets
Community Discussions
Trending Discussions on lambda-runtime
QUESTION
I'm following the instructions to locally test lambda container https://docs.aws.amazon.com/lambda/latest/dg/images-test.html
but I am unable to do so.
I've created a sample project to reproduce it https://gitlab.com/sunnyatticsoftware/sandbox/lambda-dotnet5-webapi (see the README for step by step on its generation)
Basically I am using an Amazon dotnet template that generates an AWS Lambda function as a .NET 5 web api using containers.
It's all good with the project. The Dockerfile is described as
...ANSWER
Answered 2021-Feb-22 at 15:32The lambda docker images for dotnet already include the RIE, so it's enough with the following (see repo with further details):
To build image
QUESTION
I'm using the last version of Spring Cloud Function as below
...ANSWER
Answered 2021-Feb-05 at 15:52Digging some more, you have version missmatch. Basically at the moment we're dependent on the following dependencies from AWS
QUESTION
I've looked at and tried nearly every other post on this topic with no luck.
EC2I'm using python 3.6
so I'm using the following AMI amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2
(see here). Once I SSH into my EC2, I download Chrome with:
ANSWER
Answered 2020-Nov-18 at 22:38This error message...
QUESTION
Outline: I need to use scikit-image
inside some AWS lambda functions, so I'm looking to build a custom AWS lambda layer containing scikit-image
.
My questions in general should apply to any python module, notably scikit-learn, or any custom layer in general I think.
Background: After much googling and reading it seems the best way to do that is to use docker to run the AWS lambda runtime locally, and then inside there install/compile scikit-image (or whichever module you're looking for). After that's done, you can upload/install it to AWS as a custom layer.
This is conceptually pretty simple, but I'm struggling a bit with best-practices way to do this. I've got this working, but not sure I'm doing it the best/right/optimal/secure way ... there are million all-slightly-different blog posts about this, and the AWS docs themselves are (IMHO) too detailed but skip over some of the basic questions.
I've been trying to basically follow two good medium posts, here and here ...kudos to those guys.
My main questions are:
- Where is the best place to find the latest AWS AMI docker image?
There are multiple (even on amazon itself) multiple locations/versions etc for what is supposedly the latest image. eg https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html, or https://cdn.amazonlinux.com/os-images/2.0.20190823.1/.
..This is ignoring the multitude of non-amazon github hosted possibilities, such as lambci/lambda:build-python3.6
from medium posts here, or onema/amazonlinux4lambda
from here.
I'd prefer to use an amazon provided docker image, for both security and up-to-date'ness.
- Is the AWS lambda runtime here, which links to this AMI, a docker image? If so (or not) how do you download it to run it locally?
- How do you ensure you know when you might need to rebuild a layer, because the AWS lambda runtime is changed by amazon and that breaks you're layer using an older runtime?
- Is it better to build (compile in the case of scikit-image) the pip installed module inside of the docker AIM container, or simply just to tell pip to download the pre-built version and hope/trust it will get the compiled libs that are the best for the AMI you're running?
Basically here I'm concerned about stability and performance. I'd like to ensure that the compiled libraries for scikit-image in this case are as optimized as possible for the AMI container.
- Is it better to just download and use AWS's SAM to do all of this? (looks like overkill and complicated, but it does look like it takes care of ensuring you're using the 'correct' AMI docker container all the time)
- Are there any (good, trustable) repo's of pre-built lambda layers around (that might make all this a moot point)? I looked but couldn't find any.
...thanks for any advice, thoughts and comments!
...ANSWER
Answered 2019-Oct-15 at 14:49I'm not an expert at this, but I happened to have the very same set of questions on the same day. However I can answer question #1 and #2. Taking them out of order:
2) An AMI is not a docker image, its for use in an EC2 instance.
1) Here is how I got the appropriate docker image:
I installed SAM cli and executed the following commands:
sam init --runtime python3.7 (sets up hello world example)
sam build -u (builds app, -u means use a container)
Output from sam build -u:
Fetching lambci/lambda:build-python3.7 Docker container image
So there you go. You can either get the image from dockerhub directly or if you have SAM cli installed, you can execute "sam build -u". Now that you have the image, you don't have to follow the full SAM workflow, if you don't want the overhead.
QUESTION
{
"errorMessage": "Unable to import module 'lambda_function':
cannot import name 'etree' from 'lxml' (/var/task/lxml/__init__.py)",
"errorType": "Runtime.ImportModuleError"
}
...ANSWER
Answered 2019-Jun-29 at 21:59There are modules that cannot be added directly into the site-packages
directory to be recognised inside an AWS Lambda environment. When that happens, you have to get an Amazon Linux image from Docker repositories and make your own compiled environment in a container version that will run on AWS Lambda
For example, if you want to use Python 3.6 a good choice will be amazonlinux:2018.03
in case you want to install more packages e.g. pandas, numpy, scipy
QUESTION
I would like to deploy my java function on aws lambda
I took this documentation https://docs.aws.amazon.com/lambda/latest/dg/java-package.html
This is my build.gradle
file
ANSWER
Answered 2020-May-03 at 21:06The into
method of the Zip
task type can accept a CopySpec
which you can use to add exclusions:
QUESTION
I'm trying to build wheel for mysqlclient
Base image Dockerfile
ANSWER
Answered 2020-Apr-03 at 21:51Due to the bug in the patcheif
we need to use this repo with patched for auditwheel patcheif
version. Full example can be found here
QUESTION
Trying to build the hello world example, but the cmake always complain
By not providing "Findaws-lambda-runtime.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "aws-lambda-runtime", but CMake did not find one.
Environment
- OS : ubuntu18.04.3 LTS,64bits
- install curl by : sudo apt-get install libcurl4-openssl-dev
- install cmake by ubuntu software(cmake version 3.16.1)
Steps to build and install aws lambda cpp
- git clone https://github.com/awslabs/aws-lambda-cpp.git
- cd aws-lambda-cpp
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_PREFIX=${PWD}/install
- make -j2
- sudo make install
CmakeLists.txt(omit another part, want to make sure find_package works first)
...ANSWER
Answered 2019-Dec-17 at 11:10Could you try to set CMAKE_PREFIX_PATH
just before the find_package
?
Something like this:
QUESTION
I would like to try the custom C++ runtime for AWS Lambda and testing it locally using SAM. Unfortunately I get the error Runtime exited without providing a reason
(compare error details below). How can I run C++ Lambda functions locally with SAM?
Approach:
I am following the exact steps described in official C++ Introduction blog, up to the last step of "Create your C++ function". The rest of the blog is about deploying the function on Lambda (which I DO NOT want to do, since I would like to use SAM locally).
In order to use SAM, I am putting a template.yaml
in the build dir. The structure of the build dir
now looks like this:
ANSWER
Answered 2019-Oct-18 at 15:57The problem is likely here:
/var/task/bin/hello: error while loading shared libraries: /var/task/lib/libc.so.6: file too short
Your binary does not even invoke.
You should be able to resolve this problem by building the binary on matching version of AWS Linux
or by building a static binary.
QUESTION
I am trying to run an exiftool for reading image meta data within a python script, as part of a lambda function on AWS.
On an ec2 instance running amazon linux, which is what the python3.6 runtime uses, I can download the tool, extract it, then run it easily. However, trying to do this from my python script in the lambda function does not work.
My lambda function is as follows:
...ANSWER
Answered 2019-Jul-02 at 23:10Try adding to your Referenced Layers one of the ARNs listed in https://p3rl.org/AWS::Lambda (there are instructions there).
I haven't done this myself, but from everything I see it should work.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lambda-runtime
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page