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
10 changes: 5 additions & 5 deletions codeserver/ubi9-python-3.12/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
36 changes: 33 additions & 3 deletions codeserver/ubi9-python-3.12/devel_env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ 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
Expand Down Expand Up @@ -101,7 +130,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 ppc64le
mkdir -p /root/OpenBLAS/
fi
Comment on lines +135 to 137
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify comment vs condition.

Block runs on non-ppc64le, but the comment mentions “other ppc64le”. Reword to match behavior.

-   # only for mounting on other ppc64le
+   # Create mount point for OpenBLAS in non-ppc64le builds (used by ppc64le multistage mounting)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# only for mounting on other ppc64le
mkdir -p /root/OpenBLAS/
fi
# Create mount point for OpenBLAS in non-ppc64le builds (used by ppc64le multistage mounting)
mkdir -p /root/OpenBLAS/
fi
🤖 Prompt for AI Agents
In codeserver/ubi9-python-3.12/devel_env_setup.sh around lines 135 to 137, the
inline comment "only for mounting on other ppc64le" contradicts the condition
(block runs on non-ppc64le); update the comment to accurately reflect the
behavior (e.g., "create OpenBLAS dir for mounting when not on ppc64le" or
similar) so it matches the condition and avoid confusion.

47 changes: 46 additions & 1 deletion codeserver/ubi9-python-3.12/get_code_server_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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 : https://github.com/VSCodium/vscodium/blob/master/patches/linux/reh/s390x/arch-4-s390x-package.json.patch
if [[ "$ARCH" == "s390x" ]]; then
cat > s390x.patch <<EOL
diff --git a/lib/vscode/package-lock.json b/lib/vscode/package-lock.json
index 0d0272a92b2..73e8feb92dd 100644
--- a/lib/vscode/package-lock.json
+++ b/lib/vscode/package-lock.json
@@ -18236,10 +18236,11 @@
}
},
"node_modules/web-tree-sitter": {
- "version": "0.20.8",
- "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.20.8.tgz",
- "integrity": "sha512-weOVgZ3aAARgdnb220GqYuh7+rZU0Ka9k9yfKtGAzEYMa6GgiCzW9JjQRJyCJakvibQW+dfjJdihjInKuuCAUQ==",
- "dev": true
+ "version": "0.23.0",
+ "resolved": "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.23.0.tgz",
+ "integrity": "sha512-p1T+ju2H30fpVX2q5yr+Wv/NfdMMWMjQp9Q+4eEPrHAJpPFh9DPfI2Yr9L1f5SA5KPE+g1cNUqPbpihxUDzmVw==",
+ "dev": true,
+ "license": "MIT"
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
diff --git a/lib/vscode/package.json b/lib/vscode/package.json
index a4c7a2a3a35..d7f816248af 100644
--- a/lib/vscode/package.json
+++ b/lib/vscode/package.json
@@ -227,6 +227,9 @@
"node-gyp-build": "4.8.1",
"[email protected]": {
"node-addon-api": "7.1.0"
+ },
+ "@vscode/[email protected]": {
+ "web-tree-sitter": "0.23.0"
}
},
"repository": {
EOL

git apply s390x.patch
fi

source ${NVM_DIR}/nvm.sh
while IFS= read -r src_patch; do echo "patches/$src_patch"; patch -p1 < "patches/$src_patch"; done < patches/series
nvm use ${NODE_VERSION}
npm cache clean --force
npm install
npm run build
VERSION=${CODESERVER_VERSION/v/} npm run build:vscode
export KEEP_MODULES=1
npm run release
npm run release:standalone

Expand Down
4 changes: 4 additions & 0 deletions codeserver/ubi9-python-3.12/pylock.toml
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/8f/8e/9ad090d3553c280
[[packages]]
name = "ml-dtypes"
version = "0.5.3"
marker = "platform_machine != 's390x'"
sdist = { url = "https://files.pythonhosted.org/packages/78/a7/aad060393123cfb383956dca68402aff3db1e1caffd5764887ed5153f41b/ml_dtypes-0.5.3.tar.gz", upload-time = 2025-07-29T18:39:19Z, size = 692316, hashes = { sha256 = "95ce33057ba4d05df50b1f3cfefab22e351868a843b3b15a46c65836283670c9" } }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ac/bb/1f32124ab6d3a279ea39202fe098aea95b2d81ef0ce1d48612b6bf715e82/ml_dtypes-0.5.3-cp310-cp310-macosx_10_9_universal2.whl", upload-time = 2025-07-29T18:38:17Z, size = 667409, hashes = { sha256 = "0a1d68a7cb53e3f640b2b6a34d12c0542da3dd935e560fdf463c0c77f339fc20" } },
Expand Down Expand Up @@ -1205,6 +1206,7 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/be/9c/92789c596b8df83
[[packages]]
name = "onnx"
version = "1.19.0"
marker = "platform_machine != 's390x'"
sdist = { url = "https://files.pythonhosted.org/packages/5b/bf/b0a63ee9f3759dcd177b28c6f2cb22f2aecc6d9b3efecaabc298883caa5f/onnx-1.19.0.tar.gz", upload-time = 2025-08-27T02:34:27Z, size = 11949859, hashes = { sha256 = "aa3f70b60f54a29015e41639298ace06adf1dd6b023b9b30f1bca91bb0db9473" } }
wheels = [
{ url = "https://files.pythonhosted.org/packages/00/b3/8a6f3b05d18dffdc7c18839bd829587c826c8513f4bdbe21ddf37dacce50/onnx-1.19.0-cp310-cp310-macosx_12_0_universal2.whl", upload-time = 2025-08-27T02:32:47Z, size = 18310869, hashes = { sha256 = "e927d745939d590f164e43c5aec7338c5a75855a15130ee795f492fc3a0fa565" } },
Expand Down Expand Up @@ -1523,6 +1525,7 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/8e/37/efad0257dc6e593
[[packages]]
name = "py-spy"
version = "0.4.1"
marker = "platform_machine != 's390x'"
sdist = { url = "https://files.pythonhosted.org/packages/19/e2/ff811a367028b87e86714945bb9ecb5c1cc69114a8039a67b3a862cef921/py_spy-0.4.1.tar.gz", upload-time = 2025-07-31T19:33:25Z, size = 244726, hashes = { sha256 = "e53aa53daa2e47c2eef97dd2455b47bb3a7e7f962796a86cc3e7dbde8e6f4db4" } }
wheels = [
{ url = "https://files.pythonhosted.org/packages/14/e3/3a32500d845bdd94f6a2b4ed6244982f42ec2bc64602ea8fcfe900678ae7/py_spy-0.4.1-py2.py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", upload-time = 2025-07-31T19:33:13Z, size = 3682508, hashes = { sha256 = "809094208c6256c8f4ccadd31e9a513fe2429253f48e20066879239ba12cd8cc" } },
Expand Down Expand Up @@ -2203,6 +2206,7 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc
[[packages]]
name = "skl2onnx"
version = "1.19.1"
marker = "platform_machine != 's390x'"
sdist = { url = "https://files.pythonhosted.org/packages/e1/59/3f4d82eb96d8a80fd80325fc658d20e772ee6ac1c6f5cc85dd6aaaf7ccff/skl2onnx-1.19.1.tar.gz", upload-time = 2025-05-28T17:37:02Z, size = 948919, hashes = { sha256 = "0c105f2a3b87a624dd218d1fb98fdd19cf1bf6217190d25ce7e15484127d0e5d" } }
wheels = [{ url = "https://files.pythonhosted.org/packages/57/ec/9a0d709217aa385d87b3eadcf19e2ae32eca097077fa2236312d5fc8f656/skl2onnx-1.19.1-py3-none-any.whl", upload-time = 2025-05-28T17:37:00Z, size = 315511, hashes = { sha256 = "fddf2f49e3ffc355f332e676b43c6fec5e63797627925b279d9f5b2c4d0c81a7" } }]

Expand Down
4 changes: 2 additions & 2 deletions codeserver/ubi9-python-3.12/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies = [
"plotly~=6.3.0",
"scikit-learn~=1.7.2",
"scipy~=1.16.1",
"skl2onnx~=1.19.1",
"skl2onnx~=1.19.1; platform_machine != 's390x'",
"ipykernel~=6.30.1",
"kubeflow-training==1.9.3",
"feast~=0.53.0",
Expand All @@ -26,7 +26,7 @@ dependencies = [
"opencensus~=0.11.4",
"smart-open~=7.3.1",
"virtualenv~=20.34.0",
"py-spy~=0.4.1",
"py-spy~=0.4.1; platform_machine != 's390x'",
"prometheus-client~=0.22.1",
]

Expand Down
Loading