mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Immich: Debian Trixie (#7728)
* Immich: Debian Trixie - Use Debian Stable repo for all dependencies - Remove unneeded dependencies - Replace `libmimalloc2.0` with `libmimalloc3` - Remove pre-1.140.x workarounds - Pin an Intel OpenVINO dependency - Force use of Python3.11 for machine-learning builds - Unpin custom photo-library revisions - Remove old vchord patches - Remove DB collation version refresh - Exit on detection of Debian 12 or below with message - Force hardlink as pnpm import method (fixes #7192) * Update immich.sh --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
This commit is contained in:
		
							
								
								
									
										62
									
								
								ct/immich.sh
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								ct/immich.sh
									
									
									
									
									
								
							@@ -11,7 +11,7 @@ var_disk="${var_disk:-20}"
 | 
			
		||||
var_cpu="${var_cpu:-4}"
 | 
			
		||||
var_ram="${var_ram:-4096}"
 | 
			
		||||
var_os="${var_os:-debian}"
 | 
			
		||||
var_version="${var_version:-12}"
 | 
			
		||||
var_version="${var_version:-13}"
 | 
			
		||||
var_unprivileged="${var_unprivileged:-1}"
 | 
			
		||||
 | 
			
		||||
header_info "$APP"
 | 
			
		||||
@@ -27,11 +27,22 @@ function update_script() {
 | 
			
		||||
    msg_error "No ${APP} Installation Found!"
 | 
			
		||||
    exit
 | 
			
		||||
  fi
 | 
			
		||||
  if [[ -f /etc/apt/sources.list.d/immich.list ]]; then
 | 
			
		||||
    msg_error "Wrong Debian version detected!"
 | 
			
		||||
    msg_error "You must upgrade your LXC to Debian Trixie before updating."
 | 
			
		||||
    msg_error "Please visit https://github.com/community-scripts/ProxmoxVE/discussions/7726 for details."
 | 
			
		||||
    echo "${TAB3}  If you have upgraded your LXC to Trixie and you still see this message, please open an Issue in the Community-Scripts repo."
 | 
			
		||||
    exit
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  setup_uv
 | 
			
		||||
  PNPM_VERSION="$(curl -fsSL "https://raw.githubusercontent.com/immich-app/immich/refs/heads/main/package.json" | jq -r '.packageManager | split("@")[1]')"
 | 
			
		||||
  NODE_VERSION="22" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
 | 
			
		||||
 | 
			
		||||
  if dpkg -l | grep -q "libmimalloc2.0"; then
 | 
			
		||||
    $STD apt-get update && $STD apt-get install -y libmimalloc3
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  STAGING_DIR=/opt/staging
 | 
			
		||||
  BASE_DIR=${STAGING_DIR}/base-images
 | 
			
		||||
  SOURCE_DIR=${STAGING_DIR}/image-source
 | 
			
		||||
@@ -45,8 +56,10 @@ function update_script() {
 | 
			
		||||
      for url in "${INTEL_URLS[@]}"; do
 | 
			
		||||
        curl -fsSLO "$url"
 | 
			
		||||
      done
 | 
			
		||||
      $STD apt-mark unhold libigdgmm12
 | 
			
		||||
      $STD apt install -y ./*.deb
 | 
			
		||||
      rm ./*.deb
 | 
			
		||||
      $STD apt-mark hold libigdgmm12
 | 
			
		||||
      msg_ok "Intel iGPU dependencies updated"
 | 
			
		||||
    fi
 | 
			
		||||
    rm ~/Dockerfile
 | 
			
		||||
@@ -78,22 +91,10 @@ function update_script() {
 | 
			
		||||
 | 
			
		||||
    if [[ ! -f ~/.vchord_version ]] || [[ "$VCHORD_RELEASE" != "$(cat ~/.vchord_version)" ]]; then
 | 
			
		||||
      msg_info "Updating VectorChord"
 | 
			
		||||
      if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then
 | 
			
		||||
        $STD sudo -u postgres pg_dumpall --clean --if-exists --username=postgres | gzip >/etc/postgresql/immich-db-vchord0.3.0.sql.gz
 | 
			
		||||
        chown postgres /etc/postgresql/immich-db-vchord0.3.0.sql.gz
 | 
			
		||||
        $STD sudo -u postgres gunzip --stdout /etc/postgresql/immich-db-vchord0.3.0.sql.gz |
 | 
			
		||||
          sed -e "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
 | 
			
		||||
            -e "/vchordrq.prewarm_dim/d" |
 | 
			
		||||
          sudo -u postgres psql
 | 
			
		||||
      fi
 | 
			
		||||
      curl -fsSL "https://github.com/tensorchord/vectorchord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb
 | 
			
		||||
      $STD apt install -y ./vchord.deb
 | 
			
		||||
      $STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;"
 | 
			
		||||
      systemctl restart postgresql
 | 
			
		||||
      if [[ ! -f ~/.vchord_version ]] || [[ ! "$(cat ~/.vchord_version)" > "0.3.0" ]]; then
 | 
			
		||||
        $STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;"
 | 
			
		||||
        $STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;"
 | 
			
		||||
      fi
 | 
			
		||||
      echo "$VCHORD_RELEASE" >~/.vchord_version
 | 
			
		||||
      rm ./vchord.deb
 | 
			
		||||
      msg_ok "Updated VectorChord to v${VCHORD_RELEASE}"
 | 
			
		||||
@@ -126,9 +127,6 @@ EOF
 | 
			
		||||
 | 
			
		||||
    msg_info "Updating ${APP} web and microservices"
 | 
			
		||||
    cd "$SRC_DIR"/server
 | 
			
		||||
    if [[ "$RELEASE" == "1.135.1" ]]; then
 | 
			
		||||
      rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts
 | 
			
		||||
    fi
 | 
			
		||||
    export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
 | 
			
		||||
    export CI=1
 | 
			
		||||
    corepack enable
 | 
			
		||||
@@ -144,6 +142,7 @@ EOF
 | 
			
		||||
 | 
			
		||||
    # openapi & web build
 | 
			
		||||
    cd "$SRC_DIR"
 | 
			
		||||
    echo "packageImportMethod: hardlink" >>./pnpm-workspace.yaml
 | 
			
		||||
    $STD pnpm --filter @immich/sdk --filter immich-web --frozen-lockfile --force install
 | 
			
		||||
    $STD pnpm --filter @immich/sdk --filter immich-web build
 | 
			
		||||
    cp -a web/build "$APP_DIR"/www
 | 
			
		||||
@@ -158,16 +157,16 @@ EOF
 | 
			
		||||
    msg_ok "Updated ${APP} web and microservices"
 | 
			
		||||
 | 
			
		||||
    cd "$SRC_DIR"/machine-learning
 | 
			
		||||
    mkdir -p "$ML_DIR"
 | 
			
		||||
    mkdir -p "$ML_DIR" && chown -R immich:immich "$ML_DIR"
 | 
			
		||||
    export VIRTUAL_ENV="${ML_DIR}"/ml-venv
 | 
			
		||||
    if [[ -f ~/.openvino ]]; then
 | 
			
		||||
      msg_info "Updating HW-accelerated machine-learning"
 | 
			
		||||
      $STD /usr/local/bin/uv sync --extra openvino --no-cache --active
 | 
			
		||||
      $STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --active -n -p python3.11 --managed-python
 | 
			
		||||
      patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so"
 | 
			
		||||
      msg_ok "Updated HW-accelerated machine-learning"
 | 
			
		||||
    else
 | 
			
		||||
      msg_info "Updating machine-learning"
 | 
			
		||||
      $STD /usr/local/bin/uv sync --extra cpu --no-cache --active
 | 
			
		||||
      $STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra cpu --active -n -p python3.11 --managed-python
 | 
			
		||||
      msg_ok "Updated machine-learning"
 | 
			
		||||
    fi
 | 
			
		||||
    cd "$SRC_DIR"
 | 
			
		||||
@@ -186,10 +185,6 @@ EOF
 | 
			
		||||
    ln -s "$GEO_DIR" "$APP_DIR"
 | 
			
		||||
 | 
			
		||||
    chown -R immich:immich "$INSTALL_DIR"
 | 
			
		||||
    if [[ ! -f ~/.debian_version.bak ]]; then
 | 
			
		||||
      cp /etc/debian_version ~/.debian_version.bak
 | 
			
		||||
      sed -i 's/.*/13.0/' /etc/debian_version
 | 
			
		||||
    fi
 | 
			
		||||
    msg_ok "Updated ${APP} to v${RELEASE}"
 | 
			
		||||
 | 
			
		||||
    msg_info "Cleaning up"
 | 
			
		||||
@@ -205,8 +200,7 @@ function compile_libjxl() {
 | 
			
		||||
  SOURCE=${SOURCE_DIR}/libjxl
 | 
			
		||||
  JPEGLI_LIBJPEG_LIBRARY_SOVERSION="62"
 | 
			
		||||
  JPEGLI_LIBJPEG_LIBRARY_VERSION="62.3.0"
 | 
			
		||||
  # : "${LIBJXL_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)}"
 | 
			
		||||
  : "${LIBJXL_REVISION:=794a5dcf0d54f9f0b20d288a12e87afb91d20dfc}"
 | 
			
		||||
  : "${LIBJXL_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)}"
 | 
			
		||||
  if [[ "$LIBJXL_REVISION" != "$(grep 'libjxl' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
 | 
			
		||||
    msg_info "Recompiling libjxl"
 | 
			
		||||
    if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
 | 
			
		||||
@@ -253,8 +247,7 @@ function compile_libheif() {
 | 
			
		||||
    $STD apt-get install -y libaom-dev
 | 
			
		||||
    local update="required"
 | 
			
		||||
  fi
 | 
			
		||||
  # : "${LIBHEIF_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libheif.json)}"
 | 
			
		||||
  : "${LIBHEIF_REVISION:=35dad50a9145332a7bfdf1ff6aef6801fb613d68}"
 | 
			
		||||
  : "${LIBHEIF_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libheif.json)}"
 | 
			
		||||
  if [[ "${update:-}" ]] || [[ "$LIBHEIF_REVISION" != "$(grep 'libheif' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
 | 
			
		||||
    msg_info "Recompiling libheif"
 | 
			
		||||
    if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
 | 
			
		||||
@@ -285,9 +278,7 @@ function compile_libheif() {
 | 
			
		||||
 | 
			
		||||
function compile_libraw() {
 | 
			
		||||
  SOURCE=${SOURCE_DIR}/libraw
 | 
			
		||||
  local update
 | 
			
		||||
  # : "${LIBRAW_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libraw.json)}"
 | 
			
		||||
  : "${LIBRAW_REVISION:=09bea31181b43e97959ee5452d91e5bc66365f1f}"
 | 
			
		||||
  : "${LIBRAW_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libraw.json)}"
 | 
			
		||||
  if [[ "$LIBRAW_REVISION" != "$(grep 'libraw' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
 | 
			
		||||
    msg_info "Recompiling libraw"
 | 
			
		||||
    if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
 | 
			
		||||
@@ -308,15 +299,15 @@ function compile_libraw() {
 | 
			
		||||
 | 
			
		||||
function compile_imagemagick() {
 | 
			
		||||
  SOURCE=$SOURCE_DIR/imagemagick
 | 
			
		||||
  # : "${IMAGEMAGICK_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/imagemagick.json)}"
 | 
			
		||||
  : "${IMAGEMAGICK_REVISION:=8289a3388a085ad5ae81aa6812f21554bdfd54f2}"
 | 
			
		||||
  if [[ "$IMAGEMAGICK_REVISION" != "$(grep 'imagemagick' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
 | 
			
		||||
  : "${IMAGEMAGICK_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/imagemagick.json)}"
 | 
			
		||||
  if [[ "$IMAGEMAGICK_REVISION" != "$(grep 'imagemagick' ~/.immich_library_revisions | awk '{print $2}')" ]] ||
 | 
			
		||||
    ! grep -q 'DMAGICK_LIBRAW' /usr/local/lib/ImageMagick-7*/config-Q16HDRI/configure.xml; then
 | 
			
		||||
    msg_info "Recompiling ImageMagick"
 | 
			
		||||
    if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
 | 
			
		||||
    $STD git clone https://github.com/ImageMagick/ImageMagick.git "$SOURCE"
 | 
			
		||||
    cd "$SOURCE"
 | 
			
		||||
    $STD git reset --hard "$IMAGEMAGICK_REVISION"
 | 
			
		||||
    $STD ./configure --with-modules
 | 
			
		||||
    $STD ./configure --with-modules CPPFLAGS="-DMAGICK_LIBRAW_VERSION_TAIL=202502"
 | 
			
		||||
    $STD make -j"$(nproc)"
 | 
			
		||||
    $STD make install
 | 
			
		||||
    ldconfig /usr/local/lib
 | 
			
		||||
@@ -329,8 +320,7 @@ function compile_imagemagick() {
 | 
			
		||||
 | 
			
		||||
function compile_libvips() {
 | 
			
		||||
  SOURCE=$SOURCE_DIR/libvips
 | 
			
		||||
  # : "${LIBVIPS_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libvips.json)}"
 | 
			
		||||
  : "${LIBVIPS_REVISION:=8fa37a64547e392d3808eed8d72adab7e02b3d00}"
 | 
			
		||||
  : "${LIBVIPS_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libvips.json)}"
 | 
			
		||||
  if [[ "$LIBVIPS_REVISION" != "$(grep 'libvips' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
 | 
			
		||||
    msg_info "Recompiling libvips"
 | 
			
		||||
    if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user