-
Notifications
You must be signed in to change notification settings - Fork 113
RHAIENG-1238: fix(codeserver/ppc64le): remove EPEL from final image of Codeserver #2561
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
Changes from all commits
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 |
---|---|---|
|
@@ -9,10 +9,32 @@ set -eoux pipefail | |
export WHEEL_DIR=${WHEEL_DIR:-"/wheelsdir"} | ||
mkdir -p ${WHEEL_DIR} | ||
|
||
build_pillow() { | ||
CURDIR=$(pwd) | ||
|
||
export PILLOW_VERSION=$1 | ||
|
||
TEMP_BUILD_DIR=$(mktemp -d) | ||
cd ${TEMP_BUILD_DIR} | ||
|
||
: ================== Installing Pillow ================== | ||
git clone --recursive https://github.com/python-pillow/Pillow.git -b ${PILLOW_VERSION} | ||
cd Pillow | ||
uv build --wheel --out-dir /pillowwheel | ||
|
||
: ================= Fix Pillow Wheel ==================== | ||
cd /pillowwheel | ||
uv pip install auditwheel | ||
auditwheel repair pillow*.whl | ||
mv wheelhouse/pillow*.whl ${WHEEL_DIR} | ||
|
||
cd ${CURDIR} | ||
rm -rf ${TEMP_BUILD_DIR} | ||
} | ||
build_pyarrow() { | ||
CURDIR=$(pwd) | ||
|
||
export PYARROW_VERSION=${1:-$(curl -s https://api.github.com/repos/apache/arrow/releases/latest | jq -r '.tag_name' | grep -Eo "[0-9\.]+")} | ||
export PYARROW_VERSION=$1 | ||
|
||
TEMP_BUILD_DIR=$(mktemp -d) | ||
cd ${TEMP_BUILD_DIR} | ||
|
@@ -44,7 +66,8 @@ build_pyarrow() { | |
if [[ $(uname -m) == "ppc64le" ]]; then | ||
# install development packages | ||
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm | ||
dnf install -y cmake gcc-toolset-13 fribidi-devel lcms2-devel \ | ||
# patchelf: needed by `auditwheel repair` | ||
dnf install -y cmake gcc-toolset-13 fribidi-devel lcms2-devel patchelf \ | ||
Shafi-Hussain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libimagequant-devel libraqm-devel openjpeg2-devel tcl-devel tk-devel | ||
Comment on lines
68
to
71
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 chainEnsure EPEL and build-only deps aren’t present in the final image. PR goal is to remove EPEL from the final image. This script enables EPEL and installs -devel packages; please disable/remove EPEL and drop build-only deps after wheel installation, and clean caches. Add a cleanup block after installing wheels: uv pip install ${WHEEL_DIR}/*.whl
+
+ # Cleanup: ensure EPEL and build-only deps do not remain in final image
+ dnf remove -y cmake gcc-toolset-13 fribidi-devel lcms2-devel libimagequant-devel \
+ libraqm-devel openjpeg2-devel tcl-devel tk-devel patchelf || true
+ dnf remove -y epel-release || true
+ rm -f /etc/yum.repos.d/epel*.repo /etc/yum.repos.d/epel*.repo.rpmnew || true
+ # Remove rust toolchain if not needed at runtime
+ rm -rf "$HOME/.cargo" "$HOME/.rustup" || true
+ dnf clean all && rm -rf /var/cache/dnf /var/cache/yum || true Please confirm whether this script runs in a builder-only stage; if yes, cleanup may move to the Dockerfile stage boundary instead. Based on PR objectives. Also applies to: 103-103 🏁 Script executed: #!/bin/bash
# List all Dockerfiles
echo "Dockerfiles in repo:"
find . -type f -iname '*dockerfile*'
# Search for multi-stage builder patterns
echo -e "\nBuilder stages:"
rg -nP 'FROM\s+\S+\s+as\s+\w+' -C3
# Locate invocation of devel_env_setup.sh
echo -e "\nScript usage:"
rg -n 'devel_env_setup\.sh' -C3 Length of output: 5396 🏁 Script executed: #!/bin/bash
echo "codeserver/ubi9-python-3.12/Dockerfile.cpu stages:"
rg -n '^FROM' codeserver/ubi9-python-3.12/Dockerfile.cpu
echo -e "\njupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu stages:"
rg -n '^FROM' jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu Length of output: 720 Append cleanup of EPEL and build‐only deps to devel_env_setup.sh 🤖 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. no, devel_env_setup.sh is only sourced from 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🏁 Script executed:
Length of output: 14541 @jiridanek, you're absolutely correct, and I apologize for the confusion. Looking at the Dockerfile structure:
The builder stage artifacts (wheels and OpenBLAS) are mounted into the final stages using cache mounts:
Since 🧠 Learnings used
|
||
|
||
# install rust | ||
|
@@ -73,6 +96,10 @@ if [[ $(uname -m) == "ppc64le" ]]; then | |
|
||
PYARROW_VERSION=$(grep -A1 '"pyarrow"' pylock.toml | grep -Eo '\b[0-9\.]+\b') | ||
build_pyarrow ${PYARROW_VERSION} | ||
|
||
PILLOW_VERSION=$(grep -A1 '"pillow"' pylock.toml | grep -Eo '\b[0-9\.]+\b') | ||
build_pillow ${PILLOW_VERSION} | ||
|
||
uv pip install ${WHEEL_DIR}/*.whl | ||
else | ||
# only for mounting on non-ppc64le | ||
|
Uh oh!
There was an error while loading. Please reload this page.