Repository navigation
feat(omnibus): add the migration from the multi-container Compose stack - #3179
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The migration changes the search provider from Meilisearch to PostgreSQL when bundled Meilisearch is disabled, which can change search results or their order. Please add before-and-after captures of the same search query and screen, identifying the surface and build or commit; the Evidence section currently provides none. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b5b23290a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0b5b232 to
cffd9ad
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cffd9ad48a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b16027f7-60b7-4ee4-b3c4-9a04a5551b66
Files selected for processing: 3-
omnibus/rootfs/etc/s6-overlay/scripts/init-adduseromnibus/rootfs/etc/s6-overlay/scripts/init-postgresomnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a9a4cbec-e8ff-45f8-b90a-e7d74d4cf769
Files selected for processing: 3-
omnibus/rootfs/etc/s6-overlay/scripts/init-adduseromnibus/rootfs/etc/s6-overlay/scripts/init-postgresomnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
Files skipped from review as they are similar to previous changes: 2-
- omnibus/rootfs/etc/s6-overlay/scripts/init-adduser
- omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bdc141e5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f5bebe8a-ab02-4f1c-8948-21e41189b292
Files selected for processing: 1-
omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
c9192b9 to
02230be
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
migrate-compose-stack copies an install of the earlier docker-compose.yml, which ran PostgreSQL, Redis, and Meilisearch beside a root-run Silo, into the omnibus layout under SILO_DATA_ROOT/config. It ships in the image ahead of the Compose file that runs it, so the default file can switch only once a published image carries it. The PostgreSQL cluster is copied and Silo's plugins, artwork, and compat directories are hard-linked, all under staging names moved into place at the end, with the source cluster's identifier and checkpoint recorded last. The old directories are never changed, so the earlier Compose file still starts on them. A temporary server on a private socket creates the silo superuser, renames POSTGRES_DB to silo, resets search to PostgreSQL when it pointed at the old Meilisearch service and the bundled one stays off, and refuses a server with enabled nodes unless node access is on. Files in the copy are replaced as postgres, never written through. Before changing anything it refuses a running or uncleanly stopped cluster, another major version, WAL or tablespaces outside the data directory, too little space for the copy and its index rebuild, an earlier install's files without a cluster, an .env from the earlier stack with none of its data at the default paths, DATABASE_URL or REDIS_URL naming the old services, a pinned SILO_IMAGE without SILO_OMNIBUS_IMAGE, and an old cluster used again since its copy. init-adduser warns when PUID cannot read the media root, since the old image ran Silo as root. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vice An .env following the earlier .env.example can set SILO_SEARCH_PROVIDER and SILO_MEILISEARCH_URL=http://meilisearch:7700. Silo applies those on every start, over the stored provider the migration resets, and the image keeps an explicit URL even with its own Meilisearch on, so search would target the removed container. The migration now refuses such a URL and says which settings to remove. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A kill between writing the done marker and removing the pending record left both behind, and the next run set the promoted cluster and Silo directories aside before exiting on the done marker, so Silo started on an empty database. With the done marker present, recovery now only removes the pending record. The done marker is written to a temporary file and renamed into place. cp does not flush and PostgreSQL does not sync a cleanly stopped cluster it starts on, so the migration syncs the file system after staging and writing the pending record, after the moves, and after the done marker. Also refuse a Silo directory in SILO_DATA_ROOT that is a symbolic link or not a directory, which was skipped silently; check free space before copying a directory that cannot be hard-linked, keeping the room the database's first start needs; refuse SILO_SEARCH_PROVIDER=meilisearch without a URL when the bundled Meilisearch is off; set aside a data directory an unfinished initdb left; and list set-aside copies at the end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Updating with `docker compose up -d --no-deps silo` skips the postgres service that moves the multi-container stack's data. init-postgres then created an empty cluster, Silo came up with no data, and the next full `docker compose up -d` saw an omnibus database and exited without moving the earlier install, leaving it orphaned. migrate-compose-stack now refuses when an omnibus cluster exists, no migration finished, and the earlier stack's cluster or Silo directories are present, and says how to recover either way. It also leaves a root-owned /config/.compose-migration-checked on every successful path. With REQUIRE_COMPOSE_MIGRATION set, init-postgres refuses to create a cluster until that marker exists and tells the operator to run `docker compose up -d` once without --no-deps. Without the variable, nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres now refuses to start while migrate-compose-stack's pending record is present: a cluster found then may be half of an interrupted move that the next run sets aside, which would leave Silo's writes behind. control_fingerprint runs pg_controldata in the C locale and fails with its error instead of printing nothing, so an unreadable cluster never compares equal or reports a misleading concurrent-use error. init-adduser warns when find cannot reach the media root at all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
init-postgres exits early when the bundled PostgreSQL is off, but the migration also moves Silo's directories when DATABASE_URL names another database. Check the pending record before that exit so Silo never writes to directories the next run would set aside. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…silo An earlier stack run with POSTGRES_DB=postgres kept Silo's data in the postgres database, and renaming it to silo left the cluster without one. init-postgres-db connects there, so the first start failed. Create the empty postgres database initdb makes after the rename. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A copied cluster's template1 records the earlier glibc collation version until init-postgres-db refreshes it, and PostgreSQL refuses to copy a template with a mismatched version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
02230be to
ed58b54
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed58b547ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [[ "${provider,,}" == meilisearch && "$(url_host "$meili_url")" == meilisearch ]] && ! truthy "${ENABLE_MEILISEARCH:-false}"; then | ||
| stage_psql -d silo -c "UPDATE server_settings SET value = 'postgres' WHERE key = 'catalog.search.provider'" | ||
| log "search used the earlier stack's Meilisearch and now uses PostgreSQL. Set ENABLE_MEILISEARCH=true in .env to use the bundled Meilisearch; Silo builds a new index" | ||
| fi |
There was a problem hiding this comment.
Require Redis when retaining an external Meilisearch provider
For an installation that selected an external Meilisearch server through the admin UI, with no search environment overrides, this condition preserves the Meilisearch provider but migration silently drops its Redis dependency. The earlier docker-compose.yml always supplied Redis, whereas init-config enables it only through environment settings such as ENABLE_REDIS, ENABLE_MEILISEARCH, or SILO_SEARCH_PROVIDER; it does not inspect the stored provider. With those settings unset, the migrated installation therefore cannot serve cursor-paged search: searchSessionStore.put in internal/catalog/search_session.go returns ErrSearchContinuationUnavailable without a Redis client. When retaining this provider, refuse migration with instructions to set ENABLE_REDIS=true or provide an external REDIS_URL, rather than reporting success with broken search.
Useful? React with 👍 / 👎.
| # under SILO_DATA_ROOT/config. docker-compose.yml runs this as its postgres | ||
| # service before Silo starts, with SILO_DATA_ROOT mounted at /silo-data. |
There was a problem hiding this comment.
Unintended database initialization occurs when switching an existing installation to docker-compose.omnibus.yml because neither shipped Compose deployment invokes the migration entry point: docker-compose.yml still starts pgvector and the regular Silo image, while docker-compose.omnibus.yml starts only Silo with /config mounted, creating a new database beside the old data instead of migrating it. Wire this script into a prerequisite service with SILO_DATA_ROOT mounted at /silo-data, and gate Silo startup on its successful completion.
Prompt for LLM
File omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack:
Line 4 to 5:
Unintended database initialization occurs when switching an existing installation to docker-compose.omnibus.yml because neither shipped Compose deployment invokes the migration entry point: docker-compose.yml still starts pgvector and the regular Silo image, while docker-compose.omnibus.yml starts only Silo with /config mounted, creating a new database beside the old data instead of migrating it. Wire this script into a prerequisite service with SILO_DATA_ROOT mounted at /silo-data, and gate Silo startup on its successful completion.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| s6-setuidgid postgres pg_ctl -D "$pg_stage" -s -w -t 600 -l "$pglog" \ | ||
| -o "-c listen_addresses='' -c unix_socket_directories='$sock' -c shared_buffers=128MB -c archive_mode=off" start |
There was a problem hiding this comment.
Credential exposure occurs because pg_ctl launches the temporary PostgreSQL server with the migration process's full environment, without the filtering used by svc-postgres, allowing a database superuser executing programs during migration to read SECRET_KEY and unrelated deployment credentials. Launch pg_ctl and its server with an explicitly allowlisted environment.
Prompt for LLM
File omnibus/rootfs/etc/silo-omnibus/migrate-compose-stack:
Line 276 to 277:
Credential exposure occurs because pg_ctl launches the temporary PostgreSQL server with the migration process's full environment, without the filtering used by svc-postgres, allowing a database superuser executing programs during migration to read SECRET_KEY and unrelated deployment credentials. Launch pg_ctl and its server with an explicitly allowlisted environment.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Problem
Related issue: N/A
Validation tasks: none
Every existing Docker install runs the multi-container Compose stack: PostgreSQL in
pgvector/pgvector:pg18, Redis, optional Meilisearch, and a root-run Silo, with data inSILO_DATA_ROOT/{postgres,redis,meilisearch,plugins,artwork,compat}. Moving one to the omnibus image means copying its database into/config/postgres, renaming its superuser and database, linking Silo's files into/config/silo, and not losing anything if it goes wrong. Done by hand, that is a long list of steps most users should not have to follow.This PR adds the migration as a script in the image, used by nothing yet. The next PR switches
docker-compose.ymlto run it. Shipping the script first means the default Compose file can switch only once a publishedaiocarries it.Fourth in the stack: #3118, the artwork identity fix, node support, this, the default Compose switch.
Approach
/etc/silo-omnibus/migrate-compose-stackruns withSILO_DATA_ROOTmounted at/silo-data:config/postgres/data. A temporary server on a private socket creates thesilosuperuser ifPOSTGRES_USERnamed another, renamesPOSTGRES_DBtosilo, resets a search provider the admin UI pointed at the old Meilisearch service unless the bundled one is on, and refuses a server with enabled nodes unless node access is on. Silo's directories are hard-linked intoconfig/silo, also whenDATABASE_URLpoints at an external database./config, and any later use of the old cluster refuses the copy./config/.compose-migration-checked. WithREQUIRE_COMPOSE_MIGRATIONset, which the next PR's Compose file sets,init-postgrescreates no cluster until that marker exists, sodocker compose up -d --no-deps siloon the first update stops with an explanation instead of starting an empty server. A cluster created before the migration ran beside an earlier install is refused rather than silently kept. While the pending record exists,init-postgresrefuses to start at all, so Silo never writes to a half-moved cluster the next run would set aside. Cluster fingerprints are read withpg_controldatain the C locale, and an unreadable cluster stops the script instead of comparing as empty.SILO_IMAGEwithoutSILO_OMNIBUS_IMAGE;DATABASE_URLorREDIS_URLnaming the old services; an.envfrom the old stack with none of its data at the default paths (named volumes, edited paths); a running or uncleanly stopped cluster, another major version, external WAL or tablespaces, a linkedPG_VERSION; too little space for the copy and for rebuilding its largest text index; a Silo directory that is a symlink or not a directory; a directory on another file system that won't fit beside that room;SILO_SEARCH_PROVIDER=meilisearchwithout a URL while the bundled Meilisearch is off.postgres, never written through, since a cluster from another container can hold links.init-adduseralso warns whenPUIDcannot read the media root, since the old image ran Silo as root.Validation
On amd64, with images built from this stack and the current Compose stack as the starting point, one install walked through every rule: pinned image, localhost
DATABASE_URL, and an enabled node each refused before anything moved (the node refusal discarded its partial copy); back on the old stack and changed; then migrated, with the newer database and artwork, the stale directory from the failed attempt set aside, search reset to PostgreSQL, the artwork identity row unchanged, and Silo healthy; a second run silent; old stack used again, then refused. Separately: an interrupted promotion was set aside and redone, an external-database install moved only Silo's directories, an emptyconfigwith an old-stack.envwas refused, and a new install with node access was accepted.make verify-shellcheck: pass.After review, on arm64 against a cleanly stopped
pgvector/pgvector:pg18cluster: both markers present after a finished migration kept the data and the next run was silent; a symlinked artwork directory, an artwork file, and a paddedSILO_SEARCH_PROVIDER=" MeiliSearch "were refused; artwork on a separate volume was copied, and refused when it would not fit. End to end through the next PR's Compose file, from an install of the current Compose stack with an admin account:up -d --no-deps silowas refused and created no cluster, thenup -dmigrated and the admin signed in; an omnibus cluster created before the migration was refused, then migrated after it was moved aside; a new install started, and a later--no-depsrecreate started too. The fingerprint read was also checked against stubbedpg_controldataoutput: readable, permission denied, and missing fields. Not tested: a real power loss.Evidence
No user-visible change. Test runs and results:
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3179/
Risks
Checklist
AI Disclosure
configdefeating the empty-install refusal, a linkedPG_VERSION, index-size headroom, false refusals on installs with nothing to migrate, and external-database installs skipping Silo's directories. All are fixed above.Note
Add migration path from multi-container Compose stack to the omnibus image
DATABASE_URLandREDIS_URL.ENABLE_NODE_ACCESSnow requiresPOSTGRES_PASSWORD, and with bundled Redis requires a URL-safeREDIS_PASSWORDused for SCRAM authentication; svc-redis and init-postgres then bind to all interfaces..compose-migration-pendingexists, and refuses to create an empty cluster whenREQUIRE_COMPOSE_MIGRATIONis set without the checked marker — run Compose without--no-depson first start. Without thepostgres.networkmarker, the silo role password is cleared and network listeners are removed.Macroscope summarized 02230be.