| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,6 +63,9 @@ docker run --rm -v "$PWD":/var/task lambci/lambda:python3.6 my_module.my_handler | |||
| 63 | 63 | # Python 3.7 requires the handler be given explicitly | |
| 64 | 64 | docker run --rm -v "$PWD":/var/task lambci/lambda:python3.7 lambda_function.lambda_handler | |
| 65 | 65 | ||
| 66 | + # Similarly with Ruby 2.5 | ||
| 67 | + docker run --rm -v "$PWD":/var/task lambci/lambda:ruby2.5 lambda_function.lambda_handler | ||
| 68 | + | ||
| 66 | 69 | # Test on Go 1.x with a compiled handler named my_handler and a custom event | |
| 67 | 70 | docker run --rm -v "$PWD":/var/task lambci/lambda:go1.x my_handler '{"some": "event"}' | |
| 68 | 71 | ||
@@ -208,6 +211,7 @@ Docker tags (follow the Lambda runtime names): | |||
| 208 | 211 | - `python2.7` | |
| 209 | 212 | - `python3.6` | |
| 210 | 213 | - `python3.7` | |
| 214 | + - `ruby2.5` | ||
| 211 | 215 | - `java8` | |
| 212 | 216 | - `go1.x` | |
| 213 | 217 | - `dotnetcore2.0` | |
@@ -219,6 +223,7 @@ Docker tags (follow the Lambda runtime names): | |||
| 219 | 223 | - `build-python2.7` | |
| 220 | 224 | - `build-python3.6` | |
| 221 | 225 | - `build-python3.7` | |
| 226 | + - `build-ruby2.5` | ||
| 222 | 227 | - `build-java8` | |
| 223 | 228 | - `build-go1.x` | |
| 224 | 229 | - `build-dotnetcore2.0` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 3 | + RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 ruby2.5 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 4 | 4 | ||
| 5 | 5 | TOP_DIR="${PWD}/.." | |
| 6 | 6 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 3 | + RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 ruby2.5 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 4 | 4 | ||
| 5 | 5 | rm -rf diff | |
| 6 | 6 | mkdir -p diff | |
@@ -60,6 +60,12 @@ diff docker/var/runtime/bootstrap.py lambda/var/runtime/bootstrap.py | |||
| 60 | 60 | diff docker/var/runtime/lambda_runtime_client.py lambda/var/runtime/lambda_runtime_client.py | |
| 61 | 61 | diff -qr docker lambda | grep -v __pycache__ | |
| 62 | 62 | ||
| 63 | + cd ${DIFF_DIR}/ruby2.5 | ||
| 64 | + pwd | ||
| 65 | + diff docker/var/runtime/bootstrap lambda/var/runtime/bootstrap | ||
| 66 | + diff docker/var/runtime/lib lambda/var/runtime/lib | ||
| 67 | + diff -qr docker lambda | ||
| 68 | + | ||
| 63 | 69 | cd ${DIFF_DIR}/java8 | |
| 64 | 70 | pwd | |
| 65 | 71 | diff -qr docker lambda | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,31 @@ | |||
| 1 | + require 'json' | ||
| 2 | + require 'aws-sdk-s3' | ||
| 3 | + | ||
| 4 | + S3_CLIENT = Aws::S3::Client.new({region: "us-east-1"}) | ||
| 5 | + | ||
| 6 | + def lambda_handler(event:, context:) | ||
| 7 | + filename = 'ruby2.5.tgz' | ||
| 8 | + | ||
| 9 | + puts `tar -cpzf /tmp/#{filename} --numeric-owner --ignore-failed-read /var/runtime /var/lang /var/rapid` | ||
| 10 | + | ||
| 11 | + File.open("/tmp/#{filename}", 'rb') do |file| | ||
| 12 | + S3_CLIENT.put_object({ | ||
| 13 | + body: file, | ||
| 14 | + bucket: 'lambci', | ||
| 15 | + key: "fs/#{filename}", | ||
| 16 | + acl: 'public-read', | ||
| 17 | + }) | ||
| 18 | + end | ||
| 19 | + | ||
| 20 | + info = { | ||
| 21 | + 'ENV' => ENV.to_hash, | ||
| 22 | + 'context' => context.instance_variables.each_with_object({}) { |k, h| h[k] = context.instance_variable_get k }, | ||
| 23 | + 'ps aux' => `ps aux`, | ||
| 24 | + 'proc environ' => `xargs -n 1 -0 < /proc/1/environ`, | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + print JSON.pretty_generate(info) | ||
| 28 | + | ||
| 29 | + return info | ||
| 30 | + end | ||
| 31 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - RUNTIMES="node43 node610 node810 python27 python36 python37 java8 go1x dotnetcore20 dotnetcore21 provided" | ||
| 3 | + RUNTIMES="node43 node610 node810 python27 python36 python37 ruby2.5 java8 go1x dotnetcore20 dotnetcore21 provided" | ||
| 4 | 4 | ||
| 5 | 5 | for RUNTIME in $RUNTIMES; do | |
| 6 | 6 | echo $RUNTIME | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 3 | + RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 ruby2.5 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 4 | 4 | ||
| 5 | 5 | docker push lambci/lambda-base | |
| 6 | 6 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 3 | + RUNTIMES="nodejs4.3 nodejs6.10 nodejs8.10 python2.7 python3.6 python3.7 ruby2.5 java8 go1.x dotnetcore2.0 dotnetcore2.1 provided" | ||
| 4 | 4 | ||
| 5 | 5 | git tag -f latest | |
| 6 | 6 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,9 @@ docker run --rm -v "$PWD":/var/task lambci/lambda:python2.7 | |||
| 19 | 19 | docker run --rm -v "$PWD":/var/task lambci/lambda:python3.6 | |
| 20 | 20 | docker run --rm -v "$PWD":/var/task lambci/lambda:python3.7 lambda_function.lambda_handler | |
| 21 | 21 | ||
| 22 | + cd ${EXAMPLES_DIR}/ruby | ||
| 23 | + docker run --rm -v "$PWD":/var/task lambci/lambda:ruby2.5 lambda_function.lambda_handler | ||
| 24 | + | ||
| 22 | 25 | cd ${EXAMPLES_DIR}/java | |
| 23 | 26 | gradle build | |
| 24 | 27 | docker run --rm -v "$PWD/build/docker":/var/task lambci/lambda:java8 org.lambci.lambda.ExampleHandler '{"some": "event"}' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 1 | + require 'pp' | ||
| 2 | + | ||
| 3 | + # docker run --rm -v "$PWD":/var/task lambci/lambda:ruby2.5 lambda_function.lambda_handler | ||
| 4 | + | ||
| 5 | + def lambda_handler(event:, context:) | ||
| 6 | + info = { | ||
| 7 | + 'event' => event, | ||
| 8 | + 'ENV' => ENV.to_hash, | ||
| 9 | + 'context' => context.instance_variables.each_with_object({}) { |k, h| h[k] = context.instance_variable_get k }, | ||
| 10 | + 'ps aux' => `ps aux`, | ||
| 11 | + 'proc environ' => `xargs -n 1 -0 < /proc/1/environ`, | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + pp info | ||
| 15 | + | ||
| 16 | + return info | ||
| 17 | + end | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,16 @@ | |||
| 1 | + FROM lambci/lambda-base:build | ||
| 2 | + | ||
| 3 | + ENV PATH=/var/lang/bin:$PATH \ | ||
| 4 | + LD_LIBRARY_PATH=/var/lang/lib:$LD_LIBRARY_PATH \ | ||
| 5 | + AWS_EXECUTION_ENV=AWS_Lambda_ruby2.5 \ | ||
| 6 | + GEM_HOME=/var/runtime \ | ||
| 7 | + GEM_PATH=/var/task/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0 \ | ||
| 8 | + RUBYLIB=/var/task:/var/runtime/lib:/opt/ruby/lib | ||
| 9 | + | ||
| 10 | + RUN rm -rf /var/runtime /var/lang /var/rapid && \ | ||
| 11 | + curl https://lambci.s3.amazonaws.com/fs/ruby2.5.tgz | tar -zx -C / | ||
| 12 | + | ||
| 13 | + # Add these as a separate layer as they get updated frequently | ||
| 14 | + RUN gem update --system --no-ri --no-rdoc && \ | ||
| 15 | + curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python && \ | ||
| 16 | + pip install -U awscli boto3 aws-sam-cli aws-lambda-builders==0.0.3 --no-cache-dir | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments