From cec479d997c8917e9c712b553680c78384102b48 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 13:36:33 +0300 Subject: [PATCH 01/22] Test fully-static key Signed-off-by: Roman Nikitenko --- build/dockerfiles/assembly.Dockerfile | 10 +- build/dockerfiles/linux-libc.Dockerfile | 141 +++++++++++++----------- 2 files changed, 80 insertions(+), 71 deletions(-) diff --git a/build/dockerfiles/assembly.Dockerfile b/build/dockerfiles/assembly.Dockerfile index 5a05c2ef5ce..ce53d6b7227 100644 --- a/build/dockerfiles/assembly.Dockerfile +++ b/build/dockerfiles/assembly.Dockerfile @@ -8,10 +8,10 @@ # Grab content from previously build images FROM linux-libc-amd64 as linux-libc-content -FROM linux-musl-amd64 as linux-musl-content +# FROM linux-musl-amd64 as linux-musl-content # https://quay.io/eclipse/che-machine-exec#^7\. -FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec +# FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec # https://registry.access.redhat.com/ubi8/ubi FROM registry.access.redhat.com/ubi8/ubi:8.6-990 AS ubi-builder @@ -21,7 +21,7 @@ RUN rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/ WORKDIR /mnt/rootfs -COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl +# COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl COPY --from=linux-libc-content --chown=0:0 /checode-linux-libc /mnt/rootfs/checode-linux-libc RUN mkdir -p /mnt/rootfs/projects && mkdir -p /mnt/rootfs/home/che && mkdir -p /mnt/rootfs/bin/ @@ -32,8 +32,8 @@ RUN for f in "/mnt/rootfs/bin/" "/mnt/rootfs/home/che" "/mnt/rootfs/etc/passwd" chmod -R g+rwX ${f}; \ done -COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec -COPY --chmod=755 /build/scripts/*.sh /mnt/rootfs/ +# COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec +# COPY --chmod=755 /build/scripts/*.sh /mnt/rootfs/ # Create all-in-one image FROM scratch diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 18791f8b37f..112657172a8 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -45,81 +45,90 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ else \ LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \ fi; } \ - && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake gcc gcc-c++ python2 git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ + && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake libstdc++-static openssl-devel libffi-devel zlib-devel gcc gcc-c++ python3 python3-pip git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ && yum -y clean all && rm -rf /var/cache/yum \ && npm install -g yarn@1.22.17 -COPY code /checode-compilation +# COPY code /checode-compilation +RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation -ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 +RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node +RUN cd node \ + && ./configure --prefix=/checode-compilation/customNode --fully-static \ + && make -j4 \ + && make install + + + +# ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ +# PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 # Initialize a git repository for code build tools -RUN git init . +# RUN git init . # change network timeout (slow using multi-arch build) -RUN yarn config set network-timeout 600000 -g +# RUN yarn config set network-timeout 600000 -g # Grab dependencies (and force to rebuild them) -RUN yarn install --force +# RUN yarn install --force # Compile -RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ - && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | 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 \ - && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \ - && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode - -RUN chmod a+x /checode/out/server-main.js \ - && chgrp -R 0 /checode && chmod -R g+rwX /checode - -### Testing -# 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile - -# install test dependencies -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install -# Install procps to manage to kill processes and centos stream repository -RUN [[ $(uname -m) == "x86_64" ]] && \ - ARCH=$(uname -m) && \ - yum install --nobest -y procps \ - http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ - http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ - http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm - -RUN [[ $(uname -m) == "x86_64" ]] && 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" - -# 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 [[ $(uname -m) == "x86_64" ]] && 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 - -# Run smoke tests (Browser) -RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" - -# Store the content of the result +# RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ +# && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | 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 \ +# && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \ +# && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode + +# RUN chmod a+x /checode/out/server-main.js \ +# && chgrp -R 0 /checode && chmod -R g+rwX /checode + +# ### Testing +# # 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile + +# # install test dependencies +# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +# RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install +# # Install procps to manage to kill processes and centos stream repository +# RUN [[ $(uname -m) == "x86_64" ]] && \ +# ARCH=$(uname -m) && \ +# yum install --nobest -y procps \ +# http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ +# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ +# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm + +# RUN [[ $(uname -m) == "x86_64" ]] && 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" + +# # 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 [[ $(uname -m) == "x86_64" ]] && 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 + +# # Run smoke tests (Browser) +# RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" + +# # Store the content of the result FROM scratch as linux-libc-content -COPY --from=linux-libc-builder /checode /checode-linux-libc +COPY --from=linux-libc-builder /checode-compilation /checode-linux-libc From f9084b29d4eb852f6cbb14a42f55140ceb55a86e Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 14:04:49 +0300 Subject: [PATCH 02/22] Use enable-static key Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 112657172a8..071997757fa 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -53,7 +53,7 @@ RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node RUN cd node \ - && ./configure --prefix=/checode-compilation/customNode --fully-static \ + && ./configure --prefix=/checode-compilation/customNode --enable-static \ && make -j4 \ && make install From 6682b1f884a68653518fe4cc7fa0f8c798f67999 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 15:41:47 +0300 Subject: [PATCH 03/22] Use --partly-static key Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 071997757fa..02581551c7e 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -53,7 +53,7 @@ RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node RUN cd node \ - && ./configure --prefix=/checode-compilation/customNode --enable-static \ + && ./configure --prefix=/checode-compilation/customNode --partly-static \ && make -j4 \ && make install From 8e117b1e0cf6b05cf52d66cc6d95329aea3c3af2 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 18:00:46 +0300 Subject: [PATCH 04/22] test fully static with j1 Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 02581551c7e..f5643c9e9a7 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -53,8 +53,8 @@ RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node RUN cd node \ - && ./configure --prefix=/checode-compilation/customNode --partly-static \ - && make -j4 \ + && ./configure --prefix=/checode-compilation/customNode ./configure --fully-static --enable-static \ + && make -j1 \ && make install From 6dc18732ecc68cda92c486eeb8708f46bf8c8a07 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 18:13:32 +0300 Subject: [PATCH 05/22] Code clean up Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index f5643c9e9a7..183adb8e4ad 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -53,8 +53,8 @@ RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node RUN cd node \ - && ./configure --prefix=/checode-compilation/customNode ./configure --fully-static --enable-static \ - && make -j1 \ + && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ + && make -j$(nproc) \ && make install From 7cac814ec4191ae727396b03f0f763f55a095082 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 19:56:08 +0300 Subject: [PATCH 06/22] Test 'configure' for downloaded node.js Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 52 +++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 183adb8e4ad..9ef62a96b07 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -51,12 +51,56 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ # COPY code /checode-compilation RUN mkdir -p /checode-compilation/customNode/sss WORKDIR /checode-compilation -RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node -RUN cd node \ - && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ +# RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node +# RUN cd node \ +# && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ +# && make -j$(nproc) \ +# && make install + +ARG PLATFORM="linux" +ARG NODE_LOCATION="https://nodejs.org" + +RUN { \ + if [[ $(uname -m) == "s390x" ]]; then \ + NODE_ARCH="s390x"; \ + BUILD_ARCH="s390x"; \ + elif [[ $(uname -m) == "ppc64le" ]]; then \ + NODE_ARCH="ppc64le"; \ + BUILD_ARCH="ppc64"; \ + elif [[ $(uname -m) == "x86_64" ]]; then \ + NODE_ARCH="x64"; \ + BUILD_ARCH="x64"; \ + elif [[ $(uname -m) == "aarch64" ]]; then \ + NODE_ARCH="arm64"; \ + BUILD_ARCH="arm64"; \ + else \ + NODE_ARCH=""; \ + BUILD_ARCH=$(echo "console.log(process.arch)" | node); \ + fi; \ + } \ + && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \ + && { \ + if [ -n "$NODE_ARCH" ]; then \ + NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH}.tar.gz"; \ + echo "Downloading Node.js from ${NODE_URL}"; \ + wget -q "${NODE_URL}"; \ + tar -xf node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH}.tar.gz; \ + mv node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH} nodejs; \ + else mkdir -p nodejs/bin && cp /usr/bin/node nodejs/bin/node; \ + fi; \ + } \ + && cd nodejs \ + && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ && make -j$(nproc) \ && make install - + # cache node from this image to avoid to grab it within the build + # && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ + # && mkdir -p $CACHE_NODE_PATH \ + # && echo "caching ${CACHE_NODE_PATH}" \ + # && cp nodejs/bin/node ${CACHE_NODE_PATH}/node \ + # compile assembly + # && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ + # && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode # ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ From 7d50da7d1b5f66121fc93a98408c5f8e03643501 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 20:14:17 +0300 Subject: [PATCH 07/22] Add node version Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 9ef62a96b07..12b0537efeb 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -59,6 +59,7 @@ WORKDIR /checode-compilation ARG PLATFORM="linux" ARG NODE_LOCATION="https://nodejs.org" +ARG NODE_VERSION="16.17.1" RUN { \ if [[ $(uname -m) == "s390x" ]]; then \ From 284aa4ea1d2597795bb058212312f0e346c92665 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 20:22:41 +0300 Subject: [PATCH 08/22] Fix node version Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 12b0537efeb..6e034cab921 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -79,7 +79,7 @@ RUN { \ BUILD_ARCH=$(echo "console.log(process.arch)" | node); \ fi; \ } \ - && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \ + # && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \ && { \ if [ -n "$NODE_ARCH" ]; then \ NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH}.tar.gz"; \ From 5a11a236b6657e32bca65c48d99533416fb6ef49 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 20:28:14 +0300 Subject: [PATCH 09/22] Add wget Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 6e034cab921..0f6f66029cc 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -45,7 +45,7 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ else \ LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \ fi; } \ - && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake libstdc++-static openssl-devel libffi-devel zlib-devel gcc gcc-c++ python3 python3-pip git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ + && yum install -y $LIBSECRET $LIBKEYBOARD curl wget make cmake libstdc++-static openssl-devel libffi-devel zlib-devel gcc gcc-c++ python3 python3-pip git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ && yum -y clean all && rm -rf /var/cache/yum \ && npm install -g yarn@1.22.17 # COPY code /checode-compilation From 5c4eecc7d86c15853fd3c8b4c4816d6b424472f4 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 11 Jul 2023 20:37:06 +0300 Subject: [PATCH 10/22] Change node.js package for downloading Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 0f6f66029cc..fcd2e901ef7 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -82,11 +82,11 @@ RUN { \ # && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \ && { \ if [ -n "$NODE_ARCH" ]; then \ - NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH}.tar.gz"; \ + NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"; \ echo "Downloading Node.js from ${NODE_URL}"; \ wget -q "${NODE_URL}"; \ - tar -xf node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH}.tar.gz; \ - mv node-v${NODE_VERSION}-${PLATFORM}-${NODE_ARCH} nodejs; \ + tar -xf node-v${NODE_VERSION}.tar.gz; \ + mv node-v${NODE_VERSION} nodejs; \ else mkdir -p nodejs/bin && cp /usr/bin/node nodejs/bin/node; \ fi; \ } \ From 97687da932603a160e6bb8773ecbe593366f21d0 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Wed, 12 Jul 2023 08:58:42 +0300 Subject: [PATCH 11/22] Test nodejs Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 85 +++++++++---------------- 1 file changed, 29 insertions(+), 56 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index fcd2e901ef7..273d64952b3 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -45,11 +45,12 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ else \ LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \ fi; } \ - && yum install -y $LIBSECRET $LIBKEYBOARD curl wget make cmake libstdc++-static openssl-devel libffi-devel zlib-devel gcc gcc-c++ python3 python3-pip git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ + && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake gcc gcc-c++ git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ + wget python3 libstdc++-static glibc-devel glibc-static python3-pip \ && yum -y clean all && rm -rf /var/cache/yum \ && npm install -g yarn@1.22.17 -# COPY code /checode-compilation -RUN mkdir -p /checode-compilation/customNode/sss +COPY code /checode-compilation +RUN mkdir -p /checode-compilation/customNode WORKDIR /checode-compilation # RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node # RUN cd node \ @@ -60,27 +61,22 @@ WORKDIR /checode-compilation ARG PLATFORM="linux" ARG NODE_LOCATION="https://nodejs.org" ARG NODE_VERSION="16.17.1" +ARG NODE_ARCH="x64" +ARG BUILD_ARCH="x64" -RUN { \ - if [[ $(uname -m) == "s390x" ]]; then \ - NODE_ARCH="s390x"; \ - BUILD_ARCH="s390x"; \ - elif [[ $(uname -m) == "ppc64le" ]]; then \ - NODE_ARCH="ppc64le"; \ - BUILD_ARCH="ppc64"; \ - elif [[ $(uname -m) == "x86_64" ]]; then \ - NODE_ARCH="x64"; \ - BUILD_ARCH="x64"; \ - elif [[ $(uname -m) == "aarch64" ]]; then \ - NODE_ARCH="arm64"; \ - BUILD_ARCH="arm64"; \ - else \ - NODE_ARCH=""; \ - BUILD_ARCH=$(echo "console.log(process.arch)" | node); \ - fi; \ - } \ - # && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | grep target | cut -d ' ' -f 2 | tr -d '"') \ - && { \ +ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 + +# Initialize a git repository for code build tools +RUN git init . + +# change network timeout (slow using multi-arch build) +RUN yarn config set network-timeout 600000 -g + +# Grab dependencies (and force to rebuild them) +RUN yarn install --force + +RUN { \ if [ -n "$NODE_ARCH" ]; then \ NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"; \ echo "Downloading Node.js from ${NODE_URL}"; \ @@ -91,43 +87,20 @@ RUN { \ fi; \ } \ && cd nodejs \ - && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ + && ./configure --prefix=/checode-compilation/customNode --download=all --cross-compiling --fully-static --enable-static \ && make -j$(nproc) \ - && make install + && make install \ # cache node from this image to avoid to grab it within the build - # && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ - # && mkdir -p $CACHE_NODE_PATH \ - # && echo "caching ${CACHE_NODE_PATH}" \ - # && cp nodejs/bin/node ${CACHE_NODE_PATH}/node \ + && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ + && mkdir -p $CACHE_NODE_PATH \ + && echo "caching ${CACHE_NODE_PATH}" \ + && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node \ # compile assembly - # && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ - # && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode + && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ + && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode - -# ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ -# PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 - -# Initialize a git repository for code build tools -# RUN git init . - -# change network timeout (slow using multi-arch build) -# RUN yarn config set network-timeout 600000 -g - -# Grab dependencies (and force to rebuild them) -# RUN yarn install --force - -# Compile -# RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \ -# && NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | 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 \ -# && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \ -# && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode - -# RUN chmod a+x /checode/out/server-main.js \ -# && chgrp -R 0 /checode && chmod -R g+rwX /checode +RUN chmod a+x /checode/out/server-main.js \ + && chgrp -R 0 /checode && chmod -R g+rwX /checode # ### Testing # # Compile tests From 10957c3e50a76084edccd2befe6544c63a20260b Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Wed, 12 Jul 2023 11:31:10 +0300 Subject: [PATCH 12/22] Fix build Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 273d64952b3..5589c9e764c 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -87,7 +87,7 @@ RUN { \ fi; \ } \ && cd nodejs \ - && ./configure --prefix=/checode-compilation/customNode --download=all --cross-compiling --fully-static --enable-static \ + && ./configure --prefix=/checode-compilation/customNode --cross-compiling --fully-static --enable-static \ && make -j$(nproc) \ && make install \ # cache node from this image to avoid to grab it within the build @@ -95,6 +95,7 @@ RUN { \ && mkdir -p $CACHE_NODE_PATH \ && echo "caching ${CACHE_NODE_PATH}" \ && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node \ + && cd .. \ # compile assembly && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode From e38b14bf411a76e9e95d228666d507ace527e3ff Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Thu, 13 Jul 2023 08:59:20 +0300 Subject: [PATCH 13/22] Fix build Signed-off-by: Roman Nikitenko --- build/dockerfiles/assembly.Dockerfile | 6 +++--- build/dockerfiles/linux-libc.Dockerfile | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build/dockerfiles/assembly.Dockerfile b/build/dockerfiles/assembly.Dockerfile index ce53d6b7227..ff12432ce24 100644 --- a/build/dockerfiles/assembly.Dockerfile +++ b/build/dockerfiles/assembly.Dockerfile @@ -11,7 +11,7 @@ FROM linux-libc-amd64 as linux-libc-content # FROM linux-musl-amd64 as linux-musl-content # https://quay.io/eclipse/che-machine-exec#^7\. -# FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec +FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec # https://registry.access.redhat.com/ubi8/ubi FROM registry.access.redhat.com/ubi8/ubi:8.6-990 AS ubi-builder @@ -32,8 +32,8 @@ RUN for f in "/mnt/rootfs/bin/" "/mnt/rootfs/home/che" "/mnt/rootfs/etc/passwd" chmod -R g+rwX ${f}; \ done -# COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec -# COPY --chmod=755 /build/scripts/*.sh /mnt/rootfs/ +COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec +COPY --chmod=755 /build/scripts/*.sh /mnt/rootfs/ # Create all-in-one image FROM scratch diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 5589c9e764c..501ce1dd3a9 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -94,10 +94,9 @@ RUN { \ && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ && mkdir -p $CACHE_NODE_PATH \ && echo "caching ${CACHE_NODE_PATH}" \ - && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node \ - && cd .. \ - # compile assembly - && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ + && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node + +RUN NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode RUN chmod a+x /checode/out/server-main.js \ @@ -150,4 +149,4 @@ RUN chmod a+x /checode/out/server-main.js \ # # Store the content of the result FROM scratch as linux-libc-content -COPY --from=linux-libc-builder /checode-compilation /checode-linux-libc +COPY --from=linux-libc-builder /checode /checode-linux-libc From 8cf23b8242c343768609a59956dcfcd08c22692c Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Fri, 14 Jul 2023 14:15:38 +0300 Subject: [PATCH 14/22] Use correct node binary file for node_modules as well Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 501ce1dd3a9..17e5cfc194a 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -73,9 +73,6 @@ RUN git init . # change network timeout (slow using multi-arch build) RUN yarn config set network-timeout 600000 -g -# Grab dependencies (and force to rebuild them) -RUN yarn install --force - RUN { \ if [ -n "$NODE_ARCH" ]; then \ NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"; \ @@ -96,6 +93,13 @@ RUN { \ && echo "caching ${CACHE_NODE_PATH}" \ && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node +# RUN npm config set node_bin_location /checode-compilation/customNode/bin/node +ENV NODE_PATH=/checode-compilation/customNode/bin/node +ENV PATH=/checode-compilation/customNode/bin:$PATH + +# Grab dependencies (and force to rebuild them) +RUN yarn install --force + RUN NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode From c85d240b4335101ffb7698d1367ed54981c247d0 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Fri, 14 Jul 2023 17:28:04 +0300 Subject: [PATCH 15/22] test other keys for building Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 17e5cfc194a..bc62ecccaa8 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -84,7 +84,7 @@ RUN { \ fi; \ } \ && cd nodejs \ - && ./configure --prefix=/checode-compilation/customNode --cross-compiling --fully-static --enable-static \ + && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static --without-npm \ && make -j$(nproc) \ && make install \ # cache node from this image to avoid to grab it within the build From 6c26b25dc44696e004c30e2bea00ecc79c29dd23 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Sat, 15 Jul 2023 12:51:26 +0300 Subject: [PATCH 16/22] Try partly-static key Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index bc62ecccaa8..6e0c6a5be77 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -47,6 +47,7 @@ RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\ fi; } \ && yum install -y $LIBSECRET $LIBKEYBOARD curl make cmake gcc gcc-c++ git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ wget python3 libstdc++-static glibc-devel glibc-static python3-pip \ + openssl-devel zlib-devel ncurses-devel libffi-devel \ && yum -y clean all && rm -rf /var/cache/yum \ && npm install -g yarn@1.22.17 COPY code /checode-compilation @@ -84,7 +85,7 @@ RUN { \ fi; \ } \ && cd nodejs \ - && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static --without-npm \ + && ./configure --prefix=/checode-compilation/customNode --partly-static --enable-static \ && make -j$(nproc) \ && make install \ # cache node from this image to avoid to grab it within the build From 4f2eb402d6ba84b5bbe3082604360dfade7d0af6 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Thu, 20 Jul 2023 11:13:09 +0300 Subject: [PATCH 17/22] Try to build fully static Node.js using Fedora-based image Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 233 +++++++++++++----------- 1 file changed, 124 insertions(+), 109 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 6e0c6a5be77..490dc53b884 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -7,7 +7,7 @@ # # https://registry.access.redhat.com/ubi8/nodejs-16 -FROM registry.access.redhat.com/ubi8/nodejs-16:1-111.1689167503 as linux-libc-builder +FROM fedora:latest as linux-libc-builder USER root @@ -21,137 +21,152 @@ ENV GITHUB_TOKEN=$GITHUB_TOKEN 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://rpmfind.net/linux/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm"; \ - elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\ - https://rpmfind.net/linux/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://rpmfind.net/linux/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://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm \ - https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm"; \ - elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\ - https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-1.el8.aarch64.rpm \ - https://rpmfind.net/linux/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++ git git-core-doc openssh less libX11-devel libxkbcommon bash tar gzip rsync patch \ - wget python3 libstdc++-static glibc-devel glibc-static python3-pip \ - openssl-devel zlib-devel ncurses-devel libffi-devel \ - && yum -y clean all && rm -rf /var/cache/yum \ - && npm install -g yarn@1.22.17 +# 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://rpmfind.net/linux/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm"; \ +# elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\ +# https://rpmfind.net/linux/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://rpmfind.net/linux/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://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm \ +# https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm"; \ +# elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\ +# https://rpmfind.net/linux/centos/8-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-1.el8.aarch64.rpm \ +# https://rpmfind.net/linux/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; } \ + # dnf install -y make python3.9 gcc g++ git git-core-doc bash tar gzip rsync patch \ + # wget python3-pip \ + # && dnf -y clean all +RUN dnf install -y gcc g++ gcc-c++ make npm +RUN dnf install -y python3.9 openssl-devel git glibc-devel glibc-static libstdc++-static libuv-devel +RUN dnf install -y libsecret-devel libsecret libX11-devel libxkbfile-devel libxkbfile libxkbcommon + +# Install additional libraries that may be required +# RUN dnf install -y libuv-devel libstdc++-static + COPY code /checode-compilation RUN mkdir -p /checode-compilation/customNode WORKDIR /checode-compilation -# RUN git clone --depth 1 --branch v16.17.1 https://github.com/nodejs/node -# RUN cd node \ -# && ./configure --prefix=/checode-compilation/customNode --fully-static --enable-static \ -# && make -j$(nproc) \ -# && make install + +RUN git clone --depth 1 --branch v16.20.1 https://github.com/nodejs/node +RUN cd node \ + && ./configure --fully-static --enable-static \ + && make \ + && make install ARG PLATFORM="linux" -ARG NODE_LOCATION="https://nodejs.org" -ARG NODE_VERSION="16.17.1" -ARG NODE_ARCH="x64" +# ARG NODE_LOCATION="https://nodejs.org" +ARG NODE_VERSION="16.20.1" +# ARG NODE_ARCH="x64" ARG BUILD_ARCH="x64" ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 -# Initialize a git repository for code build tools -RUN git init . +# RUN { \ +# if [ -n "$NODE_ARCH" ]; then \ +# NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"; \ +# echo "Downloading Node.js from ${NODE_URL}"; \ +# wget -q "${NODE_URL}"; \ +# tar -xf node-v${NODE_VERSION}.tar.gz; \ +# mv node-v${NODE_VERSION} nodejs; \ +# else mkdir -p nodejs/bin && cp /usr/bin/node nodejs/bin/node; \ +# fi; \ +# } \ +# && cd nodejs \ +# && make clean \ +# && ./configure --fully-static --enable-static --download=all \ +# && make \ +# && make install + # cache node from this image to avoid to grab it within the build + # && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ + # && mkdir -p $CACHE_NODE_PATH \ + # && echo "caching ${CACHE_NODE_PATH}" \ + # && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node + +# RUN npm config set node_bin_location /checode-compilation/customNode/bin/node +# ENV NODE_PATH=/checode-compilation/customNode/bin/node +# ENV PATH=/checode-compilation/customNode/bin:$PATH + +RUN npm install -g yarn@1.22.17 # change network timeout (slow using multi-arch build) RUN yarn config set network-timeout 600000 -g -RUN { \ - if [ -n "$NODE_ARCH" ]; then \ - NODE_URL="${NODE_LOCATION}/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"; \ - echo "Downloading Node.js from ${NODE_URL}"; \ - wget -q "${NODE_URL}"; \ - tar -xf node-v${NODE_VERSION}.tar.gz; \ - mv node-v${NODE_VERSION} nodejs; \ - else mkdir -p nodejs/bin && cp /usr/bin/node nodejs/bin/node; \ - fi; \ - } \ - && cd nodejs \ - && ./configure --prefix=/checode-compilation/customNode --partly-static --enable-static \ - && make -j$(nproc) \ - && make install \ - # cache node from this image to avoid to grab it within the build - && CACHE_NODE_PATH=/checode-compilation/.build/node/v${NODE_VERSION}/${PLATFORM}-${BUILD_ARCH} \ - && mkdir -p $CACHE_NODE_PATH \ - && echo "caching ${CACHE_NODE_PATH}" \ - && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node - -# RUN npm config set node_bin_location /checode-compilation/customNode/bin/node -ENV NODE_PATH=/checode-compilation/customNode/bin/node -ENV PATH=/checode-compilation/customNode/bin:$PATH +# Initialize a git repository for code build tools +RUN git init . # Grab dependencies (and force to rebuild them) RUN yarn install --force +RUN CACHE_NODE_PATH=/checode-compilation/.build/node/v16.17.1/linux-x64 \ + && mkdir -p $CACHE_NODE_PATH \ + && echo "caching ${CACHE_NODE_PATH}" \ + && cp /usr/local/bin/node ${CACHE_NODE_PATH}/node + RUN NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode RUN chmod a+x /checode/out/server-main.js \ && chgrp -R 0 /checode && chmod -R g+rwX /checode -# ### Testing -# # 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile - -# # install test dependencies -# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -# RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install -# # Install procps to manage to kill processes and centos stream repository -# RUN [[ $(uname -m) == "x86_64" ]] && \ -# ARCH=$(uname -m) && \ -# yum install --nobest -y procps \ -# http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ -# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ -# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm - -# RUN [[ $(uname -m) == "x86_64" ]] && 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" - -# # 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 [[ $(uname -m) == "x86_64" ]] && 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 - -# # Run smoke tests (Browser) -# RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" - -# # Store the content of the result +### Testing +# 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile + +# install test dependencies +ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install +# Install procps to manage to kill processes and centos stream repository +RUN [[ $(uname -m) == "x86_64" ]] && \ + ARCH=$(uname -m) && \ + yum install --nobest -y procps \ + http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ + http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ + http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm + +RUN [[ $(uname -m) == "x86_64" ]] && 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" + +# 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 [[ $(uname -m) == "x86_64" ]] && 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 + +# Run smoke tests (Browser) +RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" + +# Store the content of the result FROM scratch as linux-libc-content COPY --from=linux-libc-builder /checode /checode-linux-libc From d4cc700a9132b0d588610f96bba4c09afbf7cb85 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Thu, 20 Jul 2023 15:59:20 +0300 Subject: [PATCH 18/22] Use built node.js for Che Code building Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 490dc53b884..17cae1a462c 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -97,8 +97,8 @@ ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ # && cp /checode-compilation/customNode/bin/node ${CACHE_NODE_PATH}/node # RUN npm config set node_bin_location /checode-compilation/customNode/bin/node -# ENV NODE_PATH=/checode-compilation/customNode/bin/node -# ENV PATH=/checode-compilation/customNode/bin:$PATH +ENV NODE_PATH=/usr/local/bin/node +ENV PATH=/usr/local/bin:$PATH RUN npm install -g yarn@1.22.17 From f22ffd28cb19f05fb2e10ae3981c059e828470ef Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Mon, 31 Jul 2023 18:19:49 +0300 Subject: [PATCH 19/22] build only libc assembly Signed-off-by: Roman Nikitenko --- build/dockerfiles/dev.Dockerfile | 120 ++++++++++++------------ build/dockerfiles/linux-musl.Dockerfile | 106 ++++++++++----------- 2 files changed, 113 insertions(+), 113 deletions(-) diff --git a/build/dockerfiles/dev.Dockerfile b/build/dockerfiles/dev.Dockerfile index 2a259d37545..b8d668d3a64 100644 --- a/build/dockerfiles/dev.Dockerfile +++ b/build/dockerfiles/dev.Dockerfile @@ -7,80 +7,80 @@ # # https://quay.io/eclipse/che-machine-exec#^7\. -FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec +# FROM quay.io/eclipse/che-machine-exec:7.56.0 as machine-exec # https://registry.access.redhat.com/ubi8/ubi FROM registry.access.redhat.com/ubi8/ubi:8.6-990 AS ubi-micro-build -RUN mkdir -p /mnt/rootfs -RUN ARCH=$(uname -m) && yum install --installroot /mnt/rootfs libsecret curl make cmake gcc gcc-c++ python3 git git-core-doc openssh less wget \ - "https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/libsecret-devel-0.18.6-1.el8.x86_64.rpm" \ - "https://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm" \ - "https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm" \ - procps vi nano \ - "https://rpmfind.net/linux/centos/8-stream/BaseOS/${ARCH}/os/Packages/zsh-5.5.1-6.el8_1.2.x86_64.rpm" \ - "http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm" \ - "http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm" \ - "http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm" \ - libX11-devel libxkbcommon krb5-devel bash tar gzip rsync patch pkg-config glib2-devel coreutils-single glibc-minimal-langpack which util-linux-user --releasever 8 --nodocs -y && yum --installroot /mnt/rootfs clean all -# node-gyp will search for python -RUN cd /mnt/rootfs && ln -s /usr/bin/python3 ./usr/bin/python +# RUN mkdir -p /mnt/rootfs +# # RUN ARCH=$(uname -m) && yum install --installroot /mnt/rootfs libsecret curl make cmake gcc gcc-c++ python3 git git-core-doc openssh less wget \ +# "https://rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/libsecret-devel-0.18.6-1.el8.x86_64.rpm" \ +# "https://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm" \ +# "https://rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm" \ +# procps vi nano \ +# "https://rpmfind.net/linux/centos/8-stream/BaseOS/${ARCH}/os/Packages/zsh-5.5.1-6.el8_1.2.x86_64.rpm" \ +# "http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm" \ +# "http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm" \ +# "http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm" \ +# libX11-devel libxkbcommon krb5-devel bash tar gzip rsync patch pkg-config glib2-devel coreutils-single glibc-minimal-langpack which util-linux-user --releasever 8 --nodocs -y && yum --installroot /mnt/rootfs clean all +# # node-gyp will search for python +# RUN cd /mnt/rootfs && ln -s /usr/bin/python3 ./usr/bin/python -RUN rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* +# RUN rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* -# Download nodejs required by VS Code -RUN mkdir -p /mnt/rootfs/opt/nodejs && curl -sL https://nodejs.org/download/release/v16.17.1/node-v16.17.1-linux-x64.tar.gz | tar xzf - -C /mnt/rootfs/opt/nodejs --strip-components=1 +# # Download nodejs required by VS Code +# RUN mkdir -p /mnt/rootfs/opt/nodejs && curl -sL https://nodejs.org/download/release/v16.17.1/node-v16.17.1-linux-x64.tar.gz | tar xzf - -C /mnt/rootfs/opt/nodejs --strip-components=1 -# Download kubectl -RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ - chmod +x kubectl && \ - mv kubectl /mnt/rootfs/usr/bin/ +# # Download kubectl +# RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ +# chmod +x kubectl && \ +# mv kubectl /mnt/rootfs/usr/bin/ -# setup home folder inside the new fs -ENV HOME=/mnt/rootfs/home/che -ENV NPM_CONFIG_PREFIX=/mnt/rootfs/home/che/.npm-global -ENV PATH /mnt/rootfs/opt/nodejs/bin:/mnt/rootfs/home/che/.npm-global/bin/:$PATH +# # setup home folder inside the new fs +# ENV HOME=/mnt/rootfs/home/che +# ENV NPM_CONFIG_PREFIX=/mnt/rootfs/home/che/.npm-global +# ENV PATH /mnt/rootfs/opt/nodejs/bin:/mnt/rootfs/home/che/.npm-global/bin/:$PATH -# install yarn -RUN npm install -g yarn +# # install yarn +# RUN npm install -g yarn -ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +# ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \ +# PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN cat /mnt/rootfs/etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/bash#g > /mnt/rootfs/home/che/.passwd.template \ - && cat /mnt/rootfs/etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > /mnt/rootfs/home/che/.group.template +# RUN cat /mnt/rootfs/etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/bash#g > /mnt/rootfs/home/che/.passwd.template \ +# && cat /mnt/rootfs/etc/group | sed s#root:x:0:#root:x:0:0,\${USER_ID}:#g > /mnt/rootfs/home/che/.group.template -COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec -COPY --chmod=755 /build/scripts/entrypoint-dev.sh /mnt/rootfs/entrypoint.sh -COPY --chmod=755 /build/conf/dev/.p10k.zsh /mnt/rootfs/home/che/.p10k.zsh +# COPY --from=machine-exec --chown=0:0 /go/bin/che-machine-exec /mnt/rootfs/bin/machine-exec +# COPY --chmod=755 /build/scripts/entrypoint-dev.sh /mnt/rootfs/entrypoint.sh +# COPY --chmod=755 /build/conf/dev/.p10k.zsh /mnt/rootfs/home/che/.p10k.zsh -RUN mkdir -p /mnt/rootfs/projects +# RUN mkdir -p /mnt/rootfs/projects -RUN for f in "/mnt/rootfs/home/che" "/mnt/rootfs/etc/passwd" "/mnt/rootfs/etc/group" "/mnt/rootfs/projects" ; do\ - chgrp -R 0 ${f} && \ - chmod -R g+rwX ${f}; \ - done +# RUN for f in "/mnt/rootfs/home/che" "/mnt/rootfs/etc/passwd" "/mnt/rootfs/etc/group" "/mnt/rootfs/projects" ; do\ +# chgrp -R 0 ${f} && \ +# chmod -R g+rwX ${f}; \ +# done FROM scratch -COPY --from=ubi-micro-build /mnt/rootfs/ / -ENV HOME=/home/che -ENV NPM_CONFIG_PREFIX=/home/che/.npm-global -ENV PATH /opt/nodejs/bin:/home/che/.npm-global/bin/:$PATH -ENTRYPOINT /entrypoint.sh -WORKDIR /projects -RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh && \ - cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc && \ - chsh -s $(which zsh) root && \ - git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/.oh-my-zsh/custom/themes/powerlevel10k && \ - git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \ - sed -i 's|\(ZSH_THEME="\).*|\1powerlevel10k/powerlevel10k"|' $HOME/.zshrc && \ - # Add zsh autosuggestions plug-in - sed -i 's|plugins=(\(.*\))|plugins=(\1 zsh-autosuggestions)|' $HOME/.zshrc && \ - echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> $HOME/.zshrc +# COPY --from=ubi-micro-build /mnt/rootfs/ / +# ENV HOME=/home/che +# ENV NPM_CONFIG_PREFIX=/home/che/.npm-global +# ENV PATH /opt/nodejs/bin:/home/che/.npm-global/bin/:$PATH +# ENTRYPOINT /entrypoint.sh +# WORKDIR /projects +# RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh && \ +# cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc && \ +# chsh -s $(which zsh) root && \ +# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/.oh-my-zsh/custom/themes/powerlevel10k && \ +# git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions && \ +# sed -i 's|\(ZSH_THEME="\).*|\1powerlevel10k/powerlevel10k"|' $HOME/.zshrc && \ +# # Add zsh autosuggestions plug-in +# sed -i 's|plugins=(\(.*\))|plugins=(\1 zsh-autosuggestions)|' $HOME/.zshrc && \ +# echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> $HOME/.zshrc -ENV ZSH_DISABLE_COMPFIX="true" -# build che-code and keep node-modules folder -RUN git clone --depth 1 https://github.com/che-incubator/che-code /tmp/che-code && \ - cd /tmp/che-code && yarn && cd /tmp/che-code/code && yarn compile && \ - tar zcf /home/che/.node_modules.tgz node_modules && rm -rf /tmp/che-code && \ - chgrp -R 0 /home/che && chmod -R g+rwX /home/che +# ENV ZSH_DISABLE_COMPFIX="true" +# # build che-code and keep node-modules folder +# RUN git clone --depth 1 https://github.com/che-incubator/che-code /tmp/che-code && \ +# cd /tmp/che-code && yarn && cd /tmp/che-code/code && yarn compile && \ +# tar zcf /home/che/.node_modules.tgz node_modules && rm -rf /tmp/che-code && \ +# chgrp -R 0 /home/che && chmod -R g+rwX /home/che USER 1001 diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index eed5e7ecbd1..a082d30ad36 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -26,70 +26,70 @@ RUN apk add --update --no-cache \ krb5-dev COPY code /checode-compilation -WORKDIR /checode-compilation -ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 -# Initialize a git repository for code build tools -RUN git init . +# WORKDIR /checode-compilation +# ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 +# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 +# # Initialize a git repository for code build tools +# RUN git init . -# change network timeout (slow using multi-arch build) -RUN yarn config set network-timeout 600000 -g +# # change network timeout (slow using multi-arch build) +# RUN yarn config set network-timeout 600000 -g -# Grab dependencies -RUN yarn +# # Grab dependencies +# RUN yarn -# Rebuild platform specific dependencies -RUN npm rebuild +# # Rebuild platform specific dependencies +# RUN npm rebuild -RUN NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | 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 +# RUN NODE_VERSION=$(cat /checode-compilation/remote/.yarnrc | 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 -RUN NODE_OPTIONS="--max_old_space_size=6500" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min -RUN cp -r ../vscode-reh-web-linux-alpine /checode +# RUN NODE_OPTIONS="--max_old_space_size=6500" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min +# RUN cp -r ../vscode-reh-web-linux-alpine /checode -RUN chmod a+x /checode/out/server-main.js \ - && chgrp -R 0 /checode && chmod -R g+rwX /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 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile +# # Compile test suites +# # https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile +# RUN [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile -# use of retry and timeout -COPY /build/scripts/helper/retry.sh /usr/bin/retry -RUN chmod u+x /usr/bin/retry +# # use of retry and timeout +# COPY /build/scripts/helper/retry.sh /usr/bin/retry +# 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 [[ $(uname -m) == "x86_64" ]] && apk add --update --no-cache chromium procps -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install -RUN [[ $(uname -m) == "x86_64" ]] && \ - PLAYWRIGHT_CHROMIUM_PATH=$(echo /root/.cache/ms-playwright/chromium-*/) && \ - rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \ - ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \ - ls -la /checode-compilation/extensions/vscode-api-tests/ && \ - ls -la /checode-compilation/extensions/vscode-api-tests/out/ +# # install test dependencies +# # chromium for tests and procps as tests are using kill commands and it does not work with busybox implementation +# RUN [[ $(uname -m) == "x86_64" ]] && apk add --update --no-cache chromium procps +# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +# RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install +# RUN [[ $(uname -m) == "x86_64" ]] && \ +# PLAYWRIGHT_CHROMIUM_PATH=$(echo /root/.cache/ms-playwright/chromium-*/) && \ +# rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \ +# ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" && \ +# ls -la /checode-compilation/extensions/vscode-api-tests/ && \ +# ls -la /checode-compilation/extensions/vscode-api-tests/out/ -# Run integration tests (Browser) -RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium +# # Run integration tests (Browser) +# RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ +# retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium -# Run smoke tests (Browser) -RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - retry -v -t 3 -s 2 -- timeout 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" +# # Run smoke tests (Browser) +# RUN [[ $(uname -m) == "x86_64" ]] && VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ +# retry -v -t 3 -s 2 -- timeout 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" FROM scratch as linux-musl-content -COPY --from=linux-musl-builder /checode /checode-linux-musl +COPY --from=linux-musl-builder /checode-compilation /checode-linux-musl From 29041a60565f75a1404dc66cd0b13ed7cbe08cf1 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Mon, 31 Jul 2023 22:23:03 +0300 Subject: [PATCH 20/22] Add krb5-devel Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 17cae1a462c..2505f348eb3 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -51,7 +51,7 @@ RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi # && dnf -y clean all RUN dnf install -y gcc g++ gcc-c++ make npm RUN dnf install -y python3.9 openssl-devel git glibc-devel glibc-static libstdc++-static libuv-devel -RUN dnf install -y libsecret-devel libsecret libX11-devel libxkbfile-devel libxkbfile libxkbcommon +RUN dnf install -y libsecret-devel libsecret libX11-devel libxkbfile-devel libxkbfile libxkbcommon krb5-devel # Install additional libraries that may be required # RUN dnf install -y libuv-devel libstdc++-static From a4e2ee2c50ab55348d10dbdc0e35e69a741bd50f Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 1 Aug 2023 09:37:59 +0300 Subject: [PATCH 21/22] Add memory for building VS Code Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 2505f348eb3..57f6d402c94 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -116,7 +116,7 @@ RUN CACHE_NODE_PATH=/checode-compilation/.build/node/v16.17.1/linux-x64 \ && echo "caching ${CACHE_NODE_PATH}" \ && cp /usr/local/bin/node ${CACHE_NODE_PATH}/node -RUN NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ +RUN NODE_OPTIONS="--max_old_space_size=10500" ./node_modules/.bin/gulp vscode-reh-web-${PLATFORM}-${BUILD_ARCH}-min \ && cp -r ../vscode-reh-web-${PLATFORM}-${BUILD_ARCH} /checode RUN chmod a+x /checode/out/server-main.js \ From 8f70926a488f7100b0d129cca9cc3c2b21aa8981 Mon Sep 17 00:00:00 2001 From: Roman Nikitenko Date: Tue, 1 Aug 2023 14:15:20 +0300 Subject: [PATCH 22/22] Turn off tests Signed-off-by: Roman Nikitenko --- build/dockerfiles/linux-libc.Dockerfile | 88 ++++++++++++------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/build/dockerfiles/linux-libc.Dockerfile b/build/dockerfiles/linux-libc.Dockerfile index 57f6d402c94..f34f66ad345 100644 --- a/build/dockerfiles/linux-libc.Dockerfile +++ b/build/dockerfiles/linux-libc.Dockerfile @@ -122,50 +122,50 @@ RUN NODE_OPTIONS="--max_old_space_size=10500" ./node_modules/.bin/gulp vscode-re RUN chmod a+x /checode/out/server-main.js \ && chgrp -R 0 /checode && chmod -R g+rwX /checode -### Testing -# 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile - -# install test dependencies -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install -# Install procps to manage to kill processes and centos stream repository -RUN [[ $(uname -m) == "x86_64" ]] && \ - ARCH=$(uname -m) && \ - yum install --nobest -y procps \ - http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ - http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ - http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm - -RUN [[ $(uname -m) == "x86_64" ]] && 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" - -# 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 [[ $(uname -m) == "x86_64" ]] && 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 - -# Run smoke tests (Browser) -RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" +# ### Testing +# # 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 [[ $(uname -m) == "x86_64" ]] && yarn --cwd test/smoke compile && yarn --cwd test/integration/browser compile + +# # install test dependencies +# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 +# RUN [[ $(uname -m) == "x86_64" ]] && yarn playwright-install +# # Install procps to manage to kill processes and centos stream repository +# RUN [[ $(uname -m) == "x86_64" ]] && \ +# ARCH=$(uname -m) && \ +# yum install --nobest -y procps \ +# http://mirror.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ +# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ +# http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm + +# RUN [[ $(uname -m) == "x86_64" ]] && 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" + +# # 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 [[ $(uname -m) == "x86_64" ]] && 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 + +# # Run smoke tests (Browser) +# RUN [[ $(uname -m) == "x86_64" ]] && 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 yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader" # Store the content of the result FROM scratch as linux-libc-content