From b73caab29cc45f8130b32fcec18f559d5ce09115 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 18 Jun 2026 21:17:19 +0530 Subject: [PATCH 1/9] Added ppc64le support --- .github/workflows/image-publish.yml | 111 ++++++++++----- .../workflows/pull-request-check-publish.yml | 35 +++-- .github/workflows/pull-request-check.yml | 63 ++++++--- build/dockerfiles/linux-musl.Dockerfile | 133 +++++++++++++----- 4 files changed, 249 insertions(+), 93 deletions(-) diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index c918ebfa8ef4..f31409cfe2c2 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -23,19 +23,33 @@ jobs: strategy: fail-fast: false matrix: - dist: [ 'musl', 'libc-ubi8', 'libc-ubi9' ] - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + arch: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + dist: + - libc-ubi8 + - libc-ubi9 + - musl + runs-on: ${{ matrix.arch.runner }} steps: - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch.arch }}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Docker Build env: # https://github.com/microsoft/vscode-ripgrep#github-api-limit-note @@ -53,8 +67,17 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} steps: - name: Checkout uses: actions/checkout@v4 @@ -63,12 +86,7 @@ jobs: BRANCH_NAME=${{ github.ref }} echo "BRANCH_NAME=${BRANCH_NAME##*/}" >> $GITHUB_ENV - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Set tag suffix environment variable run: | SHORT_SHA1=$(git rev-parse --short=7 HEAD) @@ -139,33 +157,58 @@ jobs: - name: publish run: | SHORT_SHA1=$(git rev-parse --short=7 HEAD) - if [[ ${{env.BRANCH_NAME}} == main ]]; then - docker manifest create quay.io/che-incubator/che-code:next --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} + if [[ ${{env.BRANCH_NAME}} == main ]]; then + docker manifest create quay.io/che-incubator/che-code:next \ + --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:next quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --os linux --arch amd64 docker manifest annotate quay.io/che-incubator/che-code:next quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} --os linux --arch arm64 - docker manifest push quay.io/che-incubator/che-code:next - - docker manifest create quay.io/che-incubator/che-code:insiders --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:next quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} --os linux --arch ppc64le + docker manifest push quay.io/che-incubator/che-code:next + + docker manifest create quay.io/che-incubator/che-code:insiders \ + --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:insiders quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --os linux --arch amd64 docker manifest annotate quay.io/che-incubator/che-code:insiders quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} --os linux --arch arm64 - docker manifest push quay.io/che-incubator/che-code:insiders - - docker manifest create quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:insiders quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} --os linux --arch ppc64le + docker manifest push quay.io/che-incubator/che-code:insiders + + docker manifest create quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} \ + --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --os linux --arch amd64 docker manifest annotate quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} --os linux --arch arm64 - docker manifest push quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} - elif [[ ${{env.BRANCH_NAME}} =~ ^7\.[0-9]+\.[0-9]+$ ]]; then - docker manifest create quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} --os linux --arch ppc64le + docker manifest push quay.io/che-incubator/che-code:insiders-${SHORT_SHA1} + + elif [[ ${{env.BRANCH_NAME}} =~ ^7\.[0-9]+\.[0-9]+$ ]]; then + docker manifest create quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} \ + --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --os linux --arch amd64 docker manifest annotate quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} --os linux --arch arm64 - docker manifest push quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} - - docker manifest create quay.io/che-incubator/che-code:latest --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} --os linux --arch ppc64le + docker manifest push quay.io/che-incubator/che-code:${{ env.BRANCH_NAME }} + + docker manifest create quay.io/che-incubator/che-code:latest \ + --amend quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} \ + --amend quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} + docker manifest annotate quay.io/che-incubator/che-code:latest quay.io/che-incubator/che-code:amd64-${{env.tag_suffix}} --os linux --arch amd64 docker manifest annotate quay.io/che-incubator/che-code:latest quay.io/che-incubator/che-code:arm64-${{env.tag_suffix}} --os linux --arch arm64 - docker manifest push quay.io/che-incubator/che-code:latest - fi - + docker manifest annotate quay.io/che-incubator/che-code:latest quay.io/che-incubator/che-code:ppc64le-${{env.tag_suffix}} --os linux --arch ppc64le + docker manifest push quay.io/che-incubator/che-code:latest + fi release-finish: name: release-finish needs: [build, assemble, publish] diff --git a/.github/workflows/pull-request-check-publish.yml b/.github/workflows/pull-request-check-publish.yml index a7e2bd1f62db..612a4bf2ce59 100644 --- a/.github/workflows/pull-request-check-publish.yml +++ b/.github/workflows/pull-request-check-publish.yml @@ -67,6 +67,7 @@ jobs: - name: List downloaded files run: | ls -lahR + - name: Load che-code-amd64 image run: | docker load -i che-code-amd64.tgz @@ -77,7 +78,7 @@ jobs: docker tag che-code-amd64 ${IMAGE} docker push ${IMAGE} echo "_CHE_CODE_AMD64_IMAGE=${IMAGE}" >> $GITHUB_ENV - + - name: Remove che-code-amd64 and prune run: | docker image rm che-code-amd64 || true @@ -93,12 +94,28 @@ jobs: docker tag che-code-arm64 ${IMAGE} docker push ${IMAGE} echo "_CHE_CODE_ARM64_IMAGE=${IMAGE}" >> $GITHUB_ENV - + - name: Remove che-code-arm64 and prune run: | docker image rm che-code-arm64 || true docker system prune -af + - name: Load che-code-ppc64le image + run: | + docker load -i che-code-ppc64le.tgz + + - name: Push che-code-ppc64le docker image + run: | + export IMAGE=quay.io/che-incubator-pull-requests/che-code:pr-${{env._PR_NUMBER}}-ppc64le + docker tag che-code-ppc64le ${IMAGE} + docker push ${IMAGE} + echo "_CHE_CODE_PPC64LE_IMAGE=${IMAGE}" >> $GITHUB_ENV + + - name: Remove che-code-ppc64le and prune + run: | + docker image rm che-code-ppc64le || true + docker system prune -af + - name: Load che-dev image run: | docker load -i che-dev.tgz @@ -109,20 +126,20 @@ jobs: docker tag che-dev ${IMAGE} docker push ${IMAGE} echo "_CHE_DEV_IMAGE=${IMAGE}" >> $GITHUB_ENV - + - name: Remove che-dev and prune run: | docker image rm che-dev || true docker system prune -af - + - name: 'Comment PR' uses: actions/github-script@v7 with: - script: | - const { repo: { owner, repo } } = context; - await github.rest.issues.createComment({ + script: | + const { repo: { owner, repo } } = context; + await github.rest.issues.createComment({ issue_number: process.env._PR_NUMBER, owner: context.repo.owner, repo: context.repo.repo, - body: `Pull Request images published ✨\n\nEditor amd64: [${process.env._CHE_CODE_AMD64_IMAGE}](https://${process.env._CHE_CODE_AMD64_IMAGE})\nEditor arm64: [${process.env._CHE_CODE_ARM64_IMAGE}](https://${process.env._CHE_CODE_ARM64_IMAGE})\nDev image: [${process.env._CHE_DEV_IMAGE}](https://${process.env._CHE_DEV_IMAGE})` - }) + body: `Pull Request images published ✨\n\nEditor amd64: [${process.env._CHE_CODE_AMD64_IMAGE}](https://${process.env._CHE_CODE_AMD64_IMAGE})\nEditor arm64: [${process.env._CHE_CODE_ARM64_IMAGE}](https://${process.env._CHE_CODE_ARM64_IMAGE})\nEditor ppc64le: [${process.env._CHE_CODE_PPC64LE_IMAGE}](https://${process.env._CHE_CODE_PPC64LE_IMAGE})\nDev image: [${process.env._CHE_DEV_IMAGE}](https://${process.env._CHE_DEV_IMAGE})` + }) \ No newline at end of file diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index 5aa8de431721..9b9f04b4844d 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -35,31 +35,45 @@ jobs: echo "[ERROR] Run './build/artifacts/generate.sh' and include file into the commit." exit 1 fi - build: name: build strategy: fail-fast: false matrix: - dist: ['libc-ubi8', 'libc-ubi9', 'musl'] - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + arch: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + dist: + - libc-ubi8 + - libc-ubi9 + - musl + runs-on: ${{ matrix.arch.runner }} steps: - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch.arch }}" >> $GITHUB_ENV - name: Checkout che-code source code uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Cleanup docker images run: docker system prune -af - name: Compile che-code run: | docker buildx build \ --platform linux/${{env.arch}} \ + --load \ --progress=plain \ -f build/dockerfiles/linux-${{matrix.dist}}.Dockerfile \ -t linux-${{matrix.dist}}-${{env.arch}} . @@ -79,18 +93,29 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} steps: - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Checkout che-code source code uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Cleanup docker images run: docker system prune -af - name: Download editor artifacts @@ -117,6 +142,7 @@ jobs: run: | docker buildx build \ --platform linux/${{env.arch}} \ + --load \ --progress=plain \ -f build/dockerfiles/assembly.Dockerfile \ -t che-code-${{env.arch}} . @@ -159,6 +185,7 @@ jobs: run: | docker buildx build \ --platform linux/amd64 \ + --load \ --progress=plain \ -f build/dockerfiles/dev.Dockerfile \ -t che-dev . diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index 7ce5b3da3983..dcd09088fa1b 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -6,25 +6,32 @@ # SPDX-License-Identifier: EPL-2.0 # -# Make an assembly including both musl and libc variant to be able to run on all linux systems -FROM docker.io/node:22-alpine3.22 as linux-musl-builder +# Use Debian-based Node.js image for all architectures (amd64, arm64, ppc64le) +FROM docker.io/node:22-bookworm as linux-musl-builder -RUN apk add --update --no-cache \ +# Set architecture variable for later use +ARG TARGETARCH +ENV BUILD_ARCH=${TARGETARCH} + +# Install dependencies using apt-get (Debian package manager) +RUN apt-get update && apt-get install -y --no-install-recommends \ # Download some files curl \ patch \ # compile some javascript native stuff (node-gyp) - make gcc g++ python3 py3-pip \ - # git + make gcc g++ python3 python3-pip \ + # git git \ # bash shell bash \ - # some lib to compile 'native-keymap' npm mpdule + # some lib to compile 'native-keymap' npm module libx11-dev libxkbfile-dev \ # requirements for keytar - libsecret libsecret-dev \ + libsecret-1-dev \ # kerberos authentication - krb5-dev + libkrb5-dev \ + ca-certificates procps \ + && rm -rf /var/lib/apt/lists/* ######################################################### # @@ -33,6 +40,7 @@ RUN apk add --update --no-cache \ ######################################################### COPY code /checode-compilation WORKDIR /checode-compilation + ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 ENV VSCODE_SKIP_HEADER_INSTALL=1 @@ -52,28 +60,61 @@ RUN rm -rf /checode-compilation/node_modules && npm install --force # Rebuild platform specific dependencies RUN npm rebuild +# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall exits with code 1. +# Disable the postinstall on unsupported architectures — the module is never included in the +# final runtime bundle, so this has no effect on the running product. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + /checode-compilation/package-lock.json; \ + fi + +# Cache node binary with architecture-specific path RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \ - # cache node from this image to avoid to grab it from within the build - && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node" \ - && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine \ - && cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node \ - # workaround to fix build + && if [ "${TARGETARCH}" = "ppc64le" ]; then \ + PLATFORM_DIR="linux-ppc64"; \ + elif [ "${TARGETARCH}" = "arm64" ]; then \ + PLATFORM_DIR="linux-arm64"; \ + else \ + PLATFORM_DIR="linux-x64"; \ + fi \ + && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM_DIR}/node" \ + && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM_DIR} \ + && cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM_DIR}/node \ && cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/ -RUN VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min -RUN cp -r ../vscode-reh-web-linux-alpine /checode +# Build with architecture-specific gulp target +RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ + VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ + ./node_modules/.bin/gulp vscode-reh-web-linux-ppc64-min; \ + elif [ "${TARGETARCH}" = "arm64" ]; then \ + VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ + ./node_modules/.bin/gulp vscode-reh-web-linux-arm64-min; \ + else \ + VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ + ./node_modules/.bin/gulp vscode-reh-web-linux-x64-min; \ + fi + +# Copy output to /checode with architecture-specific source +RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ + cp -r ../vscode-reh-web-linux-ppc64 /checode; \ + elif [ "${TARGETARCH}" = "arm64" ]; then \ + cp -r ../vscode-reh-web-linux-arm64 /checode; \ + else \ + cp -r ../vscode-reh-web-linux-x64 /checode; \ + fi RUN chmod a+x /checode/out/server-main.js \ && chgrp -R 0 /checode && chmod -R g+rwX /checode # Compile tests RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ - compile-extension:markdown-language-features \ - compile-extension:typescript-language-features \ - compile-extension:emmet \ - compile-extension:git \ - compile-extension:ipynb \ - compile-extension-media \ + compile-extension:markdown-language-features \ + compile-extension:typescript-language-features \ + compile-extension:emmet \ + compile-extension:git \ + compile-extension:ipynb \ + compile-extension-media \ compile-extension:configuration-editing # Compile test suites @@ -81,6 +122,7 @@ RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ RUN if [ "$(uname -m)" = "x86_64" ]; then \ npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; \ fi + # use of retry and timeout COPY /build/scripts/helper/retry.sh /usr/bin/retry RUN chmod u+x /usr/bin/retry @@ -88,32 +130,58 @@ RUN chmod u+x /usr/bin/retry # install test dependencies # chromium for tests and procps as tests are using kill commands and it does not work with busybox implementation RUN if [ "$(uname -m)" = "x86_64" ]; then \ - apk add --update --no-cache chromium procps; \ + apt-get update && apt-get install -y --no-install-recommends chromium \ + && rm -rf /var/lib/apt/lists/*; \ fi + ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 + RUN if [ "$(uname -m)" = "x86_64" ]; then \ npm run playwright-install; \ fi + RUN if [ "$(uname -m)" = "x86_64" ]; then \ PLAYWRIGHT_HEADLESS_PATH=$(echo /root/.cache/ms-playwright/chromium_headless_shell-*/chrome-linux) && \ echo "Found headless_shell path: $PLAYWRIGHT_HEADLESS_PATH" && \ rm -f "$PLAYWRIGHT_HEADLESS_PATH/headless_shell" && \ - ln -sf /usr/bin/chromium-browser "$PLAYWRIGHT_HEADLESS_PATH/headless_shell" && \ - ln -sf /usr/bin/chromium-browser "$PLAYWRIGHT_HEADLESS_PATH/chrome" && \ + if command -v chromium-browser > /dev/null; then \ + ln -sf /usr/bin/chromium-browser "$PLAYWRIGHT_HEADLESS_PATH/headless_shell" && \ + ln -sf /usr/bin/chromium-browser "$PLAYWRIGHT_HEADLESS_PATH/chrome"; \ + elif command -v chromium > /dev/null; then \ + ln -sf /usr/bin/chromium "$PLAYWRIGHT_HEADLESS_PATH/headless_shell" && \ + ln -sf /usr/bin/chromium "$PLAYWRIGHT_HEADLESS_PATH/chrome"; \ + fi && \ ls -la "$PLAYWRIGHT_HEADLESS_PATH"; \ fi -# Run integration tests (Browser) +# Run integration tests (Browser) with architecture-specific path RUN if [ "$(uname -m)" = "x86_64" ]; then \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - MACHINE_EXEC_MAX_RETRIES=1 \ - retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ + if [ "${TARGETARCH}" = "ppc64le" ]; then \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-ppc64" \ + retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ + elif [ "${TARGETARCH}" = "arm64" ]; then \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-arm64" \ + MACHINE_EXEC_MAX_RETRIES=1 \ + retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ + else \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ + MACHINE_EXEC_MAX_RETRIES=1 \ + retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ + fi \ fi -# Run smoke tests (Browser) +# Run smoke tests (Browser) with architecture-specific path RUN if [ "$(uname -m)" = "x86_64" ]; then \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + if [ "${TARGETARCH}" = "ppc64le" ]; then \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-ppc64" \ + retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + elif [ "${TARGETARCH}" = "arm64" ]; then \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-arm64" \ + retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + else \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ + retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + fi \ fi ######################################################### @@ -123,10 +191,11 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \ ######################################################### COPY launcher /checode-launcher WORKDIR /checode-launcher + RUN npm install \ && mkdir /checode/launcher \ && cp -r out/src/*.js /checode/launcher \ && chgrp -R 0 /checode && chmod -R g+rwX /checode FROM scratch as linux-musl-content -COPY --from=linux-musl-builder /checode /checode-linux-musl +COPY --from=linux-musl-builder /checode /checode-linux-musl \ No newline at end of file From ff82113cc50fe2c71972eb2bebb45068381a00bf Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 23 Jun 2026 11:18:10 +0530 Subject: [PATCH 2/9] Updated Qemu installation version --- .github/workflows/image-publish.yml | 2 +- .github/workflows/pull-request-check.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image-publish.yml b/.github/workflows/image-publish.yml index f31409cfe2c2..926bae22e45e 100644 --- a/.github/workflows/image-publish.yml +++ b/.github/workflows/image-publish.yml @@ -44,7 +44,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index 9b9f04b4844d..0c9b56900b05 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -61,7 +61,7 @@ jobs: - name: Checkout che-code source code uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -110,7 +110,7 @@ jobs: - name: Checkout che-code source code uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: From 9c7c607b37ab6280a0baf1be91b9f2af558b8d94 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 23 Jun 2026 11:52:16 +0530 Subject: [PATCH 3/9] Update .github/workflows/pull-request-check.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/pull-request-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index 0c9b56900b05..aa2cbf9a3836 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -61,7 +61,7 @@ jobs: - name: Checkout che-code source code uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v4 + uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: From 2d60e478c772df01c845374e0611813cd696b1ff Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Wed, 15 Jul 2026 18:13:11 +0530 Subject: [PATCH 4/9] Reorder dependency installation in Dockerfile --- build/dockerfiles/linux-musl.Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index dcd09088fa1b..8994b4f7ab62 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -54,21 +54,21 @@ RUN git init . # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 -# Grab dependencies (and force to rebuild them) -RUN rm -rf /checode-compilation/node_modules && npm install --force - -# Rebuild platform specific dependencies -RUN npm rebuild - # @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall exits with code 1. # Disable the postinstall on unsupported architectures — the module is never included in the # final runtime bundle, so this has no effect on the running product. # hadolint ignore=SC3014 RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ - /checode-compilation/package-lock.json; \ + /checode-compilation/build/package-lock.json; \ fi +# Grab dependencies (and force to rebuild them) +RUN rm -rf /checode-compilation/node_modules && npm install --force + +# Rebuild platform specific dependencies +RUN npm rebuild + # Cache node binary with architecture-specific path RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \ && if [ "${TARGETARCH}" = "ppc64le" ]; then \ @@ -198,4 +198,4 @@ RUN npm install \ && chgrp -R 0 /checode && chmod -R g+rwX /checode FROM scratch as linux-musl-content -COPY --from=linux-musl-builder /checode /checode-linux-musl \ No newline at end of file +COPY --from=linux-musl-builder /checode /checode-linux-musl From 32e831a4e1deed18adc2babaac6c7b1a92e15937 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Wed, 15 Jul 2026 20:38:29 +0530 Subject: [PATCH 5/9] Fix package-lock.json paths in Dockerfile Updated package-lock.json paths for non-amd64 and non-arm64 architectures. --- build/dockerfiles/linux-musl.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index 8994b4f7ab62..24cb5ae32752 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -60,7 +60,8 @@ RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-m # hadolint ignore=SC3014 RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ - /checode-compilation/build/package-lock.json; \ + build/package-lock.json \ + extensions/copilot/package-lock.json; \ fi # Grab dependencies (and force to rebuild them) From 04b751c9542368bc33d133bc59a8577da01a2680 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Fri, 17 Jul 2026 23:14:31 +0530 Subject: [PATCH 6/9] Fixed ppc64le arch failures --- build/dockerfiles/linux-libc-ubi8.Dockerfile | 26 ++++++++++++++++++++ build/dockerfiles/linux-libc-ubi9.Dockerfile | 25 +++++++++++++++++++ build/dockerfiles/linux-musl.Dockerfile | 19 ++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/build/dockerfiles/linux-libc-ubi8.Dockerfile b/build/dockerfiles/linux-libc-ubi8.Dockerfile index e4e19e92bee0..d6b95d90ca60 100644 --- a/build/dockerfiles/linux-libc-ubi8.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi8.Dockerfile @@ -69,9 +69,35 @@ RUN git init . # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 +# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall +# exits with code 1. Disable it in package-lock.json before npm install. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + build/package-lock.json \ + extensions/copilot/package-lock.json; \ + fi + +# gyp_main.py on UBI8 is not executable AND has wrong shebang +# (python3.8 does not exist - only python3.9/3.12 available). Fix both. +RUN chmod +x /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py \ + && sed -i '1s|^#!.*python.*|#!/usr/bin/python3|' \ + /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py + # Grab dependencies (and force to rebuild them) RUN rm -rf /checode-compilation/node_modules && npm install --force +# tsgo has no native binary for ppc64le/s390x - replace with a no-op. +# Must run AFTER npm install so node_modules/.bin/tsgo exists. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + find . -path "*/node_modules/.bin/tsgo" | while read f; do \ + echo '#!/bin/sh' > "$f"; \ + echo 'exit 0' >> "$f"; \ + chmod +x "$f"; \ + done; \ + fi + # Compile RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ && NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \ diff --git a/build/dockerfiles/linux-libc-ubi9.Dockerfile b/build/dockerfiles/linux-libc-ubi9.Dockerfile index 73b9485627be..59610a344638 100644 --- a/build/dockerfiles/linux-libc-ubi9.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi9.Dockerfile @@ -68,9 +68,34 @@ RUN git init . # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 +# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall +# exits with code 1. Disable it in package-lock.json before npm install. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + build/package-lock.json \ + extensions/copilot/package-lock.json; \ + fi + +# gyp_main.py is not executable on UBI9 - fix permission so node-gyp +# can build native modules (affects all architectures on this image). +RUN chmod +x /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py + # Grab dependencies (and force to rebuild them) RUN rm -rf /checode-compilation/node_modules && npm install --force +# tsgo has no native binary for ppc64le/s390x - replace it with a no-op +# so type-check steps (noEmit only) are skipped gracefully during the gulp build. +# Must run AFTER npm install so node_modules/.bin/tsgo exists. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + find . -path "*/node_modules/.bin/tsgo" | while read f; do \ + echo '#!/bin/sh' > "$f"; \ + echo 'exit 0' >> "$f"; \ + chmod +x "$f"; \ + done; \ + fi + # Compile RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ && NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \ diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index 24cb5ae32752..171bbf20a66e 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -67,9 +67,28 @@ RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ # Grab dependencies (and force to rebuild them) RUN rm -rf /checode-compilation/node_modules && npm install --force +# Disable @vscode/vsce-sign postinstall in installed node_modules for unsupported architectures. +# npm install unpacks the package fresh, so the patch must be applied after install and before rebuild. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + find . -path "*/node_modules/@vscode/vsce-sign/package.json" -exec \ + sed -i 's/"postinstall": "node \.\/src\/postinstall\.js"/"postinstall": "echo skipped"/' {} +; \ + fi + # Rebuild platform specific dependencies RUN npm rebuild +# tsgo has no native binary for ppc64le/s390x - replace it with a no-op so +# type-check steps (noEmit only) are skipped gracefully during the build. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + find . -path "*/node_modules/.bin/tsgo" | while read f; do \ + echo '#!/bin/sh' > "$f"; \ + echo 'exit 0' >> "$f"; \ + chmod +x "$f"; \ + done; \ + fi + # Cache node binary with architecture-specific path RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \ && if [ "${TARGETARCH}" = "ppc64le" ]; then \ From 83e50501009e1fb8f8a5a92580f640cd90f25f9b Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Wed, 12 Aug 2026 19:43:03 +0530 Subject: [PATCH 7/9] Rebuilt images with new node base image version --- build/dockerfiles/linux-libc-ubi8.Dockerfile | 31 ++++++++- build/dockerfiles/linux-libc-ubi9.Dockerfile | 31 ++++++++- build/dockerfiles/linux-musl.Dockerfile | 68 +++++++++++++++----- 3 files changed, 109 insertions(+), 21 deletions(-) diff --git a/build/dockerfiles/linux-libc-ubi8.Dockerfile b/build/dockerfiles/linux-libc-ubi8.Dockerfile index 4341032e09e8..35a3efa8c3ee 100644 --- a/build/dockerfiles/linux-libc-ubi8.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi8.Dockerfile @@ -66,16 +66,36 @@ ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ # Initialize a git repository for code build tools RUN git init . +# prepareBuiltInCopilotRipgrepShim has no unsupported-arch guard unlike other +# copilot functions. Patch it to skip gracefully on ppc64le/s390x. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i 's/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {\n\tif (!copilotPlatforms.includes(toCopilotPackagePlatformArch(platform, arch))) { return; }/' \ + build/lib/copilot.ts; \ + fi + # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 -# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall -# exits with code 1. Disable it in package-lock.json before npm install. +# @vscode/vsce-sign and @github/copilot have no binary for ppc64le/s390x. +# Disable their postinstall scripts before npm install. # hadolint ignore=SC3014 RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ build/package-lock.json \ extensions/copilot/package-lock.json; \ + sed -i 's/"postinstall": "tsx \.\/script\/postinstall\.ts"/"postinstall": "echo skipped"/' \ + extensions/copilot/package.json; \ + fi + +# On ppc64le/s390x, build_from_source in remote/.npmrc causes node-gyp to +# download headers from nodejs.org which times out. Disable it and also +# disable @parcel/watcher install script since no prebuilt exists for ppc64le. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i '/^build_from_source/d' remote/.npmrc; \ + sed -i '0,/"hasInstallScript": true/s/"hasInstallScript": true/"hasInstallScript": false/' \ + remote/package-lock.json; \ fi # node-gyp's make generator execs gyp entrypoints via shebang; UBI npm may @@ -108,7 +128,11 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \ && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \ && cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \ - && NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-copilot-extension-build compile-extension-media-build \ + && if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "aarch64" ]; then \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-copilot-extension-build compile-extension-media-build; \ + else \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-extension-media-build; \ + fi \ && npx tsgo --project src/tsconfig.json --noEmit --skipLibCheck \ && NODE_OPTIONS="--max-old-space-size=8192" node build/next/index.ts bundle --minify --nls --mangle-privates --target server-web --out out-vscode-reh-web-min \ && NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min-ci \ @@ -205,3 +229,4 @@ RUN npm install \ # Store the content of the result FROM scratch as linux-libc-content COPY --from=linux-libc-ubi8-builder /checode /checode-linux-libc/ubi8 + diff --git a/build/dockerfiles/linux-libc-ubi9.Dockerfile b/build/dockerfiles/linux-libc-ubi9.Dockerfile index 2d4df0ed4c0a..c945d387bd6e 100644 --- a/build/dockerfiles/linux-libc-ubi9.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi9.Dockerfile @@ -73,16 +73,36 @@ ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ # Initialize a git repository for code build tools RUN git init . +# prepareBuiltInCopilotRipgrepShim has no unsupported-arch guard unlike other +# copilot functions. Patch it to skip gracefully on ppc64le/s390x. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i 's/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {\n\tif (!copilotPlatforms.includes(toCopilotPackagePlatformArch(platform, arch))) { return; }/' \ + build/lib/copilot.ts; \ + fi + # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 -# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall -# exits with code 1. Disable it in package-lock.json before npm install. +# @vscode/vsce-sign and @github/copilot have no binary for ppc64le/s390x. +# Disable their postinstall scripts before npm install. # hadolint ignore=SC3014 RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ build/package-lock.json \ extensions/copilot/package-lock.json; \ + sed -i 's/"postinstall": "tsx \.\/script\/postinstall\.ts"/"postinstall": "echo skipped"/' \ + extensions/copilot/package.json; \ + fi + +# On ppc64le/s390x, build_from_source in remote/.npmrc causes node-gyp to +# download headers from nodejs.org which times out. Disable it and also +# disable @parcel/watcher install script since no prebuilt exists for ppc64le. +# hadolint ignore=SC3014 +RUN if [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ]; then \ + sed -i '/^build_from_source/d' remote/.npmrc; \ + sed -i '0,/"hasInstallScript": true/s/"hasInstallScript": true/"hasInstallScript": false/' \ + remote/package-lock.json; \ fi # node-gyp's make generator execs gyp entrypoints via shebang; UBI npm may ship them without +x @@ -112,7 +132,11 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \ && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \ && cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \ - && NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-copilot-extension-build compile-extension-media-build \ + && if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "aarch64" ]; then \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-copilot-extension-build compile-extension-media-build; \ + else \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-extension-media-build; \ + fi \ && npx tsgo --project src/tsconfig.json --noEmit --skipLibCheck \ && NODE_OPTIONS="--max-old-space-size=8192" node build/next/index.ts bundle --minify --nls --mangle-privates --target server-web --out out-vscode-reh-web-min \ && NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min-ci \ @@ -211,3 +235,4 @@ RUN npm install \ # Store the content of the result FROM scratch as linux-libc-content COPY --from=linux-libc-ubi9-builder /checode /checode-linux-libc/ubi9 + diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index c82581fcc601..c27b27819552 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -7,7 +7,7 @@ # # Use Debian-based Node.js image for all architectures (amd64, arm64, ppc64le) -FROM docker.io/node:22-bookworm as linux-musl-builder +FROM docker.io/node:24-bookworm as linux-musl-builder # Set architecture variable for later use ARG TARGETARCH @@ -59,14 +59,42 @@ RUN git init . # change network timeout (slow using multi-arch build) RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000 -# @vscode/vsce-sign has no binary for ppc64le/s390x and its postinstall exits with code 1. -# Disable the postinstall on unsupported architectures — the module is never included in the -# final runtime bundle, so this has no effect on the running product. +# prepareBuiltInCopilotRipgrepShim has no unsupported-arch guard unlike other +# copilot functions. Patch it to skip gracefully on ppc64le/s390x. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + sed -i 's/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {/export function prepareBuiltInCopilotRipgrepShim(platform: string, arch: string, builtInCopilotExtensionDir: string, appNodeModulesDir: string): void {\n\tif (!copilotPlatforms.includes(toCopilotPackagePlatformArch(platform, arch))) { return; }/' \ + build/lib/copilot.ts; \ + fi + +# The root .npmrc sets runtime=electron and disturl=electronjs.org for desktop builds. +# On ppc64le/s390x we build the web server only — write global npmrc overrides so +# node-gyp uses plain Node headers. Project .npmrc is left intact for build tools. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + printf 'runtime=node\ndisturl=https://nodejs.org/dist\nbuild_from_source=false\n' \ + >> /root/.npmrc; \ + fi + +# @vscode/vsce-sign and @github/copilot have no binary for ppc64le/s390x. +# Disable their postinstall scripts before npm install. # hadolint ignore=SC3014 RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ build/package-lock.json \ extensions/copilot/package-lock.json; \ + sed -i 's/"postinstall": "tsx \.\/script\/postinstall\.ts"/"postinstall": "echo skipped"/' \ + extensions/copilot/package.json; \ + fi + +# On ppc64le/s390x, build_from_source in remote/.npmrc causes node-gyp to +# download headers from nodejs.org which times out. Disable it and also +# disable @parcel/watcher install script since no prebuilt exists for ppc64le. +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" != "amd64" ] && [ "${TARGETARCH}" != "arm64" ]; then \ + sed -i '/^build_from_source/d' remote/.npmrc; \ + sed -i '0,/"hasInstallScript": true/s/"hasInstallScript": true/"hasInstallScript": false/' \ + remote/package-lock.json; \ fi # Grab dependencies (and force to rebuild them) @@ -108,25 +136,34 @@ RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d && cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM_DIR}/node \ && cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/ -# Build with architecture-specific gulp target +# Compile non-arch-specific assets (main's new pipeline steps) +RUN NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp copy-codicons compile-non-native-extensions-build compile-extension-media-build + +# Compile copilot extension only on supported architectures +# hadolint ignore=SC3014 +RUN if [ "${TARGETARCH}" = "amd64" ] || [ "${TARGETARCH}" = "arm64" ]; then \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp compile-copilot-extension-build; \ + fi + +RUN npx tsgo --project src/tsconfig.json --noEmit --skipLibCheck + +RUN NODE_OPTIONS="--max-old-space-size=8192" node build/next/index.ts bundle --minify --nls --mangle-privates --target server-web --out out-vscode-reh-web-min + +# Build and copy with architecture-specific gulp target RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ - VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ - ./node_modules/.bin/gulp vscode-reh-web-linux-ppc64-min; \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-ppc64-min-ci; \ elif [ "${TARGETARCH}" = "arm64" ]; then \ - VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ - ./node_modules/.bin/gulp vscode-reh-web-linux-arm64-min; \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-arm64-min-ci; \ else \ - VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" \ - ./node_modules/.bin/gulp vscode-reh-web-linux-x64-min; \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min-ci; \ fi -# Copy output to /checode with architecture-specific source RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ cp -r ../vscode-reh-web-linux-ppc64 /checode; \ elif [ "${TARGETARCH}" = "arm64" ]; then \ cp -r ../vscode-reh-web-linux-arm64 /checode; \ else \ - cp -r ../vscode-reh-web-linux-x64 /checode; \ + cp -r ../vscode-reh-web-linux-alpine /checode; \ fi # Pre-compress static assets for faster HTTP delivery (served by che/webClientServer.ts) @@ -199,7 +236,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \ MACHINE_EXEC_MAX_RETRIES=1 \ retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ else \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ MACHINE_EXEC_MAX_RETRIES=1 \ retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ fi \ @@ -214,7 +251,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \ VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-arm64" \ retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ else \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ fi \ fi @@ -234,3 +271,4 @@ RUN npm install \ FROM scratch as linux-musl-content COPY --from=linux-musl-builder /checode /checode-linux-musl + From 728f62163eaddb3148a936a6b8860f402e0b90b4 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 13 Aug 2026 18:14:05 +0530 Subject: [PATCH 8/9] Fixed amd64 workflow issue --- build/dockerfiles/linux-musl.Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index c27b27819552..0c8f8372029d 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -155,7 +155,7 @@ RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ elif [ "${TARGETARCH}" = "arm64" ]; then \ NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-arm64-min-ci; \ else \ - NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min-ci; \ + NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-x64-min-ci; \ fi RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ @@ -163,7 +163,7 @@ RUN if [ "${TARGETARCH}" = "ppc64le" ]; then \ elif [ "${TARGETARCH}" = "arm64" ]; then \ cp -r ../vscode-reh-web-linux-arm64 /checode; \ else \ - cp -r ../vscode-reh-web-linux-alpine /checode; \ + cp -r ../vscode-reh-web-linux-x64 /checode; \ fi # Pre-compress static assets for faster HTTP delivery (served by che/webClientServer.ts) @@ -236,7 +236,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \ MACHINE_EXEC_MAX_RETRIES=1 \ retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ else \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ MACHINE_EXEC_MAX_RETRIES=1 \ retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ fi \ @@ -251,7 +251,7 @@ RUN if [ "$(uname -m)" = "x86_64" ]; then \ VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-arm64" \ retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ else \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ + VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-x64" \ retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ fi \ fi From 266601448a6d0d2df2da33e16a8a41dd1e19f239 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Fri, 28 Aug 2026 13:25:38 +0530 Subject: [PATCH 9/9] Fixed assemble job failures Removed QEMU and Docker Buildx setup steps from the workflow. --- .github/workflows/pull-request-check.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index db349c7d26f5..07895d5987c4 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -109,13 +109,6 @@ jobs: run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Checkout che-code source code uses: actions/checkout@v6 - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Cleanup docker images run: docker system prune -af - name: Download editor artifacts @@ -142,7 +135,6 @@ jobs: run: | docker buildx build \ --platform linux/${{env.arch}} \ - --load \ --progress=plain \ -f build/dockerfiles/assembly.Dockerfile \ -t che-code-${{env.arch}} .