diff --git a/WORKSPACE.yaml b/WORKSPACE.yaml index 71d3fdd43d55e9..e75c8ccecbfd77 100644 --- a/WORKSPACE.yaml +++ b/WORKSPACE.yaml @@ -7,7 +7,7 @@ defaultArgs: publishToNPM: true publishToJBMarketplace: true localAppVersion: unknown - codeCommit: cac02285a3fef09965c46fb813c953b4fd0e13eb + codeCommit: 2ce4401e10ffb3926c3f28c360f66cf9dc38b9cf codeVersion: 1.94.1 codeQuality: stable codeWebExtensionCommit: 7ff72a2938a7a06cbdf3964590f7e9b7525958f3 diff --git a/components/ide/code/leeway.Dockerfile b/components/ide/code/leeway.Dockerfile index a8cc9aeb3bf289..6adee1f1db6588 100644 --- a/components/ide/code/leeway.Dockerfile +++ b/components/ide/code/leeway.Dockerfile @@ -1,7 +1,25 @@ -# Copyright (c) 2020 Gitpod GmbH. All rights reserved. +# Copyright (c) 2024 Gitpod GmbH. All rights reserved. # Licensed under the GNU Affero General Public License (AGPL). # See License.AGPL.txt in the project root for license information. -FROM gitpod/openvscode-server-linux-build-agent:focal-x64 as code_builder +FROM gitpod/openvscode-server-linux-build-agent:centos7-devtoolset8-x64 as dependencies_builder + +ENV TRIGGER_REBUILD 1 + +ARG CODE_COMMIT + +RUN mkdir /gp-code \ + && cd /gp-code \ + && git init \ + && git remote add origin https://github.com/gitpod-io/openvscode-server \ + && git fetch origin $CODE_COMMIT --depth=1 \ + && git reset --hard FETCH_HEAD +WORKDIR /gp-code/remote + +RUN npm ci + +FROM ubuntu:22.04 as code_builder + +ARG DEBIAN_FRONTEND=noninteractive ENV TRIGGER_REBUILD 1 @@ -9,20 +27,57 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1 ENV VSCODE_ARCH=x64 ENV NPM_REGISTRY=https://registry.npmjs.org +ENV NODE_VERSION=20 ARG CODE_COMMIT ARG CODE_QUALITY ARG CODE_VERSION +# Latest stable git +RUN apt-get update && apt-get install -y software-properties-common +RUN add-apt-repository ppa:git-core/ppa -y + +RUN apt-get update && apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + file \ + git \ + gnome-keyring \ + iproute2 \ + libfuse2 \ + libgconf-2-4 \ + libgdk-pixbuf2.0-0 \ + libgl1 \ + libgtk-3.0 \ + libsecret-1-dev \ + libssl-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxkbfile-dev \ + locales \ + lsb-release \ + lsof \ + python3-pip \ + sudo \ + wget \ + xvfb \ + tzdata \ + unzip \ + jq + +# Set python3 as default +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 +RUN python --version + +# Check compiler toolchain +RUN gcc --version +RUN g++ --version + RUN sudo mkdir -m 0755 -p /etc/apt/keyrings RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -RUN if dpkg --compare-versions "$CODE_VERSION" "ge" "1.90"; then \ - NODE_VERSION=20; \ - else \ - NODE_VERSION=18; \ - fi && \ - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list RUN apt-get update && apt-get install -y nodejs RUN mkdir /gp-code \ @@ -41,14 +96,15 @@ RUN apt-get install -y pkg-config dbus xvfb libgtk-3-0 libxkbfile-dev libkrb5-de # Start dbus session && mkdir -p /var/run/dbus -# Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555 -ENV DISABLE_V8_COMPILE_CACHE=1 - -# ENV npm_config_arch=x64 +ENV npm_config_arch=x64 RUN mkdir -p .build \ && npm config set registry "$NPM_REGISTRY" \ && npm ci +# copy remote dependencies build in dependencies_builder image +RUN rm -rf remote/node_modules/ +COPY --from=dependencies_builder /gp-code/remote/node_modules/ /gp-code/remote/node_modules/ + # check that the provided codeVersion is the correct one for the given codeCommit RUN commitVersion=$(cat package.json | jq -r .version) \ && if [ "$commitVersion" != "$CODE_VERSION" ]; then echo "Code version mismatch: $commitVersion != $CODE_VERSION"; exit 1; fi