Skip to content

Commit 91ff4e2

Browse files
author
jaya.mohan@pnnl.gov
committedDec 4, 2023
test lambda container with entrypoint.sh
1 parent 811e7a8 commit 91ff4e2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed
 

‎cdk-projects/s3lambda/entry_script.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
3+
exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric
4+
else
5+
exec /usr/bin/npx aws-lambda-ric
6+
fi

‎cdk-projects/s3lambda/lambda/Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
FROM ghcr.io/pnnl/exago:exago-develop-x436raytwpfhkihapsbpto3jd3dpfyqg.spack
22
# Copy requirements.txt
33
#COPY requirements.txt ${LAMBDA_TASK_ROOT}
4-
4+
#Define lambda task root
5+
ENV LAMBDA_TASK_ROOT /var/task
56
# Copy function code
7+
RUN mkdir -p ${LAMBDA_TASK_ROOT}
68
COPY lambda_handler.py ${LAMBDA_TASK_ROOT}
79
ADD python_wrapper ${LAMBDA_TASK_ROOT}/python_wrapper
810

@@ -18,6 +20,9 @@ RUN apt-get -yqq update && apt-get -yqq upgrade \
1820
RUN pip install --upgrade pip
1921
#RUN pip install -r ${LAMBDA_TASK_ROOT}/requirements.txt
2022
RUN pip install awslambdaric
23+
# Make port 9000 available to the world outside this container
24+
EXPOSE 9000
25+
#ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie
2126
ENTRYPOINT ["python", "-m", "awslambdaric"]
2227
ENV PYTHONPATH "${PYTHONPATH}:/usr/local/lib/python3.10/dist-packages"
2328

‎cdk-projects/s3lambda/lambda/lambda_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import boto3
1+
import boto
22
import subprocess
33
import os
44
import exago

0 commit comments

Comments
 (0)
Please sign in to comment.