mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-11 13:22:08 +02:00
Immich: survive an interrupted update and a failing ML build (#17798)
* Immich: survive an interrupted update and a failing ML build An update cancelled midway leaves /opt/immich/app empty, and the next run died at once on cd /opt/immich/app/bin to enable maintenance mode (#17796). Maintenance mode is now only toggled when immich-admin exists. uv sync fetching the ml-models git dependency failed with "Could not resolve host" behind DNS filters such as AdGuard while DNS itself worked (#17797); running uv one download at a time got through. Retries now do that. If machine learning still cannot be built, the update no longer stops with maintenance mode on and every service down: it finishes, starts the web service, puts the previous version back into ~/.immich so the next update retries, and exits with an error. Updates are also announced as taking 5-15 minutes, since the first report came from cancelling one that looked stuck. * Immich: point immich-ml at the moved ml_start.sh and clear failed units The update moves ml_start.sh into app/machine-learning, but only rewrote immich-web's ExecStart, so older containers kept starting ML from /opt/immich/ml_start.sh and failed with 203/EXEC. Rewrite immich-ml the same way. A crash loop before the update can also leave both units rate-limited, which makes the final restart fail; reset them first.
This commit is contained in:
committed by
GitHub
parent
d271571ff7
commit
227526cf55
@@ -441,9 +441,11 @@ if [[ -f ~/.openvino ]]; then
|
||||
msg_ok "Pre-installed Python ${ML_PYTHON}"
|
||||
msg_info "Installing Intel OpenVINO machine-learning"
|
||||
for attempt in $(seq 1 3); do
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV,UV_HTTP_TIMEOUT -Pnu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p "${ML_PYTHON}" --managed-python && break
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV,UV_HTTP_TIMEOUT,UV_CONCURRENT_DOWNLOADS,UV_CONCURRENT_BUILDS,UV_CONCURRENT_INSTALLS -Pnu immich uv sync --extra openvino --no-dev --active --link-mode copy -n -p "${ML_PYTHON}" --managed-python && break
|
||||
[[ $attempt -eq 3 ]] && { msg_error "uv sync failed three times, the machine-learning environment was not built"; exit 1; }
|
||||
msg_warn "uv sync attempt $attempt failed, retrying..." && sleep 10
|
||||
# Parallel fetches can trip DNS rate limits (AdGuard, Pi-hole); retry one at a time.
|
||||
export UV_CONCURRENT_DOWNLOADS=1 UV_CONCURRENT_BUILDS=1 UV_CONCURRENT_INSTALLS=1
|
||||
msg_warn "uv sync attempt $attempt failed, retrying one download at a time..." && sleep 10
|
||||
done
|
||||
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.13/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-313-$(arch_resolve "x86_64" "aarch64")-linux-gnu.so"
|
||||
msg_ok "Installed Intel OpenVINO machine-learning"
|
||||
@@ -457,9 +459,11 @@ else
|
||||
msg_ok "Pre-installed Python ${ML_PYTHON}"
|
||||
msg_info "Installing machine-learning"
|
||||
for attempt in $(seq 1 3); do
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV,UV_HTTP_TIMEOUT -Pnu immich uv sync --extra cpu --no-dev --active --link-mode copy -n -p "${ML_PYTHON}" --managed-python && break
|
||||
$STD sudo --preserve-env=VIRTUAL_ENV,UV_HTTP_TIMEOUT,UV_CONCURRENT_DOWNLOADS,UV_CONCURRENT_BUILDS,UV_CONCURRENT_INSTALLS -Pnu immich uv sync --extra cpu --no-dev --active --link-mode copy -n -p "${ML_PYTHON}" --managed-python && break
|
||||
[[ $attempt -eq 3 ]] && { msg_error "uv sync failed three times, the machine-learning environment was not built"; exit 1; }
|
||||
msg_warn "uv sync attempt $attempt failed, retrying..." && sleep 10
|
||||
# Parallel fetches can trip DNS rate limits (AdGuard, Pi-hole); retry one at a time.
|
||||
export UV_CONCURRENT_DOWNLOADS=1 UV_CONCURRENT_BUILDS=1 UV_CONCURRENT_INSTALLS=1
|
||||
msg_warn "uv sync attempt $attempt failed, retrying one download at a time..." && sleep 10
|
||||
done
|
||||
msg_ok "Installed machine-learning"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user