Skip to content

Commit 4152010

Browse files
author
Edd
committed
Add Python 3.13 runtime support and fix Docker Lambda execution
- Add python3.13 to supported Lambda runtimes - Update Dockerfile.release to install Python and create symlinks for python3.11/3.12/3.13 so Lambda functions can execute - Enables running Python Lambda functions inside the Docker container
1 parent dd6d52d commit 4152010

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Dockerfile.release

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ RUN cargo build --release
1616
# Runtime image
1717
FROM debian:bookworm-slim
1818

19+
# Install Python and other dependencies for Lambda execution
1920
RUN apt-get update && apt-get install -y --no-install-recommends \
2021
ca-certificates \
2122
curl \
2223
python3 \
23-
&& rm -rf /var/lib/apt/lists/*
24+
python3-pip \
25+
python3-venv \
26+
&& rm -rf /var/lib/apt/lists/* \
27+
&& ln -sf /usr/bin/python3 /usr/bin/python3.11 \
28+
&& ln -sf /usr/bin/python3 /usr/bin/python3.12 \
29+
&& ln -sf /usr/bin/python3 /usr/bin/python3.13
2430

2531
COPY --from=builder /app/target/release/ruststack /usr/local/bin/ruststack
2632

ruststack-lambda/src/function.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub enum Runtime {
1616
Python311,
1717
#[serde(rename = "python3.12")]
1818
Python312,
19+
#[serde(rename = "python3.13")]
20+
Python313,
1921
#[serde(rename = "nodejs18.x")]
2022
Nodejs18,
2123
#[serde(rename = "nodejs20.x")]
@@ -34,6 +36,7 @@ impl Runtime {
3436
Self::Python310 => "public.ecr.aws/lambda/python:3.10",
3537
Self::Python311 => "public.ecr.aws/lambda/python:3.11",
3638
Self::Python312 => "public.ecr.aws/lambda/python:3.12",
39+
Self::Python313 => "public.ecr.aws/lambda/python:3.13",
3740
Self::Nodejs18 => "public.ecr.aws/lambda/nodejs:18",
3841
Self::Nodejs20 => "public.ecr.aws/lambda/nodejs:20",
3942
Self::ProvidedAl2 => "public.ecr.aws/lambda/provided:al2",
@@ -49,6 +52,7 @@ impl Runtime {
4952
"python3.10" => Some(Self::Python310),
5053
"python3.11" => Some(Self::Python311),
5154
"python3.12" => Some(Self::Python312),
55+
"python3.13" => Some(Self::Python313),
5256
"nodejs18.x" => Some(Self::Nodejs18),
5357
"nodejs20.x" => Some(Self::Nodejs20),
5458
"provided.al2" => Some(Self::ProvidedAl2),
@@ -63,6 +67,7 @@ impl Runtime {
6367
Self::Python310 => "python3.10",
6468
Self::Python311 => "python3.11",
6569
Self::Python312 => "python3.12",
70+
Self::Python313 => "python3.13",
6671
Self::Nodejs18 => "nodejs18.x",
6772
Self::Nodejs20 => "nodejs20.x",
6873
Self::ProvidedAl2 => "provided.al2",

ruststack-lambda/src/service.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ except Exception as e:
447447
Runtime::Python310 => "python3.10",
448448
Runtime::Python311 => "python3.11",
449449
Runtime::Python312 => "python3.12",
450+
Runtime::Python313 => "python3.13",
450451
_ => "python3",
451452
};
452453

0 commit comments

Comments
 (0)