Skip to content

feat: add native app-image launcher distribution#172

Open
golemcore1 wants to merge 12 commits intomainfrom
feat/native-app-image-launcher
Open

feat: add native app-image launcher distribution#172
golemcore1 wants to merge 12 commits intomainfrom
feat/native-app-image-launcher

Conversation

@golemcore1
Copy link
Copy Markdown
Collaborator

@golemcore1 golemcore1 commented Mar 15, 2026

Summary

This PR introduces a native local distribution path for GolemCore Bot and makes launcher behavior consistent across staged updates, bundled app-image runtime jars, and the legacy classpath fallback.

At the packaging level, the release workflow now builds platform-specific native app-image bundles in addition to the executable JAR and publishes those archives together with updated SHA-256 checksums. To support local development and manual packaging, the repository also includes a reusable build script under .github/scripts/ plus an npx entry point that generates the same native archive format locally.

At runtime, RuntimeLauncher is extended so that a native launcher can start the bot using the same self-update model that already exists for the JAR flow. The launcher now resolves runtime in a deterministic order: first a staged update selected through updates/current.txt, then the bundled runtime JAR embedded in the app-image, and finally the existing Jib/classpath fallback. This keeps local native bundles compatible with staged updates without introducing a separate execution model.

The native launcher itself is now implemented with picocli. It exposes documented launcher-specific options, converts launcher-level overrides into child JVM/system properties where appropriate, and still forwards unmatched Spring Boot arguments to the spawned runtime unchanged. This gives the native bundle a real CLI surface instead of relying only on raw pass-through arguments.

To make the new behavior durable, the test suite for RuntimeLauncher is expanded to cover bundled runtime resolution, picocli argument parsing, launcher option forwarding, property precedence rules, help/version flows, and the fallback path when no valid bundled runtime JAR is available.

Documentation is updated across the README, quick start, deployment guide, and configuration reference so users can understand:

  • how to build the native app-image locally
  • what files are produced
  • how the launcher resolves runtime
  • which launcher parameters exist and what their defaults are
  • how launcher options differ from Spring Boot pass-through arguments
  • how native archives are now included in release assets

Native launcher parameters

All native launcher parameters are optional. Running the app-image with no arguments is valid.

Parameter Aliases Purpose Default when omitted Required
--storage-path=<path> --bot.storage.local.base-path=<path> Override the workspace storage root and forward it as -Dbot.storage.local.base-path=... to the child runtime Uses existing JVM property bot.storage.local.base-path if already set, otherwise environment STORAGE_PATH, otherwise no explicit launcher override No
--updates-path=<path> --bot.update.updates-path=<path> Override the updates directory and forward it as -Dbot.update.updates-path=... to the child runtime Uses existing JVM property bot.update.updates-path if already set, otherwise environment UPDATE_PATH, otherwise derives from storage path, otherwise falls back to ${user.home}/.golemcore/workspace/updates No
--bundled-jar=<path> --golemcore.launcher.bundled-jar=<path> Force a specific bundled runtime JAR instead of relying on auto-discovery Uses existing JVM property golemcore.launcher.bundled-jar if set, otherwise environment GOLEMCORE_BUNDLED_JAR, otherwise auto-discovers the bundled JAR from the app-image layout, otherwise falls back to classpath mode No
--server-port=<port> --server.port=<port> Set the HTTP port by forwarding -Dserver.port=... to the child runtime Uses existing JVM property server.port if already set, otherwise no explicit launcher override and Spring Boot default behavior remains in effect No
-J=<jvm-option> --java-option=<jvm-option> Forward additional JVM options directly to the spawned runtime process No extra JVM options are added beyond the launcher's built-in forwarded properties No
-h --help Print launcher help and exit false No
-V --version Print launcher version and exit false No

Unmatched arguments are still forwarded to Spring Boot unchanged, including standard -D... JVM properties, Spring --... arguments such as --spring.profiles.active=prod, and arguments placed after --.

@sonarqubecloud
Copy link
Copy Markdown

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