Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/pytorch/ubi9-python-3.12/Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/pytorch/ubi9-python-3.12/Dockerfile.konflux.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/tensorflow/ubi9-python-3.12/Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
1 change: 0 additions & 1 deletion jupyter/trustyai/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ 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"
# Dependencies for PDF export end

USER 1001
Expand Down
94 changes: 61 additions & 33 deletions jupyter/utils/install_pdf_deps.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,71 @@
#!/bin/bash

# Install dependencies required for Notebooks PDF exports
# Install OS dependencies required for JupyterLab PDF export.
# Uses RHEL/UBI AppStream texlive RPMs plus EPEL for texlive-tcolorbox and pandoc.
# Requires AppStream (subscription or c9s); plain unsubscribed UBI lacks these packages
# (see https://github.com/red-hat-data-services/notebooks/issues/2310).
# Backport of main's RPM approach (RHAIENG-2186 / RHAIENG-2345); replaces Utah/CTAN curl.

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 [[ -z "${ARCH:-}" ]]; then
echo "Unsupported architecture: $(uname -m)" >&2
exit 1
fi
set -Eeuxo pipefail

# Skip PDF export installation for s390x and ppc64le architectures
if [[ "$(uname -m)" == "s390x" || "$(uname -m)" == "ppc64le" ]]; then
echo "PDF export functionality is not supported on $(uname -m) architecture. Skipping installation."
exit 0
fi

# tex live installation
# Pin to the TeX Live 2025 historic archive so the installer version and
# package repository version always match (mirror.ctan.org now serves 2026).
TEXLIVE_HISTORIC="https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/tlnet-final"
echo "Installing TexLive to allow PDf export from Notebooks"
curl -fL "${TEXLIVE_HISTORIC}/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 --repository="${TEXLIVE_HISTORIC}"
ln -s /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux
cd /usr/local/texlive/bin/linux
./tlmgr --repository="${TEXLIVE_HISTORIC}" install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended

# 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
# https://github.com/rh-aiservices-bu/workbench-images/blob/main/snippets/ides/1-jupyter/os/os-packages.txt
# texlive-tcolorbox is not in AppStream; install from EPEL (do not curl a pinned Fedora RPM URL).
PACKAGES=(
texlive-adjustbox
texlive-bibtex
texlive-charter
texlive-ec
texlive-euro
texlive-eurosym
texlive-fpl
texlive-jknapltx
texlive-knuth-local
texlive-lm-math
texlive-marvosym
texlive-mathpazo
texlive-mflogo-font
texlive-parskip
texlive-plain
texlive-pxfonts
texlive-rsfs
texlive-tcolorbox
texlive-times
texlive-titling
texlive-txfonts
texlive-ulem
texlive-upquote
texlive-utopia
texlive-wasy
texlive-wasy-type1
texlive-wasysym
texlive-xetex
# dependencies of texlive-tcolorbox
texlive-environ
texlive-trimspaces
)

# EPEL provides texlive-tcolorbox and pandoc (dynamic binary; check-payload friendly).
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

if ! dnf install -y "${PACKAGES[@]}" pandoc; then
echo "ERROR: Failed to install texlive/pandoc RPMs." >&2
echo "AppStream texlive packages require a subscribed RHEL/UBI build or c9s AppStream." >&2
echo "Unsubscribed UBI-only template builds are tracked in" >&2
echo "https://github.com/red-hat-data-services/notebooks/issues/2310" >&2
exit 1
fi

dnf clean all

pdflatex --version
pandoc --version
texhash
kpsewhich tcolorbox.sty
command -v pandoc
command -v pdflatex
1 change: 0 additions & 1 deletion scripts/dockerfile_fragments.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def main():
"""),
"Dependencies for PDF export": textwrap.dedent(r"""
RUN ./utils/install_pdf_deps.sh
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
"""),
"Download Elyra Bootstrapper": textwrap.dedent(r"""
RUN curl -fL https://raw.githubusercontent.com/opendatahub-io/elyra/refs/tags/v4.3.1/elyra/kfp/bootstrapper.py \
Expand Down
2 changes: 1 addition & 1 deletion tests/containers/workbenches/jupyterlab/jupyterlab_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_pdf_export(self, jupyterlab_image: conftest.Image, container_arch: str)
if container_arch in ("s390x", "ppc64le"):
pytest.skip(f"PDF export not supported on {container_arch} architecture")
container = WorkbenchContainer(image=jupyterlab_image.name, user=4321, group_add=[0])
test_file_name = "test.ipybn"
test_file_name = "test.ipynb"
test_file_content = """{
"cells": [
{
Expand Down
Loading