App manifest: add explicit autostart flag#350
Open
woltspace-jerpint[bot] wants to merge 1 commit into
Open
Conversation
Adds an opt-in `autostart` boolean to the woltspace.json manifest. Apps flagged autostart=true are launched on container boot via a new apps_autostart() called in FastAPI lifespan, after apps_restore(). start_app() is already idempotent (returns existing state if the PID is alive), so apps revived by apps_restore are a no-op here. Closes #349.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autostart: bool(defaultfalse) to thewoltspace.jsonschema incontainer/lib/apps.py.apps_autostart()function: iteratesdiscover_apps(), filters toautostart=true, callsstart_app(name)for each.apps_restore().start_appis already idempotent (returns existing state if PID is alive), so apps already revived byapps_restoreare a no-op.Closes #349.
Why
Today, boot-time intent is implicit —
apps_restore()infers "user wants this on" from the presence of a runtime state file in.space/apps/. That's clever but the source of truth lives in the wrong place. Reading the manifest should tell you whether an app comes up on boot.Two wolts (Loup, lolo's lab) have been working around this by writing
wolf.jsonscript crons to keep their services up (see #347). Wolf is for scheduled wolt sessions, not service supervision — "keep my app on" belongs in the app manifest.Migration
autostart: false— no behavior change for existing manifests.apps_restore(preserved)."autostart": trueto theirwoltspace.jsonand drop any wolf-cron workarounds.Test plan
test/test_woltspace_apps.py:autostart=Falseon the schemaautostart: falsedoes nothingautostart: truestarts the appstartcommandtest_telegram_loop,test_wolt_sites)autostart: trueon an app, confirm it comes up afterwoltspace stop && woltspace startOut of scope (follow-ups)
create_timehardening to eliminate PID-reuse false positivesautostartper app