Skip to main content
Documentation
Preview
You're viewing the Next docs — a rolling preview of in-development changes. The current release docs may differ.

Rugix Apps

Nexigon Agent installs, updates, starts, stops, and removes apps with Rugix Apps. Rugix Apps installs each app from a bundle as a new generation and keeps earlier generations on the device for rollback. Set Up Rugix Apps shows how to prepare devices and publish apps.

Operators set the desired state of a device’s apps in the dev.nexigon.rugix-apps.config device property. For each app, it names the release to run, for example the stable tag of a package, and whether the app should run, stay stopped, or be removed. The agent publishes the state of the apps in the dev.nexigon.rugix-apps.status property and records each installation and failure as an event in the apps category. Rugix Apps Interface describes both properties.

The Check Cycle

The agent checks the apps after it connects to Nexigon Hub, every check-interval-secs, when a deferred update becomes due, and when the nexigon.rugix-apps.check command runs. For each app that the configuration lists, a check:

  1. Starts, stops, or removes the app as its desired state requires. If an app should run but its workload stopped, the agent starts it again, with the new generation if step 5 activates one.
  2. Resolves the configured release to a package version.
  3. Waits while a hold, a retry delay, or a spread defers the update.
  4. Downloads the bundle for the device’s architecture and installs it as a new generation, while the current generation keeps running.
  5. If the app should run, activates the new generation, which switches the app to it. For a running app, the agent waits for the maintenance window, if one is set. A stopped app starts with the new generation later.
  6. Removes old generations that it no longer needs to keep.

Because installation and activation are separate steps, a maintenance window only has to cover the switch itself. If the new generation fails to start, Rugix Apps returns the app to its previous generation, if there is one, and the agent reports the update as failed. An app that starts but does not work correctly stays on the new generation; pin an earlier release to return to it.

While a system update installs a new system and reboots into it, the agent does not change apps. Stopping the agent interrupts the installation of a bundle. The next check counts an unfinished installation as a failed attempt; if the target generation finished installing before shutdown, it continues with that generation.

Versions on the Device

With each generation that it installs, the agent records the package version that it installed it from. The device therefore knows which version each app runs, even after Rugix Apps has rolled an app back. If a configured version is still installed, the agent switches back to it without downloading it again.

After switching an app to a new version, the agent removes old generations with rugix-ctrl apps gc, which also frees their files. It keeps the running generation and, by default, one previously running generation. The gc.keep setting and the gc policy of the configuration change this number.

Managed and Unmanaged Apps

The agent changes only the apps that the configuration lists. It reports other installed apps, for example apps included in the device image, as not managed and leaves them unchanged.

When the configuration starts listing an installed app, the agent does not know which package version the existing generation came from, because only generations that the agent installs record it. It therefore installs the configured release as a new generation, even if the app already runs the same release. From then on, the agent recognizes the versions of the app.

When the configuration stops listing an app, the agent stops managing it and leaves it installed. To uninstall the app instead, including its persistent data, set its state to removed.

An app whose entry in the configuration is invalid stays as it is. The agent reports it as failed with the error and brings the other apps into their desired states.

For apps that the configuration does not list, the agent provides the nexigon.rugix-apps.start, stop, rollback, and remove commands, which take the app name as input, such as {"app": "debug-shell"}. The web interface offers them for unmanaged apps. The commands reject managed apps, whose state the configuration determines.

Bundle Selection

The agent installs the bundle for the device’s architecture, which defaults to the one that the agent was built for and which the arch setting overrides. The device reports it as arch in the status. Bundle Selection describes the filenames, and Select the Architecture shows how to name bundles.

App Logs

The nexigon.rugix-apps.logs command returns the most recent log records of an app’s workload, which the agent reads with rugix-ctrl apps logs. It works for managed and unmanaged apps and requires Rugix Ctrl 1.4.1 or later. To fit the limit of Nexigon Hub for command outputs, the agent cuts long messages and omits the oldest records. Nexigon Hub shows the logs in the settings of each app. Logs Command describes the input and output.

Settings

App Management lists the settings of the integration, which requires Rugix Ctrl 1.4 or later. It can run alongside a system update integration.