Skip to content

Commit a0d2ebc

Browse files
committed
Match version in Python base image with local Python version
I was running into serialization errors caused by packaging with Python 12 locally and running remotely with Python 13. This fixes the issue.
1 parent ebb54cb commit a0d2ebc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

keras_remote/backend/execution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,11 @@ def _build_container(ctx: JobContext) -> None:
218218
ctx.image_uri = ctx.container_image
219219
logging.info("Using custom container: %s", ctx.image_uri)
220220
else:
221+
import sys
221222
logging.info("Building container image...")
223+
py_version = f"{sys.version_info.major}.{sys.version_info.minor}"
222224
ctx.image_uri = container_builder.get_or_build_container(
223-
base_image="python:3.12-slim",
225+
base_image=f"python:{py_version}-slim",
224226
requirements_path=ctx.requirements_path,
225227
accelerator_type=ctx.accelerator,
226228
project=ctx.project,

0 commit comments

Comments
 (0)