Skip to content

Commit fc17981

Browse files
use update file
1 parent 2cb255e commit fc17981

File tree

1 file changed

+38
-16
lines changed

1 file changed

+38
-16
lines changed

Dockerfile.redhat

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#
1+
##
22
# Copyright (c) 2020-2023 Intel Corporation
3-
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
54
# you may not use this file except in compliance with the License.
65
# You may obtain a copy of the License at
@@ -12,15 +11,14 @@
1211
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312
# See the License for the specific language governing permissions and
1413
# limitations under the License.
15-
#
1614

17-
ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.5
15+
ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.6
1816
ARG BUILD_IMAGE=build
1917
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
2119

2220
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
2422

2523
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
2624

@@ -109,7 +107,6 @@ ARG JOBS=16
109107
ARG VERBOSE_LOGS=ON
110108
ARG LTO_ENABLE=ON
111109

112-
113110
# hadolint ignore=DL3041
114111
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 && \
115112
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
124121
unzip \
125122
vim \
126123
xz \
127-
python3-devel \
124+
python3-devel \
128125
libicu-devel && \
129126
dnf clean all
130127

@@ -146,7 +143,6 @@ RUN python3 --version && python3 -m pip install "numpy<2.0.0" --no-cache-dir &&
146143
python3 --version && python3 -m pip install "Jinja2==3.1.6" "MarkupSafe==3.0.2" --no-cache-dir
147144

148145
# Set up Bazel
149-
150146
ENV BAZEL_VERSION 6.1.1
151147
WORKDIR /bazel
152148
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
327323
# C api shared library
328324
ARG CAPI_FLAGS="--strip=always --config=mp_off_py_off --verbose_failures --//:distro=redhat --local_ram_resources=23552 --local_cpu_resources=16 --subcommands"
329325
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+
331338

332339
# C api app with bazel
333340
# hadolint ignore=DL3059
334341
RUN bazel build --jobs $JOBS ${CAPI_FLAGS} //src:capi_cpp_example
335342

336343
# 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
342357

343358
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+
344363

345364
FROM $BUILD_IMAGE as pkg
346365

347-
RUN mkdir /patchelf
366+
RUN mkdir /patchelf
348367
WORKDIR /patchelf
349368
# hadolint ignore=DL3003
350369
RUN wget -q https://github.com/NixOS/patchelf/archive/0.10.tar.gz && \
@@ -357,6 +376,9 @@ ARG ov_use_binary=0
357376
ARG FUZZER_BUILD=0
358377
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"
359378

379+
#workaround to debug
380+
RUN find / -name libovms_shared.so 2>/dev/null || echo "Not found"
381+
360382
COPY --from=capi-build /ovms_release/lib/libovms_shared.so /ovms_release/lib/
361383
COPY create_package.sh /
362384
RUN ./create_package.sh ; if ! [[ $debug_bazel_flags == *"_py_off"* ]]; then \

0 commit comments

Comments
 (0)