From 0dedfb044472e18bf07aa4463befc2e5e7e98216 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Aug 2025 14:21:09 +0000 Subject: [PATCH 01/10] ci: update commit SHAs for image digests changes --- manifests/base/commit-latest.env | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/manifests/base/commit-latest.env b/manifests/base/commit-latest.env index 483938ed78..1bb47b6bc9 100644 --- a/manifests/base/commit-latest.env +++ b/manifests/base/commit-latest.env @@ -1,30 +1,30 @@ -odh-workbench-jupyter-minimal-cpu-py311-ubi9-commit-n=e759b15 -odh-workbench-jupyter-minimal-cuda-py311-ubi9-commit-n=78f1a41 -odh-workbench-jupyter-minimal-rocm-py311-ubi9-commit-n=2d72365 -odh-workbench-jupyter-datascience-cpu-py311-ubi9-commit-n=e759b15 -odh-workbench-jupyter-pytorch-cuda-py311-ubi9-commit-n=78f1a41 -odh-workbench-jupyter-pytorch-rocm-py311-ubi9-commit-n=2d72365 -odh-workbench-jupyter-tensorflow-cuda-py311-ubi9-commit-n=78f1a41 -odh-workbench-jupyter-tensorflow-rocm-py311-ubi9-commit-n=e759b15 -odh-workbench-jupyter-trustyai-cpu-py311-ubi9-commit-n=e759b15 -odh-workbench-codeserver-datascience-cpu-py311-ubi9-commit-n=2d72365 -odh-pipeline-runtime-minimal-cpu-py311-ubi9-commit-n=2d72365 -odh-pipeline-runtime-datascience-cpu-py311-ubi9-commit-n=2d72365 -odh-pipeline-runtime-pytorch-cuda-py311-ubi9-commit-n=e759b15 -odh-pipeline-runtime-pytorch-rocm-py311-ubi9-commit-n=2d72365 -odh-pipeline-runtime-tensorflow-cuda-py311-ubi9-commit-n=78f1a41 -odh-pipeline-runtime-tensorflow-rocm-py311-ubi9-commit-n=e759b15 -odh-workbench-jupyter-minimal-cpu-py312-ubi9-commit-n=2d72365 -odh-workbench-jupyter-minimal-cuda-py312-ubi9-commit-n=e759b15 -odh-workbench-jupyter-minimal-rocm-py312-ubi9-commit-n=2d72365 -odh-workbench-jupyter-datascience-cpu-py312-ubi9-commit-n=2d72365 -odh-workbench-jupyter-pytorch-cuda-py312-ubi9-commit-n=78f1a41 -odh-workbench-jupyter-pytorch-rocm-py312-ubi9-commit-n=2d72365 -odh-workbench-jupyter-tensorflow-cuda-py312-ubi9-commit-n=78f1a41 -odh-workbench-jupyter-trustyai-cpu-py312-ubi9-commit-n=2d72365 -odh-workbench-codeserver-datascience-cpu-py312-ubi9-commit-n=2d72365 +odh-workbench-jupyter-minimal-cpu-py311-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-minimal-cuda-py311-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-minimal-rocm-py311-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-datascience-cpu-py311-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-pytorch-cuda-py311-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-pytorch-rocm-py311-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-tensorflow-cuda-py311-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-tensorflow-rocm-py311-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-trustyai-cpu-py311-ubi9-commit-n=e8b7177 +odh-workbench-codeserver-datascience-cpu-py311-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-minimal-cpu-py311-ubi9-commit-n=14f2d8b +odh-pipeline-runtime-datascience-cpu-py311-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-pytorch-cuda-py311-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-pytorch-rocm-py311-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-tensorflow-cuda-py311-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-tensorflow-rocm-py311-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-minimal-cpu-py312-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-minimal-cuda-py312-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-minimal-rocm-py312-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-datascience-cpu-py312-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-pytorch-cuda-py312-ubi9-commit-n=4fce1e1 +odh-workbench-jupyter-pytorch-rocm-py312-ubi9-commit-n=e8b7177 +odh-workbench-jupyter-tensorflow-cuda-py312-ubi9-commit-n=d131dbe +odh-workbench-jupyter-trustyai-cpu-py312-ubi9-commit-n=e8b7177 +odh-workbench-codeserver-datascience-cpu-py312-ubi9-commit-n=e8b7177 odh-pipeline-runtime-minimal-cpu-py312-ubi9-commit-n=4212e5f -odh-pipeline-runtime-datascience-cpu-py312-ubi9-commit-n=2d72365 -odh-pipeline-runtime-pytorch-cuda-py312-ubi9-commit-n=78f1a41 -odh-pipeline-runtime-pytorch-rocm-py312-ubi9-commit-n=2d72365 -odh-pipeline-runtime-tensorflow-cuda-py312-ubi9-commit-n=78f1a41 +odh-pipeline-runtime-datascience-cpu-py312-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-pytorch-cuda-py312-ubi9-commit-n=e8b7177 +odh-pipeline-runtime-pytorch-rocm-py312-ubi9-commit-n=4fce1e1 +odh-pipeline-runtime-tensorflow-cuda-py312-ubi9-commit-n=e8b7177 From 34d43b2f0c70d238a55d6e235e53f4c25a0c6b61 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Mon, 18 Aug 2025 11:17:48 +0530 Subject: [PATCH 02/10] backport changes from pr:1318 to main Signed-off-by: Md. Shafi Hussain --- .../ubi9-python-3.11/Dockerfile.konflux.cpu | 41 +++++-- .../ubi9-python-3.12/Dockerfile.konflux.cpu | 32 ++++-- jupyter/utils/install_pandoc.sh | 62 +++++++++++ jupyter/utils/install_texlive.sh | 100 ++++++++++++++++++ 4 files changed, 216 insertions(+), 19 deletions(-) create mode 100755 jupyter/utils/install_pandoc.sh create mode 100755 jupyter/utils/install_texlive.sh diff --git a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu index 50647007e6..d9abe63251 100644 --- a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu @@ -1,3 +1,21 @@ +############################ +# Stage 1: PDF Tool Build # +############################ +FROM registry.access.redhat.com/ubi9/python-311:latest AS pdf-builder + +WORKDIR /opt/app-root/bin + +# OS Packages needs to be installed as root +USER 0 + +# Copy scripts +COPY jupyter/utils/install_texlive.sh ./install_texlive.sh +COPY jupyter/utils/install_pandoc.sh ./install_pandoc.sh +RUN chmod +x install_texlive.sh install_pandoc.sh + +RUN ./install_texlive.sh +RUN ./install_pandoc.sh + #################### # base # #################### @@ -38,14 +56,26 @@ FROM base AS jupyter-minimal ARG JUPYTER_REUSABLE_UTILS=jupyter/utils ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.11 +LABEL name="odh-notebook-jupyter-minimal-ubi9-python-3.11" \ + summary="Minimal Jupyter notebook image for ODH notebooks" \ + description="Minimal Jupyter notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \ + io.k8s.display-name="Minimal Jupyter notebook image for ODH notebooks" \ + io.k8s.description="Minimal Jupyter notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \ + authoritative-source-url="https://github.com/opendatahub-io/notebooks" \ + io.openshift.build.commit.ref="main" \ + io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/minimal/ubi9-python-3.11" \ + io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-minimal-ubi9-python-3.11" + WORKDIR /opt/app-root/bin COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 -# Dependencies for PDF export begin -RUN ./utils/install_pdf_deps.sh +# Copy built TeXLive and Pandoc binaries only (no build deps) +COPY --from=pdf-builder /usr/local/texlive /usr/local/texlive +COPY --from=pdf-builder /usr/local/pandoc /usr/local/pandoc + ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" # Dependencies for PDF export end @@ -73,10 +103,3 @@ WORKDIR /opt/app-root/src ENTRYPOINT ["start-notebook.sh"] -LABEL name="rhoai/odh-workbench-jupyter-minimal-cpu-py311-rhel9" \ - com.redhat.component="odh-workbench-jupyter-minimal-cpu-py311-rhel9" \ - io.k8s.display-name="odh-workbench-jupyter-minimal-cpu-py311-rhel9" \ - summary="Minimal Jupyter notebook image for ODH notebooks" \ - description="Minimal Jupyter notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \ - io.k8s.description="Minimal Jupyter notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \ - com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu index 96174b3bfc..dc1a788936 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu @@ -1,3 +1,21 @@ +############################ +# Stage 1: PDF Tool Build # +############################ +FROM registry.access.redhat.com/ubi9/python-312:latest AS pdf-builder + +WORKDIR /opt/app-root/bin + +# OS Packages needs to be installed as root +USER 0 + +# Copy scripts +COPY jupyter/utils/install_texlive.sh ./install_texlive.sh +COPY jupyter/utils/install_pandoc.sh ./install_pandoc.sh +RUN chmod +x install_texlive.sh install_pandoc.sh + +RUN ./install_texlive.sh +RUN ./install_pandoc.sh + #################### # base # #################### @@ -54,8 +72,10 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 -# Dependencies for PDF export begin -RUN ./utils/install_pdf_deps.sh +# Copy built TeXLive and Pandoc binaries only (no build deps) +COPY --from=pdf-builder /usr/local/texlive /usr/local/texlive +COPY --from=pdf-builder /usr/local/pandoc /usr/local/pandoc + ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" # Dependencies for PDF export end @@ -80,11 +100,3 @@ RUN echo "Installing softwares and packages" && \ WORKDIR /opt/app-root/src ENTRYPOINT ["start-notebook.sh"] - -LABEL name="rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9" \ - com.redhat.component="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \ - io.k8s.display-name="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \ - summary="Minimal Jupyter notebook image for ODH notebooks" \ - description="Minimal Jupyter notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \ - io.k8s.description="Minimal Jupyter notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \ - com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf" diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh new file mode 100755 index 0000000000..a0debc0119 --- /dev/null +++ b/jupyter/utils/install_pandoc.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -euxo pipefail + +# Mapping of `uname -m` values to equivalent GOARCH values +declare -A UNAME_TO_GOARCH +UNAME_TO_GOARCH["x86_64"]="amd64" +UNAME_TO_GOARCH["aarch64"]="arm64" +UNAME_TO_GOARCH["ppc64le"]="ppc64le" +UNAME_TO_GOARCH["s390x"]="s390x" + +ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" + +if [[ "$ARCH" == "ppc64le" ]]; then + # Install Pandoc from source + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm + dnf install -y cabal-install ghc gmp-devel + + # Set version + PANDOC_VERSION=3.7.0.2 + + cd /tmp + git clone --recurse-submodules https://github.com/jgm/pandoc.git + cd pandoc + git checkout ${PANDOC_VERSION} + git submodule update --init --recursive + + export HOME=/root + # Initialize cabal user config (don't fail if already done) + cabal user-config init || true + + # Modify config + echo "repository hackage.haskell.org + url: https://hackage.haskell.org/ + secure: False" >> $HOME/.cabal/config + + cabal update + cd pandoc-cli + cabal build -j"$(nproc)" + mkdir -p /usr/local/pandoc/bin + cabal install \ + --installdir=/usr/local/pandoc/bin \ + --overwrite-policy=always \ + --install-method=copy + + # Clean up Haskell build system + rm -rf ~/.cabal ~/.ghc /tmp/pandoc + dnf remove -y cabal-install ghc gmp-devel + dnf clean all && rm -rf /var/cache/dnf + + /usr/local/pandoc/bin/pandoc --version + +elif [[ "$ARCH" == "amd64" ]]; then + # pandoc installation + curl -fL "https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-${ARCH}.tar.gz" -o /tmp/pandoc.tar.gz + mkdir -p /usr/local/pandoc + tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/ + rm -f /tmp/pandoc.tar.gz + +else + echo "Unsupported architecture: $ARCH" >&2 + exit 1 +fi diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh new file mode 100755 index 0000000000..f74e9e5ec9 --- /dev/null +++ b/jupyter/utils/install_texlive.sh @@ -0,0 +1,100 @@ +#!/bin/bash +set -euxo pipefail + +# Mapping of `uname -m` values to equivalent GOARCH values +declare -A UNAME_TO_GOARCH +UNAME_TO_GOARCH["x86_64"]="amd64" +UNAME_TO_GOARCH["aarch64"]="arm64" +UNAME_TO_GOARCH["ppc64le"]="ppc64le" +UNAME_TO_GOARCH["s390x"]="s390x" + +ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" + +if [[ "$ARCH" == "ppc64le" ]]; then + echo "Installing TeX Live from source for $ARCH..." + + # Install build dependencies + dnf install -y gcc-toolset-13 perl make libX11-devel \ + zlib-devel freetype-devel libpng-devel ncurses-devel \ + gd-devel libtool wget tar xz + + rpm -q libXmu-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-devel-1.1.3-8.el9.ppc64le.rpm + rpm -q libXext-devel|| rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXext-devel-1.3.4-8.el9.ppc64le.rpm + rpm -q libICE-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libICE-devel-1.0.10-8.el9.ppc64le.rpm + rpm -q libSM-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libSM-devel-1.2.3-10.el9.ppc64le.rpm + rpm -q libXmu || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-1.1.3-8.el9.ppc64le.rpm + rpm -q libXaw-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-devel-1.0.13-19.el9.ppc64le.rpm + rpm -q libXaw || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-1.0.13-19.el9.ppc64le.rpm + rpm -q libXt-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXt-devel-1.2.0-6.el9.ppc64le.rpm + rpm -q flex || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/flex-2.6.4-9.el9.ppc64le.rpm + rpm -q bison || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/bison-3.7.4-5.el9.ppc64le.rpm + + # Step 1: Download and extract the TeX Live source + wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz + tar -xf texlive-20250308-source.tar.xz + cd texlive-20250308-source + + # Enable newer GCC toolchain + source /opt/rh/gcc-toolset-13/enable + + # Create build directory and build + mkdir -p ../texlive-build + cd ../texlive-build + ../texlive-20250308-source/configure --prefix=/usr/local/texlive + make -j"$(nproc)" + make install + + # Symlink for pdflatex + ln -sf pdftex /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu/pdflatex + + # Cleanup sources to reduce image size + rm -rf /texlive-20250308-source /texlive-build + + # Step 2: Run TeX Live installer for runtime tree setup + cd / + wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz + tar -xzf install-tl-unx.tar.gz + cd install-tl-2*/ + + # Create a custom install profile + TEXLIVE_INSTALL_PREFIX="/usr/local/texlive" + cat < texlive.profile +selected_scheme scheme-small +TEXDIR $TEXLIVE_INSTALL_PREFIX +TEXMFCONFIG ~/.texlive2025/texmf-config +TEXMFVAR ~/.texlive2025/texmf-var +option_doc 0 +option_src 0 +EOF + + ./install-tl --profile=texlive.profile --custom-bin=$TEXLIVE_INSTALL_PREFIX/bin/powerpc64le-unknown-linux-gnu + +# TeX Live binary directory +TEX_BIN_DIR="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu" + +# Create standard symlink 'linux' → arch-specific folder +ln -sf "$TEX_BIN_DIR" /usr/local/texlive/bin/linux + + + # Set up environment + export PATH="$TEXLIVE_INSTALL_PREFIX/bin/linux:$PATH" + pdflatex --version + tlmgr --version + +elif [[ "$ARCH" == "amd64" ]]; then + # tex live installation + echo "Installing TexLive to allow PDf export from Notebooks" + curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz + zcat < install-tl-unx.tar.gz | tar xf - + cd install-tl-2* + perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive + mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux + cd /usr/local/texlive/bin/linux + ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended + +else + echo "Unsupported architecture: $ARCH" >&2 + exit 1 + +fi + From 7f1cc35231aed6fb1ff26c342c1d65faff6faa96 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Mon, 18 Aug 2025 22:26:02 +0530 Subject: [PATCH 03/10] enable verbose logging for build and update ghc settings Signed-off-by: Md. Shafi Hussain --- jupyter/utils/install_pandoc.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index a0debc0119..8ad0c1c05c 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -13,12 +13,16 @@ ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" if [[ "$ARCH" == "ppc64le" ]]; then # Install Pandoc from source dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - dnf install -y cabal-install ghc gmp-devel + dnf install -y cabal-install ghc gmp-devel gcc-toolset-13 git + + source /opt/rh/gcc-toolset-13/enable + + # ghc-8.10 has specific path for gcc in settings + sed -i.bak 's|/usr/bin/gcc|gcc|g' /usr/lib64/ghc-8.10.7/settings # Set version PANDOC_VERSION=3.7.0.2 - cd /tmp git clone --recurse-submodules https://github.com/jgm/pandoc.git cd pandoc git checkout ${PANDOC_VERSION} @@ -26,16 +30,14 @@ if [[ "$ARCH" == "ppc64le" ]]; then export HOME=/root # Initialize cabal user config (don't fail if already done) - cabal user-config init || true + cabal user-config init # Modify config - echo "repository hackage.haskell.org - url: https://hackage.haskell.org/ - secure: False" >> $HOME/.cabal/config + sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config - cabal update + cabal update -v cd pandoc-cli - cabal build -j"$(nproc)" + cabal build -j"$(nproc)" --verbose mkdir -p /usr/local/pandoc/bin cabal install \ --installdir=/usr/local/pandoc/bin \ From 2cf3770a1f467514625a302206f00340824cf7c7 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Tue, 19 Aug 2025 13:35:47 +0530 Subject: [PATCH 04/10] verbose logging with updated cabal Signed-off-by: Md. Shafi Hussain --- jupyter/utils/install_pandoc.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index 8ad0c1c05c..585760b2ad 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -13,25 +13,32 @@ ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" if [[ "$ARCH" == "ppc64le" ]]; then # Install Pandoc from source dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - dnf install -y cabal-install ghc gmp-devel gcc-toolset-13 git + dnf install -y cabal-install ghc gmp-devel gcc-toolset-13 git jq source /opt/rh/gcc-toolset-13/enable # ghc-8.10 has specific path for gcc in settings sed -i.bak 's|/usr/bin/gcc|gcc|g' /usr/lib64/ghc-8.10.7/settings + + cabal user-config init + + export HOME=/root + sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config + + cabal update + cabal install cabal-install --verbose + + # use latest cabal + export PATH=/root/.cabal/bin:$PATH - # Set version - PANDOC_VERSION=3.7.0.2 + PANDOC_VERSION=$(curl -s "https://api.github.com/repos/jgm/pandoc/releases/latest" | jq -r '.tag_name') + cd /tmp git clone --recurse-submodules https://github.com/jgm/pandoc.git cd pandoc git checkout ${PANDOC_VERSION} git submodule update --init --recursive - export HOME=/root - # Initialize cabal user config (don't fail if already done) - cabal user-config init - # Modify config sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config From d6646e8ffa4d29227a904827557c858768d85985 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Tue, 19 Aug 2025 15:19:23 +0530 Subject: [PATCH 05/10] verbose logging with updated cabal Signed-off-by: Md. Shafi Hussain --- jupyter/utils/install_pandoc.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index 585760b2ad..b749bad73e 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -22,7 +22,6 @@ if [[ "$ARCH" == "ppc64le" ]]; then cabal user-config init - export HOME=/root sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config cabal update From a543d75775107d72fddeb15687c10e9afaeaa192 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Tue, 19 Aug 2025 08:46:14 -0400 Subject: [PATCH 06/10] install from EPEL and symlink into /usr/local/pandoc/bin --- jupyter/utils/install_pandoc.sh | 46 +++------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index b749bad73e..9095e0a83d 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -13,49 +13,11 @@ ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" if [[ "$ARCH" == "ppc64le" ]]; then # Install Pandoc from source dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - dnf install -y cabal-install ghc gmp-devel gcc-toolset-13 git jq - - source /opt/rh/gcc-toolset-13/enable - - # ghc-8.10 has specific path for gcc in settings - sed -i.bak 's|/usr/bin/gcc|gcc|g' /usr/lib64/ghc-8.10.7/settings - - cabal user-config init - - sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config - - cabal update - cabal install cabal-install --verbose - - # use latest cabal - export PATH=/root/.cabal/bin:$PATH - - PANDOC_VERSION=$(curl -s "https://api.github.com/repos/jgm/pandoc/releases/latest" | jq -r '.tag_name') - - cd /tmp - git clone --recurse-submodules https://github.com/jgm/pandoc.git - cd pandoc - git checkout ${PANDOC_VERSION} - git submodule update --init --recursive - - # Modify config - sed -i -e 's/http/https/g' -e 's/-- secure: True/secure: True/g' $HOME/.cabal/config - - cabal update -v - cd pandoc-cli - cabal build -j"$(nproc)" --verbose + dnf install -y pandoc mkdir -p /usr/local/pandoc/bin - cabal install \ - --installdir=/usr/local/pandoc/bin \ - --overwrite-policy=always \ - --install-method=copy - - # Clean up Haskell build system - rm -rf ~/.cabal ~/.ghc /tmp/pandoc - dnf remove -y cabal-install ghc gmp-devel - dnf clean all && rm -rf /var/cache/dnf - - /usr/local/pandoc/bin/pandoc --version + ln -s /usr/bin/pandoc /usr/local/pandoc/bin/pandoc + export PATH="/usr/local/pandoc/bin:$PATH" + pandoc --version elif [[ "$ARCH" == "amd64" ]]; then # pandoc installation From 10a10af46dd5649a26f8b25735b7e1cd07c13962 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Tue, 19 Aug 2025 21:04:54 +0530 Subject: [PATCH 07/10] ease arch constraints from x86 and ppc64le Signed-off-by: Md. Shafi Hussain --- jupyter/utils/install_pandoc.sh | 7 +++---- jupyter/utils/install_texlive.sh | 31 ++++++++++++++----------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index 9095e0a83d..8f6f34b358 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -11,6 +11,7 @@ UNAME_TO_GOARCH["s390x"]="s390x" ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" if [[ "$ARCH" == "ppc64le" ]]; then + # Install Pandoc from source dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm dnf install -y pandoc @@ -19,14 +20,12 @@ if [[ "$ARCH" == "ppc64le" ]]; then export PATH="/usr/local/pandoc/bin:$PATH" pandoc --version -elif [[ "$ARCH" == "amd64" ]]; then +else + # pandoc installation curl -fL "https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-${ARCH}.tar.gz" -o /tmp/pandoc.tar.gz mkdir -p /usr/local/pandoc tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/ rm -f /tmp/pandoc.tar.gz -else - echo "Unsupported architecture: $ARCH" >&2 - exit 1 fi diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index f74e9e5ec9..b3fa64d095 100755 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -11,23 +11,23 @@ UNAME_TO_GOARCH["s390x"]="s390x" ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" if [[ "$ARCH" == "ppc64le" ]]; then + echo "Installing TeX Live from source for $ARCH..." # Install build dependencies dnf install -y gcc-toolset-13 perl make libX11-devel \ zlib-devel freetype-devel libpng-devel ncurses-devel \ - gd-devel libtool wget tar xz - - rpm -q libXmu-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-devel-1.1.3-8.el9.ppc64le.rpm - rpm -q libXext-devel|| rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXext-devel-1.3.4-8.el9.ppc64le.rpm - rpm -q libICE-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libICE-devel-1.0.10-8.el9.ppc64le.rpm - rpm -q libSM-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libSM-devel-1.2.3-10.el9.ppc64le.rpm - rpm -q libXmu || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-1.1.3-8.el9.ppc64le.rpm - rpm -q libXaw-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-devel-1.0.13-19.el9.ppc64le.rpm - rpm -q libXaw || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-1.0.13-19.el9.ppc64le.rpm - rpm -q libXt-devel || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXt-devel-1.2.0-6.el9.ppc64le.rpm - rpm -q flex || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/flex-2.6.4-9.el9.ppc64le.rpm - rpm -q bison || rpm -ivh --nodeps https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/bison-3.7.4-5.el9.ppc64le.rpm + gd-devel libtool wget tar xz \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-devel-1.1.3-8.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXext-devel-1.3.4-8.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libICE-devel-1.0.10-8.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libSM-devel-1.2.3-10.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXmu-1.1.3-8.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-devel-1.0.13-19.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXaw-1.0.13-19.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/libXt-devel-1.2.0-6.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/flex-2.6.4-9.el9.ppc64le.rpm \ + https://mirror.stream.centos.org/9-stream/AppStream/ppc64le/os/Packages/bison-3.7.4-5.el9.ppc64le.rpm # Step 1: Download and extract the TeX Live source wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz @@ -81,7 +81,8 @@ ln -sf "$TEX_BIN_DIR" /usr/local/texlive/bin/linux pdflatex --version tlmgr --version -elif [[ "$ARCH" == "amd64" ]]; then +else + # tex live installation echo "Installing TexLive to allow PDf export from Notebooks" curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz @@ -92,9 +93,5 @@ elif [[ "$ARCH" == "amd64" ]]; then cd /usr/local/texlive/bin/linux ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended -else - echo "Unsupported architecture: $ARCH" >&2 - exit 1 - fi From 61d47fd6c33acdf73b86ef3ee9955beff4421111 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Wed, 20 Aug 2025 18:42:54 +0530 Subject: [PATCH 08/10] Update pdf scripts Updated install_texlive and install_pandoc scripts to run only on ppc64le. Other architectures use the default install_pdf_deps scripts. This is to ensure s390x builds don't break with ppc64le scripts. Signed-off-by: Md. Shafi Hussain --- .../ubi9-python-3.11/Dockerfile.konflux.cpu | 13 +++++++++---- .../ubi9-python-3.12/Dockerfile.konflux.cpu | 13 +++++++++---- jupyter/utils/install_pandoc.sh | 8 -------- jupyter/utils/install_texlive.sh | 15 +-------------- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu index d9abe63251..d887c5c403 100644 --- a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu @@ -72,10 +72,15 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 -# Copy built TeXLive and Pandoc binaries only (no build deps) -COPY --from=pdf-builder /usr/local/texlive /usr/local/texlive -COPY --from=pdf-builder /usr/local/pandoc /usr/local/pandoc - +# Dependencies for PDF export begin +RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ + bash -c ' \ + if [[ "$(uname -m)" == "ppc64le" ]]; then \ + cp /pdf_builder/texlive /usr/local/; \ + cp /pdf_builder/pandoc /usr/local/; \ + else \ + ./utils/install_pdf_deps.sh; \ + fi' ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" # Dependencies for PDF export end diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu index dc1a788936..2fad17cdd5 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu @@ -72,10 +72,15 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 -# Copy built TeXLive and Pandoc binaries only (no build deps) -COPY --from=pdf-builder /usr/local/texlive /usr/local/texlive -COPY --from=pdf-builder /usr/local/pandoc /usr/local/pandoc - +# Dependencies for PDF export begin +RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ + bash -c ' \ + if [[ "$(uname -m)" == "ppc64le" ]]; then \ + cp /pdf_builder/texlive /usr/local/; \ + cp /pdf_builder/pandoc /usr/local/; \ + else \ + ./utils/install_pdf_deps.sh; \ + fi' ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" # Dependencies for PDF export end diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index 8f6f34b358..1dcb12e70b 100755 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -20,12 +20,4 @@ if [[ "$ARCH" == "ppc64le" ]]; then export PATH="/usr/local/pandoc/bin:$PATH" pandoc --version -else - - # pandoc installation - curl -fL "https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-${ARCH}.tar.gz" -o /tmp/pandoc.tar.gz - mkdir -p /usr/local/pandoc - tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/pandoc/ - rm -f /tmp/pandoc.tar.gz - fi diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index b3fa64d095..0e53665f60 100755 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -81,17 +81,4 @@ ln -sf "$TEX_BIN_DIR" /usr/local/texlive/bin/linux pdflatex --version tlmgr --version -else - - # tex live installation - echo "Installing TexLive to allow PDf export from Notebooks" - curl -fL https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz - zcat < install-tl-unx.tar.gz | tar xf - - cd install-tl-2* - perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive - mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux - cd /usr/local/texlive/bin/linux - ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended - -fi - +fi \ No newline at end of file From dd35df31ca19b3ce1dc80ffc212b9655a194620c Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Wed, 20 Aug 2025 22:15:14 +0530 Subject: [PATCH 09/10] copy recursively Signed-off-by: Md. Shafi Hussain --- jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu | 4 ++-- jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu index d887c5c403..de42bf7af2 100644 --- a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu @@ -76,8 +76,8 @@ USER 0 RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ bash -c ' \ if [[ "$(uname -m)" == "ppc64le" ]]; then \ - cp /pdf_builder/texlive /usr/local/; \ - cp /pdf_builder/pandoc /usr/local/; \ + cp -r /pdf_builder/texlive /usr/local/; \ + cp -r /pdf_builder/pandoc /usr/local/; \ else \ ./utils/install_pdf_deps.sh; \ fi' diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu index 2fad17cdd5..804b4870aa 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu @@ -76,8 +76,8 @@ USER 0 RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ bash -c ' \ if [[ "$(uname -m)" == "ppc64le" ]]; then \ - cp /pdf_builder/texlive /usr/local/; \ - cp /pdf_builder/pandoc /usr/local/; \ + cp -r /pdf_builder/texlive /usr/local/; \ + cp -r /pdf_builder/pandoc /usr/local/; \ else \ ./utils/install_pdf_deps.sh; \ fi' From b2ec92c05cf0296f1d8c677a63fcaa97ea6d44e9 Mon Sep 17 00:00:00 2001 From: "Md. Shafi Hussain" Date: Thu, 21 Aug 2025 09:42:19 +0530 Subject: [PATCH 10/10] change mount type from bind to cache Signed-off-by: Md. Shafi Hussain --- jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu | 2 +- jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu index de42bf7af2..92b336b21c 100644 --- a/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.11/Dockerfile.konflux.cpu @@ -73,7 +73,7 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 # Dependencies for PDF export begin -RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ +RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ bash -c ' \ if [[ "$(uname -m)" == "ppc64le" ]]; then \ cp -r /pdf_builder/texlive /usr/local/; \ diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu index 804b4870aa..bb3b3efdb1 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu @@ -73,7 +73,7 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 # Dependencies for PDF export begin -RUN --mount=type=bind,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ +RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \ bash -c ' \ if [[ "$(uname -m)" == "ppc64le" ]]; then \ cp -r /pdf_builder/texlive /usr/local/; \