update Immich
This commit is contained in:
parent
fd79d8d927
commit
a6e78ad118
92
ct/immich.sh
92
ct/immich.sh
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: vhsdream
|
# Author: vhsdream
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
@ -52,9 +52,7 @@ Package: *
|
|||||||
Pin:release a=testing
|
Pin:release a=testing
|
||||||
Pin-Priority: 450
|
Pin-Priority: 450
|
||||||
EOF
|
EOF
|
||||||
if [[ -f /etc/apt/preferences.d/immich ]]; then
|
[[ -f /etc/apt/preferences.d/immich ]] && rm /etc/apt/preferences.d/immich
|
||||||
rm /etc/apt/preferences.d/immich
|
|
||||||
fi
|
|
||||||
$STD apt update
|
$STD apt update
|
||||||
msg_ok "Added Debian Testing repo"
|
msg_ok "Added Debian Testing repo"
|
||||||
fi
|
fi
|
||||||
@ -69,8 +67,7 @@ EOF
|
|||||||
msg_info "Installing Mise"
|
msg_info "Installing Mise"
|
||||||
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
|
curl -fSs https://mise.jdx.dev/gpg-key.pub | tee /etc/apt/keyrings/mise-archive-keyring.pub 1>/dev/null
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" >/etc/apt/sources.list.d/mise.list
|
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.pub arch=amd64] https://mise.jdx.dev/deb stable main" >/etc/apt/sources.list.d/mise.list
|
||||||
$STD apt update
|
ensure_dependencies mise
|
||||||
$STD apt install -y mise
|
|
||||||
msg_ok "Installed Mise"
|
msg_ok "Installed Mise"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -91,7 +88,7 @@ EOF
|
|||||||
curl -fsSLO "$url"
|
curl -fsSLO "$url"
|
||||||
done
|
done
|
||||||
$STD apt-mark unhold libigdgmm12
|
$STD apt-mark unhold libigdgmm12
|
||||||
$STD apt install -y ./libigdgmm12*.deb
|
$STD apt install -y --allow-downgrades ./libigdgmm12*.deb
|
||||||
rm ./libigdgmm12*.deb
|
rm ./libigdgmm12*.deb
|
||||||
$STD apt install -y ./*.deb
|
$STD apt install -y ./*.deb
|
||||||
rm ./*.deb
|
rm ./*.deb
|
||||||
@ -112,29 +109,31 @@ EOF
|
|||||||
msg_ok "Image-processing libraries up to date"
|
msg_ok "Image-processing libraries up to date"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RELEASE="v2.5.2"
|
RELEASE="2.5.2"
|
||||||
if check_for_gh_tag "immich" "immich-app/immich" "${RELEASE}"; then
|
if check_for_gh_release "immich" "immich-app/immich" "${RELEASE}"; then
|
||||||
|
if [[ $(cat ~/.immich) > "2.5.1" ]]; then
|
||||||
|
msg_info "Enabling Maintenance Mode"
|
||||||
|
cd /opt/immich/app/bin
|
||||||
|
$STD ./immich-admin enable-maintenance-mode
|
||||||
|
export MAINT_MODE=1
|
||||||
|
$STD cd -
|
||||||
|
msg_ok "Enabled Maintenance Mode"
|
||||||
|
fi
|
||||||
msg_info "Stopping Services"
|
msg_info "Stopping Services"
|
||||||
systemctl stop immich-web
|
systemctl stop immich-web
|
||||||
systemctl stop immich-ml
|
systemctl stop immich-ml
|
||||||
msg_ok "Stopped Services"
|
msg_ok "Stopped Services"
|
||||||
VCHORD_RELEASE="0.5.3"
|
VCHORD_RELEASE="0.5.3"
|
||||||
if [[ ! -f ~/.vchord_version ]] || [[ "$VCHORD_RELEASE" != "$(cat ~/.vchord_version)" ]]; then
|
[[ -f ~/.vchord_version ]] && mv ~/.vchord_version ~/.vectorchord
|
||||||
msg_info "Upgrading VectorChord"
|
if check_for_gh_release "VectorChord" "tensorchord/VectorChord" "${VCHORD_RELEASE}"; then
|
||||||
curl -fsSL "https://github.com/tensorchord/vectorchord/releases/download/${VCHORD_RELEASE}/postgresql-16-vchord_${VCHORD_RELEASE}-1_amd64.deb" -o vchord.deb
|
fetch_and_deploy_gh_release "VectorChord" "tensorchord/VectorChord" "binary" "${VCHORD_RELEASE}" "/tmp" "postgresql-16-vchord_*_amd64.deb"
|
||||||
$STD apt install -y ./vchord.deb
|
|
||||||
systemctl restart postgresql
|
systemctl restart postgresql
|
||||||
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vector UPDATE;"
|
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vector UPDATE;"
|
||||||
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;"
|
$STD sudo -u postgres psql -d immich -c "ALTER EXTENSION vchord UPDATE;"
|
||||||
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;"
|
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX face_index;"
|
||||||
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;"
|
$STD sudo -u postgres psql -d immich -c "REINDEX INDEX clip_index;"
|
||||||
echo "$VCHORD_RELEASE" >~/.vchord_version
|
|
||||||
rm ./vchord.deb
|
|
||||||
msg_ok "Upgraded VectorChord to v${VCHORD_RELEASE}"
|
|
||||||
fi
|
|
||||||
if ! dpkg -l | grep -q ccache; then
|
|
||||||
$STD apt install -yqq ccache
|
|
||||||
fi
|
fi
|
||||||
|
ensure_dependencies ccache
|
||||||
|
|
||||||
INSTALL_DIR="/opt/${APP}"
|
INSTALL_DIR="/opt/${APP}"
|
||||||
UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)"
|
UPLOAD_DIR="$(sed -n '/^IMMICH_MEDIA_LOCATION/s/[^=]*=//p' /opt/immich/.env)"
|
||||||
@ -144,7 +143,7 @@ EOF
|
|||||||
ML_DIR="${APP_DIR}/machine-learning"
|
ML_DIR="${APP_DIR}/machine-learning"
|
||||||
GEO_DIR="${INSTALL_DIR}/geodata"
|
GEO_DIR="${INSTALL_DIR}/geodata"
|
||||||
|
|
||||||
cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR"
|
[[ -f "$ML_DIR"/ml_start.sh ]] && cp "$ML_DIR"/ml_start.sh "$INSTALL_DIR"
|
||||||
if grep -qs "set -a" "$APP_DIR"/bin/start.sh; then
|
if grep -qs "set -a" "$APP_DIR"/bin/start.sh; then
|
||||||
cp "$APP_DIR"/bin/start.sh "$INSTALL_DIR"
|
cp "$APP_DIR"/bin/start.sh "$INSTALL_DIR"
|
||||||
else
|
else
|
||||||
@ -165,7 +164,7 @@ EOF
|
|||||||
rm -rf "${APP_DIR:?}"/*
|
rm -rf "${APP_DIR:?}"/*
|
||||||
)
|
)
|
||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "immich" "immich-app/immich" "tag" "${RELEASE}" "$SRC_DIR"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR"
|
||||||
|
|
||||||
msg_info "Updating Immich web and microservices"
|
msg_info "Updating Immich web and microservices"
|
||||||
cd "$SRC_DIR"/server
|
cd "$SRC_DIR"/server
|
||||||
@ -180,7 +179,7 @@ EOF
|
|||||||
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
||||||
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
||||||
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
||||||
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
|
sed -i "s|^start|${APP_DIR}/bin/start|" "$APP_DIR"/bin/immich-admin
|
||||||
|
|
||||||
# openapi & web build
|
# openapi & web build
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
@ -196,8 +195,7 @@ EOF
|
|||||||
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
|
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
|
||||||
$STD pnpm --filter @immich/sdk --filter @immich/cli build
|
$STD pnpm --filter @immich/sdk --filter @immich/cli build
|
||||||
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
|
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
|
||||||
cd "$APP_DIR"
|
[[ -f "$INSTALL_DIR"/start.sh ]] && mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
|
||||||
mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
|
|
||||||
|
|
||||||
# plugins
|
# plugins
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
@ -217,16 +215,9 @@ EOF
|
|||||||
export VIRTUAL_ENV="${ML_DIR}"/ml-venv
|
export VIRTUAL_ENV="${ML_DIR}"/ml-venv
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
msg_info "Updating HW-accelerated machine-learning"
|
msg_info "Updating HW-accelerated machine-learning"
|
||||||
# Remove old venv if Python version changed (3.12 -> 3.13)
|
$STD uv add --no-sync --optional openvino onnxruntime-openvino==1.20.0 --active -n -p python3.12 --managed-python
|
||||||
if [[ -d "${VIRTUAL_ENV}" ]] && ! "${VIRTUAL_ENV}/bin/python3" --version 2>/dev/null | grep -q "3.13"; then
|
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.12 --managed-python
|
||||||
rm -rf "${VIRTUAL_ENV}"
|
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so"
|
||||||
fi
|
|
||||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.13 --managed-python
|
|
||||||
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-313-x86_64-linux-gnu.so"
|
|
||||||
# Add workaround for onnxruntime-openvino 1.23.x crash if not present
|
|
||||||
if ! grep -q "MACHINE_LEARNING_OPENVINO_NUM_THREADS" "$INSTALL_DIR/.env" 2>/dev/null; then
|
|
||||||
sed -i '/MACHINE_LEARNING_CACHE_FOLDER/a ## - For OpenVINO only - workaround for onnxruntime-openvino 1.23.x crash\n## - See: https://github.com/immich-app/immich/pull/11240\nMACHINE_LEARNING_OPENVINO_NUM_THREADS=$(nproc)' "$INSTALL_DIR/.env"
|
|
||||||
fi
|
|
||||||
msg_ok "Updated HW-accelerated machine-learning"
|
msg_ok "Updated HW-accelerated machine-learning"
|
||||||
else
|
else
|
||||||
msg_info "Updating machine-learning"
|
msg_info "Updating machine-learning"
|
||||||
@ -235,10 +226,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
||||||
mv "$INSTALL_DIR"/ml_start.sh "$ML_DIR"
|
[[ -f "$INSTALL_DIR"/ml_start.sh ]] && mv "$INSTALL_DIR"/ml_start.sh "$ML_DIR"
|
||||||
if [[ -f ~/.openvino ]]; then
|
[[ -f ~/.openvino ]] && sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
||||||
sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
|
||||||
fi
|
|
||||||
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g"
|
grep -rl /usr/src | xargs -n1 sed -i "s|\/usr/src|$INSTALL_DIR|g"
|
||||||
@ -247,8 +236,18 @@ EOF
|
|||||||
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$APP_DIR"/upload
|
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$APP_DIR"/upload
|
||||||
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload
|
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload
|
||||||
ln -s "$GEO_DIR" "$APP_DIR"
|
ln -s "$GEO_DIR" "$APP_DIR"
|
||||||
|
[[ ! -f /usr/bin/immich ]] && ln -sf "$APP_DIR"/cli/bin/immich /usr/bin/immich
|
||||||
|
[[ ! -f /usr/bin/immich-admin ]] && ln -sf "$APP_DIR"/bin/immich-admin /usr/bin/immich-admin
|
||||||
|
|
||||||
chown -R immich:immich "$INSTALL_DIR"
|
chown -R immich:immich "$INSTALL_DIR"
|
||||||
|
if [[ "${MAINT_MODE:-0}" == 1 ]]; then
|
||||||
|
msg_info "Disabling Maintenance Mode"
|
||||||
|
cd /opt/immich/app/bin
|
||||||
|
$STD ./immich-admin disable-maintenance-mode
|
||||||
|
unset MAINT_MODE
|
||||||
|
$STD cd -
|
||||||
|
msg_ok "Disabled Maintenance Mode"
|
||||||
|
fi
|
||||||
systemctl restart immich-ml immich-web
|
systemctl restart immich-ml immich-web
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
fi
|
fi
|
||||||
@ -262,7 +261,7 @@ function compile_libjxl() {
|
|||||||
: "${LIBJXL_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)}"
|
: "${LIBJXL_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)}"
|
||||||
if [[ "$LIBJXL_REVISION" != "$(grep 'libjxl' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
if [[ "$LIBJXL_REVISION" != "$(grep 'libjxl' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||||
msg_info "Recompiling libjxl"
|
msg_info "Recompiling libjxl"
|
||||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
[[ -d "$SOURCE" ]] && rm -rf "$SOURCE"
|
||||||
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
||||||
cd "$SOURCE"
|
cd "$SOURCE"
|
||||||
$STD git reset --hard "$LIBJXL_REVISION"
|
$STD git reset --hard "$LIBJXL_REVISION"
|
||||||
@ -302,14 +301,11 @@ function compile_libjxl() {
|
|||||||
|
|
||||||
function compile_libheif() {
|
function compile_libheif() {
|
||||||
SOURCE=${SOURCE_DIR}/libheif
|
SOURCE=${SOURCE_DIR}/libheif
|
||||||
if ! dpkg -l | grep -q libaom; then
|
ensure_dependencies libaom-dev
|
||||||
$STD apt install -y libaom-dev
|
|
||||||
local update="required"
|
|
||||||
fi
|
|
||||||
: "${LIBHEIF_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libheif.json)}"
|
: "${LIBHEIF_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libheif.json)}"
|
||||||
if [[ "${update:-}" ]] || [[ "$LIBHEIF_REVISION" != "$(grep 'libheif' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
if [[ "${update:-}" ]] || [[ "$LIBHEIF_REVISION" != "$(grep 'libheif' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||||
msg_info "Recompiling libheif"
|
msg_info "Recompiling libheif"
|
||||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
[[ -d "$SOURCE" ]] && rm -rf "$SOURCE"
|
||||||
$STD git clone https://github.com/strukturag/libheif.git "$SOURCE"
|
$STD git clone https://github.com/strukturag/libheif.git "$SOURCE"
|
||||||
cd "$SOURCE"
|
cd "$SOURCE"
|
||||||
$STD git reset --hard "$LIBHEIF_REVISION"
|
$STD git reset --hard "$LIBHEIF_REVISION"
|
||||||
@ -325,7 +321,7 @@ function compile_libheif() {
|
|||||||
-DWITH_X265=OFF \
|
-DWITH_X265=OFF \
|
||||||
-DWITH_EXAMPLES=OFF \
|
-DWITH_EXAMPLES=OFF \
|
||||||
..
|
..
|
||||||
$STD make install -j "$(nproc)"
|
$STD make install -j"$(nproc)"
|
||||||
ldconfig /usr/local/lib
|
ldconfig /usr/local/lib
|
||||||
$STD make clean
|
$STD make clean
|
||||||
cd "$STAGING_DIR"
|
cd "$STAGING_DIR"
|
||||||
@ -340,7 +336,7 @@ function compile_libraw() {
|
|||||||
: "${LIBRAW_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libraw.json)}"
|
: "${LIBRAW_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libraw.json)}"
|
||||||
if [[ "$LIBRAW_REVISION" != "$(grep 'libraw' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
if [[ "$LIBRAW_REVISION" != "$(grep 'libraw' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||||
msg_info "Recompiling libraw"
|
msg_info "Recompiling libraw"
|
||||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
[[ -d "$SOURCE" ]] && rm -rf "$SOURCE"
|
||||||
$STD git clone https://github.com/libraw/libraw.git "$SOURCE"
|
$STD git clone https://github.com/libraw/libraw.git "$SOURCE"
|
||||||
cd "$SOURCE"
|
cd "$SOURCE"
|
||||||
$STD git reset --hard "$LIBRAW_REVISION"
|
$STD git reset --hard "$LIBRAW_REVISION"
|
||||||
@ -362,7 +358,7 @@ function compile_imagemagick() {
|
|||||||
if [[ "$IMAGEMAGICK_REVISION" != "$(grep 'imagemagick' ~/.immich_library_revisions | awk '{print $2}')" ]] ||
|
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
|
! grep -q 'DMAGICK_LIBRAW' /usr/local/lib/ImageMagick-7*/config-Q16HDRI/configure.xml; then
|
||||||
msg_info "Recompiling ImageMagick"
|
msg_info "Recompiling ImageMagick"
|
||||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
[[ -d "$SOURCE" ]] && rm -rf "$SOURCE"
|
||||||
$STD git clone https://github.com/ImageMagick/ImageMagick.git "$SOURCE"
|
$STD git clone https://github.com/ImageMagick/ImageMagick.git "$SOURCE"
|
||||||
cd "$SOURCE"
|
cd "$SOURCE"
|
||||||
$STD git reset --hard "$IMAGEMAGICK_REVISION"
|
$STD git reset --hard "$IMAGEMAGICK_REVISION"
|
||||||
@ -382,7 +378,7 @@ function compile_libvips() {
|
|||||||
: "${LIBVIPS_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libvips.json)}"
|
: "${LIBVIPS_REVISION:=$(jq -cr '.revision' "$BASE_DIR"/server/sources/libvips.json)}"
|
||||||
if [[ "$LIBVIPS_REVISION" != "$(grep 'libvips' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
if [[ "$LIBVIPS_REVISION" != "$(grep 'libvips' ~/.immich_library_revisions | awk '{print $2}')" ]]; then
|
||||||
msg_info "Recompiling libvips"
|
msg_info "Recompiling libvips"
|
||||||
if [[ -d "$SOURCE" ]]; then rm -rf "$SOURCE"; fi
|
[[ -d "$SOURCE" ]] && rm -rf "$SOURCE"
|
||||||
$STD git clone https://github.com/libvips/libvips.git "$SOURCE"
|
$STD git clone https://github.com/libvips/libvips.git "$SOURCE"
|
||||||
cd "$SOURCE"
|
cd "$SOURCE"
|
||||||
$STD git reset --hard "$LIBVIPS_REVISION"
|
$STD git reset --hard "$LIBVIPS_REVISION"
|
||||||
|
|||||||
@ -149,12 +149,7 @@ NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
|||||||
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
|
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
|
||||||
|
|
||||||
VCHORD_RELEASE="0.5.3"
|
VCHORD_RELEASE="0.5.3"
|
||||||
msg_info "Installing Vectorchord v${VCHORD_RELEASE}"
|
fetch_and_deploy_gh_release "VectorChord" "tensorchord/VectorChord" "binary" "${VCHORD_RELEASE}" "/tmp" "postgresql-16-vchord_*_amd64.deb"
|
||||||
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
|
|
||||||
rm vchord.deb
|
|
||||||
echo "$VCHORD_RELEASE" >~/.vchord_version
|
|
||||||
msg_ok "Installed Vectorchord v${VCHORD_RELEASE}"
|
|
||||||
|
|
||||||
sed -i -e "/^#shared_preload/s/^#//;/^shared_preload/s/''/'vchord.so'/" /etc/postgresql/16/main/postgresql.conf
|
sed -i -e "/^#shared_preload/s/^#//;/^shared_preload/s/''/'vchord.so'/" /etc/postgresql/16/main/postgresql.conf
|
||||||
systemctl restart postgresql.service
|
systemctl restart postgresql.service
|
||||||
@ -228,7 +223,7 @@ $STD cmake --preset=release-noplugins \
|
|||||||
-DWITH_X265=OFF \
|
-DWITH_X265=OFF \
|
||||||
-DWITH_EXAMPLES=OFF \
|
-DWITH_EXAMPLES=OFF \
|
||||||
..
|
..
|
||||||
$STD make install -j "$(nproc)"
|
$STD make install -j"$(nproc)"
|
||||||
ldconfig /usr/local/lib
|
ldconfig /usr/local/lib
|
||||||
$STD make clean
|
$STD make clean
|
||||||
cd "$STAGING_DIR"
|
cd "$STAGING_DIR"
|
||||||
@ -293,10 +288,9 @@ APP_DIR="${INSTALL_DIR}/app"
|
|||||||
PLUGIN_DIR="${APP_DIR}/corePlugin"
|
PLUGIN_DIR="${APP_DIR}/corePlugin"
|
||||||
ML_DIR="${APP_DIR}/machine-learning"
|
ML_DIR="${APP_DIR}/machine-learning"
|
||||||
GEO_DIR="${INSTALL_DIR}/geodata"
|
GEO_DIR="${INSTALL_DIR}/geodata"
|
||||||
mkdir -p "$INSTALL_DIR"
|
|
||||||
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache}
|
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache}
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tag" "v2.5.2" "$SRC_DIR"
|
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v2.5.2" "$SRC_DIR"
|
||||||
|
|
||||||
msg_info "Installing Immich (patience)"
|
msg_info "Installing Immich (patience)"
|
||||||
|
|
||||||
@ -312,7 +306,7 @@ unset SHARP_IGNORE_GLOBAL_LIBVIPS
|
|||||||
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
export SHARP_FORCE_GLOBAL_LIBVIPS=true
|
||||||
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
|
||||||
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
cp "$APP_DIR"/package.json "$APP_DIR"/bin
|
||||||
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
|
sed -i "s|^start|${APP_DIR}/bin/start|" "$APP_DIR"/bin/immich-admin
|
||||||
|
|
||||||
# openapi & web build
|
# openapi & web build
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
@ -347,8 +341,9 @@ mkdir -p "$ML_DIR" && chown -R immich:immich "$INSTALL_DIR"
|
|||||||
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
|
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
msg_info "Installing HW-accelerated machine-learning"
|
msg_info "Installing HW-accelerated machine-learning"
|
||||||
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.13 --managed-python
|
$STD uv add --no-sync --optional openvino onnxruntime-openvino==1.20.0 --active -n -p python3.12 --managed-python
|
||||||
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-313-x86_64-linux-gnu.so"
|
$STD sudo --preserve-env=VIRTUAL_ENV -nu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p python3.12 --managed-python
|
||||||
|
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so"
|
||||||
msg_ok "Installed HW-accelerated machine-learning"
|
msg_ok "Installed HW-accelerated machine-learning"
|
||||||
else
|
else
|
||||||
msg_info "Installing machine-learning"
|
msg_info "Installing machine-learning"
|
||||||
@ -357,9 +352,7 @@ else
|
|||||||
fi
|
fi
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
||||||
if [[ -f ~/.openvino ]]; then
|
[[ -f ~/.openvino ]] && sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
||||||
sed -i "/intra_op/s/int = 0/int = os.cpu_count() or 0/" "$ML_DIR"/immich_ml/config.py
|
|
||||||
fi
|
|
||||||
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
ln -sf "$APP_DIR"/resources "$INSTALL_DIR"
|
||||||
|
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
@ -404,10 +397,9 @@ DB_VECTOR_EXTENSION=vectorchord
|
|||||||
REDIS_HOSTNAME=127.0.0.1
|
REDIS_HOSTNAME=127.0.0.1
|
||||||
IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003
|
IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:3003
|
||||||
MACHINE_LEARNING_CACHE_FOLDER=${INSTALL_DIR}/cache
|
MACHINE_LEARNING_CACHE_FOLDER=${INSTALL_DIR}/cache
|
||||||
## - For OpenVINO only - workaround for onnxruntime-openvino 1.23.x crash
|
## - For OpenVINO only - uncomment below to increase
|
||||||
## - See: https://github.com/immich-app/immich/pull/11240
|
## - inference speed while reducing accuracy
|
||||||
MACHINE_LEARNING_OPENVINO_NUM_THREADS=$(nproc)
|
## - Default is FP32
|
||||||
## - Uncomment below to increase inference speed while reducing accuracy
|
|
||||||
# MACHINE_LEARNING_OPENVINO_PRECISION=FP16
|
# MACHINE_LEARNING_OPENVINO_PRECISION=FP16
|
||||||
|
|
||||||
IMMICH_MEDIA_LOCATION=${UPLOAD_DIR}
|
IMMICH_MEDIA_LOCATION=${UPLOAD_DIR}
|
||||||
@ -434,9 +426,11 @@ set +a
|
|||||||
/usr/bin/node ${APP_DIR}/dist/main.js "\$@"
|
/usr/bin/node ${APP_DIR}/dist/main.js "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$ML_DIR"/ml_start.sh "$APP_DIR"/bin/start.sh
|
chmod +x "$ML_DIR"/ml_start.sh "$APP_DIR"/bin/start.sh
|
||||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service
|
ln -sf "$APP_DIR"/cli/bin/immich /usr/bin/immich
|
||||||
|
ln -sf "$APP_DIR"/bin/immich-admin /usr/bin/immich-admin
|
||||||
|
cat <<EOF >/etc/systemd/system/immich-web.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=${APPLICATION} Web Service
|
Description=Immich Web Service
|
||||||
After=network.target
|
After=network.target
|
||||||
Requires=redis-server.service
|
Requires=redis-server.service
|
||||||
Requires=postgresql.service
|
Requires=postgresql.service
|
||||||
@ -458,9 +452,9 @@ StandardError=append:/var/log/immich/web.log
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-ml.service
|
cat <<EOF >/etc/systemd/system/immich-ml.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=${APPLICATION} Machine-Learning
|
Description=Immich Machine-Learning
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@ -480,7 +474,7 @@ StandardError=append:/var/log/immich/ml.log
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
chown -R immich:immich "$INSTALL_DIR" /var/log/immich
|
chown -R immich:immich "$INSTALL_DIR" /var/log/immich
|
||||||
systemctl enable -q --now "$APPLICATION"-ml.service "$APPLICATION"-web.service
|
systemctl enable -q --now immich-ml.service immich-web.service
|
||||||
msg_ok "Modified user, created env file, scripts and services"
|
msg_ok "Modified user, created env file, scripts and services"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user