* fix(edge): serve a static site's 404.html for missing paths
* fix(routing): make static SPA fallback explicit and preserve defaults
* test(routing): update static fallback checks and run HTTP coverage
* fix(i18n): complete inbound alias guidance across locales
* test(monitoring): isolate the session in stream fixtures
---------
Co-authored-by: Hydra <abdelhamedmo59@gmail.com>
Add an opt-in swapDisabled service resource that runs Docker containers with MemorySwap pinned to Memory. Validate the required effective memory limit at config and service write time, refuse hosts without swap accounting, preserve the setting across compose sync and migration, and expose it in the topology UI, JSON schema, and docs.
Refs #1168
Singleton handover matched previous containers by role name. A
scheduler renamed from scheduler to cron, or a singleton that became a
scalable worker, started its replacement beside the old container. The
old one was removed only at commit, after the web container was live,
so both ran and a scheduled task could fire twice.
The rollout now plans the handover from both deployments' frozen role
definitions. A new role continues a previous one only when the name,
the singleton flag and the command all match. The command is the only
part of a role that says what it runs. A name alone is not enough:
two singletons can swap names, and a worker name can take over a
scheduler's command. Every other new role is changed.
A previous singleton that no new role continues is outgoing. When
some role changed, it is stopped and retained after the unchanged
workers pass their startup check, and before any changed role starts.
With no changed role, this comparison identifies no replacement, so
outgoing singletons remain running until commit. On failure, an outgoing singleton is restored only after
every changed role is confirmed removed. An unchanged worker that
cannot be removed does not block the restore.
runtimeRoleRolloutDeps now passes the previous roles to the rollout.
Without previous definitions, only same-name handover applies, as
before. The openship.json reference describes the handover rules.
Refs #1253
The Laravel scheduler preset used the same 90s stop grace as the
workers. The inspected Laravel 12.x versions lack coordinated
`schedule:work` shutdown. With PHP as container PID 1 and no
termination handler, SIGTERM does not stop scheduling, and work can
continue until Docker force-kills the container. A 90s grace made a
scheduler handover wait that long.
The scheduler preset now sets stopSignal SIGTERM and a 10s grace. The
grace favors shorter shutdown and handover latency over task
completion. A foreground scheduled command with more than 10 seconds
left can be killed on either version. Laravel 13.18.0 with signal
handling available stops new runs on INT, TERM or QUIT and waits for
existing ones, but detached background tasks may not complete.
Applications that need completion should use a verified draining
version and size the grace for the whole remaining run.
This changes registered preset metadata. Deployed roles currently come
from explicit configuration, so the openship.json reference example
gets the same signal and grace, with a note on sizing.
The queue and horizon presets keep 90s, which exceeds the default 60s
queue and Horizon supervisor timeouts. The parser round-trip test now
covers the scheduler's signal and grace.
Refs #935
Presets add no roles until detection is wired, so the cache-warming section no longer says a roles array replaces them. The singleton section now describes the same-name handover and the failed-deploy unwind, and what an interrupted handover can leave, instead of promising two schedulers never run at once. The stopSignal and stopGracePeriod defaults name the image and daemon values that actually apply. The startup check notes it runs only during a deploy, and the exec callout separates signal delivery from process shutdown.
A project that declares roles is refused for a server move or copy
before any run exists, because the migration pipeline does not carry
role containers across hosts. The refusal sits after the control plane
and not-server-hosted checks and applies to every intent.
openship.json reference gains a Runtime roles section: fields and
validation rules, where roles run, what a role container gets, deploy
order, the startup check, signals and lifecycle.
A real-Docker end-to-end test drives the rollout through first deploy,
worker overlap, stop-first scheduler handover, a crashing worker, a
crashing scheduler and removing every role.
Refs #935
Clarify two edges of the opt-in Laravel cache-warming flag in the
openship.json reference.
optimize: true always prepends php artisan optimize &&, so repeating it in a
custom startCommand runs it twice (harmless, wasteful).
Neither the optimize prefix nor a manual startCommand override reaches a
Laravel sub-app selected inside a JavaScript-workspace monorepo, where the web
command is re-derived from the bare preset. This is pre-existing behavior, not
specific to optimize. Standalone Laravel repos are unaffected.
The optimize flag was parsed and documented but read by nobody, so it was a
no-op. Thread it from the parsed openship.json config through DeploymentMetadata
into the stack detector, and apply resolveWebCommand once on the final web
command after the stack classification settles.
The prefix lands only when the resolved stack is laravel and optimize is true,
so every project that does not opt in keeps a byte-identical web command. The
shared stack presets, defaultStartCommand, defaultRoles, buildCommand, and
releaseCommands defaults are unchanged.
Add an integration test that drives the real detectStack path end to end: a
laravel project with optimize true gains the php artisan optimize prefix and
still ends in the exec frankenphp invocation, while optimize false or absent
yields the byte-identical preset. Note the && short-circuit trade-off in the
openship.json reference: a failing optimize stops the web role from booting.
Add an opt-in `optimize` flag (default false) to OpenshipConfig. When true,
the resolved Laravel web command gains a `php artisan optimize && ` prefix to
warm config/route/event/view caches. The flag applies to the Laravel web role
only. Workers and schedulers stay unwarmed.
The prepend lives in a new pure resolver, `resolveWebCommand`, in stack-roles.
The shared stack presets in stacks.ts are unchanged, so a project that does not
set the flag keeps a byte-identical web command. No change to defaultStartCommand,
defaultRoles, buildCommand, or releaseCommands defaults.
Document the available-today startCommand override, the worker roles
re-declaration path, and the env()/config:cache startup-only gotcha in the
openship.json reference and the openship-config skill reference.
The "Runtime support" note said an app "may use attached or connected
database services without changing its single-app deployment mode". That
holds for a database deployed as its own app and connected to the
project, but not for one added as a service inside the same project:
shouldUseProjectServicePipeline sends any enabled compose or monorepo row
down the services pipeline, and release commands are refused there
before any build. A live test on v0.9.0 reproduced exactly that (#935),
while the separately connected database kept working.
The note now says which path keeps the app single-app, what adding a
service to the same project does to a deploy with release commands, and
how to run migrations against a database instead.
An app project declares exactly one command (the start command), so
framework release steps had nowhere to run: php artisan migrate --force,
rails db:prepare, manage.py migrate never executed, and a stock Laravel
app's schema had to be bootstrapped by hand through the service terminal
(TODO.md "A generic release phase", adjacent to #231).
Projects (and openship.json) can now declare releaseCommands: string[].
They are frozen onto the deployment's config snapshot (a redeploy that
rebuilds an older deployment runs the commands THAT release declared, not
today's project row) and run in the pipeline after a successful build and
before any cutover: before runDeployPipeline and before domain records,
while the previous version is still running and routed. Each command gets
its own log marker; a non-zero exit or a 10-minute per-command timeout
fails the deploy with the command's output, leaving the old version
serving. An absent field deploys byte-identically to before.
Execution per runtime: docker runs each command in a throwaway container
off the freshly built image (not an exec into the running, old-image
deployment), with scoped volume binds and the project network but no
published port and no restart policy, removed on every path. Bare runs it
in the staged artifact dir through the same login-shell wrap the build
uses. Compose, cloud and static deploys log a clear warn-and-skip naming
the commands rather than silently dropping them.
The env is the app's by construction, not a copy of it: deploy and the
release command on each runtime now take it from one function
(deploymentContainerEnv on docker, bareProcessEnv on bare). So a
project-set PATH is dropped from the release container exactly as it is
from the app (the openship#623 guard in runtime-env.ts), a portless
worker gets no PORT, and each drop is logged by the release phase too,
since it runs, and can fail, before deploy gets to say it. On bare the
release command also gets the start command's node_modules/.bin prelude,
so a dependency binary like prisma resolves there as next does.
A rollback does NOT replay them. pinnedAppImage(snapshot) is the exact
discriminator: only a rollback restore pins an already-built image, since
a plain redeploy strips pinned artifacts and rebuilds. Replaying is a
no-op in the good case, because the schema is already ahead of the
release coming back, and harmful in the bad one, because rollback is the
emergency path and a phase that fails the deploy is a new way for the
recovery itself to abort. This travels as a distinct deliberateSkipReason
rather than the existing unsupportedReason, which tells the operator to
run the commands by hand: the opposite of what a rollback wants.
Schema: nullable project.release_commands jsonb (no default, no
backfill), migration 0145 following the volumes pattern; parse/schema
support in openship.json with the published JSON Schema and docs. The
examples are limited to what outlives the release container: on docker it
is discarded, so only the database and mounted volumes keep its effects.
Laravel's is migrate --force, Rails' is db:prepare (it also bootstraps an
empty database), Django's is migrate; the docs say that cache warms,
storage:link and collectstatic belong in the start command or the build,
and that a SQLite file outside a persisted path would be migrated and
discarded. They also state that attaching any service routes a project
onto the services/compose pipeline, where the phase is logged and
skipped. Dashboard UI intentionally deferred.
Tests at every seam: openship-config parsing, snapshot carry in
build.service, phase ordering/failure wiring in the pipeline,
runtime-level non-zero-exit/timeout/output-capture for docker and bare,
the deliberate skip (runs nothing, stays silent with no commands
declared, and omits the run-them-by-hand advice) and the wiring that
derives it from the pinned app image, and env parity on both runtimes
(PATH dropped and logged, no PORT for a portless deploy, the bare bin
prelude). Each was verified to fail with its behavior reverted.