0
Fork 0
mirror of https://github.com/oblien/openship.git synced 2026-11-18 06:55:56 +00:00
Commit graph

54 commits

Author SHA1 Message Date
fatih akyon
3e42fc6614
fix(routing): make static 404 responses opt-in (#1626)
* 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>
2026-11-06 10:36:34 +02:00
Hydra
2cd519e8ce fix(deploy): reconcile attached infrastructure with completed-build retries 2026-10-23 00:32:24 +03:00
Hydra
8e95307699 fix: preserve service swap guarantees across configuration writes 2026-10-22 15:52:58 +03:00
abdulrahmanhossam
95b8ef715b feat: add per-service swap disabling
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
2026-10-22 14:40:10 +03:00
Hydra
f3b21e88d5 merge: update primary app infrastructure against main 2026-10-19 04:05:08 +03:00
Hydra
0099015fff feat(deploy): skip unrelated workspace pushes safely 2026-10-18 19:39:02 +03:00
Hydra
30690bd63f feat(deploy): retain releases and roles with attached infrastructure 2026-10-18 14:17:55 +03:00
Hydra de lerne
8238314275
Merge pull request #1299 from oblien/feat/1283-runtime-role-configuration
feat(roles): configure workers without rebuilding the active app
2026-10-17 03:42:51 +03:00
Hydra de lerne
f1a9424bd6
Merge pull request #1298 from oblien/fix/1254-durable-role-handover
fix(roles): recover interrupted container handovers durably
2026-10-17 03:32:16 +03:00
Hydra de lerne
31e9fb69e9
Merge pull request #1297 from oblien/fix/935-role-preset-slots
fix(roles): resolve exclusive presets and expose source suggestions
2026-10-17 03:13:44 +03:00
Hydra
12800905ad feat(roles): apply runtime role configuration without rebuilding web 2026-10-17 02:22:31 +03:00
Hydra
d066175a89 fix(roles): recover interrupted container handovers durably 2026-10-17 01:48:28 +03:00
Hydra
e5bed59149 fix(roles): resolve exclusive presets and expose source suggestions 2026-10-17 01:13:49 +03:00
Hydra
011cea8f71 fix(monitoring): watch active runtime role replicas 2026-10-17 01:10:55 +03:00
Hydra
979e83b9ca fix(projects): expose active runtime roles and replica logs 2026-10-16 23:58:10 +03:00
Hydra
db388b56a9 fix(deployments): retry retired role cleanup through retention 2026-10-16 23:26:25 +03:00
Samer Ajlawi
186988a1e8
Merge branch 'main' into fix/GH-1253-singleton-rename-handover 2026-10-15 22:32:02 +03:00
Samer Ajlawi
4779ee1486 fix(deployments): hand over a singleton by name, singleton status and command
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
2026-10-15 14:05:21 +03:00
Samer Ajlawi
0c92bc55c1 fix(core): bound the Laravel scheduler preset's stop grace
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
2026-10-15 14:00:31 +03:00
Samer Ajlawi
7bbacb5132 docs(openship-json): correct runtime-role handover, stop and startup claims
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.
2026-10-15 11:23:53 +03:00
Hydra
ee70abfc2d Merge main and sequence runtime roles after lifecycle migration 2026-10-15 10:27:20 +03:00
Mohamed Farahat
facc68ed8a feat(deployments): document runtime roles, refuse moving them, test them on Docker
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
2026-10-14 20:25:41 +03:00
Hydra
177f10862c feat(apps): add self-hosted AI catalog templates 2026-10-14 18:45:55 +03:00
Hydra
470823739a feat(catalog): add document, dashboard and media apps 2026-10-14 15:04:14 +03:00
Hydra
1f842b5fab fix(catalog): pull official WordPress and Odoo images without builds 2026-10-14 13:05:34 +03:00
Hydra de lerne
c170303e02
Merge pull request #1190 from oblien/fix/explicit-container-resource-limits
fix(resources): keep unconfigured build and service limits uncapped
2026-10-14 04:55:56 +03:00
Hydra
d6fa269068 fix(resources): enforce only configured build and service limits 2026-10-14 04:31:15 +03:00
Hydra de lerne
402f0212a3
Merge pull request #1182 from sudanese/feature/GH-19-laravel-cache-warming
feat(core): add opt-in Laravel cache warming for the web role
2026-10-14 03:59:06 +03:00
Samer Ajlawi
9558ca99f0 docs(core): note the double-optimize and monorepo caveats for cache warming
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.
2026-10-13 23:44:50 +03:00
Samer Ajlawi
b43efb0e35 feat(core): wire opt-in Laravel cache warming into the resolved web command
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.
2026-10-13 23:31:58 +03:00
Samer Ajlawi
bb1e6d27f4 feat(core): add opt-in Laravel cache warming for the web role
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.
2026-10-13 22:53:10 +03:00
Mohamed Farahat
b05883a4a6
docs(openship-json): a same-project database makes release commands fail
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.
2026-10-13 15:33:13 +00:00
Hydra
a86a8972ae refactor(runtime): select Docker recipes by stack and validate custom bases 2026-10-13 09:31:28 +03:00
Hydra
cea6467803 refactor(runtime): expose stack-aware version configuration 2026-10-13 08:08:36 +03:00
Hydra
caf243ee27 feat(php): select matching build and FrankenPHP versions 2026-10-13 07:27:36 +03:00
Hydra
41c7718cbb feat(web): add catalog-driven public app pages 2026-10-12 23:58:50 +03:00
Hydra
e3a884478b Merge main and preserve managed-server deployment checks 2026-10-03 21:13:12 +03:00
Hydra
2ff842c61a fix(deployments): preserve root manifests for subfolder refreshes 2026-10-03 18:23:13 +03:00
Hydra
af42c5a25e fix(deploy): default to full capacity and show destination settings 2026-10-02 12:36:02 +03:00
Hydra
a368848a01 fix(cloud): size builds from provider headroom and verify runtime resizes 2026-09-30 19:06:20 +03:00
Hydra
004010f14d fix(apps): guide capacity and recover failed Cloud installs 2026-09-30 02:51:43 +03:00
hydralerne
d8dce3d718 fix(cloud): fit Supabase allocations and recover failed installs 2026-09-30 02:17:30 +03:00
Hydra
df78521fd9 update apps catalog rules 2026-09-28 22:54:16 +03:00
Hydra
3df0f5c50b fix(deployments): harden release commands and share configuration paths 2026-09-26 09:49:24 +03:00
Mohamed Farahat
47b2eea84d
feat(deployments): add a release phase: commands run once per deploy before cutover
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.
2026-09-24 17:40:28 +00:00
Hydra
7841d47210 fix(monorepo): reject empty creation and report unmatched overrides (#873) 2026-09-15 23:58:22 +03:00
Hydra
e75eedbcc0 fix docs 2026-09-14 03:47:37 +03:00
AbdullahM07
1e2dff371f fix(deployments): explain service DNS failures during Docker builds 2026-09-06 12:06:41 +03:00
Hydra
51e433c56f finish v0.7.1 2026-09-04 12:35:14 +03:00
Hydra
698893ecae patch 0.6.2 2026-08-10 16:27:29 +03:00