[PR #25876] fix: development containers init race conditions #18379

Open
opened 2026-02-05 16:37:20 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/25876
Author: @midzelis
Created: 2/4/2026
Status: 🔄 Open

Base: mainHead: push-olwpzvrxnomt


📝 Commits (1)

  • a6cffcc fix: development containers init race conditions

📊 Changes

7 files changed (+134 additions, -24 deletions)

View changed files

📝 cli/package.json (+1 -1)
📝 docker/docker-compose.dev.yml (+55 -3)
📝 e2e/docker-compose.dev.yml (+61 -3)
📝 e2e/package.json (+3 -3)
📝 pnpm-lock.yaml (+5 -5)
📝 server/Dockerfile.dev (+8 -8)
📝 web/package.json (+1 -1)

📄 Description

pnpm fetch was useless in the development containers - it wasn't even populating the correct location

but, pnpm advises that stores should not be shared across multiple containers due to file consistency issues. technically, it would probably be ok as long as only a single pnpm process was active - but with multiple containers that was not true.

instead, share the tarball cache (pnpm-cache) so that downloads can be shared pnpm-store will be unique/isolated per container.

to give a change for pnpm hardlinks to work, the store should be a volume too to match the node_modules all being volumes.

however, the node_modules are volumes that are shared between the containers, which also had race conditions when both containers were starting up linking/copying packages from the store to node_modules. instead of using isolated node_modules between containers (which would use up a lot more space) - this can be solved by ensuring that all the package installs are performed before either container starts in a single container (preventing races)

so, a tiny init-container is added that just runs pnpm install - the server/web containers depend on it. if the node_modules are already there, it exits quickly.

see also #25398


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/25876 **Author:** [@midzelis](https://github.com/midzelis) **Created:** 2/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `push-olwpzvrxnomt` --- ### 📝 Commits (1) - [`a6cffcc`](https://github.com/immich-app/immich/commit/a6cffcc3889a87fba8737e5ba610462c54f17d9a) fix: development containers init race conditions ### 📊 Changes **7 files changed** (+134 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `cli/package.json` (+1 -1) 📝 `docker/docker-compose.dev.yml` (+55 -3) 📝 `e2e/docker-compose.dev.yml` (+61 -3) 📝 `e2e/package.json` (+3 -3) 📝 `pnpm-lock.yaml` (+5 -5) 📝 `server/Dockerfile.dev` (+8 -8) 📝 `web/package.json` (+1 -1) </details> ### 📄 Description pnpm fetch was useless in the development containers - it wasn't even populating the correct location but, pnpm advises that stores should not be shared across multiple containers due to file consistency issues. technically, it would probably be ok as long as only a single pnpm process was active - but with multiple containers that was not true. instead, share the tarball cache (pnpm-cache) so that downloads can be shared pnpm-store will be unique/isolated per container. to give a change for pnpm hardlinks to work, the store should be a volume too to match the node_modules all being volumes. however, the node_modules are volumes that are **shared** between the containers, which also had race conditions when both containers were starting up linking/copying packages from the store to node_modules. instead of using isolated node_modules between containers (which would use up a lot more space) - this can be solved by ensuring that all the package installs are performed before either container starts in a single container (preventing races) so, a tiny init-container is added that just runs `pnpm install` - the server/web containers depend on it. if the node_modules are already there, it exits quickly. see also #25398 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 16:37:20 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#18379