Skip to content

feat: migrate AKernel deployment to Python YuanRong CLI - #19

Open
mhsong1998-dot wants to merge 1 commit into
inclusionAI:mainfrom
mhsong1998-dot:smh/python-cli-migration
Open

feat: migrate AKernel deployment to Python YuanRong CLI#19
mhsong1998-dot wants to merge 1 commit into
inclusionAI:mainfrom
mhsong1998-dot:smh/python-cli-migration

Conversation

@mhsong1998-dot

@mhsong1998-dot mhsong1998-dot commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • migrate master, frontend, node, and standalone startup to the Python openYuanRong CLI
  • upgrade core, SDK, and sandbox packages to 0.9.7 and lock the Python 3.12 dependency closure
  • integrate PR feat(deploy): pin openYuanRong 0.9.4 and align node IP #18 and node etcd discovery while preserving resource reporting, sandbox networking, metrics, and Traefik behavior

Review fixes

  • render standalone node IP and etcd client/peer ports consistently
  • use the live sandbox0 IPv4 address and external metrics for node/standalone roles
  • derive node DNS from node.sandboxIPRange
  • fail image builds if either wheel safety patch no longer matches
  • use complete amd64/arm64-resolved Python constraints

Validation

Validated final HEAD 3d195f7c27185c1fa837ad94d1d1b16005a3c6e5 on native x86 CCE cn-north-4/akernel-cce, namespace akernel-test.

  • image: linux/amd64, Docker schema v2, openyuanrong-core==0.9.7, pip check clean
  • SWR: swr.cn-north-4.myhuaweicloud.com/openyuanrong/cluster-all-in-one:pr19-0.9.7-3d195f7-20260812
    • digest: sha256:772710e4523d140abfbbf52c08176236c52e451bb0ed56cea9153e9fc230afd9
  • Helm: clean install succeeded; master, frontend, etcd, Traefik, and all 13 node Pods Ready on the exact digest
  • runtime: master/frontend components healthy; node bootstrap reads live sandbox0; Function Proxy runs with --ip=172.17.0.1, --proxy_ip=172.17.0.1, and --metrics_collector_type=external
  • SDK package gate: core/SDK/sandbox all 0.9.7, pip check clean, native imports passed
  • SDK tests: 100 unit tests passed (105 discovered, 5 integration skipped); live sandbox integration 5/5 passed
  • examples: basic_usage.py, command_stdin.py, and named_sandbox.py passed
  • gateway: Traefik-to-frontend health returned 200; dynamic sandbox port forwarding and reverse tunnel passed

Final HEAD differs from the previously full-built 0.9.7 feature image only by the upstream sandboxd gitlink. The published final digest recompiles that exact sandboxd revision and overlays its binaries on the fully validated image.

The stock port-forwarding example assumes python3 exists inside the default RRT rootfs. The deployed route was therefore tested with an available in-rootfs Perl HTTP server; no source workaround is included.

No temporary URL, registry alias, test/plan file, credential, or local validation fixture is committed. GitHub Actions still requires maintainer approval for the fork workflow.

@mhsong1998-dot
mhsong1998-dot force-pushed the smh/python-cli-migration branch 9 times, most recently from b7de90a to 7e5c006 Compare August 10, 2026 11:31
Comment thread builder/config/yr/config.toml.jinja Outdated
enable_multi_master = true
{% endif %}

{% if is_cluster or is_agent %}

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.

The standalone role is excluded by this condition, so its ETCD_PORT and ETCD_PEER_PORT values are never rendered. With openYuanRong 0.9.5 and --port-policy FIX, the embedded etcd therefore listens on the CLI defaults (32379/32380), while deploy/standalone/start.sh still configures Traefik with ${NODE_IP}:2379. The static file provider can hide this in /healthz smoke tests, but etcd-backed dynamic routes such as sandbox port forwarding will not be discovered. Please render a standalone values.etcd.address using YR_NODE_IP and the configured ports, or update the gateway to the actual embedded endpoint.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in the squashed HEAD 3d195f7. Standalone now renders its node address plus etcd client/peer ports explicitly, so embedded etcd and the launcher use the same values.

Comment thread builder/config/yr/config.toml.jinja Outdated
fc_agent_mgr_retry_cycle = 60000
runtime_logs_dir = "/home/yuanrong/logs"
{% endif %}
{% if is_agent %}

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.

standalone is included in is_node but not is_agent, so this leaves the standalone function proxy on the CLI default metrics_collector_type = "proc". The previous bootstrap explicitly selected external for both node and standalone, and the standalone sandboxd resource provider publishes cgroup, GPU, and storage data through /var/run/resource.sock. Please apply this setting to is_node so standalone keeps using sandboxd's resource accounting.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 3d195f7. External metrics is selected for every node role, including standalone. Native CCE validation confirmed the node Function Proxy starts with --metrics_collector_type=external.


node:
# sandboxd allocates sandbox addresses from this CIDR.
sandboxIPRange: "172.17.0.1/16"

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.

This exposes node.sandboxIPRange as configurable, but the node postStart hook still rewrites loopback resolvers to the hard-coded 172.17.0.1. For a value such as 172.23.0.1/16, sandboxd uses 172.23 while /etc/resolv_akernel.conf still points to 172.17, breaking DNS when the pod resolver is loopback. Please derive the resolver address from this value or from the live sandbox0 address.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 3d195f7. The resolver is derived from node.sandboxIPRange. Native CCE validation confirmed sandbox0=172.17.0.1/16 and the node Function Proxy uses 172.17.0.1 as its sandbox-local address.

Comment thread builder/node.Dockerfile
site_packages="$(/opt/openyuanrong/bin/python -c 'import site; print(site.getsitepackages()[0])')"; \
base_py="${site_packages}/yr/cli/component/base.py"; \
launcher_py="${site_packages}/yr/cli/system_launcher.py"; \
sed -i \

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.

These sed commands return success even if zero lines were changed. That is dangerous for the supported OPEN_YR_CORE_WHEEL_URL override: an upstream formatting change or refactor can make the patches silently no-op, causing the full environment (including LITEBUS_DATA_KEY) to be logged or persisted in session JSON. Please assert that each expected replacement occurred, or validate the patched invariant; ideally, carry the fixes upstream.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 3d195f7. Both wheel patches now have exact pre- and post-condition grep checks, so a changed or unmatched wheel fails the image build. The 0.9.7 image built successfully and passed package checks.

Comment thread builder/node.Dockerfile
python3 -m pip install \
--break-system-packages \
python3 -m venv /opt/openyuanrong; \
/opt/openyuanrong/bin/python -m pip 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.

pip install now resolves the core wheel's transitive dependencies from the index, and most of those requirements are lower-bounded rather than pinned. The top-level wheel checksum therefore no longer makes this image build reproducible: the same AKernel commit can install different dependency versions later or fail after an incompatible release. Please install from a pinned constraints or wheelhouse set, preferably with hashes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 3d195f7. The Python 3.12 direct and transitive dependency closure is committed as constraints and was resolved for amd64 and arm64. Native CCE also passed matching core/SDK/sandbox 0.9.7, pip check, imports, 100 unit tests, and 5/5 live integration tests.

@mhsong1998-dot
mhsong1998-dot force-pushed the smh/python-cli-migration branch from 7e5c006 to 6a7e84d Compare August 11, 2026 12:36
@tianyuzhou95

Copy link
Copy Markdown
Collaborator

One remaining process issue before merge: the current commit body contains only the Signed-off-by trailer. The repository's AGENTS.md requires a Conventional Commit with a prose body explaining what changed and why, followed by the DCO sign-off. Please amend the commit message accordingly.

Also, GitHub currently reports no checks for this branch. The validation documented in the PR is extensive, but there is no automated status attached to the commit. Please ensure the expected CI checks are configured and passing before merge, or explicitly confirm that this repository does not currently provide PR checks.

@mhsong1998-dot
mhsong1998-dot force-pushed the smh/python-cli-migration branch from 6a7e84d to 7284cd1 Compare August 12, 2026 02:20
Replace legacy YuanRong binary startup for master, frontend, node, and
standalone roles with the packaged Python CLI and a shared rendered config.

Upgrade core, SDK, and sandbox dependencies to 0.9.7, lock the Python 3.12
dependency closure, and preserve etcd discovery, resource reporting, sandbox
networking, metrics, and Traefik behavior across cloud profiles.

Signed-off-by: mhsong1998-dot <258010372+mhsong1998-dot@users.noreply.github.com>
@mhsong1998-dot
mhsong1998-dot force-pushed the smh/python-cli-migration branch from 7284cd1 to 3d195f7 Compare August 12, 2026 05:32
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.

2 participants