Deployment Lifecycle
This page describes the current shared deployment flow implemented by
@le-space/core and @le-space/node.
High-Level Flow
- Validate the rootfs reference and deployment inputs.
- Resolve or rank CRN candidates.
- Build and sign the Aleph
INSTANCEmessage. - Broadcast the deployment request.
- Optionally publish required port forwards through an Aleph
AGGREGATE. - Wait for Aleph to process the deployment message.
- Poll runtime endpoints until networking becomes available.
- For
uc-go-peer, notify the CRN allocation, wait for the setup endpoint, run/configure, then fetch/metadata. - Verify required TCP and HTTPS reachability.
- If deployment fails on a CRN, forget failed messages and retry the next candidate when appropriate.
As a picture — the happy path runs down the left, and every failure inside the CRN attempt folds back into the retry loop described below:
Shared Core Modules
manifests.tsManifest validation plus rootfsSTOREexistence and gateway probing.crns.tsCRN list fetching, compatibility filtering, geo enrichment, ranking, and preferred-country selection.instance-deployment.tsAlephINSTANCEpayload creation and message broadcasting.aggregate-publication.tsPort-forward aggregate publication.deployment-inspection.tsAleph message polling and rejection diagnostics.runtime.tsScheduler, execution-map, and runtime availability inspection.guest.tsuc-go-peersetup, metadata fetch, and reachability verification.forget.tsCleanup of failed deployments.retention.tsSuccessful-deployment ledger maintenance and forgetting old resources.
Retry Model
The current shared deploy executor supports:
- explicit
crn_hashpinning - preferred-country ranking
- multi-CRN retry when a deployment is rejected
- cleanup of failed deployment attempts before moving to the next CRN
Since @le-space/ui 0.6.40 the retry loop also enforces a
browser-dialable-address invariant for every relay profile: an
acknowledgement that carries no browser-dialable address (secure websocket
or certhash transport) throws inside the CRN loop, the failed attempt is
cleaned up (config aggregate, INSTANCE FORGET) and the next CRN is tried
— instead of reporting a deploy as successful that browsers can never
reach. The controller waits up to 10 minutes for the 2n6 hostname to
activate and probes https://<2n6-host>/health before declaring the relay
reachable. A single failed CRN attempt costs 7–13 minutes before failover
moves on; see Relay dialability
timeline for the full
activation model and budget guidance.
This keeps the higher-level consumer workflows simpler because the retry behavior now lives in shared code instead of repo-local scripts.
The browser loop in packages/ui/src/shared/controller.ts takes at most five
ordered candidates (a user-pinned CRN first, then the score-sorted compatible
ones) and treats "not browser-dialable" as a failed attempt rather than a
success:
The controller waits up to ten minutes per attempt for the 2n6 hostname to activate, which is why a single failed candidate costs 7–13 minutes.
uc-go-peer Guest Lifecycle
The current shared implementation includes the uc-go-peer operational flow:
- deploy VM
- wait for runtime networking
- notify CRN allocation endpoint
- wait for temporary setup endpoint
- submit
/configure - poll
/metadata - verify relay ports and optional HTTPS proxy
That makes the shared repo more than a raw Aleph SDK. It already contains the first app-profile lifecycle that UC needs today.
Retention Flow
The shared retention logic stores a ledger under the Aleph aggregate key
uc-go-peer-successful-deployments.
Each successful record may include:
instance_item_hashrootfs_item_hashsite_item_hashrootfs_cidsite_urlrelay_peer_idrootfs_versionvm_namedeployed_at
When the keep limit is exceeded, older Aleph hashes are collected and forgotten
through a shared FORGET message.