Immich UV test (#5032)
- Simplifies UV use in Immich install & update - Uses Python 3.11 (No official support for 3.12 yet) - Restores python3-dev package
This commit is contained in:
parent
0c04d8900b
commit
84e93cd7d0
20
ct/immich.sh
20
ct/immich.sh
@ -27,6 +27,9 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setup_uv
|
||||||
|
|
||||||
STAGING_DIR=/opt/staging
|
STAGING_DIR=/opt/staging
|
||||||
BASE_DIR=${STAGING_DIR}/base-images
|
BASE_DIR=${STAGING_DIR}/base-images
|
||||||
SOURCE_DIR=${STAGING_DIR}/image-source
|
SOURCE_DIR=${STAGING_DIR}/image-source
|
||||||
@ -251,23 +254,16 @@ EOF
|
|||||||
msg_ok "Updated ${APP} web and microservices"
|
msg_ok "Updated ${APP} web and microservices"
|
||||||
|
|
||||||
cd "$SRC_DIR"/machine-learning
|
cd "$SRC_DIR"/machine-learning
|
||||||
$STD python3 -m venv "$ML_DIR"/ml-venv
|
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
|
||||||
|
$STD uv venv "$VIRTUAL_ENV"
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
msg_info "Updating HW-accelerated machine-learning"
|
msg_info "Updating HW-accelerated machine-learning"
|
||||||
(
|
uv -q sync --extra openvino --no-cache --active
|
||||||
source "$ML_DIR"/ml-venv/bin/activate
|
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so"
|
||||||
$STD pip3 install -U uv
|
|
||||||
uv -q sync --extra openvino --no-cache --active
|
|
||||||
)
|
|
||||||
patchelf --clear-execstack "$ML_DIR"/ml-venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so
|
|
||||||
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"
|
||||||
(
|
uv -q sync --extra cpu --no-cache --active
|
||||||
source "$ML_DIR"/ml-venv/bin/activate
|
|
||||||
$STD pip3 install -U uv
|
|
||||||
uv -q sync --extra cpu --no-cache --active
|
|
||||||
)
|
|
||||||
msg_ok "Updated machine-learning"
|
msg_ok "Updated machine-learning"
|
||||||
fi
|
fi
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
|
@ -13,7 +13,7 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
PYTHON_VERSION="3.12" setup_uv
|
setup_uv
|
||||||
|
|
||||||
msg_info "Configuring apt and installing dependencies"
|
msg_info "Configuring apt and installing dependencies"
|
||||||
echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list
|
echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list
|
||||||
@ -29,6 +29,7 @@ $STD apt-get install --no-install-recommends -y \
|
|||||||
redis \
|
redis \
|
||||||
autoconf \
|
autoconf \
|
||||||
build-essential \
|
build-essential \
|
||||||
|
python3-dev \
|
||||||
cmake \
|
cmake \
|
||||||
jq \
|
jq \
|
||||||
libbrotli-dev \
|
libbrotli-dev \
|
||||||
@ -304,22 +305,16 @@ cp LICENSE "$APP_DIR"
|
|||||||
msg_ok "Installed Immich Web Components"
|
msg_ok "Installed Immich Web Components"
|
||||||
|
|
||||||
cd "$SRC_DIR"/machine-learning
|
cd "$SRC_DIR"/machine-learning
|
||||||
$STD uv venv "$ML_DIR/.venv"
|
export VIRTUAL_ENV="${ML_DIR}/ml-venv"
|
||||||
$ML_DIR/.venv/bin/uv pip install --upgrade uv
|
$STD uv venv "$VIRTUAL_ENV"
|
||||||
$ML_DIR/.venv/bin/uv sync --no-cache
|
|
||||||
cd "$SRC_DIR"/machine-learning
|
|
||||||
$STD uv venv "$ML_DIR/.venv"
|
|
||||||
$ML_DIR/.venv/bin/uv pip install --upgrade uv
|
|
||||||
|
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
msg_info "Installing HW-accelerated machine-learning"
|
msg_info "Installing HW-accelerated machine-learning"
|
||||||
$STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra openvino
|
uv -q sync --no-cache --extra openvino --active
|
||||||
patchelf --clear-execstack "$ML_DIR/.venv/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so"
|
patchelf --clear-execstack "${VIRTUAL_ENV}/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-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"
|
||||||
$STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra cpu
|
uv -q sync --no-cache --extra cpu --active
|
||||||
msg_ok "Installed machine-learning"
|
msg_ok "Installed machine-learning"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -396,7 +391,7 @@ set -a
|
|||||||
. ${INSTALL_DIR}/.env
|
. ${INSTALL_DIR}/.env
|
||||||
set +a
|
set +a
|
||||||
|
|
||||||
python -m immich_ml
|
python3 -m immich_ml
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$ML_DIR"/ml_start.sh
|
chmod +x "$ML_DIR"/ml_start.sh
|
||||||
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service
|
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service
|
||||||
|
Loading…
x
Reference in New Issue
Block a user