@@ -18,28 +18,25 @@ ENV \
18
18
IMMICH_PORT="8080" \
19
19
MACHINE_LEARNING_CACHE_FOLDER="/config/machine-learning/models" \
20
20
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \
21
- TRANSFORMERS_CACHE="/config/machine-learning/models"
21
+ TRANSFORMERS_CACHE="/config/machine-learning/models" \
22
+ UV_PYTHON_INSTALL_DIR="/usr/local/bin"
22
23
23
24
RUN \
24
25
echo "**** install build packages ****" && \
26
+ echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/ /" >>/etc/apt/sources.list.d/cuda.list && \
27
+ curl -s "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub" | gpg --dearmor | tee /usr/share/keyrings/cuda-archive-keyring.gpg >/dev/null && \
28
+ printf "Package: *\n Pin: release l=NVIDIA CUDA\n Pin-Priority: 600" > /etc/apt/preferences.d/cuda && \
25
29
apt-get update && \
26
30
apt-get install --no-install-recommends -y \
27
- build-essential \
28
- python3-dev && \
31
+ build-essential && \
29
32
echo "**** install runtime packages ****" && \
30
33
apt-get install --no-install-recommends -y \
31
34
libcublas12 \
32
35
libcublaslt12 \
33
36
libcudart12 \
37
+ libcudnn9-cuda-12 \
34
38
libcufft11 \
35
- libcurand10 \
36
- python3 \
37
- python3-pip \
38
- python3-venv && \
39
- echo "**** download libcudnn ****" && \
40
- curl -o "/tmp/libcudnn9.deb" -L \
41
- "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/libcudnn9-cuda-12_9.2.1.18-1_amd64.deb" && \
42
- dpkg -i "/tmp/libcudnn9.deb" && \
39
+ libcurand10 && \
43
40
echo "**** download immich ****" && \
44
41
mkdir -p \
45
42
/tmp/immich && \
@@ -115,17 +112,23 @@ RUN \
115
112
mkdir -p \
116
113
/app/immich/machine-learning/ann && \
117
114
cd /tmp/immich/machine-learning && \
118
- pip install --break-system-packages -U --no-cache-dir \
119
- poetry && \
120
- python3 -m venv /lsiopy && \
121
- poetry config installer.max-workers 10 && \
122
- poetry config virtualenvs.create false && \
123
- poetry install --sync --no-interaction --no-ansi --no-root --with cuda --without dev && \
115
+ if [ -z ${UV_VERSION} ]; then \
116
+ UV_VERSION=$(curl -sL https://api.github.com/repos/astral-sh/uv/releases/latest | \
117
+ jq -r '.tag_name' ); \
118
+ fi && \
119
+ curl -o \
120
+ /tmp/uv.tar.gz -L \
121
+ "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-x86_64-unknown-linux-gnu.tar.gz" && \
122
+ tar xf \
123
+ /tmp/uv.tar.gz -C \
124
+ /tmp --strip-components=1 && \
125
+ /tmp/uv python install --default --preview 3.11 && \
126
+ /tmp/uv sync --active --frozen --extra openvino --no-dev --no-editable --no-install-project --compile-bytecode --no-progress && \
124
127
cp -a \
125
128
pyproject.toml \
126
- poetry.lock \
127
129
app \
128
130
log_conf.json \
131
+ uv.lock \
129
132
/app/immich/machine-learning && \
130
133
cp -a \
131
134
ann/ann.py \
@@ -135,16 +138,18 @@ RUN \
135
138
find /usr/local/lib/python3.* /usr/lib/python3.* /lsiopy/lib/python3.* -name "${cleanfiles}" -delete; \
136
139
done && \
137
140
apt-get remove -y --purge \
138
- build-essential \
139
- python3-dev && \
141
+ build-essential && \
140
142
apt-get autoremove -y --purge && \
141
143
apt-get clean && \
142
144
rm -rf \
145
+ /etc/apt/preferences.d/cuda \
146
+ /etc/apt/sources.list.d/cuda.list \
147
+ /root/.cache \
148
+ /root/.npm
143
149
/tmp/* \
150
+ /usr/share/keyrings/cuda-archive-keyring.gpg \
144
151
/var/tmp/* \
145
152
/var/lib/apt/lists/* \
146
- /root/.cache \
147
- /root/.npm
148
153
149
154
# copy local files
150
155
COPY root/ /
0 commit comments