1
- #
1
+ ##
2
2
# Copyright (c) 2020-2023 Intel Corporation
3
- #
4
3
# Licensed under the Apache License, Version 2.0 (the "License");
5
4
# you may not use this file except in compliance with the License.
6
5
# You may obtain a copy of the License at
12
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
12
# See the License for the specific language governing permissions and
14
13
# limitations under the License.
15
- #
16
14
17
- ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.5
15
+ ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.6
18
16
ARG BUILD_IMAGE=build
19
17
ARG PKG_IMAGE=pkg
20
- ARG RELEASE_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi -minimal:9.5
18
+ ARG RELEASE_BASE_IMAGE=registry.access.redhat.com/ubi9-minimal:9.6
21
19
22
20
FROM $BASE_IMAGE as base_build
23
- ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.5
21
+ ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.6
24
22
25
23
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
26
24
27
- ARG JOBS=8
28
- ARG VERBOSE_LOGS=OFF
29
- ARG LTO_ENABLE=OFF
30
- ARG LTO_CXX_FLAGS=""
31
- ARG LTO_LD_FLAGS="-Wl,-z,relro "
25
+ ARG JOBS=16
26
+ ARG VERBOSE_LOGS=ON
27
+ ARG LTO_ENABLE=ON
28
+ ARG LTO_CXX_FLAGS="-flto=auto -ffat-lto-objects -march=haswell "
29
+ ARG LTO_LD_FLAGS="-flto=auto -ffat-lto-objects "
32
30
33
31
# hadolint ignore=DL3041
34
32
RUN echo -e "max_parallel_downloads=8\nretries=50" >> /etc/dnf/dnf.conf && \
@@ -101,13 +99,13 @@ RUN if [ "$VERBOSE_LOGS" == "ON" ] ; then export VERBOSE=1 ; fi && ./install_ope
101
99
102
100
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
103
101
FROM base_build as build
104
- ARG BASE_IMAGE
102
+ ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.6
105
103
106
104
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
107
105
108
- ARG JOBS=40
109
- ARG VERBOSE_LOGS=OFF
110
- ARG LTO_ENABLE=OFF
106
+ ARG JOBS=16
107
+ ARG VERBOSE_LOGS=ON
108
+ ARG LTO_ENABLE=ON
111
109
112
110
# hadolint ignore=DL3041
113
111
RUN dnf install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/opencl-headers-3.0-6.20201007gitd65bcc5.el9.noarch.rpm && \
@@ -123,7 +121,7 @@ RUN dnf install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os
123
121
unzip \
124
122
vim \
125
123
xz \
126
- python3-devel \
124
+ python3-devel \
127
125
libicu-devel && \
128
126
dnf clean all
129
127
@@ -157,15 +155,15 @@ RUN dnf install -y https://github.com/linux-test-project/lcov/releases/download
157
155
158
156
ENV TF_SYSTEM_LIBS="curl"
159
157
ENV TEST_LOG="/root/.cache/bazel/_bazel_root/bc57d4817a53cab8c785464da57d1983/execroot/ovms/bazel-out/test.log"
160
- ARG ov_source_branch=master
161
- ARG ov_contrib_branch=master
162
- ARG ov_source_org=openvinotoolkit
163
- ARG ov_contrib_org=openvinotoolkit
158
+ ARG ov_source_branch=releases/2025/1
159
+ ARG ov_contrib_branch=releases/2025/1
160
+ ARG ov_source_org=opendatahub-io
161
+ ARG ov_contrib_org=opendatahub-io
164
162
ARG ov_use_binary=0
165
163
ARG DLDT_PACKAGE_URL
166
164
ARG TEMP_DIR=/tmp/openvino_installer
167
165
ARG CMAKE_BUILD_TYPE=Release
168
- ARG debug_bazel_flags="--strip=always -- config=mp_on_py_on --//:distro=redhat"
166
+ ARG debug_bazel_flags="--strip=always --define MEDIAPIPE_DISABLE=0 --define PYTHON_DISABLE=0 -- config=mp_on_py_on --verbose_failures -- //:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16 "
169
167
170
168
################### BUILD OPENVINO FROM SOURCE - buildarg ov_use_binary=0 ############################
171
169
# hadolint ignore=DL3041
@@ -222,7 +220,7 @@ RUN if [ -f /opt/intel/openvino/samples/cpp/build_samples.sh ]; then /opt/intel
222
220
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
223
221
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/intel/openvino/runtime/lib/intel64/:/opt/opencv/lib/:/opt/intel/openvino/runtime/3rdparty/tbb/lib/
224
222
225
- ARG ov_tokenizers_branch=master
223
+ ARG ov_tokenizers_branch=releases/2025/1
226
224
# hadolint ignore=DL3003
227
225
RUN git clone https://github.com/openvinotoolkit/openvino_tokenizers.git /openvino_tokenizers && cd /openvino_tokenizers && git checkout $ov_tokenizers_branch && git submodule update --init --recursive
228
226
WORKDIR /openvino_tokenizers/build
@@ -281,7 +279,7 @@ ENV PYTHONPATH=/opt/intel/openvino/python:/ovms/bazel-bin/src/python/binding
281
279
282
280
WORKDIR /ovms
283
281
284
- ARG PROJECT_VERSION="2025.1"
282
+ ARG PROJECT_VERSION="2025.1.0 "
285
283
LABEL description="OpenVINO Model Server"
286
284
ARG minitrace_flags
287
285
@@ -323,26 +321,49 @@ RUN python3 -c "import json; m={'PROJECT_VERSION':'${PROJECT_VERSION}','OPENVINO
323
321
324
322
FROM $BUILD_IMAGE as capi-build
325
323
# C api shared library
326
- ARG CAPI_FLAGS="--strip=always --config=mp_off_py_off --//:distro=redhat"
327
- ARG JOBS=40
328
- RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:ovms_shared
324
+ ARG CAPI_FLAGS="--strip=always --config=mp_off_py_off --verbose_failures --//:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16 --subcommands"
325
+ ARG JOBS=16
326
+
327
+ #RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:ovms_shared
328
+
329
+ RUN mkdir -p /tmp/bazel-output && \
330
+ bazel --output_base=/tmp/bazel-output \
331
+ build //src:ovms_shared && \
332
+ find /tmp/bazel-output -name libovms_shared.so && \
333
+ LIB_PATH=$(find /tmp/bazel-output -name libovms_shared.so | head -n1) && \
334
+ echo "Found built file: $LIB_PATH" && \
335
+ mkdir -p /ovms_release/lib && \
336
+ cp -v "$LIB_PATH" /ovms_release/lib/
337
+
329
338
330
339
# C api app with bazel
331
340
# hadolint ignore=DL3059
332
341
RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:capi_cpp_example
333
342
334
343
# C-API benchmark app
335
- RUN bazel build --jobs=$JOBS ${CAPI_FLAGS} //src:capi_benchmark && ./bazel-bin/src/capi_benchmark --niter 2 --nstreams 1 --servable_name "dummy"
336
- # C-api C/C++ app with gcc
337
- COPY MakefileCapi /ovms/
338
- RUN make -f MakefileCapi cpp CAPI_FLAGS="${CAPI_FLAGS}" && \
339
- make -f MakefileCapi c CAPI_FLAGS="${CAPI_FLAGS}"
344
+ RUN bazel build --jobs=$JOBS ${CAPI_FLAGS} //src:capi_benchmark
345
+
346
+ #workaround for debugging
347
+ #RUN find /root/.cache/bazel/ -type f -name '*capi_benchmark*'
348
+
349
+ #RUN ls -al /ovms_release/lib/
350
+
351
+ RUN pwd && ls -al
352
+
353
+ RUN bazel build --jobs=$JOBS ${CAPI_FLAGS} //src:capi_benchmark && \
354
+ echo "WORKDIR at build-time: $PWD" && \
355
+ bazel info bazel-bin && \
356
+ find $(bazel info bazel-bin)/src -type f -name capi_benchmark
340
357
341
358
RUN mkdir -p /ovms_release/lib/ ; find /ovms/bazel-out/k8-*/bin -iname 'libovms_shared.so' -exec cp -v {} /ovms_release/lib/ \;
359
+ #RUN mkdir -p /ovms_release/lib/ ; find $(bazel info bazel-bin) -iname 'libovms_shared.so' -exec cp -v {} /ovms_release/lib/ \;
360
+
361
+ #debuggig to find the correct lib file
362
+
342
363
343
364
FROM $BUILD_IMAGE as pkg
344
365
345
- RUN mkdir /patchelf
366
+ RUN mkdir /patchelf
346
367
WORKDIR /patchelf
347
368
# hadolint ignore=DL3003
348
369
RUN wget -q https://github.com/NixOS/patchelf/archive/0.10.tar.gz && \
@@ -353,7 +374,11 @@ WORKDIR /
353
374
ARG BASE_OS=redhat
354
375
ARG ov_use_binary=0
355
376
ARG FUZZER_BUILD=0
356
- ARG debug_bazel_flags="--strip=always --config=mp_on_py_on --//:distro=redhat"
377
+ ARG debug_bazel_flags="--strip=always --define MEDIAPIPE_DISABLE=0 --define PYTHON_DISABLE=0 --config=mp_on_py_on --verbose_failures --//:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16"
378
+
379
+ #workaround to debug
380
+ RUN find / -name libovms_shared.so 2>/dev/null || echo "Not found"
381
+
357
382
COPY --from=capi-build /ovms_release/lib/libovms_shared.so /ovms_release/lib/
358
383
COPY create_package.sh /
359
384
RUN ./create_package.sh ; if ! [[ $debug_bazel_flags == *"_py_off"* ]]; then \
@@ -378,11 +403,11 @@ LABEL "description"="OpenVINO(TM) Model Server is a solution for serving AI mode
378
403
LABEL "maintainer"="
[email protected] "
379
404
ARG INSTALL_RPMS_FROM_URL=
380
405
ARG INSTALL_DRIVER_VERSION="23.22.26516"
381
- ARG GPU=0
382
- ARG debug_bazel_flags=
406
+ ARG GPU=1
407
+ ARG debug_bazel_flags="--strip=always --define MEDIAPIPE_DISABLE=0 --define PYTHON_DISABLE=0 --config=mp_on_py_on --verbose_failures --//:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16"
383
408
LABEL bazel-build-flags=${debug_bazel_flags}
384
409
LABEL supported-devices="CPU=1 GPU=${GPU}"
385
- ARG RELEASE_BASE_IMAGE
410
+ ARG RELEASE_BASE_IMAGE=registry.access.redhat.com/ubi9-minimal:9.6
386
411
LABEL base-image=${RELEASE_BASE_IMAGE}
387
412
388
413
ENV PYTHONPATH=/ovms/lib/python:/ovms/python_deps
0 commit comments