diff --git a/.tekton/README.md b/.tekton/README.md index 00e47cb012..722f3af643 100644 --- a/.tekton/README.md +++ b/.tekton/README.md @@ -6,7 +6,7 @@ All Tekton file updates **must be made in the `konflux-central` repository**. ## ✅ How to Make Changes -To modify the pipelines for `notebooks` in the `main` branch: +To modify the pipelines for `notebooks` in the `rhoai-3.0` release: - Clone the [`konflux-central`](https://github.com/red-hat-data-services/konflux-central) repository. @@ -15,10 +15,10 @@ git clone git@github.com:red-hat-data-services/konflux-central.git cd konflux-central ``` -- Check out the branch +- Check out the release branch ```bash -git checkout main +git checkout rhoai-3.0 ``` - Navigate to the Tekton files for your component(s). @@ -32,8 +32,8 @@ cd pipelineruns/notebooks/.tekton - Commit and push your changes. ```bash -git commit -am "Update pipelinerun for notebooks (main)" -git push origin main +git commit -am "Update pipelinerun for notebooks (rhoai-3.0)" +git push origin rhoai-3.0 ``` - Once pushed, automation will automatically sync your updates to the corresponding component repository. diff --git a/.tekton/odh-workbench-codeserver-datascience-cpu-py312-v3-0-push.yaml b/.tekton/odh-workbench-codeserver-datascience-cpu-py312-v3-0-push.yaml index ecf138d983..525d3afab3 100644 --- a/.tekton/odh-workbench-codeserver-datascience-cpu-py312-v3-0-push.yaml +++ b/.tekton/odh-workbench-codeserver-datascience-cpu-py312-v3-0-push.yaml @@ -51,6 +51,7 @@ spec: - linux-extra-fast/amd64 - linux-m2xlarge/arm64 - linux/ppc64le + - linux/s390x pipelineRef: resolver: git params: diff --git a/.tekton/odh-workbench-jupyter-trustyai-cpu-py312-v3-0-push.yaml b/.tekton/odh-workbench-jupyter-trustyai-cpu-py312-v3-0-push.yaml index f86560ef24..684d3f4d05 100644 --- a/.tekton/odh-workbench-jupyter-trustyai-cpu-py312-v3-0-push.yaml +++ b/.tekton/odh-workbench-jupyter-trustyai-cpu-py312-v3-0-push.yaml @@ -56,6 +56,7 @@ spec: - linux/x86_64 - linux-m2xlarge/arm64 - linux/ppc64le + - linux/s390x pipelineRef: resolver: git params: diff --git a/ci/cached-builds/storage.conf b/ci/cached-builds/storage.conf index a3d94f4024..2faae7c7cd 100644 --- a/ci/cached-builds/storage.conf +++ b/ci/cached-builds/storage.conf @@ -9,6 +9,7 @@ driver = "overlay" graphroot = "/home/runner/.local/share/containers/storage" runroot = "/home/runner/.local/share/containers/storage" +# https://www.redhat.com/en/blog/speed-containers-podman-raspberry-pi transient_store = true [storage.options] diff --git a/codeserver/ubi9-python-3.12/Dockerfile.cpu b/codeserver/ubi9-python-3.12/Dockerfile.cpu index c349b924dd..65a0c43c77 100644 --- a/codeserver/ubi9-python-3.12/Dockerfile.cpu +++ b/codeserver/ubi9-python-3.12/Dockerfile.cpu @@ -57,7 +57,7 @@ COPY ${CODESERVER_SOURCE_CODE}/devel_env_setup.sh ./ # the final stage with the necessary permissions to consume from cache RUN --mount=type=cache,target=/root/.cache/uv \ pip install --no-cache-dir uv && \ - # the devel script is ppc64le specific - sets up build-time dependencies + # the devel script is ppc64le and s390x specific - sets up build-time dependencies source ./devel_env_setup.sh && \ # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. @@ -90,7 +90,7 @@ RUN dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setop # upgrade first to avoid fixable vulnerabilities end # Install useful OS packages -RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum +RUN dnf install -y tar perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/dnf # (ARCH-ppc64le): since wheels are compiled from source, we need shared libs available at runtime RUN --mount=type=cache,from=whl-cache,source=/root/OpenBLAS,target=/OpenBlas,rw \ @@ -139,9 +139,9 @@ USER 0 WORKDIR /opt/app-root/bin # Install useful OS packages -RUN dnf install -y jq git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum +RUN dnf install -y jq git-lfs libsndfile && dnf clean all && rm -rf /var/cache/dnf -# wait for rpm-base stage (rpm builds for ppc64le) +# wait for rpm-base stage (rpm builds for ppc64le and s390x) COPY --from=rpm-base /tmp/control /dev/null # Install code-server @@ -253,7 +253,7 @@ COPY --from=whl-cache /tmp/control /dev/null RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=cache,from=whl-cache,source=/wheelsdir/,target=/wheelsdir/,rw \ bash -c ' \ - if [[ $(uname -m) == "ppc64le" ]]; then \ + if [[ $(uname -m) == "ppc64le" ]] || [[ $(uname -m) == "s390x" ]]; then \ uv pip install /wheelsdir/*.whl; \ fi ' # install packages as USER 0 (this will allow us to consume uv cache) diff --git a/codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu b/codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu index 2f4379e665..67abb0e477 100644 --- a/codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu +++ b/codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu @@ -52,7 +52,7 @@ COPY ${CODESERVER_SOURCE_CODE}/devel_env_setup.sh ./ # the final stage with the necessary permissions to consume from cache RUN --mount=type=cache,target=/root/.cache/uv \ pip install --no-cache uv && \ - # the devel script is ppc64le specific - sets up build-time dependencies + # the devel script is ppc64le and s390x specific - sets up build-time dependencies source ./devel_env_setup.sh && \ # This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`, # we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common. @@ -85,14 +85,12 @@ RUN dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setop # upgrade first to avoid fixable vulnerabilities end # Install useful OS packages -RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum +RUN dnf install -y tar perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/dnf # (ARCH-ppc64le): since wheels are compiled from source, we need shared libs available at runtime RUN --mount=type=cache,from=whl-cache,source=/root/OpenBLAS,target=/OpenBlas,rw \ bash -c ' \ if [[ $(uname -m) == "ppc64le" ]]; then \ - dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm; \ - dnf install -y lcms2 libraqm libimagequant openjpeg2; \ PREFIX=/usr/ make install -C /OpenBlas; \ fi ' @@ -134,9 +132,9 @@ USER 0 WORKDIR /opt/app-root/bin # Install useful OS packages -RUN dnf install -y jq git-lfs libsndfile && dnf clean all && rm -rf /var/cache/yum +RUN dnf install -y jq git-lfs libsndfile && dnf clean all && rm -rf /var/cache/dnf -# wait for rpm-base stage (rpm builds for ppc64le) +#wait for rpm-base stage (rpm builds for ppc64le and s390x) COPY --from=rpm-base /tmp/control /dev/null # Install code-server @@ -246,7 +244,7 @@ COPY --from=whl-cache /tmp/control /dev/null RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=cache,from=whl-cache,source=/wheelsdir/,target=/wheelsdir/,rw \ bash -c ' \ - if [[ $(uname -m) == "ppc64le" ]]; then \ + if [[ $(uname -m) == "ppc64le" ]] || [[ $(uname -m) == "s390x" ]]; then \ uv pip install /wheelsdir/*.whl; \ fi ' # install packages as USER 0 (this will allow us to consume uv cache) diff --git a/codeserver/ubi9-python-3.12/devel_env_setup.sh b/codeserver/ubi9-python-3.12/devel_env_setup.sh index 4c30e8f829..f7f4fcbd84 100755 --- a/codeserver/ubi9-python-3.12/devel_env_setup.sh +++ b/codeserver/ubi9-python-3.12/devel_env_setup.sh @@ -63,6 +63,36 @@ build_pyarrow() { rm -rf ${TEMP_BUILD_DIR} } + # Additional dev tools only for s390x \ +if [[ $(uname -m) == "s390x" ]]; then \ + + dnf install -y perl mesa-libGL skopeo libxcrypt-compat python3.12-devel pkgconf-pkg-config gcc gcc-gfortran gcc-c++ ninja-build make openssl-devel python3-devel pybind11-devel autoconf automake libtool cmake openblas-devel libjpeg-devel zlib-devel libtiff-devel freetype-devel lcms2-devel libwebp-devel git tar wget + dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm + dnf install -y cmake gcc gcc-toolset-13 fribidi-devel lcms2-devel && \ + openjpeg2-devel libraqm-devel libimagequant-devel tcl-devel tk-devel && \ + dnf clean all && rm -rf /var/cache/dnf; + + # install rust + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + + source /opt/rh/gcc-toolset-13/enable + source "$HOME/.cargo/env" + + export MAX_JOBS=${MAX_JOBS:-$(nproc)} + + if [[ $(uname -m) == "s390x" ]]; then + echo "Checking OpenBLAS pkg-config..." + pkg-config --exists openblas || echo "Warning: openblas.pc not found" + fi + + export CMAKE_ARGS="-DPython3_EXECUTABLE=python -DCMAKE_PREFIX_PATH=/usr/local" + + PYARROW_VERSION=$(grep -A1 '"pyarrow"' pylock.toml | grep -Eo '\b[0-9\.]+\b') + build_pyarrow ${PYARROW_VERSION} + uv pip install ${WHEEL_DIR}/*.whl +fi + + if [[ $(uname -m) == "ppc64le" ]]; then # install development packages dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm @@ -101,7 +131,8 @@ if [[ $(uname -m) == "ppc64le" ]]; then build_pillow ${PILLOW_VERSION} uv pip install ${WHEEL_DIR}/*.whl -else - # only for mounting on non-ppc64le - mkdir -p /root/OpenBLAS/ +fi +if [[ $(uname -m) != "ppc64le" ]]; then + # only for mounting on other than s390x and ppc64le + mkdir -p /root/OpenBLAS/ fi diff --git a/codeserver/ubi9-python-3.12/get_code_server_rpm.sh b/codeserver/ubi9-python-3.12/get_code_server_rpm.sh index f293eabe7c..61fc0c0762 100755 --- a/codeserver/ubi9-python-3.12/get_code_server_rpm.sh +++ b/codeserver/ubi9-python-3.12/get_code_server_rpm.sh @@ -17,7 +17,7 @@ UNAME_TO_GOARCH["s390x"]="s390x" ARCH="${UNAME_TO_GOARCH[$(uname -m)]}" -if [[ "$ARCH" == "amd64" || "$ARCH" == "arm64" ||"$ARCH" == "ppc64le" ]]; then +if [[ "$ARCH" == "amd64" || "$ARCH" == "arm64" ||"$ARCH" == "ppc64le" || "$ARCH" == "s390x" ]]; then export MAX_JOBS=${MAX_JOBS:-$(nproc)} export NODE_VERSION=${NODE_VERSION:-22.18.0} @@ -62,12 +62,57 @@ if [[ "$ARCH" == "amd64" || "$ARCH" == "arm64" ||"$ARCH" == "ppc64le" ]]; then # build codeserver git clone --depth 1 --branch "${CODESERVER_VERSION}" --recurse-submodules --shallow-submodules https://github.com/coder/code-server.git cd code-server + +#patch taken from vscodium s390x IBM +if [[ "$ARCH" == "s390x" ]]; then +cat > s390x.patch <