-
Notifications
You must be signed in to change notification settings - Fork 113
Add TeX Live and Pandoc installation for ppc64le #1179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9211d51
38b91c3
7184ab0
c5eb49a
1c8cc56
8d3b3e5
2ca6f7d
fd58c51
b009cdd
f124aa1
510e5a0
6673212
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/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 | ||
|
||
jiridanek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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)" | ||
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 |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,89 @@ | ||||||||||||
#!/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 libXt-devel \ | ||||||||||||
zlib-devel freetype-devel libpng-devel ncurses-devel \ | ||||||||||||
gd-devel libtool wget tar xz bison flex libXaw-devel | ||||||||||||
Comment on lines
+16
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://github.com/jiridanek/notebooks/actions/runs/17487759428/job/49670454695 @coderabbitai what to do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain@jiridanek, the build failure is due to missing packages in the UBI9 repositories for ppc64le. Let me investigate the available packages and provide a solution. Based on the build failure, here are the solutions: Immediate FixThe missing packages (
Recommended Script FixReplace lines 16-18 in This aligns with your previous acceptance of EPEL packages for ppc64le architecture improvements, as noted in the retrieved learnings about exploring EPEL alternatives for Pandoc installation. 🏁 Script executed:
Length of output: 1450 🏁 Script executed:
Length of output: 123 🏁 Script executed:
Length of output: 0 🏁 Script executed:
Length of output: 123 🏁 Script executed:
Length of output: 365 @jiridanek, the investigation confirms that UBI9 lacks several essential packages needed for building TeX Live from source. Here's the concrete solution: Fix for install_texlive.shReplace the failing package installation section (lines 16-18) with: # Install EPEL repository first to access missing packages
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# Install build dependencies (removed GUI X11 components not needed for headless PDF generation)
dnf install -y gcc-toolset-13 perl make libX11-devel \
zlib-devel freetype-devel libpng-devel ncurses-devel \
gd-devel libtool wget tar xz bison flex Key Changes
Alternative Minimal ApproachIf you want to minimize dependencies further, try this version that removes even more X11 components: # Install EPEL repository
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# Minimal build dependencies
dnf install -y gcc-toolset-13 perl make \
zlib-devel freetype-devel libpng-devel \
gd-devel libtool wget tar xz bison flex The first approach is recommended as it maintains compatibility while fixing the immediate build failure. This aligns with your previous acceptance of EPEL packages for ppc64le improvements. 🧠 Learnings used
|
||||||||||||
|
||||||||||||
# 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 ../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 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 <<EOF > 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 | ||||||||||||
Comment on lines
+80
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Derive TeX Live binary dir dynamically instead of assuming The installer names the bin dir -mv /usr/local/texlive/bin/"$(uname -m)-linux" /usr/local/texlive/bin/linux
+BIN_DIR=$(find /usr/local/texlive/bin -maxdepth 1 -type d -name '*-linux' | head -n1)
+mv "$BIN_DIR" /usr/local/texlive/bin/linux 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this overly complicated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jiridanek You're absolutely right! The current approach using My suggested Thanks for the reality check - sometimes the straightforward solution is the right one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai create github issue as a reminder for me to revisit this discussion in a final once-over for all the ibm arches merging process There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain@jiridanek I've created a GitHub issue to track the TeX Live binary directory naming discussion for your final review during the IBM architectures merging process. The issue captures the key discussion points and provides a structured way to revisit this technical decision as part of your comprehensive review. 🏁 Script executed:
Length of output: 1800 @jiridanek Perfect! I've successfully created GitHub issue #2279 to track the TeX Live binary directory naming discussion for your final review during the IBM architectures merging process. The issue captures:
You can find it at: #2279 ✏️ Learnings added
🧠 Learnings used
|
||||||||||||
./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended | ||||||||||||
|
||||||||||||
else | ||||||||||||
echo "Unsupported architecture: $ARCH" >&2 | ||||||||||||
exit 1 | ||||||||||||
|
||||||||||||
fi | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai create a github issue to explore installing pandoc from epel, because epel is acceptable (as opposed to centos stream, which is not acceptable in red-hat-data-services/notebooks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@jiridanek, I've created a comprehensive GitHub issue to explore installing Pandoc from EPEL repository for ppc64le architecture as requested. The issue systematically covers:
This aligns with your established pattern of creating systematic issues for infrastructure improvements rather than implementing point fixes during PR reviews.
🏁 Script executed:
Length of output: 1395
🏁 Script executed:
Length of output: 3589
@jiridanek, I've successfully created GitHub issue #2281 to explore installing Pandoc from EPEL repository for ppc64le architecture. The issue provides a comprehensive analysis covering:
The issue systematically addresses your suggestion to use EPEL packages, leveraging the established knowledge from retrieved learnings that EPEL is acceptable according to Red Hat guidance, while maintaining your preference for comprehensive infrastructure improvements through detailed issue tracking.
✏️ Learnings added
🧠 Learnings used