diff --git a/codeserver/ubi9-python-3.12/Dockerfile.cpu b/codeserver/ubi9-python-3.12/Dockerfile.cpu index 8738a4073..c349b924d 100644 --- a/codeserver/ubi9-python-3.12/Dockerfile.cpu +++ b/codeserver/ubi9-python-3.12/Dockerfile.cpu @@ -96,8 +96,6 @@ RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/ RUN --mount=type=cache,from=whl-cache,source=/root/OpenBLAS,target=/OpenBlas,rw \ bash -c ' \ if [[ $(uname -m) == "ppc64le" ]]; then \ - dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ - dnf install -y lcms2 libraqm libimagequant openjpeg2; \ PREFIX=/usr/ make install -C /OpenBlas; \ fi ' diff --git a/codeserver/ubi9-python-3.12/devel_env_setup.sh b/codeserver/ubi9-python-3.12/devel_env_setup.sh index badfef10a..4c30e8f82 100755 --- a/codeserver/ubi9-python-3.12/devel_env_setup.sh +++ b/codeserver/ubi9-python-3.12/devel_env_setup.sh @@ -9,10 +9,32 @@ set -eoux pipefail export WHEEL_DIR=${WHEEL_DIR:-"/wheelsdir"} mkdir -p ${WHEEL_DIR} +build_pillow() { + CURDIR=$(pwd) + + export PILLOW_VERSION=$1 + + TEMP_BUILD_DIR=$(mktemp -d) + cd ${TEMP_BUILD_DIR} + + : ================== Installing Pillow ================== + git clone --recursive https://github.com/python-pillow/Pillow.git -b ${PILLOW_VERSION} + cd Pillow + uv build --wheel --out-dir /pillowwheel + + : ================= Fix Pillow Wheel ==================== + cd /pillowwheel + uv pip install auditwheel + auditwheel repair pillow*.whl + mv wheelhouse/pillow*.whl ${WHEEL_DIR} + + cd ${CURDIR} + rm -rf ${TEMP_BUILD_DIR} +} build_pyarrow() { CURDIR=$(pwd) - export PYARROW_VERSION=${1:-$(curl -s https://api.github.com/repos/apache/arrow/releases/latest | jq -r '.tag_name' | grep -Eo "[0-9\.]+")} + export PYARROW_VERSION=$1 TEMP_BUILD_DIR=$(mktemp -d) cd ${TEMP_BUILD_DIR} @@ -44,7 +66,8 @@ build_pyarrow() { if [[ $(uname -m) == "ppc64le" ]]; then # install development packages dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - dnf install -y cmake gcc-toolset-13 fribidi-devel lcms2-devel \ + # patchelf: needed by `auditwheel repair` + dnf install -y cmake gcc-toolset-13 fribidi-devel lcms2-devel patchelf \ libimagequant-devel libraqm-devel openjpeg2-devel tcl-devel tk-devel # install rust @@ -73,6 +96,10 @@ if [[ $(uname -m) == "ppc64le" ]]; then PYARROW_VERSION=$(grep -A1 '"pyarrow"' pylock.toml | grep -Eo '\b[0-9\.]+\b') build_pyarrow ${PYARROW_VERSION} + + PILLOW_VERSION=$(grep -A1 '"pillow"' pylock.toml | grep -Eo '\b[0-9\.]+\b') + build_pillow ${PILLOW_VERSION} + uv pip install ${WHEEL_DIR}/*.whl else # only for mounting on non-ppc64le