From d00cdac3c36d06e6d582d7750bc245e44b6047ec Mon Sep 17 00:00:00 2001 From: Daniel S Date: Sun, 16 Jan 2022 16:39:41 +0100 Subject: [PATCH 1/3] update to build theia direct for latest versions and update purposes --- Dockerfile | 59 ++++++++++++++++++++++++------- deploy/charts/webshell/Chart.yaml | 4 +-- package.json | 43 ++++++++++++++++++++++ 3 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 package.json diff --git a/Dockerfile b/Dockerfile index 96dba32..0d1ff93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,39 @@ -FROM quay.io/acend/theia-original +FROM node:12-alpine3.15 -ARG ARGOCD_VERSION=2.1.2 -ARG AZURECLI_VERSION=2.28.0 -ARG DOCKER_COMPOSE=1.29.2 -ARG HELM_VERSION=3.7.0 -ARG KUBECTL_VERSION=1.22.2 +RUN apk add --no-cache make pkgconfig gcc g++ python3 libx11-dev libxkbfile-dev libsecret-dev + +WORKDIR /home/theia +ADD package.json ./package.json + +ARG GITHUB_TOKEN +RUN yarn --pure-lockfile && \ + NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && \ + yarn theia download:plugins && \ + yarn --production && \ + yarn autoclean --init && \ + echo *.ts >> .yarnclean && \ + echo *.ts.map >> .yarnclean && \ + echo *.spec.* >> .yarnclean && \ + yarn autoclean --force && \ + yarn cache clean + +FROM node:12-alpine3.15 + +ARG ARGOCD_VERSION=2.2.2 +ARG AZURECLI_VERSION=2.32.0 +ARG DOCKER_COMPOSE=2.2.3 +ARG HELM_VERSION=3.7.2 +ARG KUBECTL_VERSION=1.23.1 ARG OC_VERSION=4.8 -ARG TERRAFORM_VERSION=1.0.10 +ARG TERRAFORM_VERSION=1.1.3 ARG TFENV_VERSION=v2.2.2 -ARG KUSTOMIZE_VERSION=4.4.0 +ARG KUSTOMIZE_VERSION=4.4.1 ARG MINIKUBE_VERSION=1.24.0 -USER root -RUN sed -i "s/3.11/3.14/" /etc/apk/repositories && \ - apk --no-cache update && \ +RUN apk --no-cache update && \ apk --no-cache -U upgrade -a && \ - apk --no-cache add coreutils grep bash curl gettext vim tree git p7zip gcompat \ + apk add --no-cache git openssh-client-default bash libsecret \ + coreutils grep curl gettext vim tree git p7zip gcompat \ docker-cli mysql-client lynx bind-tools figlet jq \ bash-completion docker-bash-completion git-bash-completion \ py3-pip py3-yaml py3-pynacl py3-bcrypt py3-cryptography py3-psutil py3-wheel @@ -52,6 +70,12 @@ RUN pip3 install azure-cli==${AZURECLI_VERSION} --no-cache-dir && \ curl -#L -o minikube "https://github.com/kubernetes/minikube/releases/download/v${MINIKUBE_VERSION}/minikube-linux-amd64" && \ install -t /usr/local/bin minikube && rm minikube +RUN addgroup theia && \ + adduser -G theia -s /bin/sh -D theia && \ + chmod g+rw /home && \ + mkdir -p /home/project && \ + chown -R theia:theia /home/theia && \ + chown -R theia:theia /home/project RUN git config --global advice.detachedHead false && \ # tfenv & terraform @@ -60,5 +84,16 @@ RUN git config --global advice.detachedHead false && \ tfenv install ${TERRAFORM_VERSION} && \ tfenv use ${TERRAFORM_VERSION} +ENV HOME /home/theia +WORKDIR /home/theia + +COPY --from=0 --chown=theia:theia /home/theia /home/theia +EXPOSE 3000 + +ENV SHELL=/bin/bash \ + THEIA_DEFAULT_PLUGINS=local-dir:/home/theia/plugins +ENV USE_LOCAL_GIT true + USER theia COPY bashrc /home/theia/.bashrc +ENTRYPOINT [ "node", "/home/theia/src-gen/backend/main.js", "/home/project", "--hostname=0.0.0.0" ] diff --git a/deploy/charts/webshell/Chart.yaml b/deploy/charts/webshell/Chart.yaml index 2793c77..1c8bbe1 100644 --- a/deploy/charts/webshell/Chart.yaml +++ b/deploy/charts/webshell/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: webshell description: A Helm chart to deploy a webshell environment type: application -version: 0.1.12 -appVersion: "0.1.12" +version: 0.2.0 +appVersion: "0.2.0" diff --git a/package.json b/package.json new file mode 100644 index 0000000..b65dbdd --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "private": true, + "dependencies": { + "@theia/callhierarchy": "next", + "@theia/file-search": "next", + "@theia/git": "next", + "@theia/markers": "next", + "@theia/messages": "next", + "@theia/navigator": "next", + "@theia/outline-view": "next", + "@theia/plugin-ext-vscode": "next", + "@theia/preferences": "next", + "@theia/preview": "next", + "@theia/search-in-workspace": "next", + "@theia/terminal": "next", + "@theia/vsx-registry": "next" + }, + "devDependencies": { + "@theia/cli": "next" + }, + "scripts": { + "preinstall": "node-gyp install", + "prepare": "yarn run clean && yarn build && yarn run download:plugins", + "clean": "theia clean", + "build": "theia build --mode development", + "start": "theia start --plugins=local-dir:plugins", + "download:plugins": "theia download:plugins" + }, + "theiaPluginsDir": "plugins", + "theiaPlugins": { + "vscode-builtin-extensions-pack": "https://open-vsx.org/api/eclipse-theia/builtin-extension-pack/1.50.1/file/eclipse-theia.builtin-extension-pack-1.50.1.vsix", + "terraform": "https://open-vsx.org/api/4ops/terraform/0.2.1/file/4ops.terraform-0.2.1.vsix", + "yaml.lint": "https://open-vsx.org/api/phil9909/ytt-lint/0.3.1/file/phil9909.ytt-lint-0.3.1.vsix" + }, + "theiaPluginsExcludeIds": [ + "vscode.extension-editing", + "vscode.git", + "vscode.git-ui", + "vscode.github", + "vscode.markdown-language-features", + "vscode.microsoft-authentication" + ] +} From 173baad6168a8ef9bdf6255fc2bd293606116ebb Mon Sep 17 00:00:00 2001 From: Daniel S Date: Sun, 23 Jan 2022 15:17:32 +0100 Subject: [PATCH 2/3] OLA-83: update releases, adding markdown linter --- Dockerfile | 5 +++-- package.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d1ff93..a8c75a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ ARG DOCKER_COMPOSE=2.2.3 ARG HELM_VERSION=3.7.2 ARG KUBECTL_VERSION=1.23.1 ARG OC_VERSION=4.8 -ARG TERRAFORM_VERSION=1.1.3 +ARG TERRAFORM_VERSION=1.1.4 ARG TFENV_VERSION=v2.2.2 ARG KUSTOMIZE_VERSION=4.4.1 ARG MINIKUBE_VERSION=1.24.0 @@ -33,10 +33,11 @@ ARG MINIKUBE_VERSION=1.24.0 RUN apk --no-cache update && \ apk --no-cache -U upgrade -a && \ apk add --no-cache git openssh-client-default bash libsecret \ + zsh zsh-autosuggestions \ coreutils grep curl gettext vim tree git p7zip gcompat \ docker-cli mysql-client lynx bind-tools figlet jq \ bash-completion docker-bash-completion git-bash-completion \ - py3-pip py3-yaml py3-pynacl py3-bcrypt py3-cryptography py3-psutil py3-wheel + py3-pip py3-yaml py3-pynacl py3-bcrypt py3-cryptography py3-psutil py3-wheel RUN pip3 install azure-cli==${AZURECLI_VERSION} --no-cache-dir && \ # azure cli cleanup diff --git a/package.json b/package.json index b65dbdd..133a10d 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "theiaPlugins": { "vscode-builtin-extensions-pack": "https://open-vsx.org/api/eclipse-theia/builtin-extension-pack/1.50.1/file/eclipse-theia.builtin-extension-pack-1.50.1.vsix", "terraform": "https://open-vsx.org/api/4ops/terraform/0.2.1/file/4ops.terraform-0.2.1.vsix", - "yaml.lint": "https://open-vsx.org/api/phil9909/ytt-lint/0.3.1/file/phil9909.ytt-lint-0.3.1.vsix" + "yaml.lint": "https://open-vsx.org/api/phil9909/ytt-lint/0.3.1/file/phil9909.ytt-lint-0.3.1.vsix", + "md.lint": "https://open-vsx.org/api/DavidAnson/vscode-markdownlint/0.45.0/file/DavidAnson.vscode-markdownlint-0.45.0.vsix" }, "theiaPluginsExcludeIds": [ "vscode.extension-editing", From 118d39cd11fb593f8d0b62fa86c7e0a905cc0653 Mon Sep 17 00:00:00 2001 From: Daniel S Date: Mon, 24 Jan 2022 13:05:53 +0100 Subject: [PATCH 3/3] update kubectl --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a8c75a5..2f63e6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ ARG ARGOCD_VERSION=2.2.2 ARG AZURECLI_VERSION=2.32.0 ARG DOCKER_COMPOSE=2.2.3 ARG HELM_VERSION=3.7.2 -ARG KUBECTL_VERSION=1.23.1 +ARG KUBECTL_VERSION=1.23.2 ARG OC_VERSION=4.8 ARG TERRAFORM_VERSION=1.1.4 ARG TFENV_VERSION=v2.2.2