File tree 5 files changed +14
-10
lines changed
5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1
- FROM nytimes/blender:2.93 -cpu-ubuntu18.04
1
+ FROM nytimes/blender:3.1 -cpu-ubuntu18.04
2
2
3
3
ARG FUNCTION_DIR="/home/app"
4
4
RUN mkdir -p $FUNCTION_DIR
@@ -7,7 +7,7 @@ WORKDIR ${FUNCTION_DIR}
7
7
RUN pip install boto3
8
8
RUN pip install awslambdaric --target ${FUNCTION_DIR}
9
9
10
- ENTRYPOINT [ "/bin/2.93 /python/bin/python3.9 " , "-m" , "awslambdaric" ]
10
+ ENTRYPOINT [ "/bin/3.1 /python/bin/python3.10 " , "-m" , "awslambdaric" ]
11
11
CMD [ "consumer_function.handler" ]
12
12
13
13
COPY *.py ${FUNCTION_DIR}/
Original file line number Diff line number Diff line change 1
- FROM nytimes/blender:2.93 -cpu-ubuntu18.04
1
+ FROM nytimes/blender:3.1 -cpu-ubuntu18.04
2
2
3
3
ARG FUNCTION_DIR="/home/app"
4
4
RUN mkdir -p $FUNCTION_DIR
@@ -7,7 +7,7 @@ WORKDIR ${FUNCTION_DIR}
7
7
RUN pip install boto3
8
8
RUN pip install awslambdaric --target ${FUNCTION_DIR}
9
9
10
- ENTRYPOINT [ "/bin/2.93 /python/bin/python3.9 " , "-m" , "awslambdaric" ]
10
+ ENTRYPOINT [ "/bin/3.1 /python/bin/python3.10 " , "-m" , "awslambdaric" ]
11
11
CMD [ "producer_function.handler" ]
12
12
13
13
COPY *.py ${FUNCTION_DIR}/
Original file line number Diff line number Diff line change @@ -93,9 +93,12 @@ def retrieve_file_from_s3(file_name):
93
93
s3_bucket .download_file (file_name , LOCAL_RENDER_FILE )
94
94
95
95
96
- def assert_request_is_valid (render_request ) -> Tuple [ bool , str ] :
96
+ def assert_request_is_valid (render_request : dict ) -> None :
97
97
logger .debug (f'Validating request { render_request } ' )
98
98
99
+ if not isinstance (render_request , dict ):
100
+ raise TypeError (f"data is not valid json, instead is { str (type (render_request ))} " )
101
+
99
102
if 'file_name' not in render_request :
100
103
raise TypeError ("'file_name' parameter is missing" )
101
104
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ resource "aws_lambda_function" "producer_lambda" {
12
12
package_type = " Image"
13
13
image_uri = module. producer_docker_image . image_uri
14
14
role = aws_iam_role. lambda_exec . arn
15
- timeout = 60
15
+ timeout = 120
16
16
17
17
environment {
18
18
variables = {
Original file line number Diff line number Diff line change 10
10
SUPPORT_FILES_STRING=" ${SUPPORT_FILES_STRING% ?} ]"
11
11
12
12
PUBLIC_URL=$( terraform output -raw public_url)
13
+ DATA=' { "file_name": "' $BLENDER_FILE ' ", "support_files": ' $SUPPORT_FILES_STRING ' }'
13
14
14
15
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"
You can’t perform that action at this time.
0 commit comments