From c5dcd65f7c7cba93c785a365536fdd4e12eac1f7 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 20 Jun 2024 18:37:11 -0400 Subject: [PATCH 1/5] Hardcode Theia version for 1.49 community release Signed-off-by: Timothy Johnson --- ze/theia-slim/getTheiaVersion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ze/theia-slim/getTheiaVersion.js b/ze/theia-slim/getTheiaVersion.js index c142c48..51b7062 100644 --- a/ze/theia-slim/getTheiaVersion.js +++ b/ze/theia-slim/getTheiaVersion.js @@ -29,7 +29,7 @@ async function getTheiaReleases() { if (process.argv[2] == null || process.argv[2] === "latest") { // "latest" tag (default) = latest community release of Theia const release = (await getTheiaReleases()).find(obj => obj.body.includes("community release")); - theiaVersion = release.tag_name.slice(1); + theiaVersion = "1.49.1"; // release.tag_name.slice(1); dockerTags.push(...expandImageTag("latest"), ...expandImageTag(theiaVersion.slice(0, theiaVersion.lastIndexOf(".")))); } else if (process.argv[2] === "next") { From 8989221e9ee531af55070b56e626e8a096f17d7a Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 20 Jun 2024 18:55:12 -0400 Subject: [PATCH 2/5] Lock down Python version to 3.11 Signed-off-by: Timothy Johnson --- ze/theia-slim/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ze/theia-slim/Dockerfile b/ze/theia-slim/Dockerfile index e20b280..a9a818a 100644 --- a/ze/theia-slim/Dockerfile +++ b/ze/theia-slim/Dockerfile @@ -8,7 +8,7 @@ ARG NODE_VERSION=lts FROM node:${NODE_VERSION}-alpine -RUN apk add --no-cache curl make pkgconfig gcc g++ python3 libx11-dev libxkbfile-dev libsecret-dev chromium +RUN apk add --no-cache curl make pkgconfig gcc g++ "python3=~3.11" libx11-dev libxkbfile-dev libsecret-dev chromium WORKDIR /home/theia ADD buildPackageJson.js ./buildPackageJson.js ARG THEIA_VERSION=latest From 7a746e2fa759706d735b305cdb07b10c7aad88c2 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 20 Jun 2024 19:12:11 -0400 Subject: [PATCH 3/5] Lock down Alpine version to use older Python Signed-off-by: Timothy Johnson --- ze/theia-slim/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ze/theia-slim/Dockerfile b/ze/theia-slim/Dockerfile index a9a818a..7d1233e 100644 --- a/ze/theia-slim/Dockerfile +++ b/ze/theia-slim/Dockerfile @@ -7,8 +7,8 @@ # Copyright Contributors to the Zowe Project. ARG NODE_VERSION=lts -FROM node:${NODE_VERSION}-alpine -RUN apk add --no-cache curl make pkgconfig gcc g++ "python3=~3.11" libx11-dev libxkbfile-dev libsecret-dev chromium +FROM node:${NODE_VERSION}-alpine3.19 +RUN apk add --no-cache curl make pkgconfig gcc g++ python3 libx11-dev libxkbfile-dev libsecret-dev chromium WORKDIR /home/theia ADD buildPackageJson.js ./buildPackageJson.js ARG THEIA_VERSION=latest @@ -32,7 +32,7 @@ RUN yarn global add node-gyp && \ # curl -fLOJ https://github.com/zowe/vscode-extension-for-zowe/releases/download/v${ZOWE_EXPLORER_VERSION}/vscode-extension-for-zowe-${ZOWE_EXPLORER_VERSION}.vsix && \ # curl -fLOJ https://github.com/zowe/vscode-extension-for-zowe/releases/download/v${ZOWE_EXPLORER_VERSION}/zowe-explorer-ftp-extension-${ZOWE_EXPLORER_VERSION}.vsix -FROM node:${NODE_VERSION}-alpine +FROM node:${NODE_VERSION}-alpine3.19 # See : https://github.com/theia-ide/theia-apps/issues/34 RUN addgroup theia && \ adduser -G theia -s /bin/sh -D theia; From c7b40676384a812b71a17a1ec6184e6af913df30 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 21 Jun 2024 10:21:29 -0400 Subject: [PATCH 4/5] Update inputs of ZE Theia workflow Signed-off-by: Timothy Johnson --- .github/workflows/ze-theia-slim.yaml | 8 ++++---- ze/theia-slim/getTheiaVersion.js | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ze-theia-slim.yaml b/.github/workflows/ze-theia-slim.yaml index 1e02a7e..bc8fbaa 100644 --- a/.github/workflows/ze-theia-slim.yaml +++ b/.github/workflows/ze-theia-slim.yaml @@ -7,9 +7,9 @@ on: - .github/workflows/docker-reusable.yaml workflow_dispatch: inputs: - theia-version: - description: "Specify Theia version (e.g., 1.37)" - default: "latest" + docker-tags: + description: "Docker tags to build (e.g., 1.37 latest)" + default: "next" required: false type: string deploy: @@ -33,7 +33,7 @@ jobs: - name: Get Theia version id: load-env - run: node ze/theia-slim/getTheiaVersion.js ${{ inputs.theia-version || 'next' }} + run: node ze/theia-slim/getTheiaVersion.js ${{ inputs.docker-tags }} build-and-deploy: needs: setup diff --git a/ze/theia-slim/getTheiaVersion.js b/ze/theia-slim/getTheiaVersion.js index 51b7062..11c2a06 100644 --- a/ze/theia-slim/getTheiaVersion.js +++ b/ze/theia-slim/getTheiaVersion.js @@ -26,22 +26,24 @@ async function getTheiaReleases() { (async () => { const dockerTags = []; let theiaVersion; - if (process.argv[2] == null || process.argv[2] === "latest") { - // "latest" tag (default) = latest community release of Theia - const release = (await getTheiaReleases()).find(obj => obj.body.includes("community release")); - theiaVersion = "1.49.1"; // release.tag_name.slice(1); - dockerTags.push(...expandImageTag("latest"), - ...expandImageTag(theiaVersion.slice(0, theiaVersion.lastIndexOf(".")))); - } else if (process.argv[2] === "next") { + if (process.argv[2] == null || process.argv[2] === "next") { // "next" tag = latest version of Theia on master branch theiaVersion = "latest"; dockerTags.push(...expandImageTag("next")); } else { - // "1.XX" tag = older community release of Theia - const release = (await getTheiaReleases()).find(obj => obj.body.includes("community release") && - obj.tag_name.startsWith(`v${process.argv[2]}`)); - theiaVersion = release.tag_name.slice(1); - dockerTags.push(...expandImageTag(theiaVersion.slice(0, theiaVersion.lastIndexOf(".")))); + // "1.XX" and "latest" tag = community releases of Theia + for (const tagName of process.argv.slice(2)) { + if (tagName === "latest") { + dockerTags.push(...expandImageTag("latest")); + } else { + const release = (await getTheiaReleases()).find(obj => obj.tag_name.startsWith("v" + tagName)); + theiaVersion = release?.tag_name.slice(1); + dockerTags.push(...expandImageTag(tagName)); + } + }; + } + if (theiaVersion == null) { + throw new Error("Could not find Theia version that matches these tags: " + process.argv.slice(2).join(" ")); } fs.appendFileSync(outputPath, "DOCKER_TAGS< Date: Fri, 21 Jun 2024 11:44:04 -0400 Subject: [PATCH 5/5] Update .github/workflows/ze-theia-slim.yaml Co-authored-by: Trae Yelovich Signed-off-by: Timothy Johnson --- .github/workflows/ze-theia-slim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ze-theia-slim.yaml b/.github/workflows/ze-theia-slim.yaml index bc8fbaa..47bdcfb 100644 --- a/.github/workflows/ze-theia-slim.yaml +++ b/.github/workflows/ze-theia-slim.yaml @@ -8,7 +8,7 @@ on: workflow_dispatch: inputs: docker-tags: - description: "Docker tags to build (e.g., 1.37 latest)" + description: "Docker tags to build (space-separated - e.g., '1.37 latest')" default: "next" required: false type: string