Commit Graph

71 Commits

Author SHA1 Message Date
Georges-Antoine Assi
e232a52656 fix(docker): boot when the container runs as a non-default UID (#5189)
* fix(docker): boot when the container runs as a non-default UID

Unraid runs the container as 99:100, which can't write to the image's
/romm (owned by 1000, mode 755), only to the mounted subfolders. The
PSP pending dir at /romm/cache/retroarch_sync was created at import
time, so every gunicorn worker failed to boot.

- Buffer pending PSP save files under the user's assets folder
  (assets/users/<user>/retroarch/psp_pending/), beside the other
  RetroArch Cloud Sync files and outside the client-reachable blob
  categories.
- Move the zip and rom-converto download caches to /tmp/romm/cache,
  and point nginx's internal /cache/ alias there.
- Put gunicorn's control socket in /tmp/gunicorn instead of
  $HOME/.gunicorn, since HOME is / for that UID.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(docker): honor ROMM_TMP_PATH for caches, explain an unwritable sync folder

- The download caches live under $ROMM_TMP_PATH/cache when it's set,
  so installs with a small Docker disk (Unraid's docker.img) can point
  them at a share. The entrypoint exports the same path for nginx's
  /cache/ alias.
- With ENABLE_SYNC_FOLDER_WATCHER on and /romm/sync not writable, /init
  warns and skips the watcher instead of dying on mkdir under errexit.
- The compose example lists the /romm/sync mount the sync features need.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(sync): cover reading back and clearing buffered PSP files

Addresses Greptile's review on #5189.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(sync): apply code-review findings to PSP pending buffer

Remove the emptied psp_pending folder after a merge, define the sync
folder path once in init, update the architecture doc's PSP and blob
locations, and drop a stale .gitignore entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor(sync): apply simplify findings to PSP pending cleanup

Clear the buffered folder with remove_directory, let the startup check
own creating the sync folder, and reword the test fixture docstring.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(sync): cap buffered PSP files and drop them on delete

Buffered files for an unresolved save folder now count against the
bundle limits, so a folder can't fill the assets share and then fail
every merge once it resolves. A DELETE also removes the buffered copy,
so a deleted file isn't merged back when the folder resolves.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(docker): check the sync folder for push-pull sync too

ENABLE_SYNC_PUSH_PULL keeps SSH keys and device saves under /romm/sync
as well, so an unwritable folder now disables it with the watcher and
warns at boot instead of failing when the task runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(docker): strip whitespace from env vars like the backend does

The backend strips every variable it reads, while the init script and
nginx templates used raw values, so a padded ROMM_TMP_PATH sent nginx's
/cache/ alias somewhere the backend never writes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(config): drop the CACHE_BASE_PATH comment

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(docker): say which backend config strips env whitespace

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* revert(docker): drop the entrypoint env whitespace trimming

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(sync): apply pr-ready code-review findings

Gate push-pull on its SSH keys path rather than a writable sync folder,
accept the same truthy values as the backend, and clear only the merged
PSP pending files so another worker's buffered file survives.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* refactor: apply pr-ready simplify findings

Share one truthy pattern across init's flag checks (the watcher gates
now accept the same values as the backend), disable gunicorn's unused
control socket instead of placing it, derive the converts redirect from
its own cache path, and factor the unknown PSP folder in tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(docker): apply pr-ready humanizer pass to the sync mount note

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(fs): create handler base folders on first write, skip leftover temp files

FSHandler no longer mkdirs its base path when constructed, so a module-level
handler rooted at an unmounted or unwritable folder can't take down boot;
every write path already creates its parent folders. Blob listings skip
.romm_tmp_ files a crashed write left behind, so they are never merged into
a PSP bundle or advertised in the sync manifest. The prefix now lives in one
TEMP_FILE_PREFIX constant.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:48:50 -04:00
Georges-Antoine Assi
eb7d72a500 Merge remote-tracking branch 'origin/master' into perf/scan-workers-default
# Conflicts:
#	examples/docker-compose.example.yml
2026-09-07 14:23:47 -04:00
Georges-Antoine Assi
3767d1b5b9 cleanup 2026-09-07 14:17:56 -04:00
Georges-Antoine Assi
7365d17738 cleanup 2026-09-07 14:15:25 -04:00
Spinnich
e090574eff perf(scan): default to 4 scan workers instead of 1
Hashing 1.96 GiB of real ROM files is 2.2x faster at 4 concurrent
workers than at 1 (108 -> 240 MiB/s on 16 cores, 108 -> 264 MiB/s
pinned to 4 cores). Pinned to 2 cores it is still 1.6x, so the new
default costs nothing on small hosts.

Metadata providers cap themselves independently of this value, so the
extra workers queue rather than exceed an allowance: ScreenScraper holds
a concurrency limiter set to the account's advertised thread count, and
the other adapters pace their own request rate. Database work in the
scan path is synchronous on the event loop, so it serializes regardless
and the connection pool is unaffected.

The compose example advised one worker per CPU, which overshoots on a
large host. Both it and env.template now say what raising this actually
buys, since metadata is paced no matter how many workers there are.

Only installs that never set SCAN_WORKERS move; any explicit value is
preserved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 17:56:27 +00:00
Spinnich
003dfe2d06 docs(env): replace the WEB_SERVER_CONCURRENCY worker heuristic
"2 x CPU cores + 1" is gunicorn's guidance for sync workers. RomM runs
UvicornWorker with sync endpoints served from Starlette's threadpool, so
the rule does not transfer: on a 16-core host it measured 3x slower than
4 workers and cost 5.31 GB PSS.

The variable also only reaches the gunicorn API server; background tasks
run in the separate RQ worker processes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 16:43:43 +00:00
danblu3
6020793b11 Changed default compose, will explain more in pull 2026-08-15 17:22:40 +00:00
Cool Contributor
cc13c9efd7 chore: remove obsolete 'version' attribute
Remove the now obsolete 'version' attribute in the example docker compose file.
2026-05-28 11:50:45 +02:00
Georges-Antoine Assi
19b5a83261 Use default config values when config.yml not mount + show warning 2025-09-19 09:17:59 -04:00
Tomasz Gorochowik
8be994c887 Fix documentation link in docker-compose example
Updated documentation link for game library path.
2025-09-08 11:38:33 +02:00
Georges-Antoine Assi
a63fd574bf add sgdb to ecample 2025-07-11 21:29:32 -04:00
Georges-Antoine Assi
7bb4ad31c8 update example with recommended providers 2025-07-11 00:18:09 -04:00
zurdi
5f1d39c8f8 refactor: remove RETROACHIEVEMENTS_USERNAME from docker env variables 2025-05-13 09:31:06 +00:00
zurdi
30a0be2c4c Merge branch 'master' into HEAD 2025-04-10 22:56:55 +00:00
Georges-Antoine Assi
2b2e5a9a2b update old wiki links 2025-03-12 10:44:25 -04:00
Georges-Antoine Assi
d0ccd6a0cd Merge branch 'master' into feat/retro_achievements 2024-12-14 21:24:49 -05:00
zurdi
a51dd03e1a Added full offline support and configurable logging level and API requests debug logs 2024-11-27 17:12:13 +00:00
Michael Manganiello
7e64a02e08 misc: Add MariaDB healthcheck recommendation to Docker Compose config
This commit adds a healthcheck configuration to the MariaDB service in the
Docker Compose example configuration. The healthcheck script is a simple
shell script that checks if the MariaDB server is ready to accept connections.

The application will wait for the MariaDB service to be healthy before
starting the application service. This should solve issues where the
database takes longer to start than the application, and logs some
`Something went horribly wrong with our database` errors.

This change also stops recommending the `linuxserver/mariadb` image as
an alternative. We have had users that change the image because of the
first time run triggering those errors, but the `linuxserver/mariadb`
image requires a different configuration that could be confusing for new
users (e.g. volume mountpoint needs to be `/config` instead of
`/var/lib/mysql`).
2024-11-06 15:00:59 -03:00
Eduardo Balsa
48f198cbef Update docker-compose.example.yml
Switched to MARIADB variables as we are using the MARIADB container
2024-10-14 20:15:25 +02:00
SaraVieira
9b298d46eb use env & reuse request 2024-09-10 21:00:20 +01:00
SaraVieira
27e0c14474 revert many files since saving info on db 2024-09-04 18:15:47 +01:00
SaraVieira
11b46494a7 start work on retro achievements 2024-08-31 19:09:20 +01:00
zurdi
074b368ae9 updated docker.compose example 2024-07-08 11:49:27 +02:00
Need4Swede
0fbbfe9e9d added linuxserver/mariadb as alternative
"mariadb:latest" can cause problems when mounting the database. The use of "linuxserver/mariadb:latest" may fix this issue. Added it as an alternative option.
2024-06-09 09:47:13 -07:00
Georges-Antoine Assi
697ce338ee mark romm/config as required mount 2024-03-26 19:05:34 -04:00
Zurdi
d283214643 Merge branch 'master' into mobygames-new-api 2024-03-26 09:11:40 +01:00
Georges-Antoine Assi
369ab47736 get rid of logs volume 2024-03-25 17:30:38 -04:00
zurdi
c3d7ecd48a merge "master" into "mobygames-new-api" 2024-03-25 11:25:16 +01:00
zurdi
b2392d0acc replaced old zurdi15/romm url to rommapp/romm 2024-03-25 02:49:08 +01:00
Georges-Antoine Assi
dc5e0e6b61 Merge branch 'master' into mobygames-new-api 2024-03-14 18:34:57 -04:00
Zurdi
02182d1a2e Update docker-compose.example.yml 2024-03-12 16:00:39 +01:00
Georges-Antoine Assi
e024fc987f bind redis data volume 2024-03-12 02:07:31 +00:00
Georges-Antoine Assi
41c85b3f80 Merge branch 'master' into mobygames-new-api 2024-03-10 18:05:02 -04:00
Georges-Antoine Assi
f15d7c666a fix quotes in example docker compose 2024-03-01 10:46:50 -05:00
Georges-Antoine Assi
a36d49979e [WIP] build redis into container
expose port right
2024-03-01 10:36:02 -05:00
Georges-Antoine Assi
1c8b86c664 More cleanup of docker-compose 2024-03-01 09:59:02 -05:00
Georges-Antoine Assi
ce9deb4f3c Rebuild moby api on new code 2024-02-13 18:46:31 -05:00
Georges-Antoine Assi
269103f0ed add redis to depends_on 2024-02-08 21:01:00 -05:00
Zurdi
0d3593d878 fixed docker-compose example 2024-02-07 23:20:32 +01:00
Georges-Antoine Assi
bf48b9037f simplify example compose 2024-02-02 00:03:30 -05:00
Georges-Antoine Assi
6bcadec702 everything we need for 3.0 2024-02-01 18:13:16 -05:00
Georges-Antoine Assi
eb18388a81 Mega refactor of asset 2024-02-01 17:59:06 -05:00
Zurdi
e231d1b73e added platform versions support 2024-01-19 13:22:56 +01:00
Georges-Antoine Assi
5e6435916f Hotfix sibling roms when igdb_id is null 2024-01-02 10:42:21 -05:00
Zurdi
ade39f1890 Update docker-compose.example.yml 2024-01-02 00:21:27 +01:00
Zurdi
063bcaf2d9 Update docker-compose.example.yml 2024-01-02 00:20:44 +01:00
Georges-Antoine Assi
cf3ab43ee4 Update example docker-compose for webrcade 2024-01-01 15:06:48 -05:00
Zurdi
cb9aec36cf Update docker-compose.example.yml 2023-11-01 18:43:35 +01:00
Georges-Antoine Assi
80ffca8f77 Update env variables to include new tasks 2023-10-31 12:51:02 -04:00
Zurdi
58fa37d99a Update docker-compose.example.yml 2023-10-30 22:49:42 +01:00