2026.05.14 Release v0.2.1
🌟 Major New Features
Official Python SDK (cubesandbox v0.1.0)
A first-party Python SDK is now shipped under sdk/python/, fully aligned with the CubeAPI OpenAPI spec.
- Full sandbox lifecycle:
create/connect/pause/kill/list/health. - Code execution:
run_code()with streaming stdout/stderr,env_vars, andtimeout. - Commands & filesystem:
commands.run()over Python subprocess,files.read()for sandbox FS access. - Direct-connect transport:
CUBE_PROXY_NODE_IPis honored via anIPOverrideTransport(TCP direct connect, bypassing DNS). - Network policy:
allow_internet_accessand explicit allow/deny lists are first-class parameters. - 12 worked examples mirroring the official CubeAPI/examples, plus a
benchmark.pyfor concurrent create/delete perf testing. - Quality: single HTTP client (
httpxonly, norequests), typedConfig, deterministic client cleanup (close()/__del__), 76/76 tests passing.
🚀 Performance
- Skip SHA256 on every startup (
Cubelet): SplittingSyncKernelFileintoEnsureKernelFilePresent(copy-if-missing, fast path) andRefreshKernelFile(force-refresh with verification) removes the expensive per-boot SHA256 comparison fromEnsurePmemFile. Kernel verification is now triggered only at image distribution time via the newmaterializeDistributedTemplateRuntimeFiles. Normal startup latency drops significantly on hosts with many templates. - Skip redundant
docker pull(CubeMaster): Source image pulls are now bypassed when the image already exists locally, removing unnecessary round-trips to the registry during template builds.
🛡️ Security Fixes
shim: protobuf bumped 3.4.0 → 3.7.2 (RUSTSEC, stack overflow on crafted unknown fields). Co-upgradescontainerd-shim-protos0.7.2 → 0.9.0,containerd-shim0.7.4 → 0.9.0,nix0.26.0 → 0.29.0. Public API surface used by the shim is unchanged.cubeapi/agent/shim/hypervisor: rand 0.8.5 → 0.8.6 (GHSA-cq8v-f236-94qc). Fixes a soundness issue where a custom logger accessingrand::rng()duringThreadRngreseeding could produce aliased mutable references (UB).CubeVS:golang.org/x/net→ v0.38.0,golang.org/x/sys→ v0.38.0 (resolves Dependabot alerts).network-agent:google.golang.org/grpc→ 1.79.3.CubeAPI/examples:pygments→ 2.20.0.
🛠️ Critical Fixes
- Fixed Seccomp swallowing all syscalls:
Seccompinitialization now setsDefaultAction = ActAllow, and an emptyreqSysCallslist short-circuits as a no-op (previously, an empty list combined with the default-deny action could silently block all syscalls). Slices are pre-allocated and tests were added. - Fixed
shimstderr being routed through stdout: TheExecstream-forwarding path was incorrectly calling the stdout read method for stderr. Stderr from sandboxed containers is now properly captured and forwarded to the host. - Fixed
CubeProxyworkers sharing the same PRNG seed: In OpenResty, workers forked from the master inherited the samemath.random()state, so every worker produced an identical sequence — defeating cache-TTL jitter and inviting synchronized cache-expiration stampedes. The RNG is now seeded per-worker ininit_workerwith(ngx.now() * 1000 + ngx.worker.id()). - Fixed dev-env sync overwriting
cube-shimsymlinks:cube-runtimeandcontainerd-shim-cube-rsare now written to${TOOLBOX_ROOT}/cube-shim/bin, preserving the toolbox's symlink layout instead of clobbering it. - Fixed Dockerfile breakage on HTTPS-only mirrors:
ca-certificatesis now installed before apt sources are swapped to internal mirrors, avoiding bootstrap failures when the new mirror is HTTPS-only.
✨ Enhancements
cubemastercli tpl watch— phase-oriented output: The old multi-line full-status dump on every update is replaced by concise[N/7] PHASE progress=… distribution=…lines plus a terminal summary. The same formatting is applied to theredowatch path. Much friendlier in CI logs.- IPAM — comprehensive optimization and reliability overhaul (Cubelet + network-agent):
- Validation rewritten on top of
net/netipfor robust IPv4/mask handling. - Cubelet and network-agent IPAM implementations brought to structural parity.
- IP ↔ index conversions simplified via
encoding/binary.BigEndian; zero-allocationidx2IP. - Bounds checks and safety limits added to
Allocate/Release/Assign;nilguards on all IPAM methods. - Reserved-address semantics (network / gateway / broadcast) clearly documented;
getGwIPAndMaskhelper extracted. - Comprehensive table-driven tests + concurrency tests with functional assertions and duplicate detection.
- Validation rewritten on top of
⚙️ Engineering Improvements
- Examples reorganized into standalone top-level directories: Moved from
CubeAPI/examples/to a top-levelexamples/, with dedicatedhost-mountandnetwork-policydirectories (each with its own README); comments translated to English. cube-benchpromoted toexamples/cube-bench: Now a standalone Go module with its own Makefile, replacing the embeddedCubeAPI/benchmark.- Go toolchain alignment:
CubeVSandnetwork-agentupgraded to Go 1.24.8 to match Cubelet / CubeMaster. cubecliinternationalization: Remaining Chinese usage strings inbenchrun.gotranslated to English.- Docker build context cleanup:
Makefilebuilder-image now builds from./dockerinstead of the repo root. - Alpine mirror swap: APK repositories switched from
dl-cdn.alpinelinux.orgtomirrors.tencent.comfor faster, more reliable builds.
🤖 CI / DevOps
- DCO check workflow: A dedicated PR gate now blocks merges if any non-merge commit is missing a valid
Signed-off-bytrailer, enforcing the requirement documented inCONTRIBUTING.mdas a hard gate. Includes concurrency grouping and actionable fix instructions. - GitHub ARC (Actions Runner Controller) support: Self-hosted ARC runners are now wired up for kernel / package build workflows, with a demo workflow included.
- No more duplicate PR checks:
pushtriggers onbuild-check,build-envd-base-image,build-builder-image, andhypervisor-integrationare now scoped tomasteronly. PR validation runs exclusively via thepull_requestevent — halving CI cost. sync-to-cnb: Uses theCNB_GIT_PASSWORDsecret (replacing the olderCNB_TOKEN).
📚 Documentation
- Deployment guide reworked: PVM and bare-metal are now presented as the preferred deployment paths.
- PVM rapid-deploy on OpenCloudOS 9: New step-by-step section added to
pvm-deploy.md. - "About us" page: English and Chinese versions of the About page added, with corresponding VitePress navigation.
- X (Twitter) link added to the project READMEs.
- Docs polish: Python import paths and architecture-diagram spacing corrected.
- WeChat / assistant QR codes refreshed in
README_zh.md.
🙏 Contributors
Thanks to everyone who contributed to v0.2.1: @fslongjin, @chenhengqi, @YangYuS8, @novahe, @staryxchen, @ls-ggg, @silencegao, @maxlong, @luzhixing12345, @caoqianyun, @kingwin-ustc, and Dependabot.
New Contributors
- @luzhixing12345 made their first contribution in #178
- @wbzdssm made their first contribution in #186
- @dependabot[bot] made their first contribution in #195
- @caoqianyun made their first contribution in #213
- @xiongxz made their first contribution in #224
Full Changelog: v0.2.0...v0.2.1