diff --git a/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi8.Dockerfile b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi8.Dockerfile new file mode 100644 index 0000000000..0858a2b835 --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi8.Dockerfile @@ -0,0 +1,175 @@ +# Copyright (c) 2021-2026 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# + +# https://registry.access.redhat.com/ubi8/nodejs-20 +FROM registry.access.redhat.com/ubi8/nodejs-22:1-1773852797 as linux-libc-ubi8-builder + +USER root + +# Export GITHUB_TOKEN into environment variable +ARG GITHUB_TOKEN='' +ENV GITHUB_TOKEN=$GITHUB_TOKEN + +# Unset GITHUB_TOKEN environment variable if it is empty. +# This is needed for some tools which use this variable and will fail with 401 Unauthorized error if it is invalid. +# For example, vscode ripgrep downloading is an example of such case. +RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi + +# Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86) +RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ + https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-0.20.4-2.fc34.s390x.rpm \ + https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-devel-0.20.4-2.fc34.s390x.rpm"; \ + elif [[ $(uname -m) == "ppc64le" ]]; then LIBSECRET="\ + libsecret \ + https://vault.centos.org/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm"; \ + elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\ + https://vault.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libsecret-devel-0.18.6-1.el8.x86_64.rpm \ + libsecret"; \ + elif [[ $(uname -m) == "aarch64" ]]; then LIBSECRET="\ + https://vault.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/libsecret-devel-0.18.6-1.el8.aarch64.rpm \ + libsecret"; \ + else \ + LIBSECRET=""; echo "Warning: arch $(uname -m) not supported"; \ + fi; } \ + && { if [[ $(uname -m) == "x86_64" ]]; then LIBKEYBOARD="\ + https://vault.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm \ + https://vault.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm"; \ + elif [[ $(uname -m) == "ppc64le" ]]; then LIBKEYBOARD="\ + https://vault.centos.org/8-stream/AppStream/ppc64le/os/Packages/libxkbfile-1.1.0-1.el8.ppc64le.rpm \ + https://vault.centos.org/8-stream/PowerTools/ppc64le/os/Packages/libxkbfile-devel-1.1.0-1.el8.ppc64le.rpm"; \ + elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\ + https://vault.centos.org/centos/8-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-1.el8.aarch64.rpm \ + https://vault.centos.org/centos/8-stream/PowerTools/aarch64/os/Packages/libxkbfile-devel-1.1.0-1.el8.aarch64.rpm"; \ + else \ + LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \ + fi; } \ + && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake gcc gcc-c++ python3.9 git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ + && yum -y clean all && rm -rf /var/cache/yum + +######################################################### +# +# Copy Che-Code to the container +# +######################################################### +COPY code /checode-compilation +WORKDIR /checode-compilation +ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \ + VSCODE_SKIP_HEADER_INSTALL=1 \ + PATH="/opt/rh/gcc-toolset-13/root/usr/bin:${PATH}" + +# Initialize a git repository for code build tools +RUN git init . + +# @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 ARCH=$(uname -m); \ + if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "aarch64" ]; then \ + sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + build/package-lock.json; \ + fi + +# 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 + +# 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 '"') \ + # cache node from this image to avoid to grab it from within the build + && 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 \ + && VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \ + && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode \ + # cache shared libs from this image to provide them to a user's container + && mkdir -p /checode/ld_libs \ + && find /usr/lib64 -name 'libnode.so*' -exec cp -P -t /checode/ld_libs/ {} + \ + && find /usr/lib64 -name 'libz.so*' -exec cp -P -t /checode/ld_libs/ {} + + +RUN chmod a+x /checode/out/server-main.js \ + && chgrp -R 0 /checode && chmod -R g+rwX /checode + +### Beginning of tests +# Do not change line above! It is used to cut this section to skip tests + +# 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:configuration-editing + +# Compile test suites +# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile +RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi + +# install test dependencies +ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi +# Install procps to manage to kill processes and centos stream repository +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + ARCH=$(uname -m) && \ + yum install --nobest -y procps \ + https://vault.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ + https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ + https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm; \ + fi + +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ + && yum install -y chromium \ + && PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/) \ + && rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" \ + && ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome"; \ + fi + +# use of retry and timeout +COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh +RUN chmod u+x /opt/app-root/src/retry.sh + +# Run integration tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + NODE_ARCH=$(echo "console.log(process.arch)" | node) \ + VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ + /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \ + fi + +# Run smoke tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + NODE_ARCH=$(echo "console.log(process.arch)" | node) \ + VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ + /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + fi + +# Do not change line below! It is used to cut this section to skip tests +### Ending of tests + +######################################################### +# +# Copy VS Code launcher to the container +# +######################################################### +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 + +# 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/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi9.Dockerfile b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi9.Dockerfile new file mode 100644 index 0000000000..ce4675e23c --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-libc-ubi9.Dockerfile @@ -0,0 +1,177 @@ +# Copyright (c) 2024-2026 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# + +# https://registry.access.redhat.com/ubi9/nodejs-20 +FROM registry.access.redhat.com/ubi9/nodejs-22:9.7-1773809184 as linux-libc-ubi9-builder + +USER root + +# Export GITHUB_TOKEN into environment variable +ARG GITHUB_TOKEN='' +ENV GITHUB_TOKEN=$GITHUB_TOKEN + +# Unset GITHUB_TOKEN environment variable if it is empty. +# This is needed for some tools which use this variable and will fail with 401 Unauthorized error if it is invalid. +# For example, vscode ripgrep downloading is an example of such case. +RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi + +# Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86) +RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/s390x/os/Packages/libsecret-0.20.4-4.el9.s390x.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/s390x/os/Packages/libsecret-devel-0.20.4-4.el9.s390x.rpm"; \ + elif [[ $(uname -m) == "ppc64le" ]]; then LIBSECRET="\ + libsecret \ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/ppc64le/os/Packages/libsecret-devel-0.20.4-4.el9.ppc64le.rpm"; \ + elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/libsecret-devel-0.20.4-4.el9.x86_64.rpm \ + libsecret"; \ + elif [[ $(uname -m) == "aarch64" ]]; then LIBSECRET="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/libsecret-devel-0.20.4-4.el9.aarch64.rpm \ + libsecret"; \ + else \ + LIBSECRET=""; echo "Warning: arch $(uname -m) not supported"; \ + fi; } \ + && { if [[ $(uname -m) == "x86_64" ]]; then LIBKEYBOARD="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-8.el9.x86_64.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/CRB/x86_64/os/Packages/libxkbfile-devel-1.1.0-8.el9.x86_64.rpm"; \ + elif [[ $(uname -m) == "ppc64le" ]]; then LIBKEYBOARD="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/ppc64le/os/Packages/libxkbfile-1.1.0-8.el9.ppc64le.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/CRB/ppc64le/os/Packages/libxkbfile-devel-1.1.0-8.el9.ppc64le.rpm"; \ + elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\ + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-8.el9.aarch64.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/CRB/aarch64/os/Packages/libxkbfile-devel-1.1.0-8.el9.aarch64.rpm"; \ + else \ + LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \ + fi; } \ + && yum install -y $LIBSECRET $LIBKEYBOARD make cmake gcc gcc-c++ python3.9 git git-core-doc openssh less libX11-devel libxkbcommon krb5-devel bash tar gzip rsync patch npm \ + && yum -y clean all && rm -rf /var/cache/yum + +######################################################### +# +# Copy Che-Code to the container +# +######################################################### +COPY code /checode-compilation +WORKDIR /checode-compilation +ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \ + VSCODE_SKIP_HEADER_INSTALL=1 + + +# @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 ARCH=$(uname -m); \ + if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "aarch64" ]; then \ + sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + build/package-lock.json; \ + fi + +# Initialize a git repository for code build tools +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 + +# 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 '"') \ + # cache node from this image to avoid to grab it from within the build + && 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 \ + && VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \ + && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode \ + # cache shared libs from this image to provide them to a user's container + && mkdir -p /checode/ld_libs/core /checode/ld_libs/openssl \ + && find /usr/lib64 -name 'libbrotli*' -exec cp -P -t /checode/ld_libs/core/ {} + \ + && find /usr/lib64 -name 'libnode.so*' -exec cp -P -t /checode/ld_libs/core/ {} + \ + && find /usr/lib64 -name 'libz.so*' -exec cp -P -t /checode/ld_libs/core/ {} + \ + && find /usr/lib64 -name 'libssl.so*' -exec cp -P -t /checode/ld_libs/openssl/ {} + \ + && find /usr/lib64 -name 'libcrypto.so*' -exec cp -P -t /checode/ld_libs/openssl/ {} + + +RUN chmod a+x /checode/out/server-main.js \ + && chgrp -R 0 /checode && chmod -R g+rwX /checode + +### Beginning of tests +# Do not change line above! It is used to cut this section to skip tests + +# 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:configuration-editing + +# # Compile test suites +# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile +RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi + +# install test dependencies +ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi +# Install procps to manage to kill processes and centos stream repository +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + ARCH=$(uname -m) && \ + yum install --nobest -y procps \ + https://rpmfind.net/linux/epel/9/Everything/x86_64/Packages/e/epel-release-9-10.el9.noarch.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-32.el9.noarch.rpm \ + https://rpmfind.net/linux/centos-stream/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-32.el9.noarch.rpm; \ + fi + +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + yum install -y chromium && \ + PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/) && \ + rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \ + ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome"; \ + fi + +# use of retry and timeout +COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh +RUN chmod u+x /opt/app-root/src/retry.sh + +# Run integration tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + NODE_ARCH=$(echo "console.log(process.arch)" | node) \ + VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ + /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \ + fi + +# Run smoke tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; then \ + NODE_ARCH=$(echo "console.log(process.arch)" | node) \ + VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ + /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ + fi + +# Do not change line below! It is used to cut this section to skip tests +### Ending of tests + +######################################################### +# +# Copy VS Code launcher to the container +# +######################################################### +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 + +# 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/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-musl.Dockerfile b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-musl.Dockerfile new file mode 100644 index 0000000000..f818c21bed --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/Dockerfiles/linux-musl.Dockerfile @@ -0,0 +1,147 @@ +# Copyright (c) 2021-2026 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# + +#Note: This Dockerfile is built only ppc64le and not work for other architectures + +# Build assembly for linux ppc64le +FROM docker.io/ppc64le/node:22 as linux-ppc64-builder + +RUN apt-get update && apt-get install -y \ + # Download some files + curl \ + patch \ + # compile some javascript native stuff (node-gyp) + make gcc g++ python3 python3-pip \ + # git + git \ + # bash shell + bash \ + # some lib to compile 'native-keymap' npm module + libx11-dev libxkbfile-dev \ + # requirements for keytar + libsecret-1-dev \ + # kerberos authentication + libkrb5-dev \ + # certificates + ca-certificates \ + # process utilities + procps \ + # browser for tests + chromium \ + && rm -rf /var/lib/apt/lists/* + +######################################################### +# +# Copy Che-Code to the container +# +######################################################### +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 + +# workaround for https://github.com/nodejs/node/issues/52229 +ENV CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT' + +# Initialize a git repository for code build tools +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 + +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-ppc64/node" \ + && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-ppc64 \ + && cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-ppc64/node \ + # workaround to fix build + && 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-ppc64-min + +RUN cp -r ../vscode-reh-web-linux-ppc64 /checode + +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:configuration-editing + +# Compile test suites +# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile +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 + +# install test dependencies +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 "$PLAYWRIGHT_HEADLESS_PATH/headless_shell" && \ + ln -sf /usr/bin/chromium "$PLAYWRIGHT_HEADLESS_PATH/chrome" && \ + ls -la "$PLAYWRIGHT_HEADLESS_PATH"; \ + fi + +# Run integration tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; 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; \ + fi + +# Run smoke tests (Browser) +RUN if [ "$(uname -m)" = "x86_64" ]; 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"; \ + fi + +######################################################### +# +# Copy VS Code launcher to the container +# +######################################################### +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-ppc64-content + +COPY --from=linux-ppc64-builder /checode /checode-linux-musl diff --git a/e/eclipse-che/che-incubator/che-code/LICENSE b/e/eclipse-che/che-incubator/che-code/LICENSE new file mode 100644 index 0000000000..d3087e4c54 --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/LICENSE @@ -0,0 +1,277 @@ +Eclipse Public License - v 2.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from + and are Distributed by that particular Contributor. A Contribution + "originates" from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's behalf. + Contributions do not include changes or additions to the Program that + are not Modified Works. + +"Contributor" means any person or entity that Distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which +are necessarily infringed by the use or sale of its Contribution alone +or when combined with the Program. + +"Program" means the Contributions Distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement +or any Secondary License (as applicable), including Contributors. + +"Derivative Works" shall mean any work, whether in Source Code or other +form, that is based on (or derived from) the Program and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. + +"Modified Works" shall mean any work in Source Code or other form that +results from an addition to, deletion from, or modification of the +contents of the Program, including, for purposes of clarity any new file +in Source Code form that contains any contents of the Program. Modified +Works shall not include works that contain only declarations, +interfaces, types, classes, structures, or files of the Program solely +in each case in order to link to, bind by name, or subclass the Program +or Modified Works thereof. + +"Distribute" means the acts of a) distributing or b) making available +in any manner that enables the transfer of a copy. + +"Source Code" means the form of a Program preferred for making +modifications, including but not limited to software source code, +documentation source, and configuration files. + +"Secondary License" means either the GNU General Public License, +Version 2.0, or any later versions of that license, including any +exceptions or additional permissions as identified by the initial +Contributor. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare Derivative Works of, publicly display, + publicly perform, Distribute and sublicense the Contribution of such + Contributor, if any, and such Derivative Works. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in Source Code or other form. This patent license shall + apply to the combination of the Contribution and the Program if, at + the time the Contribution is added by the Contributor, such addition + of the Contribution causes such combination to be covered by the + Licensed Patents. The patent license shall not apply to any other + combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to Distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + e) Notwithstanding the terms of any Secondary License, no + Contributor makes additional grants to any Recipient (other than + those set forth in this Agreement) as a result of such Recipient's + receipt of the Program under the terms of a Secondary License + (if permitted under the terms of Section 3). + +3. REQUIREMENTS + +3.1 If a Contributor Distributes the Program in any form, then: + + a) the Program must also be made available as Source Code, in + accordance with section 3.2, and the Contributor must accompany + the Program with a statement that the Source Code for the Program + is available under this Agreement, and informs Recipients how to + obtain it in a reasonable manner on or through a medium customarily + used for software exchange; and + + b) the Contributor may Distribute the Program under a license + different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and fitness + for a particular purpose; + + ii) effectively excludes on behalf of all other Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) does not attempt to limit or alter the recipients' rights + in the Source Code under section 3.2; and + + iv) requires any subsequent distribution of the Program by any + party to be under a license that satisfies the requirements + of this section 3. + +3.2 When the Program is Distributed as Source Code: + + a) it must be made available under this Agreement, or if the + Program (i) is combined with other material in a separate file or + files made available under a Secondary License, and (ii) the initial + Contributor attached to the Source Code the notice described in + Exhibit A of this Agreement, then the Program may be made available + under the terms of such Secondary Licenses, and + + b) a copy of this Agreement must be included with each copy of + the Program. + +3.3 Contributors may not remove or alter any copyright, patent, +trademark, attribution notices, disclaimers of warranty, or limitations +of liability ("notices") contained within the Program from any copy of +the Program which they Distribute, provided that Contributors may add +their own appropriate notices. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities +with respect to end users, business partners and the like. While this +license is intended to facilitate the commercial use of the Program, +the Contributor who includes the Program in a commercial product +offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes +the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every +other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits +and other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program +in a commercial product offering. The obligations in this section do not +apply to any claims or Losses relating to any actual or alleged +intellectual property infringement. In order to qualify, an Indemnified +Contributor must: a) promptly notify the Commercial Contributor in +writing of such claim, and b) allow the Commercial Contributor to control, +and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those performance +claims and warranties, and if a court requires any other Contributor to +pay any damages as a result, the Commercial Contributor must pay +those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF +TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE. Each Recipient is solely responsible for determining the +appropriateness of using and distributing the Program and assumes all +risks associated with its exercise of rights under this Agreement, +including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs +or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS +SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software +or hardware) infringes such Recipient's patent(s), then such Recipient's +rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign the +responsibility to serve as the Agreement Steward to a suitable separate +entity. Each new version of the Agreement will be given a distinguishing +version number. The Program (including Contributions) may always be +Distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to Distribute the Program (including its +Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient +receives no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted +under this Agreement are reserved. Nothing in this Agreement is intended +to be enforceable by any entity that is not a Contributor or Recipient. +No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice + +"This Source Code may also be made available under the following +Secondary Licenses when the conditions for such availability set forth +in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), +version(s), and exceptions or additional permissions here}." + + Simply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. + + If it is not possible or desirable to put the notice in a particular + file, then You may include the notice in a location (such as a LICENSE + file in a relevant directory) where a recipient would be likely to + look for such a notice. + + You may add additional accurate notices of copyright ownership. diff --git a/e/eclipse-che/che-incubator/che-code/build_info.json b/e/eclipse-che/che-incubator/che-code/build_info.json new file mode 100644 index 0000000000..7a1f91ce83 --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/build_info.json @@ -0,0 +1,16 @@ +{ + "maintainer": "prabhuk25", + "package_name": "che-code", + "github_url": "https://github.com/che-incubator/che-code", + "version": "v7.117.0", + "package_dir": "e/eclipse-che/che-incubator/che-code", + "default_branch": "devel", + "build_script": "che_code_7.117.0_rhel_9.7.sh", + "docker_build": false, + "wheel_build": true, + "validate_build_script": true, + "use_non_root_user": "false", + "*": { + "build_script": "che_code_7.117.0_rhel_9.7.sh" + } +} diff --git a/e/eclipse-che/che-incubator/che-code/che_code_7.117.0_rhel_9.7.sh b/e/eclipse-che/che-incubator/che-code/che_code_7.117.0_rhel_9.7.sh new file mode 100644 index 0000000000..e03b90e26f --- /dev/null +++ b/e/eclipse-che/che-incubator/che-code/che_code_7.117.0_rhel_9.7.sh @@ -0,0 +1,98 @@ +#!/bin/bash -e +#---------------------------------------------------------------------------- +# +# Package : che-code +# Version : 7.117.0 +# Source repo : https://github.com/che-incubator/che-code +# Tested on : rhel_9.7 +# Language : TypeScript +# Ci-Check : True +# Script License : Eclipse Public License - v 2.0 +# Maintainer : Prabhu K +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# ---------------------------------------------------------------------------- +# Prerequisites: +# +# docker must be installed and running. +# +# ---------------------------------------------------------------------------- + +set -e + +PACKAGE_URL=https://github.com/che-incubator/che-code +PACKAGE_NAME=che-code +VERSION=7.117.0 + +export CWD=`pwd` + +yum update -y +yum install git -y + +########## Container-in-Container Compatibility Patch (Only required for CI/containerized environments) ######### + +# Configure Podman/docker to use vfs storage driver for container-in-container compatibility +mkdir -p /etc/containers && cat > /etc/containers/storage.conf <<'EOF' +[storage] +driver = "vfs" +EOF + +# Install container build dependencies and force safe chroot isolation for Podman in restricted/container environments +yum install -y buildah podman fuse-overlayfs +export BUILDAH_ISOLATION=chroot + +###################### + +yum install docker -y + +#Clone repo +git clone $PACKAGE_URL +cd $PACKAGE_NAME +git checkout $VERSION + +#Move dockerfiles to main folder +cp $CWD/Dockerfiles/linux-musl.Dockerfile . +cp build/dockerfiles/linux-libc-ubi8.Dockerfile . +cp build/dockerfiles/linux-libc-ubi9.Dockerfile . +cp build/dockerfiles/assembly.Dockerfile . + +#Patch package-lock.json to skip @vscode/vsce-sign, since it has no binary for ppc64le and its exit with code 1 on postinstall. +sed -i '/@vscode\/vsce-sign/,/\}/s/"hasInstallScript": true/"hasInstallScript": false/' \ + code/build/package-lock.json; \ + +#Build linux-musl image +echo "linux-musl build started" +docker build -t linux-musl -f linux-musl.Dockerfile +echo "linux-musl build completed" + +#Build linux-libc-ubi8 +echo "linux-libc-ubi8 build started" +docker build -t linux-libc-ubi8 -f linux-libc-ubi8.Dockerfile +echo "linux-libc-ubi8 build completed" + +#Build linux-libc-ubi9 +echo "linux-libc-ubi9 build started" +docker build -t linux-libc-ubi9 -f linux-libc-ubi9.Dockerfile +echo "linux-libc-ubi9 build completed" + +#Patch the images names to use locally build images in assesbly.Dockerfile +sed -i \ +-e 's|FROM linux-libc-ubi8|FROM localhost/linux-libc-ubi8|' \ +-e 's|FROM linux-libc-ubi9|FROM localhost/linux-libc-ubi9|' \ +-e 's|FROM linux-musl|FROM localhost/linux-musl|' \ +assembly.Dockerfile + +#Build che-code +echo "che- +code build started" +docker build -t che-code -f assembly.Dockerfile +echo "che-code build completed" + +#If you want to test image, use below command +#docker run --rm -it -p 3100:3100 -e CODE_HOST=0.0.0.0 che-code:latest +