Skip to content

Commit 2b13b29

Browse files
committed
Updated to Blender 3.1
1 parent 2486206 commit 2b13b29

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

Diff for: blender-lambda-consumer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nytimes/blender:2.93-cpu-ubuntu18.04
1+
FROM nytimes/blender:3.1-cpu-ubuntu18.04
22

33
ARG FUNCTION_DIR="/home/app"
44
RUN mkdir -p $FUNCTION_DIR
@@ -7,7 +7,7 @@ WORKDIR ${FUNCTION_DIR}
77
RUN pip install boto3
88
RUN pip install awslambdaric --target ${FUNCTION_DIR}
99

10-
ENTRYPOINT [ "/bin/2.93/python/bin/python3.9", "-m", "awslambdaric" ]
10+
ENTRYPOINT [ "/bin/3.1/python/bin/python3.10", "-m", "awslambdaric" ]
1111
CMD [ "consumer_function.handler" ]
1212

1313
COPY *.py ${FUNCTION_DIR}/

Diff for: blender-lambda-producer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nytimes/blender:2.93-cpu-ubuntu18.04
1+
FROM nytimes/blender:3.1-cpu-ubuntu18.04
22

33
ARG FUNCTION_DIR="/home/app"
44
RUN mkdir -p $FUNCTION_DIR
@@ -7,7 +7,7 @@ WORKDIR ${FUNCTION_DIR}
77
RUN pip install boto3
88
RUN pip install awslambdaric --target ${FUNCTION_DIR}
99

10-
ENTRYPOINT [ "/bin/2.93/python/bin/python3.9", "-m", "awslambdaric" ]
10+
ENTRYPOINT [ "/bin/3.1/python/bin/python3.10", "-m", "awslambdaric" ]
1111
CMD [ "producer_function.handler" ]
1212

1313
COPY *.py ${FUNCTION_DIR}/

Diff for: blender-lambda-producer/producer_function.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ def retrieve_file_from_s3(file_name):
9393
s3_bucket.download_file(file_name, LOCAL_RENDER_FILE)
9494

9595

96-
def assert_request_is_valid(render_request) -> Tuple[bool, str]:
96+
def assert_request_is_valid(render_request: dict) -> None:
9797
logger.debug(f'Validating request {render_request}')
9898

99+
if not isinstance(render_request, dict):
100+
raise TypeError(f"data is not valid json, instead is {str(type(render_request))}")
101+
99102
if 'file_name' not in render_request:
100103
raise TypeError("'file_name' parameter is missing")
101104

Diff for: producer.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resource "aws_lambda_function" "producer_lambda" {
1212
package_type = "Image"
1313
image_uri = module.producer_docker_image.image_uri
1414
role = aws_iam_role.lambda_exec.arn
15-
timeout = 60
15+
timeout = 120
1616

1717
environment {
1818
variables = {

Diff for: render.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ done
1010
SUPPORT_FILES_STRING="${SUPPORT_FILES_STRING%?} ]"
1111

1212
PUBLIC_URL=$(terraform output -raw public_url)
13+
DATA='{ "file_name": "'$BLENDER_FILE'", "support_files": '$SUPPORT_FILES_STRING' }'
1314

1415
curl -s \
15-
-X POST \
16-
-H "Content-Type: application/json" \
17-
-d '{ "file_name": "'$BLENDER_FILE'", "request_id": "'$REQUEST_ID'", "support_files": '$SUPPORT_FILES_STRING' }' \
18-
"$PUBLIC_URL/render-job" | jq
16+
-X POST \
17+
-H "Content-Type: application/json" \
18+
-d "$DATA" \
19+
"$PUBLIC_URL/render-job"

0 commit comments

Comments
 (0)