Immich: v1.139.2 (#7116)

* Switch to pnpm for build

- The Immich repo now uses pnpm to build the server, web/api and cli

* streamline dependency installation

- remove unnecessary duplicates
- install libaom-dev from testing repo

* Bump version to v1.139.2
This commit is contained in:
Chris 2025-08-23 01:43:16 -04:00 committed by GitHub
parent 5cd24b503c
commit d7dea7cc5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 71 additions and 69 deletions

View File

@ -29,6 +29,8 @@ function update_script() {
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
STAGING_DIR=/opt/staging
BASE_DIR=${STAGING_DIR}/base-images
@ -59,7 +61,7 @@ function update_script() {
done
msg_ok "Image-processing libraries up to date"
fi
RELEASE="1.138.1"
RELEASE="1.139.2"
#RELEASE=$(curl -fsSL https://api.github.com/repos/immich-app/immich/releases?per_page=1 | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ -f ~/.immich && "$RELEASE" == "$(cat ~/.immich)" ]]; then
msg_ok "No update required. ${APP} is already at v${RELEASE}"
@ -116,8 +118,12 @@ set +a
EOF
chmod +x "$INSTALL_DIR"/start.sh
fi
rm -rf "${APP_DIR:?}"/*
mkdir -p "$ML_DIR"
(
shopt -s dotglob
rm -rf "${APP_DIR:?}"/*
)
rm -rf "$SRC_DIR"
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v${RELEASE}" "$SRC_DIR"
@ -127,30 +133,34 @@ EOF
if [[ "$RELEASE" == "1.135.1" ]]; then
rm ./src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts
fi
$STD npm install -g node-gyp node-pre-gyp
$STD npm ci
$STD npm run build
$STD npm prune --omit=dev --omit=optional
cp -a {bin,dist,node_modules,resources,package*.json} "$APP_DIR"/
cp package.json "$APP_DIR"/bin
mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export CI=1
corepack enable
# server build
$STD pnpm --filter immich --frozen-lockfile build
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
cp "$APP_DIR"/package.json "$APP_DIR"/bin
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
cd "$SRC_DIR"/open-api/typescript-sdk
$STD npm ci
$STD npm run build
cd "$SRC_DIR"/web
$STD npm ci
$STD npm run build
# openapi & web build
cd "$SRC_DIR"
export SHARP_FORCE_GLOBAL_LIBVIPS=true
$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
cp LICENSE "$APP_DIR"
# cli build
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
$STD pnpm --filter @immich/sdk --filter @immich/cli build
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
cd "$APP_DIR"
export SHARP_FORCE_GLOBAL_LIBVIPS=true
$STD npm install sharp
rm -rf "$APP_DIR"/node_modules/@img/sharp-{libvips*,linuxmusl-x64}
mv "$INSTALL_DIR"/start.sh "$APP_DIR"/bin
msg_ok "Updated ${APP} web and microservices"
cd "$SRC_DIR"/machine-learning
mkdir -p "$ML_DIR"
export VIRTUAL_ENV="${ML_DIR}"/ml-venv
$STD /usr/local/bin/uv venv "$VIRTUAL_ENV"
if [[ -f ~/.openvino ]]; then
@ -178,10 +188,6 @@ EOF
ln -s "${UPLOAD_DIR:-/opt/immich/upload}" "$ML_DIR"/upload
ln -s "$GEO_DIR" "$APP_DIR"
msg_info "Updating Immich CLI"
$STD npm i -g @immich/cli
msg_ok "Updated Immich CLI"
chown -R immich:immich "$INSTALL_DIR"
if [[ ! -f ~/.debian_version.bak ]]; then
cp /etc/debian_version ~/.debian_version.bak

View File

@ -30,8 +30,12 @@ $STD apt-get install --no-install-recommends -y \
autoconf \
build-essential \
python3-dev \
automake \
cmake \
jq \
libtool \
libltdl-dev \
libgdk-pixbuf-2.0-dev \
libbrotli-dev \
libde265-dev \
libexif-dev \
@ -39,37 +43,28 @@ $STD apt-get install --no-install-recommends -y \
libglib2.0-dev \
libgsf-1-dev \
libjpeg62-turbo-dev \
librsvg2-dev \
libspng-dev \
liblcms2-dev \
libopenexr-dev \
libgif-dev \
librsvg2-dev \
libexpat1 \
libgcc-s1 \
libgomp1 \
liblqr-1-0 \
libltdl7 \
libmimalloc2.0 \
libopenjp2-7 \
meson \
ninja-build \
pkg-config \
cpanminus \
libde265-0 \
libexif12 \
libexpat1 \
libgcc-s1 \
libglib2.0-0 \
libgomp1 \
libgsf-1-114 \
liblcms2-dev \
liblqr-1-0 \
libltdl7 \
libmimalloc2.0 \
libopenexr-dev \
libgif-dev \
libopenjp2-7 \
librsvg2-2 \
libspng0 \
mesa-utils \
mesa-va-drivers \
mesa-vulkan-drivers \
ocl-icd-libopencl1 \
tini \
libaom-dev \
zlib1g
$STD apt-get install -y \
libgdk-pixbuf-2.0-dev librsvg2-dev libtool
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg
DPKG_ARCHITECTURE="$(dpkg --print-architecture)"
export DPKG_ARCHITECTURE
@ -111,7 +106,8 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
msg_ok "Installed OpenVINO dependencies"
fi
NODE_VERSION="22" setup_nodejs
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
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
msg_info "Setting up Postgresql Database"
@ -149,7 +145,8 @@ $STD apt-get install -t testing --no-install-recommends -y \
libhwy1t64 \
libdav1d-dev \
libhwy-dev \
libwebp-dev
libwebp-dev \
libaom-dev
if [[ -f ~/.openvino ]]; then
$STD apt-get install -t testing -y patchelf
fi
@ -281,36 +278,39 @@ APP_DIR="${INSTALL_DIR}/app"
ML_DIR="${APP_DIR}/machine-learning"
GEO_DIR="${INSTALL_DIR}/geodata"
mkdir -p "$INSTALL_DIR"
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${ML_DIR}","${INSTALL_DIR}"/cache}
mkdir -p {"${APP_DIR}","${UPLOAD_DIR}","${GEO_DIR}","${INSTALL_DIR}"/cache}
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v1.138.1" "$SRC_DIR"
fetch_and_deploy_gh_release "immich" "immich-app/immich" "tarball" "v1.139.2" "$SRC_DIR"
msg_info "Installing ${APPLICATION} (more patience please)"
cd "$SRC_DIR"/server
$STD npm install -g node-gyp node-pre-gyp
$STD npm ci
$STD npm run build
$STD npm prune --omit=dev --omit=optional
cp -a {bin,dist,node_modules,resources,package*.json} "$APP_DIR"/
cp package.json "$APP_DIR"/bin
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export CI=1
corepack enable
# server build
$STD pnpm --filter immich --frozen-lockfile build
$STD pnpm --filter immich --frozen-lockfile --prod --no-optional deploy "$APP_DIR"
cp "$APP_DIR"/package.json "$APP_DIR"/bin
sed -i 's|^start|./start|' "$APP_DIR"/bin/immich-admin
cd "$SRC_DIR"/open-api/typescript-sdk
$STD npm ci
$STD npm run build
cd "$SRC_DIR"/web
$STD npm ci
$STD npm run build
# openapi & web build
cd "$SRC_DIR"
export SHARP_FORCE_GLOBAL_LIBVIPS=true
$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
cp LICENSE "$APP_DIR"
cd "$APP_DIR"
export SHARP_FORCE_GLOBAL_LIBVIPS=true
$STD npm install sharp
rm -rf "$APP_DIR"/node_modules/@img/sharp-{libvips*,linuxmusl-x64}
# cli build
$STD pnpm --filter @immich/sdk --filter @immich/cli --frozen-lockfile install
$STD pnpm --filter @immich/sdk --filter @immich/cli build
$STD pnpm --filter @immich/cli --prod --no-optional deploy "$APP_DIR"/cli
msg_ok "Installed Immich Server and Web Components"
cd "$SRC_DIR"/machine-learning
mkdir -p "$ML_DIR"
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
$STD uv venv "$VIRTUAL_ENV"
if [[ -f ~/.openvino ]]; then
@ -337,10 +337,6 @@ sed -i "s@\"/cache\"@\"$INSTALL_DIR/cache\"@g" "$ML_DIR"/immich_ml/config.py
ln -s "$UPLOAD_DIR" "$APP_DIR"/upload
ln -s "$UPLOAD_DIR" "$ML_DIR"/upload
msg_info "Installing Immich CLI"
$STD npm i -g @immich/cli
msg_ok "Installed Immich CLI"
msg_info "Installing GeoNames data"
cd "$GEO_DIR"
URL_LIST=(
@ -400,10 +396,10 @@ cat <<EOF >"$APP_DIR"/bin/start.sh
#!/usr/bin/env bash
set -a
. "$INSTALL_DIR"/.env
. ${INSTALL_DIR}/.env
set +a
/usr/bin/node "$APP_DIR"/dist/main.js "\$@"
/usr/bin/node ${APP_DIR}/dist/main.js "\$@"
EOF
chmod +x "$ML_DIR"/ml_start.sh "$APP_DIR"/bin/start.sh
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service