Skip to content

Restore /app default for start directory#621

Merged
phinze merged 1 commit intomainfrom
phinze/restore-app-default-start-directory
Feb 18, 2026
Merged

Restore /app default for start directory#621
phinze merged 1 commit intomainfrom
phinze/restore-app-default-start-directory

Conversation

@phinze
Copy link
Contributor

@phinze phinze commented Feb 18, 2026

The WORKDIR fix (f24f27d) did the right thing for new deploys — detect the image's WORKDIR at build time and store it in the config. But it also removed the runtime /app fallback from the deployment launcher, exec proxy, and build server. That's a problem for every existing app version that was built before the fix: they have no start_directory in their config at all, so they end up booting with CWD=/ instead of /app and immediately crash.

This restores the /app default in all three places. The build server defaults new builds to /app when no WORKDIR is detected, and the launcher and exec proxy fall back to /app when the stored config is empty. The sandbox controller's conditional WithProcessCwd is left as-is since it's the correct behavior.

The launcher and exec proxy defaults are backward-compat scaffolding — once we run a boot migration to backfill start_directory on existing configs, those can be cleaned up.

Fixes MIR-727

@phinze phinze requested a review from a team as a code owner February 18, 2026 17:48
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Documentation for the start_directory schema was changed to state the default is "/app". Code in the deployment launcher, build service, and exec proxy now sets StartDirectory to "/app" when the configuration provides an empty value. A unit test was renamed and its assertion updated to expect the "/app" default. No exported signatures were modified.


Comment @coderabbitai help to get the list of available commands and usage tips.

The WORKDIR fix (f24f27d) removed the runtime /app default for
StartDirectory from the deployment launcher, exec proxy, and build
server. That works great for freshly deployed apps, but existing app
versions built before that change have no start_directory stored in
their config. Without the runtime default to fall back on, those
apps boot with CWD=/ and immediately crash.

Restore the /app default in all three places so existing apps keep
working. The sandbox controller's conditional WithProcessCwd is left
alone — it's correct behavior. A follow-up boot migration can
backfill start_directory on existing configs, after which the
launcher and exec proxy defaults become removable.
@phinze phinze force-pushed the phinze/restore-app-default-start-directory branch from dfbae3d to a87c05f Compare February 18, 2026 17:55
@phinze
Copy link
Contributor Author

phinze commented Feb 18, 2026

Merging this right away to get this fix out there.

@phinze phinze merged commit 28e841e into main Feb 18, 2026
9 of 10 checks passed
@phinze phinze deleted the phinze/restore-app-default-start-directory branch February 18, 2026 17:59
phinze added a commit that referenced this pull request Feb 18, 2026
The previous PR (#621) restored /app defaults in the launcher and
build server, but those only take effect when creating new pool
specs. Existing pools persisted in etcd still have no directory
field in their sandbox spec, so the sandbox controller skips
WithProcessCwd entirely and the container boots with CWD=/.

Add the /app default here in the sandbox controller as a safety net.
When co.Directory is populated (new pools, WORKDIR apps), it's used
as-is. When it's empty (pre-fix pools), we fall back to /app.
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.

1 participant