Repository navigation
feat: OHE-3654: optional OH_PERSISTENCE_DIR to keep Compose data across down - #898
Merged
Merged
Conversation
…ss down Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
tofarr
marked this pull request as ready for review
October 20, 2026 14:31
jlav
requested changes
Oct 20, 2026
Member
There was a problem hiding this comment.
Can you not just use a named volume? That solves for persisting data after docker compose down, with forced removal after docker compose down -v
For example:
automation-server:
volumes:
- automation-data:/data
Persistence should be opt-in rather than a change to that default.
I don't think that's the right call here. Persistence should be the default, and we have a familiar native way to accomplish that in docker compose which provides persistence and easy cleanup when persistence isn't desired.
Co-authored-by: openhands <openhands@all-hands.dev>
…nHands/enterprise into feat/compose-persistence-dir
jlav
approved these changes
Oct 21, 2026
Comment on lines
+257
to
+258
| chown 42420:999 /data | ||
| exec setpriv --reuid 42420 --regid 999 --clear-groups sh -c 'alembic upgrade head && exec uvicorn openhands.automation.app:app --host 0.0.0.0 --port 8000' |
Member
There was a problem hiding this comment.
We can make a follow up fix to the automation docker image so that this permission manipulation isn't necessary, but not blocking this PR over it.
jlav
enabled auto-merge (squash)
October 21, 2026 17:37
# Conflicts: # docker-compose.yml
1 of 6 tasks
Contributor
|
🚀 Released in 1.76.0. |
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.
HUMAN:
AGENT:
Why
After
docker compose downandup, the Compose stack loses all users, settings and conversations, because the database, app file store and automation files were deliberately left unmounted (OHE-3376). Persistence should be the default, and named volumes are the native Compose way to get it: data survivesdownand is removed only bydown -v.This turns on named volumes
db-data,app-filestoreandautomation-data, replacing the automation service'stmpfs. The automation image has no/datadirectory, so a new volume is root-owned and its service user (uid 42420) cannot write to it. The service therefore starts as root, runschownon/data, and then drops to uid 42420 withsetprivbefore runningalembicanduvicorn.Summary
docker-compose.yml.tmpfswith a volume, chowned to the service user at startup.README.md: data persists,docker compose down -vresets it, and changingDB_USER/DB_PASSafter the first start needs a reset.Issue Number
None. Tracked in Linear as OHE-3654.
How to Test
docker compose up -d db automation-server, write a row to Postgres and a file to/datain the automation container, thendocker compose downandup -dagain: both are still there.docker compose down -vremoves all three volumes.I ran both with only
dbandautomation-server; the full stack, including theappmount at/.openhands, was not run and was checked only throughdocker compose config. I did not confirm thatuvicornruns as uid 42420, because the image has nops; the service did report healthy.Video/Screenshots
N/A (compose configuration change).
Type
Notes
Behaviour change: a stack that was previously wiped by
docker compose downnow keeps its data untildown -v. Existing users upgrading from an older checkout keep the anonymous volumes Postgres created earlier, but those are not reused.This PR was drafted by an AI agent on behalf of the user.
Enterprise server image for this PR: