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
@@ -109,7 +107,6 @@ ARG JOBS=16
109
107
ARG VERBOSE_LOGS=ON
110
108
ARG LTO_ENABLE=ON
111
109
112
-
113
110
# hadolint ignore=DL3041
114
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 && \
115
112
dnf update -d6 -y && dnf install -d6 -y \
@@ -124,7 +121,7 @@ RUN dnf install -y https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os
124
121
unzip \
125
122
vim \
126
123
xz \
127
- python3-devel \
124
+ python3-devel \
128
125
libicu-devel && \
129
126
dnf clean all
130
127
@@ -146,7 +143,6 @@ RUN python3 --version && python3 -m pip install "numpy<2.0.0" --no-cache-dir &&
146
143
python3 --version && python3 -m pip install "Jinja2==3.1.6" "MarkupSafe==3.0.2" --no-cache-dir
147
144
148
145
# Set up Bazel
149
-
150
146
ENV BAZEL_VERSION 6.1.1
151
147
WORKDIR /bazel
152
148
RUN curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
@@ -327,24 +323,47 @@ FROM $BUILD_IMAGE as capi-build
327
323
# C api shared library
328
324
ARG CAPI_FLAGS="--strip=always --config=mp_off_py_off --verbose_failures --//:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16 --subcommands"
329
325
ARG JOBS=16
330
- RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:ovms_shared
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
+
331
338
332
339
# C api app with bazel
333
340
# hadolint ignore=DL3059
334
341
RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:capi_cpp_example
335
342
336
343
# C-API benchmark app
337
- RUN bazel build --jobs=$JOBS ${CAPI_FLAGS} //src:capi_benchmark && ./bazel-bin/src/capi_benchmark --niter 2 --nstreams 1 --servable_name "dummy"
338
- # C-api C/C++ app with gcc
339
- COPY MakefileCapi /ovms/
340
- RUN make -f MakefileCapi cpp CAPI_FLAGS="${CAPI_FLAGS}" && \
341
- 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
342
357
343
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
+
344
363
345
364
FROM $BUILD_IMAGE as pkg
346
365
347
- RUN mkdir /patchelf
366
+ RUN mkdir /patchelf
348
367
WORKDIR /patchelf
349
368
# hadolint ignore=DL3003
350
369
RUN wget -q https://github.com/NixOS/patchelf/archive/0.10.tar.gz && \
@@ -357,6 +376,9 @@ ARG ov_use_binary=0
357
376
ARG FUZZER_BUILD=0
358
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"
359
378
379
+ #workaround to debug
380
+ RUN find / -name libovms_shared.so 2>/dev/null || echo "Not found"
381
+
360
382
COPY --from=capi-build /ovms_release/lib/libovms_shared.so /ovms_release/lib/
361
383
COPY create_package.sh /
362
384
RUN ./create_package.sh ; if ! [[ $debug_bazel_flags == *"_py_off"* ]]; then \
0 commit comments