Skip to content

[images] Add Python 3.15 Vercel Managed Image - #418

Open
LukeSheard wants to merge 5 commits into
mainfrom
luke/python-315-vmi
Open

LukeSheard wants to merge 5 commits into
mainfrom
luke/python-315-vmi

Conversation

@LukeSheard

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Linux amd64 Python 3.15 VMI based on the existing Ubuntu image, compiling CPython 3.15.0 from SHA-256-verified source in a separate build stage.
  • Add the python-315 Bake target with 3.15 and 3.15.0 tags; existing CI and publishing workflows discover it automatically.
  • Include pip, venv, uv, and uvx, with build-time checks for Python versions, standard-library extensions (including _decimal), and virtual environment creation as the ubuntu user.
  • Preserve the existing Python 3.14 and universal images; update documentation and add a minor changeset for sandbox-image-python.

Verification

All final checks passed (exit 0):

  • From images/: docker buildx bake python-315 --load --progress=quiet.
  • Bake configuration assertions confirmed inclusion in the default group, both image tags, staging suffix/push propagation, and unchanged Python 3.14/universal versions.
  • Loaded-image runtime checks confirmed Python 3.15.0, standard-library extensions, pip 26.2.1, uv 0.13.6, the ubuntu user, /vercel home/workdir, and passwordless sudo.
  • docker image inspect confirmed both tags resolve to the same amd64 image.
  • ./node_modules/.bin/prettier --check images/README.md images/python/README.md .changeset/python-315-vmi.md.
  • git diff --check.

The initial build exposed a GNU tar compatibility issue in the local Docker runtime (resolved by using bsdtar, consistent with the Node image). An additional runtime check exposed missing _decimal support (resolved by adding mpdecimal dependencies and a build-time import check).

The image was built and loaded locally, but has not been pushed to VCR. Hosted Sandbox execution has not been tested.

@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sandbox Ready Ready Preview, v0 Nov 9, 2026 4:17pm UTC
sandbox-cli Ready Ready Preview, v0 Nov 9, 2026 4:17pm UTC
sandbox-sdk-ai-example Ready Ready Preview, v0 Nov 9, 2026 4:17pm UTC
workflow-code-runner Ready Ready Preview, v0 Nov 9, 2026 4:17pm UTC

Comment thread images/python/README.md Outdated
extension imports, and virtual environment creation with pip as the `ubuntu`
user.

## Building locally

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this section in this README imo, this is intended to be fairly straightforward to describe whats in the image, this should be on images/README.md

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aecd463. Moved the Python build commands, version override example, and Bake group guidance to images/README.md. The Python README now stays focused on the image contents.

Comment thread images/python/README.md Outdated
| `vercel/sandbox/python:3.14` | 3.14.8 | `python` |
| `vercel/sandbox/python:3.15`, `vercel/sandbox/python:3.15.0` | 3.15.0 | `python-315` |

Both versions use the same Dockerfile. Set `PYTHON_VERSION` to a full CPython

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this description is needed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aecd463. Removed the source-build implementation paragraph and build-verification prose from this README, keeping the version table, user details, and package list.

Comment thread images/python/Dockerfile Outdated

RUN chown -R ubuntu:ubuntu /vercel
apt-get install -y --no-install-recommends \
git libbz2-1.0 libffi8 liblzma5 libmpdec4 libncursesw6 libreadline8t64 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aecd463. Compared the Ubuntu package dependencies and restored media-types, netbase, and tzdata, plus libdb-dev in the builder and libdb5.3t64 at runtime for dbm.ndbm. Added packaging, setuptools, and wheel via the selected interpreter’s pip so they are available to both source-built Python versions. Added build-time checks for the restored extension, packaging imports, and runtime data. docker buildx bake python python-315 --load --progress=plain passed for both versions, including venv creation with pip as the ubuntu user.

Comment thread images/python/Dockerfile Outdated
mkdir /tmp/python && \
bsdtar -xJf /tmp/python.tar.xz --strip-components=1 -C /tmp/python && \
cd /tmp/python && \
./configure --prefix=/usr/local --with-ensurepip=install && \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to add --disable-test-modules to stop the test suite from ending up on the image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in aecd463. Added --disable-test-modules to the shared CPython configure command, along with build-time assertions that test and _testcapi are absent. Both the Python 3.14 and 3.15 image builds passed these checks.

Comment thread images/python/Dockerfile Resolved
Updated target 'python-315' to inherit from '_common' and modified context and tags.

This branch was successfully deployed

4 active deployments
Preview – sandbox — f5807cc9 Deployed Nov 9, 2026 by vercel[bot]
Preview – sandbox-sdk-ai-example — f5807cc9 Deployed Nov 9, 2026 by vercel[bot]
Preview – workflow-code-runner — f5807cc9 Deployed Nov 9, 2026 by vercel[bot]
Preview – sandbox-cli — f5807cc9 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants