feat: make Python runtimes optional - #21
Merged
Merged
Conversation
Build the RRT-only runtime profile by default so all-in-one images no longer download or package Python and the actor SDK unless explicitly requested. Preserve Python 3.10 through 3.14 behind RUNTIME_PROFILE=python and keep the node service configuration aligned with the selected runtime image. Signed-off-by: Tianyu Zhou <albert.zty@antgroup.com>
tianyuzhou95
marked this pull request as ready for review
August 9, 2026 11:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR splits the AKernel sandbox runtime into an RRT-only default profile and
an opt-in Python compatibility profile.
A normal all-in-one build now packages only the RRT sandbox runtime:
Deployments that need Python actor runtimes can preserve the existing Python
3.10 through 3.14 environment explicitly:
This keeps the default image aligned with the AKernel SDK's default
openyuanrong-sandboxbackend, which uses sandboxd and does not require thePython actor runtime.
Runtime profiles
The
rrtprofile contains the RRT executable and the minimal userspace neededto launch it, including CA certificates,
libgcc, a shell, andtini. It doesnot download or package
uv, standalone Python distributions, Python virtualenvironments, or
openyuanrong_sdk.The
pythonprofile extends the RRT rootfs and preserves the existing Python3.10, 3.11, 3.12, 3.13, and 3.14 runtimes. Each Python environment includes
FastAPI, Pydantic, Uvicorn, and
openyuanrong_sdkfor actor-backendcompatibility.
The runtime Dockerfile places the complete
runtime-rrttarget before allPython stages. Both BuildKit and Docker's legacy builder can therefore finish
the default target without evaluating Python-only stages or downloading their
dependencies.
Both profiles continue to produce the same EROFS artifact path consumed by the
node image.
Build and node behavior
RUNTIME_PROFILEis passed from the Makefile tobuild-image.sh. The buildscript selects either the
runtime-rrtorruntime-pythonDocker target andpasses the same profile to the node image. Unsupported values fail before the
build starts.
The YuanRong service configuration is split to match the selected artifact:
rrt.rrt,py310,py311,py312,py313, andpy314.The node image selects the corresponding service configuration through
AKERNEL_RUNTIME_PROFILE. This prevents an RRT-only node from advertisingPython functions that are not present in its runtime artifact.
The all-in-one control-plane image still contains the system Python packages
required to install and run OpenYuanRong core components. The RRT-only change
applies to the sandbox runtime EROFS artifact, not to the node control plane.
SDK compatibility
This PR does not change the AKernel SDK API or backend selection behavior.
The default
openyuanrong-sandboxbackend works with both runtime profiles.It creates and controls sandboxes through sandboxd and requires only the RRT
function registered by the default profile.
Users who explicitly select the actor backend must also select the Python
runtime profile:
export AKERNEL_BACKEND=openyuanrong-sdk make build RUNTIME_PROFILE=pythonUsing
AKERNEL_BACKEND=openyuanrong-sdkwith the default RRT-only image is nota supported combination because the Python functions and actor runtime are not
registered.