Reference·UpdatesIndex

Updates

The update command, the update config keys, channels, staging, the hot and restart paths, and manual steps.

.mdllms.txt
a shell
nodecode update [VERSION] [--check]

Command

FormDoes
nodecode updateMoves to the latest release on the configured channel. Lifts a hold.
nodecode update VERSIONMoves to that release label, and holds this home there until a bare nodecode update.
nodecode update --checkStages and classifies the release. Applies nothing.
CaseResult
An organism serves this homeIt takes the update itself. The command prints its answer.
No organism runsThe release is staged and linked. The next launch runs it.
Already on that releasePrints already at LABEL.
The binary and the organism differPrints one line for each.

An organism is a running Nodecode. One update runs at a time. An error exits with code 1.

Config keys

Set these under update in ~/.nodecode/config.jsonc. The same keys are in /settings, under System > Updates.

KeyValuesDefault
update.modeauto, ask, offauto on an installed build. off on a source build.
update.channelA channel namestable
update.check_minutesInteger, 1 or more360 with a release feed. 30 without one.
update.urlA release hostThe host this build was installed from. Else https://nodecode.ai/dl.
update.feedA feed host, or offThe release host. off when the host is a folder.
~/.nodecode/config.jsonc
{
  "update": { "mode": "ask", "channel": "stable" }
}
ModeDoes
autoStages and applies each new release.
askStages the release. Posts a notice. nodecode update applies it.
offNever looks. No release note is reported.

An installed build runs from the installer's layout, beside a current link. NODECODE_BASE_URL overrides the built-in host. See Config.

Channels

A channel is one pointer file per platform on the release host:

a shell
<host>/<channel>-<arch>-<os>
PlatformPointer on stable
Linux x86_64stable-x86_64-linux
macOS Apple Siliconstable-arm64-darwin
Windows x86_64stable-x86_64-windows

The pointer holds one release label. The installer reads the same file.

CheckWhen
First look30 seconds after the gateway starts.
PollEvery update.check_minutes.
Release feedOne open connection to the feed host. A new label triggers a check at once.

Windows: the default poll is 30 minutes.

The poller only moves forward. A channel that names an older build, or a build no channel published (a source build's own), is said and left:

it prints
LABEL is out; this build, OWN, is newer, so it stays: `nodecode update LABEL' goes back to it and holds there

Naming a release holds this home there. nodecode update VERSION writes ~/.nodecode/release-pin. While the hold stands, the poller leaves the channel alone, and its look still says what came out:

it prints
release LABEL is held by `nodecode update LABEL'; NEW is out; `nodecode update' lifts the hold

A bare nodecode update lifts the hold. A restore holds nothing.

Staging

Staging runs the installer that shipped with the build, in stage mode.

  1. Download the release archive.
  2. Check its sha256.
  3. Lay it out in <release-dir>/<label>/, beside the running build.
  4. Run the staged executable with --help.

current does not move. Nothing restarts. A failure stops here with the installer's last line as the reason. The installer may run for 30 minutes at most.

After staging, Nodecode compares the staged source with its own, definition by definition. The verdict is same, hot or restart.

Hot path and restart path

Changed formPath
defun, defmethod, defvar, defparameter, defsetf, define-*, defclassHot
Any new definitionHot
A changed defmacro or inline functionHot. Every definition that uses it is evaluated again.
A defpackage that changes only :exportHot
defstruct, define-recordRestart
Any other defpackage change, defconstant, deftypeRestart
A definition in a package this image lacksRestart
A file or .asd that does not readRestart
define-kind, the store schemaRestart
A defgeneric whose lambda list changedRestart
Code outside any definitionRestart
A new system dependencyRestart
StepHot releaseRestart release
Live imageEvery changed definition is evaluated. All or nothing.Every definition that can go live is evaluated. The rest waits.
current linkMoves to the new release.Moves to the new release.
Attached shellsEvaluate the same changes.Evaluate the same changes. Boot state waits for their next launch.
RestartNone.See below.
RecordAn organism.upgraded fact.An organism.upgraded fact.

Restart on the restart path:

Organism runs asResult
The background gateway (nodecode gateway on)It checks every 5 seconds. It exits when no turn runs. The unit starts it on current.
A shell, or nodecode serveThe new build runs at the next launch.

A running turn is never interrupted. The gateway's own look applies a release only while no turn runs. A release that leaves a provider this organism served unresolved is undone whole, and runs at the next launch instead.

If the live image refuses a release, nothing changes in the image. The release is linked for the next launch. The poller does not try it again.

After an update the model reports the new version and the changes once. Latest changes, in /settings, lists what the running release changed.

Rollback

FailureWhat happens
A staged build does not answer --helpRefused at staging. Nothing moved.
A hot load failsThe image is restored. The release is linked for the next launch.
A launch dies before it servesThe next launch runs pristine: generation 0, the binary alone, no folder loaded. After two deaths in a row it stays pristine until a restore.

Go back by hand:

a shell
nodecode generations
nodecode rollback N

nodecode generations lists the sealed generations. nodecode rollback N restores one: every folder goes back to what N recorded, and a hub cell is cloned again at N's pin. The binary and its shipped folders stay on the release that runs, and updates keep coming, forward, over the restored folder. With the organism running, it exits once no turn is in flight, and the next launch runs N. /generations does the same in a shell, and asks before anything moves.

To take the binary back, name the release: nodecode update OLD-LABEL moves to it and holds this home there.

If nodecode itself does not start, reinstall the old release:

a shell
curl -fsSL https://nodecode.ai/install.sh | NODECODE_VERSION=OLD-LABEL sh

Not automated

  • Moving current back after a restart onto a build that does not serve. A pristine launch still runs that build.
  • Rollback after a store migration. Copy ~/.nodecode/history.db before an update you may want to reverse, or run /backup.
  • Updates of a source build. update.mode is off there. Run just release to rebuild.
  • Updates of cells from the hub. nodecode update moves the core and the shipped cells only.

Run the installer again to upgrade from outside. It restarts a running background gateway on the new build. See Install.

Esc

    Loading the index…

    ↑↓ moveEnter openEsc close