getumbrel / umbrel-apps

The official app repository of the Umbrel App Store. Submit apps and updates here. Learn how → https://github.com/getumbrel/umbrel-apps#readme
https://apps.umbrel.com
480 stars 357 forks source link

immich v106< request #1158

Open lmgithu opened 2 weeks ago

lmgithu commented 2 weeks ago

Dear team,

Would it be possible to bump Immich to the latest version (or at least v1.106)? The currently available mobile versions (both ios and android) made the immich on umbrel incompatible, it is not working with v1.105.x anymore… @nmfretz maybe you could check this?

Thank you in advance!

tornupnegatives commented 2 weeks ago

Is there a reason there is not a GitHub Actions runner to automatically handle this? I know it doesn't make sense for every application, but it would be nice for Immich since client updates usually introduce breaking changes which require a new server.

lmgithu commented 2 weeks ago

+1 to @tornupnegatives ’s suggestion, I fully agree. would this be possible? any solution would be highly appreciated to get this app back to being compatible with the client apps

nmfretz commented 2 weeks ago

Hey @lmgithu and @tornupnegatives thanks for the request! I just updated Immich to v1.106.4: https://github.com/getumbrel/umbrel-apps/pull/1160

Is there a reason there is not a GitHub Actions runner to automatically handle this? I know it doesn't make sense for every application, but it would be nice for Immich since client updates usually introduce breaking changes which require a new server.

This is an excellent idea, and is something that we are actually about to implement (cc @sharknoon). Over time we will be adding a bunch of automation helpers to facilitate quicker PR review and automated updates.

We have to be really careful with some apps though, and Immich is actually one of them. It is under very active development and has been making sweeping, breaking changes regularly that we have to handle carefully so that we don't break the app for existing installs or delete user data.

Here's the diff since bringing Immich to the app store 😬

diff --git a/immich/docker-compose.yml b/immich/docker-compose.yml
index e5d2a60..1eecbdb 100644
--- a/immich/docker-compose.yml
+++ b/immich/docker-compose.yml
@@ -1,121 +1,62 @@
 version: "3.7"

+x-environment: &env
+  NODE_ENV: "production"
+  DB_HOSTNAME: "immich_postgres_1"
+  DB_USERNAME: &db_username "immich"
+  DB_PASSWORD: &db_password "moneyprintergobrrr"
+  DB_DATABASE_NAME: &db_database_name "immich"
+  REDIS_HOSTNAME: "immich_redis_1"
+  LOG_LEVEL: "log"
+  JWT_SECRET: ${APP_SEED}
+  DISABLE_REVERSE_GEOCODING: "false"
+  REVERSE_GEOCODING_PRECISION: "3"
+  PUBLIC_LOGIN_PAGE_MESSAGE: ""
+  IMMICH_MACHINE_LEARNING_URL: "http://immich_machine-learning_1:3003"
+
 services:
   app_proxy:
     environment:
-      APP_HOST: immich_proxy_1
-      APP_PORT: 8080
-      PROXY_AUTH_WHITELIST: "/api/*"
+      APP_HOST: immich_server_1
+      APP_PORT: 3001
+      PROXY_AUTH_WHITELIST: "/api/*,/search/*"

   server:
-    image: altran1502/immich-server:v1.40.0_63-dev@sha256:c61f6c5373efb4544db8d04e6e090b77561b71b07d4f272821a6349a18531e37
-    entrypoint: ["/bin/sh", "./start-server.sh"]
-    volumes:
-      - ${APP_DATA_DIR}/data/upload:/usr/src/app/upload
-    environment:
-      NODE_ENV: production
-      DB_HOSTNAME: immich_postgres_1
-      DB_USERNAME: ${APP_IMMICH_DB_USERNAME}
-      DB_PASSWORD: ${APP_IMMICH_DB_PASSWORD}
-      DB_DATABASE_NAME: ${APP_IMMICH_DB_DATABASE_NAME}
-      REDIS_HOSTNAME: immich_redis_1
-      LOG_LEVEL: ${APP_IMMICH_LOG_LEVEL}
-      JWT_SECRET: ${APP_SEED}
-      DISABLE_REVERSE_GEOCODING: ${APP_IMMICH_DISABLE_REVERSE_GEOCODING}
-      REVERSE_GEOCODING_PRECISION: ${APP_IMMICH_REVERSE_GEOCODING_PRECISION}
-      PUBLIC_LOGIN_PAGE_MESSAGE: ${APP_IMMICH_PUBLIC_LOGIN_PAGE_MESSAGE}
-    depends_on:
-      - redis
-      - postgres
-    restart: on-failure
-
-  microservices:
-    image: altran1502/immich-server:v1.40.0_63-dev@sha256:c61f6c5373efb4544db8d04e6e090b77561b71b07d4f272821a6349a18531e37
-    # This service cannot run under 1000:1000
-    # And because the uploads are shared
-    # We'll run immich specific services as root
-    entrypoint: ["/bin/sh", "./start-microservices.sh"]
+    image: ghcr.io/immich-app/immich-server:v1.106.4@sha256:d39cb7ecbcc9924f2c51a3e0deb8a469075996c6ba9e1384eb2ddb550984848e
     volumes:
       - ${APP_DATA_DIR}/data/upload:/usr/src/app/upload
     environment:
-      NODE_ENV: production
-      DB_HOSTNAME: immich_postgres_1
-      DB_USERNAME: ${APP_IMMICH_DB_USERNAME}
-      DB_PASSWORD: ${APP_IMMICH_DB_PASSWORD}
-      DB_DATABASE_NAME: ${APP_IMMICH_DB_DATABASE_NAME}
-      REDIS_HOSTNAME: immich_redis_1
-      LOG_LEVEL: ${APP_IMMICH_LOG_LEVEL}
-      JWT_SECRET: ${APP_SEED}
-      DISABLE_REVERSE_GEOCODING: ${APP_IMMICH_DISABLE_REVERSE_GEOCODING}
-      REVERSE_GEOCODING_PRECISION: ${APP_IMMICH_REVERSE_GEOCODING_PRECISION}
-      PUBLIC_LOGIN_PAGE_MESSAGE: ${APP_IMMICH_PUBLIC_LOGIN_PAGE_MESSAGE}
+      <<: *env
     depends_on:
       - redis
       - postgres
     restart: on-failure

   machine-learning:
-    image: altran1502/immich-machine-learning:v1.40.0_63-dev@sha256:a5e660247a5a3c1d1b4ab9d160629def546d7e86e534a55d5ebc0e0eee5cef1a
-    entrypoint: ["/bin/sh", "./entrypoint.sh"]
+    image: ghcr.io/immich-app/immich-machine-learning:v1.106.4@sha256:9db20e5c2033bef01fa2be50fa0a2c3d62e43f069aedde4d49a65e65a436d40b
     volumes:
-      - ${APP_DATA_DIR}/data/upload:/usr/src/app/upload
+      - ${APP_DATA_DIR}/data/model-cache:/cache
     environment:
-      NODE_ENV: production
-      DB_HOSTNAME: immich_postgres_1
-      DB_USERNAME: ${APP_IMMICH_DB_USERNAME}
-      DB_PASSWORD: ${APP_IMMICH_DB_PASSWORD}
-      DB_DATABASE_NAME: ${APP_IMMICH_DB_DATABASE_NAME}
-      REDIS_HOSTNAME: immich_redis_1
-      LOG_LEVEL: ${APP_IMMICH_LOG_LEVEL}
-      JWT_SECRET: ${APP_SEED}
-      DISABLE_REVERSE_GEOCODING: ${APP_IMMICH_DISABLE_REVERSE_GEOCODING}
-      REVERSE_GEOCODING_PRECISION: ${APP_IMMICH_REVERSE_GEOCODING_PRECISION}
-      PUBLIC_LOGIN_PAGE_MESSAGE: ${APP_IMMICH_PUBLIC_LOGIN_PAGE_MESSAGE}
-    depends_on:
-      - postgres
-    restart: on-failure
-
-  web:
-    image: altran1502/immich-web:v1.40.0_63-dev@sha256:abad6488afaa1d0b4b8ea818221b86e7b45bf72a1ea328d8c0f35ad266b9e544
-    entrypoint: ["/bin/sh", "./entrypoint.sh"]
-    environment:
-      DB_HOSTNAME: immich_postgres_1
-      DB_USERNAME: ${APP_IMMICH_DB_USERNAME}
-      DB_PASSWORD: ${APP_IMMICH_DB_PASSWORD}
-      DB_DATABASE_NAME: ${APP_IMMICH_DB_DATABASE_NAME}
-      REDIS_HOSTNAME: immich_redis_1
-      LOG_LEVEL: ${APP_IMMICH_LOG_LEVEL}
-      JWT_SECRET: ${APP_SEED}
-      DISABLE_REVERSE_GEOCODING: ${APP_IMMICH_DISABLE_REVERSE_GEOCODING}
-      REVERSE_GEOCODING_PRECISION: ${APP_IMMICH_REVERSE_GEOCODING_PRECISION}
-      PUBLIC_LOGIN_PAGE_MESSAGE: ${APP_IMMICH_PUBLIC_LOGIN_PAGE_MESSAGE}
-      PUBLIC_IMMICH_SERVER_URL: "http://immich_server_1:3001"
-    restart: on-failure
-
-  proxy:
-    image: altran1502/immich-proxy:v1.40.0_63-dev@sha256:f779b86497b3d4b8822ec0d7341cfd2d1f1688b8859c70a9b16bd36d01468865
-    environment:
-      IMMICH_WEB_URL: "http://immich_web_1:3000"
-      IMMICH_SERVER_URL: "http://immich_server_1:3001"
-    depends_on:
-      - server
+      <<: *env
     restart: on-failure

   redis:
-    image: redis:6.2-bullseye@sha256:ffd3d04c8f7832ccdda89616ebaf3cb38414b645ebbf76dbef1fc9c36a72a2d1
+    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
     user: "1000:1000"
     restart: on-failure
     volumes:
       - ${APP_DATA_DIR}/data/redis:/data

   postgres:
-    image: postgres:14-bullseye@sha256:135c62a8134dcef829a1e4f5568bfae44bcfa2c75659ff948f43c71964366aa4
+    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
     user: "1000:1000"
+    command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
     environment:
-      POSTGRES_USER: ${APP_IMMICH_DB_USERNAME}
-      POSTGRES_PASSWORD: ${APP_IMMICH_DB_PASSWORD}
-      POSTGRES_DB: ${APP_IMMICH_DB_DATABASE_NAME}
-      PG_DATA: /var/lib/postgresql/data
+      <<: *env
+      POSTGRES_PASSWORD: *db_password
+      POSTGRES_USER: *db_username
+      POSTGRES_DB: *db_database_name
+      POSTGRES_INITDB_ARGS: '--data-checksums'
     volumes:
       - ${APP_DATA_DIR}/data/postgres:/var/lib/postgresql/data
     restart: on-failure
diff --git a/immich/hooks/post-update b/immich/hooks/post-update
new file mode 100755
index 0000000..a4782cd
--- /dev/null
+++ b/immich/hooks/post-update
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+# restart app so that postgres migrations are run
+# https://github.com/immich-app/immich/releases/tag/v1.95.1
+sleep 10
+"${UMBREL_ROOT}/scripts/app" restart "${APP_ID}" &
\ No newline at end of file
diff --git a/immich/hooks/pre-start b/immich/hooks/pre-start
new file mode 100755
index 0000000..eac8004
--- /dev/null
+++ b/immich/hooks/pre-start
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+# This script sets up necessary directories/permissions that have changed in the app since the initial release. 
+
+set -euo pipefail
+
+APP_DATA_DIR="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)/data"
+
+# Create model-cache directory if it doesn't exist
+MODEL_CACHE_DIR="${APP_DATA_DIR}/model-cache"
+[ ! -d "${MODEL_CACHE_DIR}" ] && mkdir -p "${MODEL_CACHE_DIR}" && chown 1000:1000 "${MODEL_CACHE_DIR}"
+
+# delete tsdata directory if it exists
+TYPESENSE_DIR="${APP_DATA_DIR}/tsdata"
+[ -d "${TYPESENSE_DIR}" ] && rm -rf "${TYPESENSE_DIR}"
\ No newline at end of file

Immich note this on their repo:

image

But looking at the new roadmap they just released it looks like they are aiming to be stable this year! So hopefully that will make future updates nice and easy (and quick!):

image
EphraimElgrabli commented 2 weeks ago

updated to the new version of immesh on the umbrel on custom linux, very buggy. the app launch but restart endlessly.

https://github.com/getumbrel/umbrel-apps/assets/32434942/9489ce60-ab9b-46e3-a8e1-bc3aacea7426

joaovictor-local commented 1 week ago

updated to the new version of immesh on the umbrel on custom linux, very buggy. the app launch but restart endlessly. Screen.Recording.2024-06-17.at.10.52.54.mp4

@EphraimElgrabli restart or redirect? did you tried open it on a anonymous tab?

tornupnegatives commented 1 week ago

@nmfretz Thanks for pushing that upgrade. Like @EphraimElgrabli, I did experience some strange behavior after upgrading Immich, but it was resolved by doing a cold reboot 🥶

nmfretz commented 1 week ago

Thanks for the reports @EphraimElgrabli and @tornupnegatives. I'm not able to recreate the issue across any of my devices with fresh install or an update of Immich unfortunately.

Do either of you have any Immich logs from when you were experiencing the issue? You can get them from the umbrelOS homescreen by going to Settings > Advanced Settings > Troubleshoot > then select Immich and download the logs.

I just took a quick look on the Immich Github repo and discord, and database issues seem to be somewhat common when updating at this stage in Immich's development so it may have been some sort of postgres error that was resolved by a restart.

Thanks for pushing that upgrade. Like @EphraimElgrabli, I did experience some strange behavior after upgrading Immich, but it was resolved by doing a cold reboot

Also, for future troubleshooting you can restart individual apps by right-clicking on their icon from the homescreen and selecting "Restart".

EphraimElgrabli commented 1 week ago

@nmfretz Thanks for pushing that upgrade. Like @EphraimElgrabli, I did experience some strange behavior after upgrading Immich, but it was resolved by doing a cold reboot 🥶

thanks for the advice! done that and worked properly after a cold reboot. thanks for all of the replies and advice!