Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3.12 layer published with SAM #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ stack.deploy:
cd cdk-stacks && npm install && npm run build
cdk deploy --app ./cdk-stacks/bin/app.js --stack PrintStack --parameters uploadBucketName=${BUCKET}

cfn.deploy: build/weasyprint-layer-python$(RUNTIME).zip
@echo "Deploying the weasyprint PDF Layer using SAM"
@sam deploy \
--resolve-s3 \
--template-file weasyprintlayer.yaml \
--stack-name PDFLayer

test.start.container:
${DOCKER_RUN} \
-e GDK_PIXBUF_MODULE_FILE="/opt/lib/loaders.cache" \
Expand Down
2 changes: 1 addition & 1 deletion weasyprint/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Define global args
ARG FUNCTION_DIR="/home/app/"
ARG RUNTIME_VERSION="3.11"
ARG RUNTIME_VERSION="3.12"
ARG DISTRO_VERSION="3.18"

# Stage 1 - bundle base image + runtime
Expand Down
32 changes: 32 additions & 0 deletions weasyprintlayer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31

Description: |
The weasyprint (html->pdf) Layer.

Parameters:
LayerName:
Type: String
Description: The name of the layer.
Default: weasyprintLayer

Resources:

PDFLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: !Ref LayerName
Description: weasyprint (html->pdf) layer.
ContentUri: build/weasyprint-layer-python3.12.zip
CompatibleRuntimes:
- python3.12
CompatibleArchitectures:
- x86_64

Outputs:

LayerVersionArn:
Value: !GetAtt PDFLayer.LayerVersionArn
Export:
Name: weasyprintLayerArn