diff --git a/README.md b/README.md index 411980c5..b8575818 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ same library versions that exist on AWS Lambda and then deploy using the [AWS CLI](https://aws.amazon.com/cli/). This project consists of a set of Docker images for each of the supported Lambda runtimes -(Node.js 0.10, 4.3 and 6.10, Python 2.7 and 3.6, Java 8, .NET Core 2.0, and Go 1.x). +(Node.js 0.10, 4.3, 6.10 and 8.10, Python 2.7 and 3.6, Java 8, .NET Core 2.0, and Go 1.x). There are also a set of build images that include packages like gcc-c++, git, zip and the aws-cli for compiling and deploying. @@ -34,14 +34,11 @@ You can run your Lambdas from local directories using the `-v` arg with `docker run` – logging goes to stderr and the callback result goes to stdout: ```sh -# Test an index.handler function from the current directory on Node.js v4.3 -docker run --rm -v "$PWD":/var/task lambci/lambda +# Test an index.handler function from the current directory on Node.js v8.10 +docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs8.10 # If using a function other than index.handler, with a custom event -docker run --rm -v "$PWD":/var/task lambci/lambda index.myHandler '{"some": "event"}' - -# Use the original Node.js v0.10 runtime -docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs +docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs8.10 index.myHandler '{"some": "event"}' # Use the Node.js v6.10 runtime docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs6.10 @@ -66,11 +63,11 @@ docker run --rm -v "$PWD":/var/task lambci/lambda:java8 org.myorg.MyHandler # a class named Function with a FunctionHandler method, and a custom event docker run --rm -v "$PWD":/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler '{"some": "event"}' -# Run custom commands on the default container -docker run --rm --entrypoint node lambci/lambda -v +# Run custom commands +docker run --rm --entrypoint node lambci/lambda:nodejs8.10 -v # For large events you can pipe them into stdin if you set DOCKER_LAMBDA_USE_STDIN (on any runtime) -echo '{"some": "event"}' | docker run --rm -v "$PWD":/var/task -i -e DOCKER_LAMBDA_USE_STDIN=1 lambci/lambda +echo '{"some": "event"}' | docker run --rm -v "$PWD":/var/task -i -e DOCKER_LAMBDA_USE_STDIN=1 lambci/lambda:nodejs8.10 ``` You can see more examples of how to build docker images and run different @@ -80,10 +77,7 @@ To use the build images, for compilation, deployment, etc: ```sh # To compile native deps in node_modules (runs `npm rebuild`) -docker run --rm -v "$PWD":/var/task lambci/lambda:build - -# To use a different runtime from the default Node.js v4.3 -docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs6.10 +docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 # To resolve dependencies on go1.x (working directory is /go/src/handler, will run `dep ensure`) docker run --rm -v "$PWD":/go/src/handler lambci/lambda:build-go1.x @@ -93,7 +87,7 @@ docker run --rm -v "$PWD":/go/src/handler lambci/lambda:build-go1.x docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub # Run custom commands on a build container -docker run --rm lambci/lambda:build aws --version +docker run --rm lambci/lambda:build-python2.7 aws --version # To run an interactive session on a build container docker run -it lambci/lambda:build-python3.6 bash @@ -117,7 +111,7 @@ lambdaCallbackResult = dockerLambda({dockerImage: 'lambci/lambda:nodejs6.10'}) Create your own Docker image for finer control: ```dockerfile -FROM lambci/lambda:build +FROM lambci/lambda:build-nodejs8.10 ENV AWS_DEFAULT_REGION us-east-1 @@ -180,17 +174,17 @@ Documentation ------------ Docker tags (follow the Lambda runtime names): - - `latest` / `nodejs4.3` - - `nodejs` + - `nodejs4.3` - `nodejs6.10` + - `nodejs8.10` - `python2.7` - `python3.6` - `java8` - `go1.x` - `dotnetcore2.0` - - `build` / `build-nodejs4.3` - - `build-nodejs` + - `build-nodejs4.3` - `build-nodejs6.10` + - `build-nodejs8.10` - `build-python2.7` - `build-python3.6` - `build-java8` diff --git a/base/diff.sh b/base/diff.sh index 52d2fda2..90353c0d 100755 --- a/base/diff.sh +++ b/base/diff.sh @@ -1,6 +1,6 @@ #!/bin/bash -RUNTIMES="nodejs4.3 nodejs6.10 python2.7 python3.6 java8 go1.x" +RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 java8 go1.x dotnetcore2.0" rm -rf diff mkdir -p diff @@ -25,24 +25,28 @@ done docker run --rm --entrypoint find lambci/lambda:nodejs4.3 / | sed 's/^\///' | sort > ./diff/nodejs4.3/fs.docker.txt -# cd diff/nodejs4.3 -# diff docker/var/runtime/node_modules/awslambda/index.js lambda/var/runtime/node_modules/awslambda/index.js -# diff -qr docker lambda | grep -v '/var/runtime/node_modules/aws-sdk' +cd diff/nodejs4.3 +diff fs.docker.txt fs.lambda.txt | grep -v '^< dev/' | grep -v '^< proc/' | grep -v '^< sys/' | grep -v 'var/runtime/' +diff docker/var/runtime/node_modules/awslambda/index.js lambda/var/runtime/node_modules/awslambda/index.js +diff -qr docker lambda | grep -v '/var/runtime/node_modules/aws-sdk' + +cd ../nodejs6.10 +diff docker/var/runtime/node_modules/awslambda/index.js lambda/var/runtime/node_modules/awslambda/index.js +diff -qr docker lambda | grep -v '/var/runtime/node_modules/aws-sdk' cd ../python2.7 diff docker/var/runtime/awslambda/bootstrap.py lambda/var/runtime/awslambda/bootstrap.py diff -qr docker lambda | grep -v '/var/runtime/boto' -# cd ../python3.6 -# diff docker/var/runtime/awslambda/bootstrap.py lambda/var/runtime/awslambda/bootstrap.py -# diff -qr docker lambda | grep -v '/var/runtime/boto' | grep -v __pycache__ +cd ../python3.6 +diff docker/var/runtime/awslambda/bootstrap.py lambda/var/runtime/awslambda/bootstrap.py +diff -qr docker lambda | grep -v '/var/runtime/boto' | grep -v __pycache__ -# cd ../nodejs6.10 -# diff docker/var/runtime/node_modules/awslambda/index.js lambda/var/runtime/node_modules/awslambda/index.js -# diff -qr docker lambda | grep -v '/var/runtime/node_modules/aws-sdk' +cd ../java8 +diff -qr docker lambda -# cd ../java -# diff -qr docker lambda +cd ../go1.x +diff -qr docker lambda -# cd ../go1.x -# diff -qr docker lambda +cd ../dotnetcore2.0 +diff -qr docker lambda diff --git a/base/dump-nodejs810.js b/base/dump-nodejs810.js new file mode 100644 index 00000000..08074e60 --- /dev/null +++ b/base/dump-nodejs810.js @@ -0,0 +1,89 @@ +var fs = require('fs') +var childProcess = require('child_process') +var AWS = require('aws-sdk') +var s3 = new AWS.S3() + +exports.handler = function(event, context, cb) { + var filename = 'nodejs8.10.tgz' + var cmd = 'tar -cpzf /tmp/' + filename + + ' --numeric-owner --ignore-failed-read /var/runtime /var/lang' + + var child = childProcess.spawn('sh', ['-c', event.cmd || cmd]) + child.stdout.setEncoding('utf8') + child.stderr.setEncoding('utf8') + child.stdout.on('data', console.log.bind(console)) + child.stderr.on('data', console.error.bind(console)) + child.on('error', cb) + + child.on('close', function() { + if (event.cmd) return cb() + + console.log('Zipping done! Uploading...') + + s3.upload({ + Bucket: 'lambci', + Key: 'fs/' + filename, + Body: fs.createReadStream('/tmp/' + filename), + ACL: 'public-read', + }, function(err, data) { + if (err) return cb(err) + + console.log('Uploading done!') + + console.log(process.execPath) + console.log(process.execArgv) + console.log(process.argv) + console.log(process.cwd()) + console.log(__filename) + console.log(process.env) + console.log(context) + + cb(null, data) + }) + }) +} + +// /var/lang/bin/node +// [ '--max-old-space-size=1229', '--max-semi-space-size=76', '--max-executable-size=153', '--expose-gc' ] +// [ '/var/lang/bin/node', '/var/runtime/node_modules/awslambda/index.js' ] +// /var/task +// /var/task/index.js +// { +// PATH: '/var/lang/bin:/usr/local/bin:/usr/bin/:/bin', +// LANG: 'en_US.UTF-8', +// LD_LIBRARY_PATH: '/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib', +// LAMBDA_TASK_ROOT: '/var/task', +// LAMBDA_RUNTIME_DIR: '/var/runtime', +// AWS_REGION: 'us-east-1', +// AWS_DEFAULT_REGION: 'us-east-1', +// AWS_LAMBDA_LOG_GROUP_NAME: '/aws/lambda/dump-node810', +// AWS_LAMBDA_LOG_STREAM_NAME: '2017/03/23/[$LATEST]c079a84d433534434534ef0ddc99d00f', +// AWS_LAMBDA_FUNCTION_NAME: 'dump-node810', +// AWS_LAMBDA_FUNCTION_MEMORY_SIZE: '1536', +// AWS_LAMBDA_FUNCTION_VERSION: '$LATEST', +// _AWS_XRAY_DAEMON_ADDRESS: '169.254.79.2', +// _AWS_XRAY_DAEMON_PORT: '2000', +// AWS_XRAY_DAEMON_ADDRESS: '169.254.79.2:2000', +// AWS_XRAY_CONTEXT_MISSING: 'LOG_ERROR', +// _X_AMZN_TRACE_ID: 'Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=0', +// AWS_EXECUTION_ENV: 'AWS_Lambda_nodejs8.10', +// NODE_PATH: '/var/runtime:/var/task:/var/runtime/node_modules', +// AWS_ACCESS_KEY_ID: 'ASIA...C37A', +// AWS_SECRET_ACCESS_KEY: 'JZvD...BDZ4L', +// AWS_SESSION_TOKEN: 'FQoDYXdzEMb//////////...0oog7bzuQU=' +// } +// { +// callbackWaitsForEmptyEventLoop: [Getter/Setter], +// done: [Function: done], +// succeed: [Function: succeed], +// fail: [Function: fail], +// logGroupName: '/aws/lambda/dump-node810', +// logStreamName: '2017/03/23/[$LATEST]c079a84d433534434534ef0ddc99d00f', +// functionName: 'dump-node810', +// memoryLimitInMB: '1536', +// functionVersion: '$LATEST', +// getRemainingTimeInMillis: [Function: getRemainingTimeInMillis], +// invokeid: '1fcdc383-a9e8-4228-bc1c-8db17629e183', +// awsRequestId: '1fcdc383-a9e8-4228-bc1c-8db17629e183', +// invokedFunctionArn: 'arn:aws:lambda:us-east-1:879423879432:function:dump-node810' +// } diff --git a/dotnetcore2.0/build/Dockerfile b/dotnetcore2.0/build/Dockerfile index 127aea9d..708c1e47 100644 --- a/dotnetcore2.0/build/Dockerfile +++ b/dotnetcore2.0/build/Dockerfile @@ -3,7 +3,7 @@ FROM lambci/lambda-base:build ENV PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin \ LD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib \ AWS_EXECUTION_ENV=AWS_Lambda_dotnetcore2.0 \ - DOTNET_SDK_VERSION=2.1.3 \ + DOTNET_SDK_VERSION=2.1.4 \ DOTNET_CLI_TELEMETRY_OPTOUT=1 \ NUGET_XMLDOC_MODE=skip diff --git a/dotnetcore2.0/run/MockBootstraps/MockBootstraps.sln b/dotnetcore2.0/run/MockBootstraps/MockBootstraps.sln new file mode 100644 index 00000000..8106873d --- /dev/null +++ b/dotnetcore2.0/run/MockBootstraps/MockBootstraps.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2017 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MockBootstraps", "MockBootstraps.csproj", "{8AD9356B-231B-4B42-B168-D06497B769AF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8AD9356B-231B-4B42-B168-D06497B769AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AD9356B-231B-4B42-B168-D06497B769AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AD9356B-231B-4B42-B168-D06497B769AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AD9356B-231B-4B42-B168-D06497B769AF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/dotnetcore2.0/run/MockBootstraps/MockLambdaContext.cs b/dotnetcore2.0/run/MockBootstraps/MockLambdaContext.cs index cf86393c..efdb2573 100644 --- a/dotnetcore2.0/run/MockBootstraps/MockLambdaContext.cs +++ b/dotnetcore2.0/run/MockBootstraps/MockLambdaContext.cs @@ -7,7 +7,7 @@ namespace MockLambdaRuntime { public class MockLambdaContext { - static Random random = new Random(); + static readonly Random random = new Random(); /// Creates a mock context from a given Lambda handler and event public MockLambdaContext(string handler, string eventBody) diff --git a/dotnetcore2.0/run/MockBootstraps/Program.cs b/dotnetcore2.0/run/MockBootstraps/Program.cs index 9afc1025..ebbe0933 100644 --- a/dotnetcore2.0/run/MockBootstraps/Program.cs +++ b/dotnetcore2.0/run/MockBootstraps/Program.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Reflection; using System.Runtime.Loader; diff --git a/dotnetcore2.0/run/MockBootstraps/lib/Bootstrap.dll b/dotnetcore2.0/run/MockBootstraps/lib/Bootstrap.dll index ac571599..288bec51 100644 Binary files a/dotnetcore2.0/run/MockBootstraps/lib/Bootstrap.dll and b/dotnetcore2.0/run/MockBootstraps/lib/Bootstrap.dll differ diff --git a/examples/docker-file/Dockerfile b/examples/docker-file/Dockerfile index 9cbb2241..7a18d10d 100644 --- a/examples/docker-file/Dockerfile +++ b/examples/docker-file/Dockerfile @@ -1,4 +1,4 @@ -FROM lambci/lambda +FROM lambci/lambda:nodejs8.10 ENV AWS_LAMBDA_FUNCTION_NAME=docker-build \ AWS_LAMBDA_FUNCTION_VERSION=2 \ diff --git a/examples/nodejs-native-module/package.json b/examples/nodejs-native-module/package.json index 58700fdf..c996b394 100644 --- a/examples/nodejs-native-module/package.json +++ b/examples/nodejs-native-module/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "build": "docker run --rm -v \"$PWD\":/var/task lambci/lambda:build", + "build": "docker run --rm -v \"$PWD\":/var/task lambci/lambda:build-nodejs4.3", "test": "node test.js" }, "dependencies": { diff --git a/examples/nodejs-native-module/test.js b/examples/nodejs-native-module/test.js index 892305b2..70416838 100644 --- a/examples/nodejs-native-module/test.js +++ b/examples/nodejs-native-module/test.js @@ -2,9 +2,9 @@ var dockerLambda = require('../..') var match = dockerLambda({event: {password: 'lambda-docker'}}) -console.log(match == 'Matches!' ? 'Match Passed' : 'Match Failed: ' + match) +console.log(match === 'Matches!' ? 'Match Passed' : 'Match Failed: ' + match) var nonMatch = dockerLambda({event: {password: 'lambda-mocker'}}) -console.log(nonMatch == 'NopeNopeNope' ? 'Non-Match Passed' : 'Non-Match Failed: ' + nonMatch) +console.log(nonMatch === 'NopeNopeNope' ? 'Non-Match Passed' : 'Non-Match Failed: ' + nonMatch) diff --git a/examples/nodejs/index.js b/examples/nodejs6.10/index.js similarity index 91% rename from examples/nodejs/index.js rename to examples/nodejs6.10/index.js index 7638d0ac..40a6e6d6 100644 --- a/examples/nodejs/index.js +++ b/examples/nodejs6.10/index.js @@ -2,6 +2,8 @@ // docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs4.3 // OR // docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs6.10 +// OR +// docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs8.10 exports.handler = function(event, context, cb) { diff --git a/examples/nodejs/package.json b/examples/nodejs6.10/package.json similarity index 75% rename from examples/nodejs/package.json rename to examples/nodejs6.10/package.json index d3bca024..9b403554 100644 --- a/examples/nodejs/package.json +++ b/examples/nodejs6.10/package.json @@ -3,6 +3,6 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "test": "docker run --rm -v \"$PWD\":/var/task lambci/lambda:nodejs4.3 index.handler '{\"some\": \"event\"}'" + "test": "docker run --rm -v \"$PWD\":/var/task lambci/lambda:nodejs6.10 index.handler '{\"some\": \"event\"}'" } } diff --git a/examples/nodejs8.10/index.js b/examples/nodejs8.10/index.js new file mode 100644 index 00000000..480be705 --- /dev/null +++ b/examples/nodejs8.10/index.js @@ -0,0 +1,26 @@ +// Just a test lambda, run with: +// docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs8.10 + +exports.handler = async(event, context) => { + console.log(process.execPath) + console.log(process.execArgv) + console.log(process.argv) + console.log(process.cwd()) + console.log(process.mainModule.filename) + console.log(__filename) + console.log(process.env) + console.log(process.getuid()) + console.log(process.getgid()) + console.log(process.geteuid()) + console.log(process.getegid()) + console.log(process.getgroups()) + console.log(process.umask()) + + console.log(event) + + console.log(context) + + context.callbackWaitsForEmptyEventLoop = false + + console.log(context.getRemainingTimeInMillis()) +} diff --git a/examples/nodejs8.10/package.json b/examples/nodejs8.10/package.json new file mode 100644 index 00000000..25dce6d2 --- /dev/null +++ b/examples/nodejs8.10/package.json @@ -0,0 +1,8 @@ +{ + "name": "docker-run", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "docker run --rm -v \"$PWD\":/var/task lambci/lambda:nodejs8.10 index.handler '{\"some\": \"event\"}'" + } +} diff --git a/go1.x/build/Dockerfile b/go1.x/build/Dockerfile index 0b56995e..2b1ce96d 100644 --- a/go1.x/build/Dockerfile +++ b/go1.x/build/Dockerfile @@ -2,7 +2,8 @@ FROM lambci/lambda-base:build ENV GOLANG_VERSION=1.10 \ GOPATH=/go \ - PATH=/go/bin:/usr/local/go/bin:$PATH + PATH=/go/bin:/usr/local/go/bin:$PATH \ + AWS_EXECUTION_ENV=AWS_Lambda_go1.x WORKDIR /go/src/handler diff --git a/go1.x/run/Dockerfile b/go1.x/run/Dockerfile index 8b7d1390..bdfefea9 100644 --- a/go1.x/run/Dockerfile +++ b/go1.x/run/Dockerfile @@ -1,6 +1,6 @@ FROM golang:1 WORKDIR /go/src/github.com/lambci/docker-lambda -RUN curl -sSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && chmod +x /usr/local/bin/dep +RUN curl -sSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep COPY aws-lambda-mock.go Gopkg.toml Gopkg.lock ./ RUN dep ensure RUN GOARCH=amd64 GOOS=linux go build aws-lambda-mock.go @@ -8,6 +8,8 @@ RUN GOARCH=amd64 GOOS=linux go build aws-lambda-mock.go FROM lambci/lambda-base +ENV AWS_EXECUTION_ENV=AWS_Lambda_go1.x + RUN rm -rf /var/runtime /var/lang && \ curl https://lambci.s3.amazonaws.com/fs/go1.x.tgz | tar -zx -C / diff --git a/go1.x/run/Gopkg.lock b/go1.x/run/Gopkg.lock index 3b455e15..9969ecf5 100644 --- a/go1.x/run/Gopkg.lock +++ b/go1.x/run/Gopkg.lock @@ -4,12 +4,12 @@ [[projects]] name = "github.com/aws/aws-lambda-go" packages = ["lambda/messages"] - revision = "6e2e37798efbb1dfd8e9c6681702e683a6046517" - version = "v1.0.1" + revision = "fafa7e49388b8991caf99308e80655ba91816b72" + version = "v1.1.0" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "2c19b35c52e708394e6cc46c177e57a8379c3ab6e44aab67e2f9074218f861e9" + inputs-digest = "3c793d7717a79ec1be981b49c1a1d884b15056f98188d915ec4b154f296eeceb" solver-name = "gps-cdcl" solver-version = 1 diff --git a/go1.x/run/Gopkg.toml b/go1.x/run/Gopkg.toml index 705f044a..97ec5bc8 100644 --- a/go1.x/run/Gopkg.toml +++ b/go1.x/run/Gopkg.toml @@ -1,3 +1,3 @@ [[constraint]] name = "github.com/aws/aws-lambda-go" - version = "1.0.1" + version = "1.1.0" diff --git a/index.js b/index.js index a560f22f..c5e76e2e 100644 --- a/index.js +++ b/index.js @@ -65,6 +65,5 @@ module.exports = function runSync(options) { // Lambda function had not output or the output could not be parsed. Both // cases should be rare and are most likely the result of an issue with the // Lambda function. - return } } diff --git a/java8/run/Dockerfile b/java8/run/Dockerfile index 907d4798..b9bf8654 100644 --- a/java8/run/Dockerfile +++ b/java8/run/Dockerfile @@ -18,4 +18,5 @@ WORKDIR / USER sbx_user1051 ENTRYPOINT ["/usr/bin/java", "-XX:MaxHeapSize=1336935k", "-XX:MaxMetaspaceSize=157286k", "-XX:ReservedCodeCacheSize=78643k", \ - "-XX:+UseSerialGC", "-Xshare:on", "-XX:-TieredCompilation", "-jar", "/var/runtime/lib/LambdaJavaRTEntry-1.0.jar"] + "-XX:+UseSerialGC", "-Xshare:on", "-XX:-TieredCompilation", "-Djava.net.preferIPv4Stack=true", \ + "-jar", "/var/runtime/lib/LambdaJavaRTEntry-1.0.jar"] diff --git a/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.java b/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.java index 0d897ebf..91b60c72 100644 --- a/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.java +++ b/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.java @@ -28,8 +28,6 @@ public class LambdaRuntime { private static final String CLIENT_CONTEXT = null; private static final String COGNITO_IDENTITY_ID = ""; private static final String COGNITO_IDENTITY_POOL_ID = ""; - private static final String TRACE_ID = ""; - private static final String PARENT_ID = ""; private static final String FUNCTION_ARN; private static final String ACCOUNT_ID; private static boolean alreadyInvoked = false; @@ -194,7 +192,7 @@ public static InvokeRequest waitForInvoke() { systemLog("START RequestId: " + INVOKE_ID + " Version: " + FUNCTION_VERSION); return new InvokeRequest(-1, INVOKE_ID, X_AMZN_TRACE_ID, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, CLIENT_CONTEXT, COGNITO_IDENTITY_ID, COGNITO_IDENTITY_POOL_ID, address, - eventBodyBytes.length, false, FUNCTION_ARN, TRACE_ID, false, PARENT_ID); + eventBodyBytes.length, false, FUNCTION_ARN); } public static int getRemainingTime() { @@ -256,15 +254,11 @@ public static class InvokeRequest { public final int eventBodyLen; public final boolean needsDebugLogs; public final String invokedFunctionArn; - public final String traceId; - public final boolean isSampled; - public final String parentId; public InvokeRequest(final int sockfd, final String invokeid, final String xAmznTraceId, final String awskey, final String awssecret, final String awssession, final String clientcontext, final String cognitoidentityid, final String cognitopoolid, final long addr, final int len, - final boolean needsDebugLogs, final String invokedFunctionArn, final String traceId, - final boolean isSampled, final String parentId) { + final boolean needsDebugLogs, final String invokedFunctionArn) { this.sockfd = sockfd; this.invokeid = invokeid; this.xAmznTraceId = xAmznTraceId; @@ -273,9 +267,6 @@ public InvokeRequest(final int sockfd, final String invokeid, final String xAmzn this.clientContext = clientcontext; this.cognitoIdentityId = cognitoidentityid; this.cognitoPoolId = cognitopoolid; - this.traceId = traceId; - this.isSampled = isSampled; - this.parentId = parentId; this.credentials = new AWSCredentials(awskey, awssecret, awssession); this.needsDebugLogs = needsDebugLogs; this.invokedFunctionArn = invokedFunctionArn; diff --git a/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.orig.java b/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.orig.java new file mode 100644 index 00000000..e1b39bd7 --- /dev/null +++ b/java8/run/lambda-runtime-mock/src/main/java/lambdainternal/LambdaRuntime.orig.java @@ -0,0 +1,112 @@ +package lambdainternal; + +public class LambdaRuntime +{ + public static final int MEMORY_LIMIT = Integer.parseInt(getEnv("AWS_LAMBDA_FUNCTION_MEMORY_SIZE")); + public static final String LOG_GROUP_NAME = getEnv("AWS_LAMBDA_LOG_GROUP_NAME"); + public static final String LOG_STREAM_NAME = getEnv("AWS_LAMBDA_LOG_STREAM_NAME"); + public static final String FUNCTION_NAME = getEnv("AWS_LAMBDA_FUNCTION_NAME"); + public static final String FUNCTION_VERSION = getEnv("AWS_LAMBDA_FUNCTION_VERSION"); + public static volatile boolean needsDebugLogs = false; + + public static String getEnv(String envVariableName) + { + return System.getenv(envVariableName); + } + + public static native void initRuntime(); + + public static native void reportRunning(String paramString); + + public static native void reportDone(String paramString, byte[] paramArrayOfByte, int paramInt1, int paramInt2); + + public static native void reportException(String paramString); + + public static native void reportUserInitStart(); + + public static native void reportUserInitEnd(); + + public static native void reportUserInvokeStart(); + + public static native void reportUserInvokeEnd(); + + public static native void reportFault(String paramString1, String paramString2, String paramString3, String paramString4); + + public static native void setenv(String paramString1, String paramString2, int paramInt); + + public static native void unsetenv(String paramString); + + public static native WaitForStartResult waitForStart(); + + public static native InvokeRequest waitForInvoke(); + + public static native int getRemainingTime(); + + public static native void sendContextLogs(byte[] paramArrayOfByte, int paramInt); + + public static synchronized native void streamLogsToSlicer(byte[] paramArrayOfByte, int paramInt1, int paramInt2); + + public static class AWSCredentials + { + public final String key; + public final String secret; + public final String session; + + public AWSCredentials(String key, String secret, String session) + { + this.key = key; + this.secret = secret; + this.session = session; + } + } + + public static class InvokeRequest + { + public final int sockfd; + public final String invokeid; + public final String xAmznTraceId; + public final LambdaRuntime.AWSCredentials credentials; + public final String clientContext; + public final String cognitoIdentityId; + public final String cognitoPoolId; + public final long eventBodyAddr; + public final int eventBodyLen; + public final boolean needsDebugLogs; + public final String invokedFunctionArn; + + public InvokeRequest(int sockfd, String invokeid, String xAmznTraceId, + String awskey, String awssecret, String awssession, String + clientcontext, String cognitoidentityid, String cognitopoolid, long + addr, int len, boolean needsDebugLogs, String invokedFunctionArn) { + this.sockfd = sockfd; + this.invokeid = invokeid; + this.xAmznTraceId = xAmznTraceId; + this.eventBodyAddr = addr; + this.eventBodyLen = len; + this.clientContext = clientcontext; + this.cognitoIdentityId = cognitoidentityid; + this.cognitoPoolId = cognitopoolid; + this.credentials = new LambdaRuntime.AWSCredentials(awskey, awssecret, awssession); + this.needsDebugLogs = needsDebugLogs; + this.invokedFunctionArn = invokedFunctionArn; + } + } + + public static class WaitForStartResult + { + public final String invokeid; + public final String handler; + public final String mode; + public final LambdaRuntime.AWSCredentials credentials; + public final boolean suppressInit; + + public WaitForStartResult(String invokeid, String handler, String mode, String awskey, String awssecret, String awssession, boolean suppressInit) + { + this.invokeid = invokeid; + this.handler = handler; + this.mode = mode; + this.credentials = new LambdaRuntime.AWSCredentials(awskey, awssecret, awssession); + this.suppressInit = suppressInit; + } + } +} diff --git a/nodejs4.3/build/Dockerfile b/nodejs4.3/build/Dockerfile index 151f7ad0..ccd98b85 100644 --- a/nodejs4.3/build/Dockerfile +++ b/nodejs4.3/build/Dockerfile @@ -6,4 +6,7 @@ ENV PATH=/usr/local/lib64/node-v4.3.x/bin:/usr/local/sbin:/usr/local/bin:/usr/sb NODE_PATH=/var/runtime:/var/task:/var/runtime/node_modules \ npm_config_unsafe-perm=true +RUN rm -rf /var/runtime /var/lang && \ + curl https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz | tar -zx -C / -- var/runtime var/lang + CMD ["npm", "rebuild"] diff --git a/nodejs4.3/run/Dockerfile b/nodejs4.3/run/Dockerfile index 94e83522..28289b2d 100644 --- a/nodejs4.3/run/Dockerfile +++ b/nodejs4.3/run/Dockerfile @@ -5,10 +5,13 @@ ENV PATH=/usr/local/lib64/node-v4.3.x/bin:/usr/local/bin:/usr/bin/:/bin \ AWS_EXECUTION_ENV=AWS_Lambda_nodejs4.3 \ NODE_PATH=/var/runtime:/var/task:/var/runtime/node_modules +RUN rm -rf /var/runtime /var/lang && \ + curl https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz | tar -zx -C / -- var/runtime var/lang + COPY awslambda-mock.js /var/runtime/node_modules/awslambda/build/Release/awslambda.js USER sbx_user1051 -ENTRYPOINT ["/usr/local/lib64/node-v4.3.x/bin/node", "--max-old-space-size=1228", "--max-semi-space-size=77", "--max-executable-size=154", "--expose-gc", \ +ENTRYPOINT ["/usr/local/lib64/node-v4.3.x/bin/node", "--expose-gc", "--max-executable-size=160", "--max-semi-space-size=150", "--max-old-space-size=2547", \ "/var/runtime/node_modules/awslambda/index.js"] diff --git a/nodejs4.3/run/awslambda-mock.js b/nodejs4.3/run/awslambda-mock.js index 8df4cd4b..d7b6ad73 100644 --- a/nodejs4.3/run/awslambda-mock.js +++ b/nodejs4.3/run/awslambda-mock.js @@ -1,7 +1,7 @@ var fs = require('fs') var crypto = require('crypto') -var HANDLER = process.argv[2] || process.env.AWS_LAMBDA_FUNCTION_HANDLER || process.env._HANDLER || 'index.handler' +var HANDLER = process.argv[2] || process.env.AWS_LAMBDA_FUNCTION_HANDLER || process.env._HANDLER || 'index.handler' var EVENT_BODY = process.argv[3] || process.env.AWS_LAMBDA_EVENT_BODY || (process.env.DOCKER_LAMBDA_USE_STDIN && fs.readFileSync('/dev/stdin', 'utf8')) || '{}' @@ -99,7 +99,7 @@ module.exports = { ].join('\t')) var exitCode = errored || errType ? 1 : 0 - if (typeof resultStr == 'string') { + if (typeof resultStr === 'string') { handleResult(resultStr, function() { process.exit(exitCode) }) } else { process.exit(exitCode) @@ -123,15 +123,15 @@ module.exports = { } function formatConsole(str) { - return str.replace(/^[0-9TZ:\.\-]+\t[0-9a-f\-]+\t/, '\033[34m$&\u001b[0m') + return str.replace(/^[0-9TZ:.-]+\t[0-9a-f-]+\t/, '\u001b[34m$&\u001b[0m') } function formatSystem(str) { - return '\033[32m' + str + '\033[0m' + return '\u001b[32m' + str + '\u001b[0m' } function formatErr(str) { - return '\033[31m' + str + '\033[0m' + return '\u001b[31m' + str + '\u001b[0m' } function hrTimeMs(hrtime) { diff --git a/nodejs6.10/run/Dockerfile b/nodejs6.10/run/Dockerfile index 2dfc6046..fe9179c3 100644 --- a/nodejs6.10/run/Dockerfile +++ b/nodejs6.10/run/Dockerfile @@ -12,6 +12,6 @@ COPY awslambda-mock.js /var/runtime/node_modules/awslambda/build/Release/awslamb USER sbx_user1051 -ENTRYPOINT ["/var/lang/bin/node", "--max-old-space-size=1228", "--max-semi-space-size=77", "--max-executable-size=154", "--expose-gc", \ +ENTRYPOINT ["/var/lang/bin/node", "--expose-gc", "--max-executable-size=160", "--max-semi-space-size=150", "--max-old-space-size=2547", \ "/var/runtime/node_modules/awslambda/index.js"] diff --git a/nodejs6.10/run/awslambda-mock.js b/nodejs6.10/run/awslambda-mock.js index 8df4cd4b..d7b6ad73 100644 --- a/nodejs6.10/run/awslambda-mock.js +++ b/nodejs6.10/run/awslambda-mock.js @@ -1,7 +1,7 @@ var fs = require('fs') var crypto = require('crypto') -var HANDLER = process.argv[2] || process.env.AWS_LAMBDA_FUNCTION_HANDLER || process.env._HANDLER || 'index.handler' +var HANDLER = process.argv[2] || process.env.AWS_LAMBDA_FUNCTION_HANDLER || process.env._HANDLER || 'index.handler' var EVENT_BODY = process.argv[3] || process.env.AWS_LAMBDA_EVENT_BODY || (process.env.DOCKER_LAMBDA_USE_STDIN && fs.readFileSync('/dev/stdin', 'utf8')) || '{}' @@ -99,7 +99,7 @@ module.exports = { ].join('\t')) var exitCode = errored || errType ? 1 : 0 - if (typeof resultStr == 'string') { + if (typeof resultStr === 'string') { handleResult(resultStr, function() { process.exit(exitCode) }) } else { process.exit(exitCode) @@ -123,15 +123,15 @@ module.exports = { } function formatConsole(str) { - return str.replace(/^[0-9TZ:\.\-]+\t[0-9a-f\-]+\t/, '\033[34m$&\u001b[0m') + return str.replace(/^[0-9TZ:.-]+\t[0-9a-f-]+\t/, '\u001b[34m$&\u001b[0m') } function formatSystem(str) { - return '\033[32m' + str + '\033[0m' + return '\u001b[32m' + str + '\u001b[0m' } function formatErr(str) { - return '\033[31m' + str + '\033[0m' + return '\u001b[31m' + str + '\u001b[0m' } function hrTimeMs(hrtime) { diff --git a/nodejs8.10/build/Dockerfile b/nodejs8.10/build/Dockerfile new file mode 100644 index 00000000..6dfb6b17 --- /dev/null +++ b/nodejs8.10/build/Dockerfile @@ -0,0 +1,12 @@ +FROM lambci/lambda-base:build + +ENV PATH=/var/lang/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + LD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib \ + AWS_EXECUTION_ENV=AWS_Lambda_nodejs8.10 \ + NODE_PATH=/var/runtime:/var/task:/var/runtime/node_modules \ + npm_config_unsafe-perm=true + +RUN rm -rf /var/runtime /var/lang && \ + curl https://lambci.s3.amazonaws.com/fs/nodejs8.10.tgz | tar -zx -C / + +CMD ["npm", "rebuild"] diff --git a/nodejs8.10/run/Dockerfile b/nodejs8.10/run/Dockerfile new file mode 100644 index 00000000..0d6a7efb --- /dev/null +++ b/nodejs8.10/run/Dockerfile @@ -0,0 +1,17 @@ +FROM lambci/lambda-base + +ENV PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin \ + LD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib \ + AWS_EXECUTION_ENV=AWS_Lambda_nodejs8.10 \ + NODE_PATH=/var/runtime:/var/task:/var/runtime/node_modules + +RUN rm -rf /var/runtime /var/lang && \ + curl https://lambci.s3.amazonaws.com/fs/nodejs8.10.tgz | tar -zx -C / + +COPY awslambda-mock.js /var/runtime/node_modules/awslambda/build/Release/awslambda.js + +USER sbx_user1051 + +ENTRYPOINT ["/var/lang/bin/node", "--expose-gc", "--max-semi-space-size=150", "--max-old-space-size=2707", \ + "/var/runtime/node_modules/awslambda/index.js"] + diff --git a/nodejs8.10/run/awslambda-mock.js b/nodejs8.10/run/awslambda-mock.js new file mode 100644 index 00000000..d7b6ad73 --- /dev/null +++ b/nodejs8.10/run/awslambda-mock.js @@ -0,0 +1,156 @@ +var fs = require('fs') +var crypto = require('crypto') + +var HANDLER = process.argv[2] || process.env.AWS_LAMBDA_FUNCTION_HANDLER || process.env._HANDLER || 'index.handler' +var EVENT_BODY = process.argv[3] || process.env.AWS_LAMBDA_EVENT_BODY || + (process.env.DOCKER_LAMBDA_USE_STDIN && fs.readFileSync('/dev/stdin', 'utf8')) || '{}' + +var FN_NAME = process.env.AWS_LAMBDA_FUNCTION_NAME || 'test' +var VERSION = process.env.AWS_LAMBDA_FUNCTION_VERSION || '$LATEST' +var MEM_SIZE = process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE || '1536' +var TIMEOUT = process.env.AWS_LAMBDA_FUNCTION_TIMEOUT || '300' +var REGION = process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || 'us-east-1' +var ACCOUNT_ID = process.env.AWS_ACCOUNT_ID || randomAccountId() +var ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID || 'SOME_ACCESS_KEY_ID' +var SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY || 'SOME_SECRET_ACCESS_KEY' +var SESSION_TOKEN = process.env.AWS_SESSION_TOKEN + +function consoleLog(str) { + process.stderr.write(formatConsole(str)) +} + +function systemLog(str) { + process.stderr.write(formatSystem(str) + '\n') +} + +function systemErr(str) { + process.stderr.write(formatErr(str) + '\n') +} + +function handleResult(resultStr, cb) { + if (!process.stdout.write('\n' + resultStr + '\n')) { + process.stdout.once('drain', cb) + } else { + process.nextTick(cb) + } +} + +// Don't think this can be done in the Docker image +process.umask(2) + +process.env.AWS_LAMBDA_FUNCTION_NAME = FN_NAME +process.env.AWS_LAMBDA_FUNCTION_VERSION = VERSION +process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = MEM_SIZE +process.env.AWS_LAMBDA_LOG_GROUP_NAME = '/aws/lambda/' + FN_NAME +process.env.AWS_LAMBDA_LOG_STREAM_NAME = new Date().toISOString().slice(0, 10).replace(/-/g, '/') + + '/[' + VERSION + ']' + crypto.randomBytes(16).toString('hex') +process.env.AWS_REGION = REGION +process.env.AWS_DEFAULT_REGION = REGION +process.env._HANDLER = HANDLER + +var OPTIONS = { + initInvokeId: uuid(), + invokeId: uuid(), + handler: HANDLER, + suppressInit: true, + credentials: { + key: ACCESS_KEY_ID, + secret: SECRET_ACCESS_KEY, + session: SESSION_TOKEN, + }, + eventBody: EVENT_BODY, + contextObjects: { + // clientContext: '{}', + // cognitoIdentityId: undefined, + // cognitoPoolId: undefined, + }, + invokedFunctionArn: arn(REGION, ACCOUNT_ID, FN_NAME), +} + +// Some weird spelling error in the source? +OPTIONS.invokeid = OPTIONS.invokeId + +var invoked = false +var errored = false +var start = null + +module.exports = { + initRuntime: function() { return OPTIONS }, + waitForInvoke: function(fn) { + if (invoked) return + systemLog('START RequestId: ' + OPTIONS.invokeId + ' Version: ' + VERSION) + start = process.hrtime() + invoked = true + fn(OPTIONS) + }, + reportRunning: function(invokeId) {}, // eslint-disable-line no-unused-vars + reportDone: function(invokeId, errType, resultStr) { + if (!invoked) return + var diffMs = hrTimeMs(process.hrtime(start)) + var billedMs = Math.min(100 * (Math.floor(diffMs / 100) + 1), TIMEOUT * 1000) + systemLog('END RequestId: ' + invokeId) + systemLog([ + 'REPORT RequestId: ' + invokeId, + 'Duration: ' + diffMs.toFixed(2) + ' ms', + 'Billed Duration: ' + billedMs + ' ms', + 'Memory Size: ' + MEM_SIZE + ' MB', + 'Max Memory Used: ' + Math.round(process.memoryUsage().rss / (1024 * 1024)) + ' MB', + '', + ].join('\t')) + + var exitCode = errored || errType ? 1 : 0 + if (typeof resultStr === 'string') { + handleResult(resultStr, function() { process.exit(exitCode) }) + } else { + process.exit(exitCode) + } + }, + reportFault: function(invokeId, msg, errName, errStack) { + errored = true + systemErr(msg + (errName ? ': ' + errName : '')) + if (errStack) systemErr(errStack) + }, + reportUserInitStart: function() {}, + reportUserInitEnd: function() {}, + reportUserInvokeStart: function() {}, + reportUserInvokeEnd: function() {}, + reportException: function() {}, + getRemainingTime: function() { + return (TIMEOUT * 1000) - Math.floor(hrTimeMs(process.hrtime(start))) + }, + sendConsoleLogs: consoleLog, + maxLoggerErrorSize: 256 * 1024, +} + +function formatConsole(str) { + return str.replace(/^[0-9TZ:.-]+\t[0-9a-f-]+\t/, '\u001b[34m$&\u001b[0m') +} + +function formatSystem(str) { + return '\u001b[32m' + str + '\u001b[0m' +} + +function formatErr(str) { + return '\u001b[31m' + str + '\u001b[0m' +} + +function hrTimeMs(hrtime) { + return (hrtime[0] * 1e9 + hrtime[1]) / 1e6 +} + +// Approximates the look of a v1 UUID +function uuid() { + return crypto.randomBytes(4).toString('hex') + '-' + + crypto.randomBytes(2).toString('hex') + '-' + + crypto.randomBytes(2).toString('hex').replace(/^./, '1') + '-' + + crypto.randomBytes(2).toString('hex') + '-' + + crypto.randomBytes(6).toString('hex') +} + +function randomAccountId() { + return String(0x100000000 * Math.random()) +} + +function arn(region, accountId, fnName) { + return 'arn:aws:lambda:' + region + ':' + accountId.replace(/[^\d]/g, '') + ':function:' + fnName +} diff --git a/package.json b/package.json index dcf2639b..27a81b42 100644 --- a/package.json +++ b/package.json @@ -17,102 +17,5 @@ }, "devDependencies": { "should": "^8.4.0" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true - }, - "rules": { - "no-console": 0, - "no-mixed-requires": 0, - "no-underscore-dangle": 0, - "no-shadow": 0, - "no-use-before-define": [ - 2, - "nofunc" - ], - "camelcase": [ - 2, - { - "properties": "never" - } - ], - "curly": 0, - "eqeqeq": 0, - "new-parens": 0, - "quotes": [ - 2, - "single", - "avoid-escape" - ], - "semi": [ - 2, - "never" - ], - "strict": 0, - "no-empty-character-class": 2, - "no-extra-parens": [ - 2, - "functions" - ], - "no-floating-decimal": 2, - "no-lonely-if": 2, - "no-self-compare": 2, - "no-throw-literal": 2, - "no-unused-vars": 2, - "array-bracket-spacing": [ - 2, - "never" - ], - "brace-style": [ - 2, - "1tbs", - { - "allowSingleLine": true - } - ], - "comma-dangle": [ - 2, - "always-multiline" - ], - "comma-style": [ - 2, - "last" - ], - "consistent-this": [ - 2, - "self" - ], - "object-curly-spacing": [ - 2, - "never" - ], - "operator-assignment": [ - 2, - "always" - ], - "operator-linebreak": [ - 2, - "after" - ], - "keyword-spacing": 2, - "space-before-blocks": [ - 2, - "always" - ], - "space-before-function-paren": [ - 2, - "never" - ], - "space-in-parens": [ - 2, - "never" - ], - "spaced-comment": [ - 2, - "always" - ] - } } } diff --git a/python2.7/run/runtime-mock.py b/python2.7/run/runtime-mock.py index 6500c080..a88ea3d8 100644 --- a/python2.7/run/runtime-mock.py +++ b/python2.7/run/runtime-mock.py @@ -134,7 +134,7 @@ def report_fault(invokeid, msg, except_value, trace): eprint('%s' % trace) return -def report_done(invokeid, errortype, result): +def report_done(invokeid, errortype, result, is_fatal): global _GLOBAL_INVOKED global _GLOBAL_ERRORED diff --git a/python3.6/build/Dockerfile b/python3.6/build/Dockerfile index 1f84abf8..35e3b3ad 100644 --- a/python3.6/build/Dockerfile +++ b/python3.6/build/Dockerfile @@ -15,4 +15,4 @@ RUN rm -rf /var/runtime /var/lang && \ make -j$(getconf _NPROCESSORS_ONLN) libinstall inclinstall && \ cd .. && \ rm -rf Python-3.6.1 && \ - pip3 install awscli virtualenv --no-cache-dir + pip3 install -U pip awscli virtualenv --no-cache-dir diff --git a/python3.6/run/runtime-mock.py b/python3.6/run/runtime-mock.py index 6500c080..a88ea3d8 100644 --- a/python3.6/run/runtime-mock.py +++ b/python3.6/run/runtime-mock.py @@ -134,7 +134,7 @@ def report_fault(invokeid, msg, except_value, trace): eprint('%s' % trace) return -def report_done(invokeid, errortype, result): +def report_done(invokeid, errortype, result, is_fatal): global _GLOBAL_INVOKED global _GLOBAL_ERRORED