From c13efc8a2344b1f2923579143afdc7b3d86afb13 Mon Sep 17 00:00:00 2001 From: Andrea Falzetti Date: Wed, 7 Dec 2022 14:20:31 +0000 Subject: [PATCH] feat: change jetbrains ides dir layout Co-authored-by: Victor Nogueira Co-authored-by: Anton Kosyakov --- .../jetbrains-auto-update-template.yml | 25 +++----- .../backend-plugin/leeway.Dockerfile | 3 + components/ide/jetbrains/cli/cmd/root.go | 1 + components/ide/jetbrains/image/BUILD.js | 4 +- .../image/create-supervisor-config.js | 58 +++++++++++++++++ components/ide/jetbrains/image/hot-deploy.sh | 8 ++- .../ide/jetbrains/image/leeway.Dockerfile | 14 ++--- .../image/resolve-latest-ide-version.sh | 18 ++++++ components/ide/jetbrains/image/status/main.go | 63 +++++++++++-------- .../supervisor-ide-config_clion-latest.json | 14 +++++ .../image/supervisor-ide-config_clion.json | 22 ++++--- .../supervisor-ide-config_goland-latest.json | 14 +++++ .../image/supervisor-ide-config_goland.json | 22 ++++--- ...supervisor-ide-config_intellij-latest.json | 14 +++++ .../image/supervisor-ide-config_intellij.json | 22 ++++--- ...supervisor-ide-config_phpstorm-latest.json | 14 +++++ .../image/supervisor-ide-config_phpstorm.json | 22 ++++--- .../supervisor-ide-config_pycharm-latest.json | 14 +++++ .../image/supervisor-ide-config_pycharm.json | 22 ++++--- .../supervisor-ide-config_rider-latest.json | 14 +++++ .../image/supervisor-ide-config_rider.json | 22 ++++--- ...supervisor-ide-config_rubymine-latest.json | 14 +++++ .../image/supervisor-ide-config_rubymine.json | 22 ++++--- ...supervisor-ide-config_webstorm-latest.json | 14 +++++ .../image/supervisor-ide-config_webstorm.json | 22 ++++--- 25 files changed, 359 insertions(+), 123 deletions(-) create mode 100644 components/ide/jetbrains/image/create-supervisor-config.js create mode 100755 components/ide/jetbrains/image/resolve-latest-ide-version.sh create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_clion-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_goland-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_intellij-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_phpstorm-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_pycharm-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_rider-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_rubymine-latest.json create mode 100644 components/ide/jetbrains/image/supervisor-ide-config_webstorm-latest.json diff --git a/.github/workflows/jetbrains-auto-update-template.yml b/.github/workflows/jetbrains-auto-update-template.yml index 7948ae62b91a75..9e92697574fc32 100644 --- a/.github/workflows/jetbrains-auto-update-template.yml +++ b/.github/workflows/jetbrains-auto-update-template.yml @@ -41,32 +41,25 @@ jobs: uses: google-github-actions/setup-gcloud@v0 with: project_id: ${{ secrets.projectId }} - - name: Get Platform Version from JetBrains EAP Backend Plugin - id: platform-version - run: | - PLATFORM_VERSION=$(cat ./components/ide/jetbrains/backend-plugin/gradle-latest.properties | grep platformVersion= | sed 's/platformVersion=//' | sed 's/-EAP-CANDIDATE-SNAPSHOT//') - echo "::set-output name=result::$PLATFORM_VERSION" - echo $PLATFORM_VERSION - name: Find IDE version to download id: ide-version run: | - curl -sL "https://data.services.jetbrains.com/products/releases?code=${{ inputs.productCode }}&type=eap,rc,release&platform=linux" > releases.json - IDE_VERSION=$(cat releases.json | jq -r -c 'first(.${{ inputs.productCode }}[] | select(.build | contains("${{ steps.platform-version.outputs.result }}")) | .build)') - IDE_BACKEND_VERSION=$(cat releases.json | jq -r '.${{ inputs.productCode }}[0].version') - rm releases.json - echo "::set-output name=result::$IDE_VERSION" - echo "::set-output name=ideBackendVersion::$IDE_BACKEND_VERSION" - echo $IDE_VERSION - echo $IDE_BACKEND_VERSION + IDE_VERSIONS_JSON=$(bash ./components/ide/jetbrains/image/resolve-latest-ide-version.sh ${{ inputs.productCode }}) + IDE_BUILD_VERSION=$(echo "$IDE_VERSIONS_JSON" | jq -r .IDE_BUILD_VERSION) + IDE_VERSION=$(echo "$IDE_VERSIONS_JSON" | jq -r .IDE_VERSION) + echo "IDE_BUILD_VERSION: $IDE_BUILD_VERSION" + echo "IDE_VERSION: $IDE_VERSION" + echo "::set-output name=ideBuildVersion::$IDE_BUILD_VERSION" + echo "::set-output name=ideVersion::$IDE_VERSION" - name: Leeway build - if: ${{ steps.ide-version.outputs.result }} + if: ${{ steps.ide-version.outputs.ideBuildVersion }} env: LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: "8388608" run: | gcloud auth configure-docker --quiet export LEEWAY_WORKSPACE_ROOT=$(pwd) cd components/ide/jetbrains/image - leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber=${{ steps.ide-version.outputs.result }} .:${{ inputs.productId }}-latest -DjbBackendVersion=${{ steps.ide-version.outputs.ideBackendVersion }} + leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber=${{ steps.ide-version.outputs.ideBuildVersion }} .:${{ inputs.productId }}-latest -DjbBackendVersion=${{ steps.ide-version.outputs.ideVersion }} - name: Get previous job's status id: lastrun uses: filiptronicek/get-last-job-status@main diff --git a/components/ide/jetbrains/backend-plugin/leeway.Dockerfile b/components/ide/jetbrains/backend-plugin/leeway.Dockerfile index 753c893f1fb83f..6b0f5332a646f0 100644 --- a/components/ide/jetbrains/backend-plugin/leeway.Dockerfile +++ b/components/ide/jetbrains/backend-plugin/leeway.Dockerfile @@ -11,4 +11,7 @@ FROM scratch ARG JETBRAINS_BACKEND_QUALIFIER # ensures right permissions for /ide-desktop-plugins COPY --from=base_builder --chown=33333:33333 /ide-desktop-plugins/ /ide-desktop-plugins/ +COPY --chown=33333:33333 components-ide-jetbrains-backend-plugin--plugin-${JETBRAINS_BACKEND_QUALIFIER}/build/gitpod-remote /ide-desktop-plugins/gitpod-remote-${JETBRAINS_BACKEND_QUALIFIER}/ + +# added for backwards compatibility, can be removed in the future COPY --chown=33333:33333 components-ide-jetbrains-backend-plugin--plugin-${JETBRAINS_BACKEND_QUALIFIER}/build/gitpod-remote /ide-desktop-plugins/gitpod-remote/ diff --git a/components/ide/jetbrains/cli/cmd/root.go b/components/ide/jetbrains/cli/cmd/root.go index aa10341de094de..0ebc846a76d0fd 100644 --- a/components/ide/jetbrains/cli/cmd/root.go +++ b/components/ide/jetbrains/cli/cmd/root.go @@ -27,6 +27,7 @@ func Execute() { func getCliApiUrl() *url.URL { var backendPort = 63342 + // TODO look up under alias + qualifier, i.e. intellij or intellij-latest if _, fileStatError := os.Stat("/ide-desktop/bin/idea-cli-dev"); !errors.Is(fileStatError, os.ErrNotExist) { backendPort = backendPort + 1 } diff --git a/components/ide/jetbrains/image/BUILD.js b/components/ide/jetbrains/image/BUILD.js index ffddfed12410e2..1c13ec2bf87ab7 100644 --- a/components/ide/jetbrains/image/BUILD.js +++ b/components/ide/jetbrains/image/BUILD.js @@ -54,7 +54,7 @@ const generateIDEBuildPackage = function (ideConfig, qualifier) { let pkg = { name, type: "docker", - srcs: ["startup.sh", `supervisor-ide-config_${ideConfig.name}.json`], + srcs: ["startup.sh", `supervisor-ide-config_${name}.json`], deps: ["components/ide/jetbrains/image/status:app", `:download-${name}`, "components/ide/jetbrains/cli:app"], config: { dockerfile: "leeway.Dockerfile", @@ -63,7 +63,7 @@ const generateIDEBuildPackage = function (ideConfig, qualifier) { }, buildArgs: { JETBRAINS_DOWNLOAD_QUALIFIER: name, - SUPERVISOR_IDE_CONFIG: `supervisor-ide-config_${ideConfig.name}.json`, + SUPERVISOR_IDE_CONFIG: `supervisor-ide-config_${name}.json`, JETBRAINS_BACKEND_QUALIFIER: qualifier, JETBRAINS_BACKEND_VERSION: getIDEVersion(qualifier, args[`${ideConfig.name}DownloadUrl`]), }, diff --git a/components/ide/jetbrains/image/create-supervisor-config.js b/components/ide/jetbrains/image/create-supervisor-config.js new file mode 100644 index 00000000000000..7c722bc653b9eb --- /dev/null +++ b/components/ide/jetbrains/image/create-supervisor-config.js @@ -0,0 +1,58 @@ +// Copyright (c) 2022 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. + +// @ts-check +const fs = require("fs"); + +const ideConfigs = [ + { + name: "intellij", + displayName: "IntelliJ IDEA", + }, + { + name: "goland", + displayName: "GoLand", + }, + { + name: "pycharm", + displayName: "PyCharm", + }, + { + name: "phpstorm", + displayName: "PhpStorm", + }, + { + name: "rubymine", + displayName: "RubyMine", + }, + { + name: "webstorm", + displayName: "WebStorm", + }, + { + name: "rider", + displayName: "Rider", + }, + { + name: "clion", + displayName: "CLion", + }, +]; + +["stable", "latest"].forEach((qualifier) => { + ideConfigs.forEach((ideConfig) => { + const name = ideConfig.name + (qualifier === "stable" ? "" : "-" + qualifier); + const template = { + entrypoint: `/ide-desktop/${name}/status`, + entrypointArgs: ["{DESKTOPIDEPORT}", ideConfig.name, `Open in ${ideConfig.displayName}`], + readinessProbe: { + type: "http", + http: { + path: "/status", + }, + }, + }; + fs.writeFileSync(`supervisor-ide-config_${name}.json`, JSON.stringify(template, null, 2), "utf-8"); + }); +}); diff --git a/components/ide/jetbrains/image/hot-deploy.sh b/components/ide/jetbrains/image/hot-deploy.sh index 7bb87b3dfefc5e..32a6a70d43ffff 100755 --- a/components/ide/jetbrains/image/hot-deploy.sh +++ b/components/ide/jetbrains/image/hot-deploy.sh @@ -19,6 +19,9 @@ echo "Product: $product" qualifier=${2:-latest} echo "Qualifier: $qualifier" +product_code=${3} +echo "Product Code: $product_code" + if [ "$qualifier" == "stable" ]; then component=$product else @@ -31,7 +34,10 @@ echo "Image Version: $version" bldfn="/tmp/build-$version.tar.gz" docker ps &> /dev/null || (echo "You need a working Docker daemon. Maybe set DOCKER_HOST?"; exit 1) -leeway build -Dversion="$version" -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build ".:$component" --save "$bldfn" +IDE_VERSIONS_JSON=$(bash "$ROOT_DIR/components/ide/jetbrains/image/resolve-latest-ide-version.sh" "$product_code") +IDE_BUILD_VERSION=$(echo "$IDE_VERSIONS_JSON" | jq -r .IDE_BUILD_VERSION) +IDE_VERSION=$(echo "$IDE_VERSIONS_JSON" | jq -r .IDE_VERSION) +leeway build -Dversion="$version" -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber="$IDE_BUILD_VERSION" -DjbBackendVersion="$IDE_VERSION" ".:$component" --save "$bldfn" dev_image="$(tar xfO "$bldfn" ./imgnames.txt | head -n1)" echo "Dev Image: $dev_image" diff --git a/components/ide/jetbrains/image/leeway.Dockerfile b/components/ide/jetbrains/image/leeway.Dockerfile index cb706342502a70..5b6106a71521ff 100644 --- a/components/ide/jetbrains/image/leeway.Dockerfile +++ b/components/ide/jetbrains/image/leeway.Dockerfile @@ -15,21 +15,21 @@ ARG SUPERVISOR_IDE_CONFIG # ensures right permissions for /ide-desktop COPY --from=base_builder --chown=33333:33333 /ide-desktop/ /ide-desktop/ COPY --chown=33333:33333 ${SUPERVISOR_IDE_CONFIG} /ide-desktop/supervisor-ide-config.json -COPY --chown=33333:33333 components-ide-jetbrains-image--download-${JETBRAINS_DOWNLOAD_QUALIFIER}/backend /ide-desktop/backend -COPY --chown=33333:33333 components-ide-jetbrains-image-status--app/status /ide-desktop +COPY --chown=33333:33333 components-ide-jetbrains-image--download-${JETBRAINS_DOWNLOAD_QUALIFIER}/backend /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/backend +COPY --chown=33333:33333 components-ide-jetbrains-image-status--app/status /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER} ARG JETBRAINS_BACKEND_QUALIFIER ENV GITPOD_ENV_SET_JETBRAINS_BACKEND_QUALIFIER ${JETBRAINS_BACKEND_QUALIFIER} -COPY --chown=33333:33333 components-ide-jetbrains-cli--app/cli /ide-desktop/bin/idea-cli -ENV GITPOD_ENV_APPEND_PATH /ide-desktop/bin: +COPY --chown=33333:33333 components-ide-jetbrains-cli--app/cli /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli +ENV GITPOD_ENV_APPEND_PATH /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin: # editor config -ENV GITPOD_ENV_SET_EDITOR "/ide-desktop/bin/idea-cli open" +ENV GITPOD_ENV_SET_EDITOR "/ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli open" ENV GITPOD_ENV_SET_VISUAL "$GITPOD_ENV_SET_EDITOR" ENV GITPOD_ENV_SET_GP_OPEN_EDITOR "$GITPOD_ENV_SET_EDITOR" ENV GITPOD_ENV_SET_GIT_EDITOR "$GITPOD_ENV_SET_EDITOR --wait" -ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide-desktop/bin/idea-cli preview" -ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide-desktop/bin/idea-cli preview" +ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli preview" +ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli preview" LABEL "io.gitpod.ide.version"=$JETBRAINS_BACKEND_VERSION diff --git a/components/ide/jetbrains/image/resolve-latest-ide-version.sh b/components/ide/jetbrains/image/resolve-latest-ide-version.sh new file mode 100755 index 00000000000000..fffb59b61089d0 --- /dev/null +++ b/components/ide/jetbrains/image/resolve-latest-ide-version.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2022 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. + +set -Eeuo pipefail + +ROOT_DIR="$(dirname "$0")/../../../.." +PRODUCT_CODE=${1} +TEMP_FILENAME=$(mktemp) +PLUGIN_PLATFORM_VERSION=$(grep platformVersion= "$ROOT_DIR/components/ide/jetbrains/backend-plugin/gradle-latest.properties" | sed 's/platformVersion=//' | sed 's/-EAP-CANDIDATE-SNAPSHOT//') # Example: PLUGIN_PLATFORM_VERSION: 223.7571 + +curl -sL "https://data.services.jetbrains.com/products/releases?code=$PRODUCT_CODE&type=eap,rc,release&platform=linux" > "$TEMP_FILENAME" +IDE_BUILD_VERSION=$(jq -r -c "first(.${PRODUCT_CODE}[] | select(.build | contains(\"$PLUGIN_PLATFORM_VERSION\")) | .build)" < "$TEMP_FILENAME") # Example: IDE_BUILD_VERSION: 223.7571.176 +IDE_VERSION=$(jq -r ".${PRODUCT_CODE}[0].version" < "$TEMP_FILENAME") # Example: IDE_VERSION: 2022.3 +rm "$TEMP_FILENAME" + +echo "{\"IDE_BUILD_VERSION\": \"$IDE_BUILD_VERSION\", \"IDE_VERSION\": \"$IDE_VERSION\"}" diff --git a/components/ide/jetbrains/image/status/main.go b/components/ide/jetbrains/image/status/main.go index d4da03e8d1df16..9fc75794e242ec 100644 --- a/components/ide/jetbrains/image/status/main.go +++ b/components/ide/jetbrains/image/status/main.go @@ -47,9 +47,6 @@ var ( Version = "" ) -const BackendPath = "/ide-desktop/backend" -const ProductInfoPath = BackendPath + "/product-info.json" - type LaunchContext struct { startTime time.Time @@ -57,6 +54,9 @@ type LaunchContext struct { alias string label string + qualifier string + productDir string + backendDir string info *ProductInfo backendVersion *version.Version wsInfo *supervisor.WorkspaceInfoResponse @@ -99,7 +99,16 @@ func main() { label = os.Args[3] } - info, err := resolveProductInfo() + qualifier := os.Getenv("JETBRAINS_BACKEND_QUALIFIER") + if qualifier == "stable" { + qualifier = "" + } else { + qualifier = "-" + qualifier + } + productDir := "/ide-desktop/" + alias + qualifier + backendDir := productDir + "/backend" + + info, err := resolveProductInfo(backendDir) if err != nil { log.WithError(err).Error("failed to resolve product info") return @@ -124,6 +133,9 @@ func main() { alias: alias, label: label, + qualifier: qualifier, + productDir: productDir, + backendDir: backendDir, info: info, backendVersion: backendVersion, wsInfo: wsInfo, @@ -359,19 +371,12 @@ func launch(launchCtx *LaunchContext) { idePrefix = "idea" } // [idea64|goland64|pycharm64|phpstorm64].vmoptions - launchCtx.vmOptionsFile = fmt.Sprintf("/ide-desktop/backend/bin/%s64.vmoptions", idePrefix) + launchCtx.vmOptionsFile = fmt.Sprintf(launchCtx.backendDir+"/bin/%s64.vmoptions", idePrefix) err = configureVMOptions(gitpodConfig, launchCtx.alias, launchCtx.vmOptionsFile) if err != nil { log.WithError(err).Error("failed to configure vmoptions") } - qualifier := os.Getenv("JETBRAINS_BACKEND_QUALIFIER") - if qualifier == "stable" { - qualifier = "" - } else { - qualifier = "-" + qualifier - } - var riderSolutionFile string if launchCtx.alias == "rider" { riderSolutionFile, err = findRiderSolutionFile(projectDir) @@ -380,10 +385,10 @@ func launch(launchCtx *LaunchContext) { } } - configDir := fmt.Sprintf("/workspace/.config/JetBrains%s", qualifier) + configDir := fmt.Sprintf("/workspace/.config/JetBrains%s", launchCtx.qualifier) launchCtx.projectDir = projectDir launchCtx.configDir = configDir - launchCtx.systemDir = fmt.Sprintf("/workspace/.cache/JetBrains%s", qualifier) + launchCtx.systemDir = fmt.Sprintf("/workspace/.cache/JetBrains%s", launchCtx.qualifier) launchCtx.riderSolutionFile = riderSolutionFile launchCtx.projectContextDir = resolveProjectContextDir(launchCtx) launchCtx.projectConfigDir = fmt.Sprintf("%s/RemoteDev-%s/%s", configDir, launchCtx.info.ProductCode, strings.ReplaceAll(launchCtx.projectContextDir, "/", "_")) @@ -407,7 +412,7 @@ func launch(launchCtx *LaunchContext) { } // install gitpod plugin - err = linkRemotePlugin() + err = linkRemotePlugin(launchCtx) if err != nil { log.WithError(err).Error("failed to install gitpod-remote plugin") } @@ -445,7 +450,7 @@ func run(launchCtx *LaunchContext) { } // resolveUserEnvs emulats the interactive login shell to ensure that all user defined shell scripts are loaded -func resolveUserEnvs() (userEnvs []string, err error) { +func resolveUserEnvs(launchCtx *LaunchContext) (userEnvs []string, err error) { shell := os.Getenv("SHELL") if shell == "" { shell = "/bin/bash" @@ -454,7 +459,7 @@ func resolveUserEnvs() (userEnvs []string, err error) { if err != nil { return } - envCmd := exec.Command(shell, []string{"-ilc", "/ide-desktop/status env " + mark.String()}...) + envCmd := exec.Command(shell, []string{"-ilc", launchCtx.productDir + "/status env " + mark.String()}...) envCmd.Stderr = os.Stderr output, err := envCmd.Output() if err != nil { @@ -469,7 +474,7 @@ func resolveUserEnvs() (userEnvs []string, err error) { func remoteDevServerCmd(args []string, launchCtx *LaunchContext) *exec.Cmd { if launchCtx.env == nil { - userEnvs, err := resolveUserEnvs() + userEnvs, err := resolveUserEnvs(launchCtx) if err == nil { launchCtx.env = append(launchCtx.env, userEnvs...) } else { @@ -484,15 +489,15 @@ func remoteDevServerCmd(args []string, launchCtx *LaunchContext) *exec.Cmd { fmt.Sprintf("IJ_HOST_SYSTEM_BASE_DIR=%s", launchCtx.systemDir), ) - // instead put them into /ide-desktop/backend/bin/idea64.vmoptions + // instead put them into /ide-desktop/${alias}${qualifier}/backend/bin/idea64.vmoptions // otherwise JB will complain to a user on each startup - // by default remote dev already set -Xmx2048m, see /ide-desktop/backend/plugins/remote-dev-server/bin/launcher.sh + // by default remote dev already set -Xmx2048m, see /ide-desktop/${alias}${qualifier}/backend/plugins/remote-dev-server/bin/launcher.sh launchCtx.env = append(launchCtx.env, "JAVA_TOOL_OPTIONS=") log.WithField("env", launchCtx.env).Debug("resolved launch env") } - cmd := exec.Command(BackendPath+"/bin/remote-dev-server.sh", args...) + cmd := exec.Command(launchCtx.backendDir+"/bin/remote-dev-server.sh", args...) cmd.Env = launchCtx.env cmd.Stderr = os.Stderr cmd.Stdout = os.Stdout @@ -619,8 +624,8 @@ type ProductInfo struct { ProductCode string `json:"productCode"` } -func resolveProductInfo() (*ProductInfo, error) { - f, err := os.Open(ProductInfoPath) +func resolveProductInfo(backendDir string) (*ProductInfo, error) { + f, err := os.Open(backendDir + "/product-info.json") if err != nil { return nil, err } @@ -764,12 +769,20 @@ func getProductConfig(config *gitpod.GitpodConfig, alias string) *gitpod.Jetbrai return productConfig } -func linkRemotePlugin() error { - remotePluginDir := BackendPath + "/plugins/gitpod-remote" +func linkRemotePlugin(launchCtx *LaunchContext) error { + remotePluginDir := launchCtx.backendDir + "/plugins/gitpod-remote" _, err := os.Stat(remotePluginDir) if err == nil || !errors.Is(err, os.ErrNotExist) { return nil } + + // added for backwards compatibility, can be removed in the future + sourceDir := "/ide-desktop-plugins/gitpod-remote-" + os.Getenv("JETBRAINS_BACKEND_QUALIFIER") + _, err = os.Stat(sourceDir) + if err == nil { + return os.Symlink(sourceDir, remotePluginDir) + } + return os.Symlink("/ide-desktop-plugins/gitpod-remote", remotePluginDir) } diff --git a/components/ide/jetbrains/image/supervisor-ide-config_clion-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_clion-latest.json new file mode 100644 index 00000000000000..a3dbcb8cfe1e59 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_clion-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/clion-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "clion", + "Open in CLion" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_clion.json b/components/ide/jetbrains/image/supervisor-ide-config_clion.json index 4fd06a40500ab6..022f41f15f1c14 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_clion.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_clion.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "clion", "Open in CLion" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/clion/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "clion", + "Open in CLion" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_goland-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_goland-latest.json new file mode 100644 index 00000000000000..4eb9a5748cd9df --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_goland-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/goland-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "goland", + "Open in GoLand" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_goland.json b/components/ide/jetbrains/image/supervisor-ide-config_goland.json index 9806595ac568d6..ab74397797d907 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_goland.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_goland.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "goland", "Open in GoLand" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/goland/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "goland", + "Open in GoLand" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_intellij-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_intellij-latest.json new file mode 100644 index 00000000000000..1d36e775d97fa0 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_intellij-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/intellij-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "intellij", + "Open in IntelliJ IDEA" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_intellij.json b/components/ide/jetbrains/image/supervisor-ide-config_intellij.json index 2f29262586acdd..bf25922475fe46 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_intellij.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_intellij.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "intellij", "Open in IntelliJ IDEA" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/intellij/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "intellij", + "Open in IntelliJ IDEA" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_phpstorm-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_phpstorm-latest.json new file mode 100644 index 00000000000000..bcd84ff879a152 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_phpstorm-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/phpstorm-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "phpstorm", + "Open in PhpStorm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_phpstorm.json b/components/ide/jetbrains/image/supervisor-ide-config_phpstorm.json index 4ca6a9e9bed845..eca86f54e55e75 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_phpstorm.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_phpstorm.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "phpstorm", "Open in PhpStorm" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/phpstorm/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "phpstorm", + "Open in PhpStorm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_pycharm-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_pycharm-latest.json new file mode 100644 index 00000000000000..515cdefba663a7 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_pycharm-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/pycharm-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "pycharm", + "Open in PyCharm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_pycharm.json b/components/ide/jetbrains/image/supervisor-ide-config_pycharm.json index 242cd3de192e65..46565be38b1ff3 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_pycharm.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_pycharm.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "pycharm", "Open in PyCharm" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/pycharm/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "pycharm", + "Open in PyCharm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_rider-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_rider-latest.json new file mode 100644 index 00000000000000..419d9d2541e171 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_rider-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/rider-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "rider", + "Open in Rider" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_rider.json b/components/ide/jetbrains/image/supervisor-ide-config_rider.json index 94159b57d81064..c9aae5d361fca9 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_rider.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_rider.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "rider", "Open in Rider" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/rider/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "rider", + "Open in Rider" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_rubymine-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_rubymine-latest.json new file mode 100644 index 00000000000000..2a51f2225e1c7c --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_rubymine-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/rubymine-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "rubymine", + "Open in RubyMine" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_rubymine.json b/components/ide/jetbrains/image/supervisor-ide-config_rubymine.json index 0da7037ea32e80..226921b3f48e4f 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_rubymine.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_rubymine.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "rubymine", "Open in RubyMine" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/rubymine/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "rubymine", + "Open in RubyMine" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_webstorm-latest.json b/components/ide/jetbrains/image/supervisor-ide-config_webstorm-latest.json new file mode 100644 index 00000000000000..40c62de031d8d6 --- /dev/null +++ b/components/ide/jetbrains/image/supervisor-ide-config_webstorm-latest.json @@ -0,0 +1,14 @@ +{ + "entrypoint": "/ide-desktop/webstorm-latest/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "webstorm", + "Open in WebStorm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file diff --git a/components/ide/jetbrains/image/supervisor-ide-config_webstorm.json b/components/ide/jetbrains/image/supervisor-ide-config_webstorm.json index 89665958046115..91ccc5d0ee6434 100644 --- a/components/ide/jetbrains/image/supervisor-ide-config_webstorm.json +++ b/components/ide/jetbrains/image/supervisor-ide-config_webstorm.json @@ -1,10 +1,14 @@ { - "entrypoint": "/ide-desktop/status", - "entrypointArgs": [ "{DESKTOPIDEPORT}", "webstorm", "Open in WebStorm" ], - "readinessProbe": { - "type": "http", - "http": { - "path": "/status" - } - } -} + "entrypoint": "/ide-desktop/webstorm/status", + "entrypointArgs": [ + "{DESKTOPIDEPORT}", + "webstorm", + "Open in WebStorm" + ], + "readinessProbe": { + "type": "http", + "http": { + "path": "/status" + } + } +} \ No newline at end of file