Skip to content

Commit 9ecacbc

Browse files
authored
RHAIENG-948: fix(jupyter datascience on IBM/Power): build failure due to AIPCC base (missing curl and openssl -devel packages) and AIPCC wheels (some prereqs are missing) (#1697)
* RHAIENG-948: fix(ppc): build failure due to missing curl add `libcurl-devel` to build dependencies for `ppc64le` and `s390x` in pyarrow and onnx builds ``` -- Building AWS C++ SDK from source CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) ``` # Conflicts: # jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu * RHAIENG-948: fix(ppc): build failure due to missing openssl add `libcurl-devel` to build dependencies for `ppc64le` and `s390x` in pyarrow and onnx builds ``` -- Configuring done (1.8s) -- Generating done (0.1s) CMake Error at cmake_modules/ThirdpartyToolchain.cmake:5282 (set_property): The link interface of target "AWS::aws-c-cal" contains: OpenSSL::Crypto but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. ``` * RHAIENG-948: fix(ppc): build failure due to missing cython in aipcc wheel index ``` + pip install --no-cache-dir -r requirements-build.txt Looking in indexes: https://console.redhat.com/api/pypi/public-rhai/rhoai/3.0/cpu-ubi9/simple/ Ignoring oldest-supported-numpy: markers 'python_version < "3.9"' don't match your environment ERROR: Could not find a version that satisfies the requirement cython>=0.29.31 (from versions: none) ERROR: No matching distribution found for cython>=0.29.31 ``` * RHAIENG-948: fix(ppc): build failure due to missing numpy in aipcc wheel index ``` + pip install --no-cache-dir -r requirements.txt Looking in indexes: https://console.redhat.com/api/pypi/public-rhai/rhoai/3.0/cpu-ubi9/simple/ ERROR: Could not find a version that satisfies the requirement numpy>=1.22 (from versions: none) ERROR: No matching distribution found for numpy>=1.22 subprocess exited with status 1 ``` * RHAIENG-948: fix(ppc): build failure due to missing protobuf>=4.25.1 in aipcc wheel index ``` + pip wheel . -w /root/onnx_wheel ... ERROR: Could not find a version that satisfies the requirement protobuf>=4.25.1 (from versions: none) ERROR: No matching distribution found for protobuf>=4.25.1 [end of output] ``` * RHAIENG-948: fix(ppc): build failure due to missing numpy>=1.16.6 in aipcc wheel index ``` + pip install --no-cache-dir /tmp/wheels/pyarrow-17.0.0-cp312-cp312-linux_ppc64le.whl Looking in indexes: https://console.redhat.com/api/pypi/public-rhai/rhoai/3.0/cpu-ubi9/simple/ Processing /tmp/wheels/pyarrow-17.0.0-cp312-cp312-linux_ppc64le.whl INFO: pip is looking at multiple versions of pyarrow to determine which version is compatible with other requirements. This could take a while. ERROR: Could not find a version that satisfies the requirement numpy>=1.16.6 (from pyarrow) (from versions: none) ERROR: No matching distribution found for numpy>=1.16.6 ``` * Add `subscription-manager register` step for base image initialization * RHAIENG-948: fix(ppc): build failure due to missing cryptography build dependencies in aipcc wheel index ``` × Failed to download and build `cryptography==43.0.3` ├─▶ Failed to resolve requirements from `build-system.requires` ├─▶ No solution found when resolving: `maturin>=1, <2`, `cffi>=1.12 │ ; platform_python_implementation != 'PyPy'`, `setuptools!=74.0.0, │ !=74.1.0, !=74.1.1, !=74.1.2, !=74.1.3, !=75.0.0, !=75.1.0, !=75.2.0` ╰─▶ Because only maturin==1.9.6 is available and maturin==1.9.6 has no wheels with a matching platform tag (e.g., `manylinux_2_34_ppc64le`), we can conclude that maturin==1.9.6 cannot be used. And because you require maturin==1.9.6, we can conclude that your requirements are unsatisfiable. hint: Wheels are available for `maturin` (v1.9.6) on the following platforms: `linux_aarch64`, `linux_x86_64` ``` * RHAIENG-948: fix(ppc): build failure due to missing zlib-devel to build pillow ``` line 20, in run_setup return super().run_setup(setup_script) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/.tmpoAXecA/builds-v0/.tmpeN0QF3/lib64/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup exec(code, locals()) File "<string>", line 1108, in <module> RequiredDependencyException: The headers or library files could not be found for zlib, a required dependency when compiling Pillow from source. ``` * RHAIENG-948: fix(ppc): build failure due to missing libjpeg-turbo-devel to build pillow ``` The headers or library files could not be found for jpeg, a required dependency when compiling Pillow from source. Please see the install instructions at: https://pillow.readthedocs.io/en/latest/installation/basic-installation.html ``` * RHAIENG-948: fix(ppc): build failure due to missing openssl-devel to build maturin ``` Could not find openssl via pkg-config: pkg-config exited with status code 1 > PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags openssl The system library `openssl` required by crate `openssl-sys` was not found. The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory. PKG_CONFIG_PATH contains the following: - /usr/local/lib/pkgconfig/ HINT: you may need to install a package such as openssl, openssl-dev or openssl-devel. ... Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the `OPENSSL_DIR` environment variable for the compilation process. Make sure you also have the development packages of openssl installed. For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora. ... warning: build failed, waiting for other jobs to finish... 💥 maturin failed Caused by: Failed to build a native library through cargo Caused by: Cargo build finished with "exit status: ``` * RHAIENG-948: fix(ppc): build failure due to missing fortran to build scikit-learn ``` × Failed to download and build `scikit-learn==1.7.2` ├─▶ Failed to install requirements from `build-system.requires` ├─▶ Failed to build `scipy==1.16.3` ├─▶ The build backend returned an error ╰─▶ Call to `mesonpy.build_wheel` failed (exit status: 1) [stdout] + meson setup ... ../meson.build:88:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang-new'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']] The following exception(s) were encountered: Running `gfortran --help` gave "[Errno 2] No such file or directory: 'gfortran'" ```
1 parent d1dac1c commit 9ecacbc

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

jupyter/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ EOF
4141
####################
4242
FROM ${BASE_IMAGE} AS cpu-base
4343
USER 0
44+
RUN subscription-manager register --org 18631088 --activationkey thisisunsafe
4445
RUN subscription-manager refresh
4546

4647
WORKDIR /opt/app-root/bin
@@ -146,7 +147,13 @@ RUN --mount=type=cache,target=/root/.cache/pip \
146147
set -Eeuxo pipefail
147148
if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then
148149
# Install build dependencies (shared for pyarrow and onnx)
149-
dnf install -y cmake make gcc-c++ pybind11-devel wget
150+
packages=(
151+
cmake make gcc-c++ pybind11-devel wget
152+
# pyarrow -DARROW_S3=ON pulls in AWS C++ SDK
153+
# libcurl-devel is required to build AWS C++ SDK
154+
libcurl-devel openssl-devel
155+
)
156+
dnf install -y "${packages[@]}"
150157
dnf clean all
151158
# Build and collect pyarrow wheel
152159
git clone --depth 1 --branch "apache-arrow-17.0.0" https://github.com/apache/arrow.git
@@ -175,7 +182,8 @@ if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then
175182
make -j$(nproc) VERBOSE=1
176183
make install -j$(nproc)
177184
cd ../../python
178-
pip install --no-cache-dir -r requirements-build.txt
185+
# aipcc index is missing cython, and maybe more
186+
pip install --no-cache-dir --extra-index-url https://pypi.org/simple -r requirements-build.txt
179187
PYARROW_WITH_PARQUET=1 \
180188
PYARROW_WITH_DATASET=1 \
181189
PYARROW_WITH_FILESYSTEM=1 \
@@ -226,10 +234,12 @@ if [ "${TARGETARCH}" = "ppc64le" ]; then
226234
cd onnx
227235
git checkout ${ONNX_VERSION}
228236
git submodule update --init --recursive
229-
pip install --no-cache-dir -r requirements.txt
237+
# aipcc index does not have numpy>=1.22
238+
pip install --no-cache-dir --extra-index-url https://pypi.org/simple -r requirements.txt
230239
CMAKE_ARGS="-DPython3_EXECUTABLE=$(which python3.12)"
231240
export CMAKE_ARGS
232-
pip wheel . -w /root/onnx_wheel
241+
# protobuf>=4.25.1
242+
pip wheel --extra-index-url https://pypi.org/simple . -w /root/onnx_wheel
233243
else
234244
echo "Skipping ONNX build on non-Power"
235245
mkdir -p /root/onnx_wheel
@@ -328,7 +338,8 @@ COPY --from=pyarrow-builder /tmp/wheels /tmp/wheels
328338
RUN /bin/bash <<'EOF'
329339
set -Eeuxo pipefail
330340
if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then
331-
pip install --no-cache-dir /tmp/wheels/*.whl
341+
# aipcc is lacking numpy>=1.16.6
342+
pip install --no-cache-dir --extra-index-url https://pypi.org/simple /tmp/wheels/*.whl
332343
else
333344
echo "Skipping wheel install for $TARGETARCH"
334345
fi
@@ -342,7 +353,8 @@ COPY --from=onnx-builder /root/onnx_wheel/ /onnxwheels/
342353
RUN /bin/bash <<'EOF'
343354
set -Eeuxo pipefail
344355
if [ "${TARGETARCH}" = "ppc64le" ]; then
345-
pip install --no-cache-dir /onnxwheels/*.whl
356+
# aipcc is sure to lack something, so add extra index preemptively
357+
pip install --no-cache-dir --extra-index-url https://pypi.org/simple /onnxwheels/*.whl
346358
else
347359
echo "Skipping ONNX/OpenBLAS install on non-Power"
348360
fi
@@ -368,6 +380,26 @@ else
368380
fi
369381
EOF
370382

383+
RUN /bin/bash <<'EOF'
384+
set -Eeuxo pipefail
385+
if [ "${TARGETARCH}" = "ppc64le" ]; then
386+
packages=(
387+
# required to compile pillow
388+
zlib-devel libjpeg-turbo-devel
389+
# optional pillow deps https://pillow.readthedocs.io/en/latest/installation/building-from-source.html#external-libraries
390+
#libtiff-devel libwebp-devel openjpeg2-devel lcms2-devel freetype-devel
391+
#libimagequant-devel harfbuzz-devel fribidi-devel
392+
393+
# required to compile maturin
394+
openssl-devel
395+
396+
# required to compile scikit-learn
397+
gcc-gfortran
398+
)
399+
dnf install -y "${packages[@]}"
400+
fi
401+
EOF
402+
371403
USER 1001:0
372404

373405
# Install Python packages and Jupyterlab extensions from pylock.toml
@@ -382,10 +414,12 @@ echo "Installing software and packages"
382414
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
383415
if [ "$TARGETARCH" = "ppc64le" ] || [ "$TARGETARCH" = "s390x" ]; then
384416
# We need special flags and environment variables when building packages
417+
# aipcc does not have some dependencies to build cryptography==43.0.3 on ppc64le, so we need to use pypi.org/simple
385418
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 \
386419
CFLAGS="-O3" CXXFLAGS="-O3" \
387420
uv pip install --strict --no-deps --no-cache --no-config --no-progress \
388421
--verify-hashes --compile-bytecode --index-strategy=unsafe-best-match \
422+
--extra-index-url https://pypi.org/simple \
389423
--requirements=./pylock.toml
390424
else
391425
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,

0 commit comments

Comments
 (0)