Files
LocalAI/contrib/appimage
mudler-agentandEttore Di Giacinto 33459f2e2a feat(launcher): ship an AppImage on tagged releases (#12647)
* feat(launcher): package a Linux AppImage

Ship the existing Fyne launcher as an additive release asset without
bundling the server or changing its runtime downloader.

Pin packaging tools and the type-2 runtime, preserve the caller
environment, and document the native amd64 graphics requirements.
Validate packaging contracts and wire extraction smoke checks into CI.

Assisted-by: Codex:gpt-5

* fix(launcher): harden AppImage release checks

PR builds must not receive repository write credentials. Isolate uploads
in a gated job that consumes the tested artifact without checkout.
Keep the existing release check and dependency on GoReleaser.

A surviving process does not prove that the UI event loop works.
Require observable startup progress, reject initialization errors, and
bound termination. Document the remaining limits without changing the
launcher application. Add permission and smoke failure regressions.

Assisted-by: nib:unknown

* fix(launcher): install file for AppImage builds

appimagetool fails after Go compilation when file is missing. Install
it explicitly in CI and document the local build dependency. Check for
it before compilation and cover the missing-command failure in tests.

Assisted-by: nib:unknown

---------

Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-10-12 17:17:43 +02:00
..

Linux launcher AppImage

This packages only the Go/Fyne launcher. It does not bundle the LocalAI server, models, a worker interface, or an AppImage updater. The existing runtime downloader remains responsible for installing LocalAI on first use.

Build

Use native Linux amd64 (x86_64), Go from go.mod, GCC, GNU Make, curl, file, pkg-config and coreutils. On Ubuntu 22.04 the development packages are:

sudo apt-get install build-essential file pkg-config libgl1-mesa-dev xorg-dev libxkbcommon-dev
make test-launcher-appimage
make build-launcher-appimage APPIMAGE_ARCH=amd64

Output: dist/LocalAI-Launcher-x86_64.AppImage and its .sha256 file. Only amd64 is supported, matching the existing Linux launcher release job. ARM64 requires a native CGO builder and separate runtime/tool pins; it is not silently cross-compiled or labelled as supported.

The release builder is Ubuntu 22.04 (glibc 2.35). Fyne uses CGO, OpenGL and X11; this is not a static or fully self-contained executable. We intentionally use host graphics libraries rather than bundle drivers or glibc, and never set LD_LIBRARY_PATH: the downloaded server must not inherit launcher libraries. Ubuntu 22.04+ desktop systems are the compatibility target. Other distributions need glibc >= 2.35, libGL, libX11, libXcursor, libXrandr, libXinerama, libXi and libXxf86vm plus their dependencies. Wayland needs XWayland. A working tray is recommended because the existing launcher starts in the tray. The separately downloaded server/backends have their own system requirements.

build.sh pins appimagetool 1.9.1 and type-2 runtime 20251108 by release and SHA-256. Both hashes come from the upstream release asset digests. Cached files are verified on every build. To update, review the upstream release and replace the URL and hash together. The build extracts appimagetool explicitly, so CI needs no FUSE. No linuxdeploy or unpinned Fyne packaging tool is used.

AppDir contents and timestamps are controlled, Go paths/build IDs are stripped, and SOURCE_DATE_EPOCH defaults to the source commit timestamp. Repeatable builds require the same Go/compiler/system packages; this does not promise bit-identical output across arbitrary distributions. dist/appimage/ldd.txt records the actual dynamic dependency tree of each build.

Verification and release

make test-launcher-appimage
# After building; requires desktop-file-utils, xvfb and xauth:
bash contrib/appimage/smoke.sh

The smoke extracts the real image, validates metadata/dependencies, then runs its AppRun under Xvfb with an isolated home and server auto-start disabled. It requires the existing “No LocalAI installation found” initialization milestone, created model/backend directories, and survival until the 15-second timeout. Initialization errors, early exits and forced kills after a 5-second termination grace fail the check. This is a limited startup smoke, not proof of a working UI event loop: the tray-only launcher exposes no UI heartbeat. It does not test tray interaction, rendering, a model or GPU workload. Logs are in dist/appimage/smoke/.

The reusable workflow builds and smokes on relevant pull requests or manual dispatch with read-only repository permissions and no persisted checkout credentials. Version tags call it after GoReleaser succeeds. A separate job, gated on both a version-tag push and publish, downloads the tested artifact and uploads it to that existing release with write permission. That job does not check out or execute repository code. Existing tar.xz, DMG and server artifacts remain unchanged.