@@ -12,150 +12,150 @@ FROM registry.access.redhat.com/ubi8/nodejs-20:1-72 as linux-libc-ubi8-builder
1212USER root
1313
1414# Export GITHUB_TOKEN into environment variable
15- ARG GITHUB_TOKEN=''
16- ENV GITHUB_TOKEN=$GITHUB_TOKEN
17-
18- # Unset GITHUB_TOKEN environment variable if it is empty.
19- # This is needed for some tools which use this variable and will fail with 401 Unauthorized error if it is invalid.
20- # For example, vscode ripgrep downloading is an example of such case.
21- RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi
22-
23- # workaround for https://github.com/nodejs/node/issues/51555
24- ENV DISABLE_V8_COMPILE_CACHE=1
25-
26- # Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86)
27- RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\
28- https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-0.20.4-2.fc34.s390x.rpm \
29- https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-devel-0.20.4-2.fc34.s390x.rpm" ; \
30- elif [[ $(uname -m) == "ppc64le" ]]; then LIBSECRET="\
31- libsecret \
32- https://vault.centos.org/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm" ; \
33- elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\
34- https://vault.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libsecret-devel-0.18.6-1.el8.x86_64.rpm \
35- libsecret" ; \
36- elif [[ $(uname -m) == "aarch64" ]]; then LIBSECRET="\
37- https://vault.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/libsecret-devel-0.18.6-1.el8.aarch64.rpm \
38- libsecret" ; \
39- else \
40- LIBSECRET="" ; echo "Warning: arch $(uname -m) not supported" ; \
41- fi; } \
42- && { if [[ $(uname -m) == "x86_64" ]]; then LIBKEYBOARD="\
43- https://vault.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm \
44- https://vault.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm" ; \
45- elif [[ $(uname -m) == "ppc64le" ]]; then LIBKEYBOARD="\
46- https://vault.centos.org/8-stream/AppStream/ppc64le/os/Packages/libxkbfile-1.1.0-1.el8.ppc64le.rpm \
47- https://vault.centos.org/8-stream/PowerTools/ppc64le/os/Packages/libxkbfile-devel-1.1.0-1.el8.ppc64le.rpm" ; \
48- elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\
49- https://vault.centos.org/centos/8-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-1.el8.aarch64.rpm \
50- https://vault.centos.org/centos/8-stream/PowerTools/aarch64/os/Packages/libxkbfile-devel-1.1.0-1.el8.aarch64.rpm" ; \
51- else \
52- LIBKEYBOARD="" ; echo "Warning: arch $(uname -m) not supported" ; \
53- fi; } \
54- && 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 \
55- && yum -y clean all && rm -rf /var/cache/yum
56-
57- # ########################################################
58- #
59- # Copy Che-Code to the container
60- #
61- # ########################################################
62- COPY code /checode-compilation
63- WORKDIR /checode-compilation
64- ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \
65- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
66-
67- # Initialize a git repository for code build tools
68- RUN git init .
69-
70- # change network timeout (slow using multi-arch build)
71- RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000
72-
73- # Grab dependencies (and force to rebuild them)
74- RUN rm -rf /checode-compilation/node_modules && npm install --force
75-
76- # Compile
77- RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
78- && NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"' ) \
79- # cache node from this image to avoid to grab it from within the build
80- && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \
81- && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \
82- && cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \
83- && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \
84- && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode
85-
86- RUN chmod a+x /checode/out/server-main.js \
87- && chgrp -R 0 /checode && chmod -R g+rwX /checode
88-
89- # ## Beginning of tests
90- # Do not change line above! It is used to cut this section to skip tests
91-
92- # Compile tests
93- RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \
94- compile-extension:markdown-language-features \
95- compile-extension:typescript-language-features \
96- compile-extension:emmet \
97- compile-extension:git \
98- compile-extension:ipynb \
99- compile-extension-media \
100- compile-extension:configuration-editing
101-
102- # Compile test suites
103- # https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile
104- RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi
105-
106- # install test dependencies
107- ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
108- RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi
109- # Install procps to manage to kill processes and centos stream repository
110- RUN if [ "$(uname -m)" = "x86_64" ]; then \
111- ARCH=$(uname -m) && \
112- yum install --nobest -y procps \
113- https://vault.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \
114- https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \
115- https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm; \
116- fi
117-
118- RUN if [ "$(uname -m)" = "x86_64" ]; then \
119- sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
120- && yum install -y chromium \
121- && PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/) \
122- && rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" \
123- && ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" ; \
124- fi
125-
126- # use of retry and timeout
127- COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh
128- RUN chmod u+x /opt/app-root/src/retry.sh
129-
130- # Run integration tests (Browser)
131- RUN if [ "$(uname -m)" = "x86_64" ]; then \
132- NODE_ARCH=$(echo "console.log(process.arch)" | node) \
133- VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
134- /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \
135- fi
136-
137- # Run smoke tests (Browser)
138- RUN if [ "$(uname -m)" = "x86_64" ]; then \
139- NODE_ARCH=$(echo "console.log(process.arch)" | node) \
140- VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
141- /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" ; \
142- fi
143-
144- # Do not change line below! It is used to cut this section to skip tests
145- # ## Ending of tests
146-
147- # ########################################################
148- #
149- # Copy VS Code launcher to the container
150- #
151- # ########################################################
152- COPY launcher /checode-launcher
153- WORKDIR /checode-launcher
154- RUN npm install \
155- && mkdir /checode/launcher \
156- && cp -r out/src/*.js /checode/launcher \
157- && chgrp -R 0 /checode && chmod -R g+rwX /checode
158-
159- # Store the content of the result
160- FROM scratch as linux-libc-content
161- COPY --from=linux-libc-ubi8-builder /checode /checode-linux-libc/ubi8
15+ # ARG GITHUB_TOKEN=''
16+ # ENV GITHUB_TOKEN=$GITHUB_TOKEN
17+
18+ # # Unset GITHUB_TOKEN environment variable if it is empty.
19+ # # This is needed for some tools which use this variable and will fail with 401 Unauthorized error if it is invalid.
20+ # # For example, vscode ripgrep downloading is an example of such case.
21+ # RUN if [ -z $GITHUB_TOKEN ]; then unset GITHUB_TOKEN; fi
22+
23+ # # workaround for https://github.com/nodejs/node/issues/51555
24+ # ENV DISABLE_V8_COMPILE_CACHE=1
25+
26+ # # Install libsecret-devel on s390x and ppc64le for keytar build (binary included in npm package for x86)
27+ # RUN { if [[ $(uname -m) == "s390x" ]]; then LIBSECRET="\
28+ # https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-0.20.4-2.fc34.s390x.rpm \
29+ # https://rpmfind.net/linux/fedora-secondary/releases/34/Everything/s390x/os/Packages/l/libsecret-devel-0.20.4-2.fc34.s390x.rpm"; \
30+ # elif [[ $(uname -m) == "ppc64le" ]]; then LIBSECRET="\
31+ # libsecret \
32+ # https://vault.centos.org/centos/8-stream/BaseOS/ppc64le/os/Packages/libsecret-devel-0.18.6-1.el8.ppc64le.rpm"; \
33+ # elif [[ $(uname -m) == "x86_64" ]]; then LIBSECRET="\
34+ # https://vault.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/libsecret-devel-0.18.6-1.el8.x86_64.rpm \
35+ # libsecret"; \
36+ # elif [[ $(uname -m) == "aarch64" ]]; then LIBSECRET="\
37+ # https://vault.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/libsecret-devel-0.18.6-1.el8.aarch64.rpm \
38+ # libsecret"; \
39+ # else \
40+ # LIBSECRET=""; echo "Warning: arch $(uname -m) not supported"; \
41+ # fi; } \
42+ # && { if [[ $(uname -m) == "x86_64" ]]; then LIBKEYBOARD="\
43+ # https://vault.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/libxkbfile-1.1.0-1.el8.x86_64.rpm \
44+ # https://vault.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/libxkbfile-devel-1.1.0-1.el8.x86_64.rpm"; \
45+ # elif [[ $(uname -m) == "ppc64le" ]]; then LIBKEYBOARD="\
46+ # https://vault.centos.org/8-stream/AppStream/ppc64le/os/Packages/libxkbfile-1.1.0-1.el8.ppc64le.rpm \
47+ # https://vault.centos.org/8-stream/PowerTools/ppc64le/os/Packages/libxkbfile-devel-1.1.0-1.el8.ppc64le.rpm"; \
48+ # elif [[ $(uname -m) == "aarch64" ]]; then LIBKEYBOARD="\
49+ # https://vault.centos.org/centos/8-stream/AppStream/aarch64/os/Packages/libxkbfile-1.1.0-1.el8.aarch64.rpm \
50+ # https://vault.centos.org/centos/8-stream/PowerTools/aarch64/os/Packages/libxkbfile-devel-1.1.0-1.el8.aarch64.rpm"; \
51+ # else \
52+ # LIBKEYBOARD=""; echo "Warning: arch $(uname -m) not supported"; \
53+ # fi; } \
54+ # && 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 \
55+ # && yum -y clean all && rm -rf /var/cache/yum
56+
57+ # # ########################################################
58+ # #
59+ # # Copy Che-Code to the container
60+ # #
61+ # # ########################################################
62+ # COPY code /checode-compilation
63+ # WORKDIR /checode-compilation
64+ # ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 \
65+ # PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
66+
67+ # # Initialize a git repository for code build tools
68+ # RUN git init .
69+
70+ # # change network timeout (slow using multi-arch build)
71+ # RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000
72+
73+ # # Grab dependencies (and force to rebuild them)
74+ # RUN rm -rf /checode-compilation/node_modules && npm install --force
75+
76+ # # Compile
77+ # RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
78+ # && NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
79+ # # cache node from this image to avoid to grab it from within the build
80+ # && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH} \
81+ # && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \
82+ # && cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \
83+ # && NODE_OPTIONS="--max_old_space_size=8500" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \
84+ # && cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode
85+
86+ # RUN chmod a+x /checode/out/server-main.js \
87+ # && chgrp -R 0 /checode && chmod -R g+rwX /checode
88+
89+ # # ## Beginning of tests
90+ # # Do not change line above! It is used to cut this section to skip tests
91+
92+ # # Compile tests
93+ # RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \
94+ # compile-extension:markdown-language-features \
95+ # compile-extension:typescript-language-features \
96+ # compile-extension:emmet \
97+ # compile-extension:git \
98+ # compile-extension:ipynb \
99+ # compile-extension-media \
100+ # compile-extension:configuration-editing
101+
102+ # # Compile test suites
103+ # # https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile
104+ # RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi
105+
106+ # # install test dependencies
107+ # ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0
108+ # RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi
109+ # # Install procps to manage to kill processes and centos stream repository
110+ # RUN if [ "$(uname -m)" = "x86_64" ]; then \
111+ # ARCH=$(uname -m) && \
112+ # yum install --nobest -y procps \
113+ # https://vault.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \
114+ # https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \
115+ # https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm; \
116+ # fi
117+
118+ # RUN if [ "$(uname -m)" = "x86_64" ]; then \
119+ # sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
120+ # && yum install -y chromium \
121+ # && PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/) \
122+ # && rm "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome" \
123+ # && ln -s /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome-linux/chrome"; \
124+ # fi
125+
126+ # # use of retry and timeout
127+ # COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh
128+ # RUN chmod u+x /opt/app-root/src/retry.sh
129+
130+ # # Run integration tests (Browser)
131+ # RUN if [ "$(uname -m)" = "x86_64" ]; then \
132+ # NODE_ARCH=$(echo "console.log(process.arch)" | node) \
133+ # VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
134+ # /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \
135+ # fi
136+
137+ # # Run smoke tests (Browser)
138+ # RUN if [ "$(uname -m)" = "x86_64" ]; then \
139+ # NODE_ARCH=$(echo "console.log(process.arch)" | node) \
140+ # VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
141+ # /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"; \
142+ # fi
143+
144+ # # Do not change line below! It is used to cut this section to skip tests
145+ # # ## Ending of tests
146+
147+ # # ########################################################
148+ # #
149+ # # Copy VS Code launcher to the container
150+ # #
151+ # # ########################################################
152+ # COPY launcher /checode-launcher
153+ # WORKDIR /checode-launcher
154+ # RUN npm install \
155+ # && mkdir /checode/launcher \
156+ # && cp -r out/src/*.js /checode/launcher \
157+ # && chgrp -R 0 /checode && chmod -R g+rwX /checode
158+
159+ # # Store the content of the result
160+ # FROM scratch as linux-libc-content
161+ # COPY --from=linux-libc-ubi8-builder /checode /checode-linux-libc/ubi8
0 commit comments