Skip to content

Add offline update script for devices without internet access - #538

Draft
brandonhs wants to merge 1 commit into
mainfrom
claude/offline-update-simple
Draft

brandonhs wants to merge 1 commit into
mainfrom
claude/offline-update-simple

Conversation

@brandonhs

Copy link
Copy Markdown
Member

Summary

Adds offline-update.sh, a new deployment tool that enables updating DWE OS on devices without internet access. The script runs on a machine with internet connectivity, probes the target device for its architecture and Python version, collects the release and all required Python wheels, and ships everything to the device over SSH for installation.

This solves the problem of updating air-gapped or isolated devices that cannot reach GitHub or PyPI directly. The script also supports building bundles for manual transfer via USB or other media when the device is not reachable via SSH.

Type of change

  • Bug fix
  • Feature / Refactor
  • Breaking change
  • Misc.

Quick Checklist

  • I have reviewed my own code.
  • I have tested these changes locally.
  • I have tested these changes on the following platforms (optional):
    • SVC
    • microSVC (optional)
    • SVC Pro

Details

New files:

  • offline-update.sh: Main update script that handles device probing, wheel collection, bundle creation, and remote installation
  • docs/offline-update.md: User documentation explaining usage patterns and limitations

Key features:

  • Automatic device detection (architecture, Python version, glibc version)
  • Cross-compilation support for wheel selection (manylinux compatibility tags)
  • Fallback wheel building for source-only packages (with validation that they're architecture-independent)
  • Two modes: direct SSH installation or bundle-only for manual transfer
  • Comprehensive error checking and validation before installation
  • Preserves existing virtual environment during updates
  • Validates device compatibility before installation begins

Limitations (by design):

  • Only updates existing installations; does not run apt (GStreamer, python3-venv, ttyd must already be present)
  • Bundle is specific to one architecture and Python version
  • Requires SSH access for direct installation mode

https://claude.ai/code/session_014D18VpvYkhtJJHD47Z9viP

Devices in the field cannot reach GitHub or PyPI, and every path through
the installer assumes they can: install.sh downloads a release,
install_requirements.sh runs apt, create_venv.sh runs pip against PyPI.

offline-update.sh moves that requirement onto the machine doing the
updating. It probes the device over SSH, collects the release and every
Python wheel resolved for the device's architecture, Python version and
glibc, copies the lot over and installs it there. The device makes no
outbound connection. --pack-only writes the bundle without deploying, for
sites where the device is not reachable from the machine with internet
either.

pip can only cross-select wheels, never build them, so a dependency that
publishes none is built here and kept only if it came out architecture
independent; anything else stops the build rather than shipping a wheel
for the wrong machine. PyEventEmitter is the current case.

Python packages install with --no-index --upgrade, so dependency changes
ship with the update. The virtual environment is kept and upgraded in
place, which is what makes a repeat update take a second rather than a
rebuild the device has no way to perform.

Scoped to updating devices that already have DWE OS: apt is never run, so
GStreamer, python3-venv and ttyd have to be present, which they are after
the initial install or from the Pi image. Nothing existing is modified,
so this can be dropped by deleting the script and its doc.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014D18VpvYkhtJJHD47Z9viP
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