@@ -242,14 +242,6 @@ ENV PATH="/home/venv/bin:$PATH"
242
242
243
243
WORKDIR /home/model-server
244
244
245
- FROM torchserve-base AS compile-cpu
246
-
247
- COPY serving/torchserve-requirements.txt .
248
- COPY requirements.txt .
249
-
250
- RUN python -m pip install --no-cache-dir -r requirements.txt && \
251
- python -m pip install --no-cache-dir -r torchserve-requirements.txt
252
-
253
245
RUN echo -e "#!/bin/bash \n \
254
246
set -e \n \
255
247
if [[ \"\$ 1\" = " serve" ]]; then \n \
@@ -260,22 +252,20 @@ else \n\
260
252
fi \n \
261
253
tail -f /dev/null" >> /usr/local/bin/dockerd-entrypoint.sh
262
254
255
+ FROM torchserve-base AS compile-cpu
256
+
257
+ COPY serving/torchserve-requirements.txt .
258
+ COPY requirements.txt .
259
+
260
+ RUN python -m pip install --no-cache-dir -r requirements.txt && \
261
+ python -m pip install --no-cache-dir -r torchserve-requirements.txt
262
+
263
263
FROM torchserve-base AS compile-xpu
264
264
265
265
COPY serving/torchserve-xpu-requirements.txt .
266
266
267
267
RUN python -m pip install --no-cache-dir -r torchserve-xpu-requirements.txt
268
268
269
- RUN echo -e "#!/bin/bash \n \
270
- set -e \n \
271
- if [[ \"\$ 1\" = " serve" ]]; then \n \
272
- shift 1 \n \
273
- torchserve --start --ts-config /home/model-server/config.properties --workflow-store /home/model-server/wf-store \n \
274
- else \n \
275
- eval \"\$ @\" \n \
276
- fi \n \
277
- tail -f /dev/null" >> /usr/local/bin/dockerd-entrypoint.sh
278
-
279
269
FROM torchserve-base AS torchserve-cpu
280
270
281
271
USER model-server
@@ -311,6 +301,8 @@ RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] http
311
301
312
302
RUN apt-get update && \
313
303
apt-get install -y --no-install-recommends \
304
+ jq \
305
+ curl \
314
306
libnl-genl-3-200 \
315
307
intel-gsc \
316
308
libdrm2 \
@@ -319,29 +311,25 @@ RUN apt-get update && \
319
311
apt-get autoremove -y && \
320
312
rm -rf /var/lib/apt/lists/*
321
313
322
- ARG XPU_SMI_BINARY
314
+ ARG XPU_SMI_VERSION
323
315
324
- RUN wget -q --no-check-certificate ${XPU_SMI_BINARY} && \
325
- ldconfig && dpkg -i --force-all *.deb && \
326
- rm -rf *.deb /etc/apt/sources.list.d/intel-gpu-jammy.list /etc/apt/sources.list.d/oneAPI.list
316
+ ARG API_URL=https://api.github.com/repos/intel/xpumanager/releases/tags/V${XPU_SMI_VERSION}
327
317
328
- ENV LD_LIBRARY_PATH=/opt/intel/oneapi/redist/lib:$LD_LIBRARY_PATH
318
+ RUN curl -H "Accept: application/vnd.github.v3+json" -H "User-Agent: MyClient/1.0.0" "$API_URL" >> /tmp/asset_data.txt && \
319
+ wget -q --no-check-certificate $(cat /tmp/asset_data.txt | jq -r '.assets[] | select(.name | test("^xpu-smi.*u22\\ .04_amd64\\ .deb$")) | .browser_download_url' ) && \
320
+ ldconfig && dpkg -i --force-all *.deb && \
321
+ rm -rf *.deb /etc/apt/sources.list.d/intel-gpu-jammy.list /etc/apt/sources.list.d/oneAPI.list /tmp/asset_data.txt
329
322
330
- ARG model-server
331
- ARG GID
332
- ARG GNAME=render
333
- ARG VNAME=video
323
+ ARG GID=109
334
324
335
- RUN groupadd -g ${GID} ${GNAME}
325
+ RUN groupadd -g ${GID} render
336
326
337
- # RUN useradd -m -s /bin/bash model-server
338
- RUN usermod -aG ${VNAME},${GNAME} model-server
327
+ RUN usermod -aG video,render model-server
339
328
340
329
USER model-server
341
330
342
331
WORKDIR /home/model-server
343
332
344
-
345
333
RUN wget --progress=dot:giga https://raw.githubusercontent.com/pytorch/serve/master/examples/intel_extension_for_pytorch/intel_gpu_metric_collector.py && \
346
334
wget --progress=dot:giga https://raw.githubusercontent.com/pytorch/serve/master/examples/intel_extension_for_pytorch/intel_gpu.py
347
335
0 commit comments