Comments (12)
Cool. I'm working on this. Do you recall what the point was of rebinding sys.std{out,err}
?
from docker-lambda.
Right π
https://github.com/lambci/docker-lambda/blob/master/python2.7/run/runtime-mock.py#L7
from docker-lambda.
It says on the README, "Python 2.7 and Java 8 test runners are not yet complete, but both languages are installed in the images so can be manually tested"
I haven't really had the time to dig into how the Python and Java runners in Lambda differ from the Node.js one βΒ the Python one appears to use more HTTP functionality to communicate with the AWS Lambda coordinator than Node.js does, but I really haven't looked into it deeply.
I'd happily accept a PR from anyone who's looked into it and can replicate the existing functionality of the Node.js wrapper
from docker-lambda.
@mhart I'd like to look into this more. Where did that runtime-mock.py file come from?
from docker-lambda.
(Also, perhaps there should be two tickets; the Java and Python problems seem distinct.)
from docker-lambda.
@lvh I just created it. Based on the contents of /var/runtime/awslambda/bootstrap.py
and reverse engineering the interface being used
from docker-lambda.
It seems like invokeid might be what the Python Lambda docs call aws_request_id
. Looks like for testing purposes it's OK if that's just a constant (or perhaps a random) string?
from docker-lambda.
@lvh yep, spot on β that's exactly what I do for Node.js: https://github.com/lambci/docker-lambda/blob/master/nodejs/run/awslambda-mock.js#L45
from docker-lambda.
@lvh I believe it's Lambda itself that overrides them (ie, bootstrap.py
, which comes from Lambda). I believe it overrides them to send logs remotely. Whereas, for mocking purposes, we don't want them overridden, so we restore them to the originals on function invocation.
from docker-lambda.
@lvh I was looking for a fork where you would have published your work but couldn't find it, so I ended up implementing it instead in #15. Sorry if there was duplicated work. Your feedback on my PR is very welcome!
from docker-lambda.
Just commenting here to say the Python 2.7 implementation started by @endemics has been merged now β so I've updated the title accordingly
from docker-lambda.
Actually, there's already an issue tracking Java support: #1 β so I'll close this one
from docker-lambda.
Related Issues (20)
- Missing files from provided.al2 HOT 1
- Need support for python3.9 HOT 10
- nodejs16.x support HOT 6
- Golang update to 1.17 HOT 1
- Is java11 image on AL2 and Corretto?
- How can I build image for python3.9 runtime? HOT 4
- Help with Debugging Go Lambda HOT 1
- Rebuild images? HOT 2
- What is the status of this project? HOT 7
- Make `myfunction` and `9001` configurable?
- Support for Node 14.x? HOT 1
- Boto3 and botocore need upgrading HOT 5
- Require image for ARM64 architecture
- Support for .NET 6
- Multi-arch support specially arm64 HOT 1
- Current ruby release (v2.7.2p137) out of date (now v2.7.6p?) HOT 1
- Missing .py file causing attributeError on lambda
- Jenkins agent install on lambci/lambda:build-python3.7 HOT 2
- Debugging with Pycharm
- [Question] Support for Provided Runtimes (Namely C++)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-lambda.