Skip to content

Functional-core gateway refactors & standalone Rust ucloud-noded - #70

Merged
rlrs merged 35 commits into
mainfrom
refactor/functional-core-shell
Nov 30, 2026
Merged

rlrs merged 35 commits into
mainfrom
refactor/functional-core-shell

Conversation

@rlrs

@rlrs rlrs commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

  1. Gateway / shared-state functional-core & imperative-shell refactors

    • Extracted SandboxProxy, ImageBuilds, SandboxMigrations, and pure lifecycle/ranking/transition helpers out of ControlPlaneHandler and vm_init.py (with unit/decision tests and reduced test-rule violations).
    • Standardized on swappable RAM-backed memory (direct_ram_memory_backing default true, removed direct_reflink_memory_restore) and added registry_disk_guard_enabled for shared drives.
  2. Full standalone Rust ucloud-noded (--standalone-config)

    • Ported remaining worker routes and background loops into runtime/noded (zero new Cargo crates, --locked):
      • File I/O, gzipped archive upload/extraction, and /environment (files_front.rs, upload_archive.rs, environment.rs)
      • Sandbox list/get/delete and teardown pipeline (control_front.rs, node_pipeline.rs)
      • Pure-Rust Ed25519 signature verification, HTTP registry client, cold image materialization, and /v1/images routes (ed25519.rs, registry_client.rs, images_front.rs)
      • RAM-backed hibernation journal, park/wake, snapshot publication, migration, and commit-export (journal.rs, warden.rs, node_lifecycle.rs, lifecycle_front.rs, commit_export.rs, storage.rs)
      • Host + storage-native runtime metrics, /healthz, /v1/heartbeat, /v1/drain, heartbeat pusher, and boot-time/TTL orphan reconciler (runtime_metrics.rs, heartbeat.rs, standalone.rs)
    • Split the builder-only HTTP server into sandboxes/builder_agent.py (zero direct_* imports).
    • Wired standalone Rust workers behind sandbox.direct_node_standalone_rust (defaults false; sandboxes/standalone_noded_config.py, sandboxes/vm_init.py, sandboxes/config.py).

Line Count / Follow-up (Wave C3)

  • This PR is +25,440 / -8,797 lines because the legacy Python sandbox node daemon stays intact while sandbox.direct_node_standalone_rust defaults off for safe rollout and rollback.
  • Once standalone Rust bakes in production, a follow-up PR (Wave C3) will flip the default to true and delete ~16.7k lines of legacy Python node-daemon code (direct_service.py, direct_warden.py, direct_provisioner.py, direct_registry.py, direct_network.py, hibernation.py, heartbeat_sender.py, transition_admission.py, memory_backing.py, pause_tier.py, and the direct worker path in node_agent.py) plus their Python-only tests.

Verification

  • bash scripts/check.sh (with local PostgreSQL 17 and SDK checkout, UCLOUD_CHECK_ALLOW_MISSING_SHELLCHECK=1):
    • ruff check & scripts/check_test_rules.py: passed
    • Python + PostgreSQL suite: 253/253 modules passed
    • Rust ucloud-noded suite: 401/401 tests passed (plus static musl runtime/noded/build_pinned.sh build verified)
    • Go components & SDK (133/133 tests): passed
  • Live staging/production smoke test with sandbox.direct_node_standalone_rust = true (zero ucloud-sandbox-node.service, ~8.9 MB RSS ucloud-noded): verified create (parkable 288 ms, ephemeral 264 ms), /environment, streaming /exec, file PUT/GET, archive upload, park (224 ms) -> wake (353 ms) with persisted state, delete, live storage-native heartbeat metrics, and POST /v1/drain + autoscaler scale-down to zero.

rlrs added 30 commits November 25, 2026 11:26
@rlrs
rlrs merged commit b15d15c into main Nov 30, 2026
4 checks passed
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.

1 participant