From 395362d6537754f16143b63be43776615f76da4c Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Mon, 23 Jun 2025 06:20:59 -0400 Subject: [PATCH 01/14] Add TeX Live install for ppc64le # Conflicts: # jupyter/utils/install_pdf_deps.sh --- jupyter/utils/install_pdf_deps.sh | 47 +++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/jupyter/utils/install_pdf_deps.sh b/jupyter/utils/install_pdf_deps.sh index f07a54f836..b8222e47dd 100755 --- a/jupyter/utils/install_pdf_deps.sh +++ b/jupyter/utils/install_pdf_deps.sh @@ -23,15 +23,46 @@ if [[ "$(uname -m)" == "s390x" ]]; then exit 0 fi -# 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 +ARCH=$(uname -m) + +if [[ "$ARCH" == "ppc64le" ]]; then + echo "Installing TeX Live from source for $ARCH" + + # Download and extract 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 + + # Install build dependencies + dnf install -y gcc gcc-c++ perl make libX11-devel libXt-devel \ + zlib-devel freetype-devel libpng-devel ncurses-devel \ + gd-devel libtool wget tar xz bison flex libXaw-devel + + # Create build directory + mkdir ../texlive-build + cd ../texlive-build + + # Configure, build, install + ../texlive-20250308-source/configure --prefix=/opt/texlive/2025 + make -j$(nproc) + make install + + # Symlink for pdflatex + cd /opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu + ln -s pdftex pdflatex + +else + echo "Installing TeX Live from installer for $ARCH" + + # Download and install from official installer + 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 + ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended +fi # 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 From 09ad4cafdd7cb14efb17ef6c971d8834abcf9966 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Mon, 23 Jun 2025 13:49:02 -0400 Subject: [PATCH 02/14] Install also pandoc on power from epel9 package --- jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu | 2 ++ jupyter/utils/install_pdf_deps.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu index ef1ebf8057..191d7ba044 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu @@ -62,6 +62,8 @@ USER 0 # Dependencies for PDF export begin RUN ./utils/install_pdf_deps.sh ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" +ENV PATH="/usr/local/texlive/bin/x86_64-linux:/usr/local/pandoc/bin:$PATH" +ENV PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:$PATH" # Dependencies for PDF export end USER 1001 diff --git a/jupyter/utils/install_pdf_deps.sh b/jupyter/utils/install_pdf_deps.sh index b8222e47dd..8a09a06b18 100755 --- a/jupyter/utils/install_pdf_deps.sh +++ b/jupyter/utils/install_pdf_deps.sh @@ -50,6 +50,12 @@ if [[ "$ARCH" == "ppc64le" ]]; then # Symlink for pdflatex cd /opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu ln -s pdftex pdflatex + export PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:$PATH" + pdflatex --version + + # Install pandoc + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm + dnf install -y pandoc else echo "Installing TeX Live from installer for $ARCH" From d4b8a9a5a5a95821e093f2c2ab0f7318a9e03e83 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Tue, 24 Jun 2025 00:32:23 -0400 Subject: [PATCH 03/14] Update PATH to support TeX Live for both ppc64le and x86_64 --- jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu index 191d7ba044..1413aa7f9f 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu @@ -63,7 +63,7 @@ USER 0 RUN ./utils/install_pdf_deps.sh ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" ENV PATH="/usr/local/texlive/bin/x86_64-linux:/usr/local/pandoc/bin:$PATH" -ENV PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:$PATH" +ENV PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:/usr/local/pandoc/bin:$PATH" # Dependencies for PDF export end USER 1001 From 96b9855b471f0409fcc635095ed4ee624cd1e308 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Fri, 27 Jun 2025 01:21:57 -0400 Subject: [PATCH 04/14] Improve TeX Live and Pandoc setup to compile pandoc from sources --- jupyter/utils/install_pdf_deps.sh | 61 +++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/jupyter/utils/install_pdf_deps.sh b/jupyter/utils/install_pdf_deps.sh index 8a09a06b18..a389d2b676 100755 --- a/jupyter/utils/install_pdf_deps.sh +++ b/jupyter/utils/install_pdf_deps.sh @@ -34,33 +34,63 @@ if [[ "$ARCH" == "ppc64le" ]]; then cd texlive-20250308-source # Install build dependencies - dnf install -y gcc gcc-c++ perl make libX11-devel libXt-devel \ + dnf install -y gcc-toolset-13 perl make libX11-devel libXt-devel \ zlib-devel freetype-devel libpng-devel ncurses-devel \ gd-devel libtool wget tar xz bison flex libXaw-devel + source /opt/rh/gcc-toolset-13/enable + # Create build directory mkdir ../texlive-build cd ../texlive-build # Configure, build, install - ../texlive-20250308-source/configure --prefix=/opt/texlive/2025 + ../texlive-20250308-source/configure --prefix=/usr/local/texlive make -j$(nproc) make install # Symlink for pdflatex - cd /opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu + cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu ln -s pdftex pdflatex - export PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:$PATH" + export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" pdflatex --version - # Install pandoc + # Install dependencies dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm - dnf install -y pandoc + dnf install -y cabal-install ghc gmp-devel + # Set version + PANDOC_VERSION=3.7.0.2 + + # Clone repo + cd /tmp + git clone --recurse-submodules https://github.com/jgm/pandoc.git + cd pandoc + git checkout ${PANDOC_VERSION} + git submodule update --init --recursive + + # Update Cabal + cabal update + + # Build the CLI tool (not the top-level library package) + cd pandoc-cli + + # Clean previous builds + cabal clean + + # Configure and build + cabal build -j -else - echo "Installing TeX Live from installer for $ARCH" + # Install the CLI executable + cabal install --installdir=/usr/local/bin --overwrite-policy=always - # Download and install from official installer + # Verify installation + /usr/local/bin/pandoc --version + +fi + +if [[ "$ARCH" == "x86_64" ]]; 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* @@ -68,10 +98,11 @@ else 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 -# 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 + # 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 From f165e9125b206c83ff30a795fd048d8b3192b840 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Fri, 27 Jun 2025 02:18:52 -0400 Subject: [PATCH 05/14] Add cleanup for the pandoc build directory and tweak TeX Live & Pandoc install --- jupyter/utils/install_pdf_deps.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/jupyter/utils/install_pdf_deps.sh b/jupyter/utils/install_pdf_deps.sh index a389d2b676..2ff8af7bc0 100755 --- a/jupyter/utils/install_pdf_deps.sh +++ b/jupyter/utils/install_pdf_deps.sh @@ -52,23 +52,24 @@ if [[ "$ARCH" == "ppc64le" ]]; then # Symlink for pdflatex cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu ln -s pdftex pdflatex + + # Cleanup TeX source to reduce image size + rm -rf /texlive-20250308-source /texlive-build + export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" pdflatex --version - # Install dependencies + # 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 - - # Clone repo cd /tmp git clone --recurse-submodules https://github.com/jgm/pandoc.git cd pandoc git checkout ${PANDOC_VERSION} git submodule update --init --recursive - - # Update Cabal cabal update # Build the CLI tool (not the top-level library package) @@ -77,12 +78,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then # Clean previous builds cabal clean - # Configure and build - cabal build -j - - # Install the CLI executable - cabal install --installdir=/usr/local/bin --overwrite-policy=always + cabal build -j$(nproc) + cabal install --installdir=/usr/local/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 # Verify installation /usr/local/bin/pandoc --version @@ -106,3 +108,4 @@ cd /usr/local/texlive/bin/linux rm -f /tmp/pandoc.tar.gz fi + From 1d0ca7010b05e69463c0c89fcfb2a10588b5a232 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Thu, 3 Jul 2025 17:30:33 -0400 Subject: [PATCH 06/14] Split PDF build into separate TeX Live and Pandoc scripts Signed-off-by: puneetsharma21 --- jupyter/utils/install_pandoc.sh | 39 ++++++++++++++++++++++++ jupyter/utils/install_texlive.sh | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 jupyter/utils/install_pandoc.sh create mode 100644 jupyter/utils/install_texlive.sh diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh new file mode 100644 index 0000000000..ddc2487f71 --- /dev/null +++ b/jupyter/utils/install_pandoc.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -euxo pipefail + +ARCH=$(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 + + cabal update + cd pandoc-cli + cabal build -j$(nproc) + cabal install --installdir=/usr/local --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 +fi + +if [[ "$ARCH" == "x86_64" ]]; then + # pandoc installation + curl -L https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-amd64.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 + +/usr/local/pandoc --version diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh new file mode 100644 index 0000000000..d63359b58b --- /dev/null +++ b/jupyter/utils/install_texlive.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -euxo pipefail + +ARCH=$(uname -m) + +if [[ "$ARCH" == "ppc64le" ]]; then + echo "Installing TeX Live from source for $ARCH" + + # Download and extract 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 + + # Install build dependencies + dnf install -y gcc-toolset-13 perl make libX11-devel libXt-devel \ + zlib-devel freetype-devel libpng-devel ncurses-devel \ + gd-devel libtool wget tar xz bison flex libXaw-devel + + source /opt/rh/gcc-toolset-13/enable + + # Create build directory + mkdir ../texlive-build + cd ../texlive-build + + # Configure, build, install + ../texlive-20250308-source/configure --prefix=/usr/local/texlive + make -j$(nproc) + make install + + # Symlink for pdflatex + cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu + ln -s pdftex pdflatex + + # Cleanup TeX source to reduce image size + rm -rf /texlive-20250308-source /texlive-build + + export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" + pdflatex --version +fi + +if [[ "$ARCH" == "x86_64" ]]; then + # tex live installation + echo "Installing TexLive to allow PDf export from Notebooks" + curl -L 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 + cd /usr/local/texlive/bin/x86_64-linux + ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended +fi + From 4b4b6a77cf91767ec92b7359f140f47c968b2317 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Wed, 9 Jul 2025 00:50:08 -0400 Subject: [PATCH 07/14] Add else condition for unsupported arch in install scripts Signed-off-by: puneetsharma21 --- jupyter/utils/install_pandoc.sh | 19 +++++++++++++------ jupyter/utils/install_texlive.sh | 10 +++++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index ddc2487f71..20ad9a1f77 100644 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -19,21 +19,28 @@ if [[ "$ARCH" == "ppc64le" ]]; then cabal update cd pandoc-cli - cabal build -j$(nproc) - cabal install --installdir=/usr/local --overwrite-policy=always --install-method=copy + 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 -fi -if [[ "$ARCH" == "x86_64" ]]; then + /usr/local/pandoc/bin/pandoc --version + +elif [[ "$ARCH" == "x86_64" ]]; then # pandoc installation curl -L https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-amd64.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 -/usr/local/pandoc --version +else + echo "Unsupported architecture: $ARCH" >&2 + exit 1 +fi diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index d63359b58b..b1573881a9 100644 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -24,7 +24,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then # Configure, build, install ../texlive-20250308-source/configure --prefix=/usr/local/texlive - make -j$(nproc) + make -j"$(nproc)" make install # Symlink for pdflatex @@ -36,9 +36,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" pdflatex --version -fi -if [[ "$ARCH" == "x86_64" ]]; then +elif [[ "$ARCH" == "x86_64" ]]; then # tex live installation echo "Installing TexLive to allow PDf export from Notebooks" curl -L https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz @@ -47,5 +46,10 @@ if [[ "$ARCH" == "x86_64" ]]; then perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive cd /usr/local/texlive/bin/x86_64-linux ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended + +else + echo "Unsupported architecture: $ARCH" >&2 + exit 1 + fi From feaa9ad2436fb620f72cbb495905933356c1db1a Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Thu, 10 Jul 2025 06:37:06 -0400 Subject: [PATCH 08/14] install TeX Live runtime via profile for ppc64le Signed-off-by: puneetsharma21 --- jupyter/utils/install_texlive.sh | 44 +++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index b1573881a9..43e48f91ea 100644 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -4,38 +4,58 @@ set -euxo pipefail ARCH=$(uname -m) if [[ "$ARCH" == "ppc64le" ]]; then - echo "Installing TeX Live from source for $ARCH" - - # Download and extract 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 + echo "Installing TeX Live from source for $ARCH..." # Install build dependencies dnf install -y gcc-toolset-13 perl make libX11-devel libXt-devel \ zlib-devel freetype-devel libpng-devel ncurses-devel \ gd-devel libtool wget tar xz bison flex libXaw-devel + # 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 + # Create build directory and build mkdir ../texlive-build cd ../texlive-build - - # Configure, build, install ../texlive-20250308-source/configure --prefix=/usr/local/texlive make -j"$(nproc)" make install # Symlink for pdflatex cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu - ln -s pdftex pdflatex + ln -sf pdftex pdflatex - # Cleanup TeX source to reduce image size + # Cleanup sources to reduce image size rm -rf /texlive-20250308-source /texlive-build - export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" + # Step 2: Run TeX Live installer for runtime tree setup + cd / + wget http://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 + + # Set up environment + export PATH="$TEXLIVE_INSTALL_PREFIX/bin/powerpc64le-unknown-linux-gnu:$PATH" pdflatex --version + tlmgr --version elif [[ "$ARCH" == "x86_64" ]]; then # tex live installation From c32a63563c8b301bea9028c8e9140847b49176c6 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Fri, 11 Jul 2025 09:31:34 -0400 Subject: [PATCH 09/14] Add PDF builder stage support to Python 3.12 minimal image Signed-off-by: puneetsharma21 # Conflicts: # jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu --- .../minimal/ubi9-python-3.12/Dockerfile.cpu | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu index 1413aa7f9f..ecd77bd852 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu @@ -3,6 +3,25 @@ ######################### ARG BASE_IMAGE +############################ +# Stage 1: PDF Tool Build # +############################ +# e.g., registry.access.redhat.com/ubi9/python-312:latest +FROM ${BASE_IMAGE} 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 + #################### # cpu-base # #################### @@ -59,6 +78,10 @@ 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 ./utils/install_pdf_deps.sh ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" From e556443b9a9a59d09640d3620cba590cd58b326a Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Mon, 14 Jul 2025 05:52:17 -0400 Subject: [PATCH 10/14] Fix TeX Live PATH for multi-arch support (x86_64, ppc64le) Signed-off-by: puneetsharma21 --- jupyter/utils/install_pandoc.sh | 13 +++++++++--- jupyter/utils/install_texlive.sh | 35 +++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index 20ad9a1f77..ae94ebc81a 100644 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -1,7 +1,14 @@ #!/bin/bash set -euxo pipefail -ARCH=$(uname -m) +# 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 @@ -33,9 +40,9 @@ if [[ "$ARCH" == "ppc64le" ]]; then /usr/local/pandoc/bin/pandoc --version -elif [[ "$ARCH" == "x86_64" ]]; then +elif [[ "$ARCH" == "amd64" ]]; then # pandoc installation - curl -L https://github.com/jgm/pandoc/releases/download/3.7.0.2/pandoc-3.7.0.2-linux-amd64.tar.gz -o /tmp/pandoc.tar.gz + 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 diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index 43e48f91ea..fa20d8c47c 100644 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -1,7 +1,14 @@ #!/bin/bash set -euxo pipefail -ARCH=$(uname -m) +# 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..." @@ -12,7 +19,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then gd-devel libtool wget tar xz bison flex libXaw-devel # 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 + #wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz + wget --no-check-certificate 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 @@ -27,9 +35,8 @@ if [[ "$ARCH" == "ppc64le" ]]; then make install # Symlink for pdflatex - cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu - ln -sf pdftex 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 @@ -52,19 +59,27 @@ 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/powerpc64le-unknown-linux-gnu:$PATH" + export PATH="$TEXLIVE_INSTALL_PREFIX/bin/linux:$PATH" pdflatex --version tlmgr --version -elif [[ "$ARCH" == "x86_64" ]]; then +elif [[ "$ARCH" == "amd64" ]]; then # tex live installation - echo "Installing TexLive to allow PDf export from Notebooks" - curl -L https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz + 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 - cd /usr/local/texlive/bin/x86_64-linux + 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 From fdcf82a0638ec9c55a012050a901071ccc4c3499 Mon Sep 17 00:00:00 2001 From: puneetsharma21 Date: Mon, 14 Jul 2025 07:21:39 -0400 Subject: [PATCH 11/14] Remove the `--no-check-certificate` wget flag because texlive mirror seems to now work correctly Signed-off-by: puneetsharma21 --- jupyter/utils/install_texlive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index fa20d8c47c..3f0c190530 100644 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -19,8 +19,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then gd-devel libtool wget tar xz bison flex libXaw-devel # 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 - wget --no-check-certificate https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz + 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 From 511270694e39f57bbefa3af8295e612845954632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 5 Sep 2025 09:42:43 +0200 Subject: [PATCH 12/14] Align the latex and pandoc installing scripts the PR being merged split the install_pdf_deps.sh into two scripts, install_texlive.sh and install_pandoc.sh this will need to be revisited later and consolidated --- jupyter/utils/install_pandoc.sh | 17 +++++++++++++++++ jupyter/utils/install_pdf_deps.sh | 10 +++++----- jupyter/utils/install_texlive.sh | 24 +++++++++++++++++------- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/jupyter/utils/install_pandoc.sh b/jupyter/utils/install_pandoc.sh index ae94ebc81a..123f378eaa 100644 --- a/jupyter/utils/install_pandoc.sh +++ b/jupyter/utils/install_pandoc.sh @@ -9,6 +9,16 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le" UNAME_TO_GOARCH["s390x"]="s390x" ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" +if [[ -z "${ARCH:-}" ]]; then + echo "Unsupported architecture: $(uname -m)" >&2 + exit 1 +fi + +# Skip PDF export installation for s390x architecture +if [[ "$(uname -m)" == "s390x" ]]; then + echo "PDF export functionality is not supported on s390x architecture. Skipping installation." + exit 0 +fi if [[ "$ARCH" == "ppc64le" ]]; then # Install Pandoc from source @@ -25,7 +35,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then git submodule update --init --recursive cabal update + + # Build the CLI tool (not the top-level library package) cd pandoc-cli + + # Clean previous builds + cabal clean + cabal build -j"$(nproc)" mkdir -p /usr/local/pandoc/bin cabal install \ @@ -38,6 +54,7 @@ if [[ "$ARCH" == "ppc64le" ]]; then dnf remove -y cabal-install ghc gmp-devel dnf clean all && rm -rf /var/cache/dnf + # Verify installation /usr/local/pandoc/bin/pandoc --version elif [[ "$ARCH" == "amd64" ]]; then diff --git a/jupyter/utils/install_pdf_deps.sh b/jupyter/utils/install_pdf_deps.sh index 2ff8af7bc0..bd4e5d2720 100755 --- a/jupyter/utils/install_pdf_deps.sh +++ b/jupyter/utils/install_pdf_deps.sh @@ -23,8 +23,6 @@ if [[ "$(uname -m)" == "s390x" ]]; then exit 0 fi -ARCH=$(uname -m) - if [[ "$ARCH" == "ppc64le" ]]; then echo "Installing TeX Live from source for $ARCH" @@ -65,11 +63,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then # 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 + cabal update # Build the CLI tool (not the top-level library package) @@ -85,12 +85,13 @@ if [[ "$ARCH" == "ppc64le" ]]; then rm -rf ~/.cabal ~/.ghc /tmp/pandoc dnf remove -y cabal-install ghc gmp-devel dnf clean all && rm -rf /var/cache/dnf + # Verify installation /usr/local/bin/pandoc --version fi -if [[ "$ARCH" == "x86_64" ]]; then +if [[ "$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 @@ -98,7 +99,7 @@ if [[ "$ARCH" == "x86_64" ]]; then 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 + cd /usr/local/texlive/bin/linux ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended # pandoc installation @@ -108,4 +109,3 @@ cd /usr/local/texlive/bin/linux rm -f /tmp/pandoc.tar.gz fi - diff --git a/jupyter/utils/install_texlive.sh b/jupyter/utils/install_texlive.sh index 3f0c190530..59808ea948 100644 --- a/jupyter/utils/install_texlive.sh +++ b/jupyter/utils/install_texlive.sh @@ -9,6 +9,16 @@ UNAME_TO_GOARCH["ppc64le"]="ppc64le" UNAME_TO_GOARCH["s390x"]="s390x" ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" +if [[ -z "${ARCH:-}" ]]; then + echo "Unsupported architecture: $(uname -m)" >&2 + exit 1 +fi + +# Skip PDF export installation for s390x architecture +if [[ "$(uname -m)" == "s390x" ]]; then + echo "PDF export functionality is not supported on s390x architecture. Skipping installation." + exit 0 +fi if [[ "$ARCH" == "ppc64le" ]]; then echo "Installing TeX Live from source for $ARCH..." @@ -29,13 +39,15 @@ if [[ "$ARCH" == "ppc64le" ]]; then # Create build directory and build mkdir ../texlive-build cd ../texlive-build + + # Configure, build, install ../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 @@ -58,12 +70,11 @@ 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 + # 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" @@ -86,4 +97,3 @@ else exit 1 fi - From 42493f4b8bbe25a92c08bfd7b74797fb62db2404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 5 Sep 2025 10:07:10 +0200 Subject: [PATCH 13/14] Enable ppc64le in github actions and in konflux, subject to further review --- ...r-minimal-cpu-py312-ubi9-pull-request.yaml | 1 + ci/cached-builds/gen_gha_matrix_jobs.py | 19 +++++++++++++++++++ scripts/generate_pull_request_pipelineruns.py | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.tekton/odh-workbench-jupyter-minimal-cpu-py312-ubi9-pull-request.yaml b/.tekton/odh-workbench-jupyter-minimal-cpu-py312-ubi9-pull-request.yaml index 23e85a2bf2..06532aebe7 100644 --- a/.tekton/odh-workbench-jupyter-minimal-cpu-py312-ubi9-pull-request.yaml +++ b/.tekton/odh-workbench-jupyter-minimal-cpu-py312-ubi9-pull-request.yaml @@ -36,6 +36,7 @@ spec: - name: build-platforms value: - linux/x86_64 + - linux/ppc64le - name: dockerfile value: jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu - name: path-context diff --git a/ci/cached-builds/gen_gha_matrix_jobs.py b/ci/cached-builds/gen_gha_matrix_jobs.py index 3e233f1d9f..a24604020c 100755 --- a/ci/cached-builds/gen_gha_matrix_jobs.py +++ b/ci/cached-builds/gen_gha_matrix_jobs.py @@ -30,6 +30,10 @@ "runtime-cuda-tensorflow-ubi9-python-3.12", } +PPC64LE_COMPATIBLE = { + "jupyter-minimal-ubi9-python-3.12", +} + S390X_COMPATIBLE = { "runtime-minimal-ubi9-python-3.11", "runtime-minimal-ubi9-python-3.12", @@ -74,6 +78,9 @@ class Arm64Images(enum.Enum): INCLUDE = "include" ONLY = "only" +class Ppc64leImages(enum.Enum): + EXCLUDE = "exclude" + INCLUDE = "include" class S390xImages(enum.Enum): EXCLUDE = "exclude" @@ -109,6 +116,15 @@ def main() -> None: nargs="?", help="Whether to include, exclude, or only include arm64 images", ) + argparser.add_argument( + "--ppc64le-images", + type=Arm64Images, + choices=list(Ppc64leImages), + required=False, + default=Arm64Images.INCLUDE, + nargs="?", + help="Whether to include or exclude ppc64le images", + ) argparser.add_argument( "--s390x-images", type=S390xImages, @@ -145,6 +161,9 @@ def main() -> None: if args.arm64_images != Arm64Images.EXCLUDE and args.s390x_images != S390xImages.ONLY: if target in ARM64_COMPATIBLE: targets_with_platform.append((target, "linux/arm64")) + if args.ppc64le_images != Ppc64leImages.EXCLUDE: + if target in PPC64LE_COMPATIBLE: + targets_with_platform.append((target, "linux/ppc64le")) if args.s390x_images != S390xImages.EXCLUDE and args.arm64_images != Arm64Images.ONLY: # NOTE: hardcode the list of s390x-compatible Makefile targets in S390X_COMPATIBLE if target in S390X_COMPATIBLE: diff --git a/scripts/generate_pull_request_pipelineruns.py b/scripts/generate_pull_request_pipelineruns.py index ce43b12054..78c8d5dad1 100644 --- a/scripts/generate_pull_request_pipelineruns.py +++ b/scripts/generate_pull_request_pipelineruns.py @@ -132,7 +132,20 @@ def transform_build_pipeline_to_pr_pipeline(push_pipeline_path: pathlib.Path): component = push_pipeline["metadata"]["labels"]["appstudio.openshift.io/component"] build_platforms = ["linux/x86_64"] - if component in ["odh-pipeline-runtime-minimal-cpu-py311-ubi9", "odh-pipeline-runtime-minimal-cpu-py312-ubi9"]: + if component in [ + "odh-base-image-cuda-py311-c9s", + "odh-base-image-cuda-py312-c9s", + "odh-base-image-cuda-py312-ubi9", + ]: + build_platforms.extend(["linux/arm64"]) + if component in [ + "odh-workbench-jupyter-minimal-cpu-py312-ubi9", + ]: + build_platforms.extend(["linux/ppc64le"]) + if component in [ + "odh-pipeline-runtime-minimal-cpu-py311-ubi9", + "odh-pipeline-runtime-minimal-cpu-py312-ubi9", + ]: build_platforms.extend(["linux/arm64", "linux/s390x"]) # Collect params From 2e0b25ebc740e0e77d8ae8bd8d02d519cbbee981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 5 Sep 2025 10:08:11 +0200 Subject: [PATCH 14/14] Use COPY from builder image to install latex in the minimal workbench --- jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu index ecd77bd852..f7e7b070ff 100644 --- a/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu +++ b/jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu @@ -78,12 +78,12 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/ USER 0 +# Dependencies for PDF export begin + # 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 ./utils/install_pdf_deps.sh ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH" ENV PATH="/usr/local/texlive/bin/x86_64-linux:/usr/local/pandoc/bin:$PATH" ENV PATH="/opt/texlive/2025/bin/powerpc64le-unknown-linux-gnu:/usr/local/pandoc/bin:$PATH"