Skip to content

Commit

Permalink
move composition of ide prebuild tasks in supervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
akosyakov committed Jun 29, 2023
1 parent 3f27877 commit 8cd3514
Show file tree
Hide file tree
Showing 24 changed files with 403 additions and 329 deletions.
9 changes: 7 additions & 2 deletions components/ide/jetbrains/image/create-supervisor-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const ideConfigs = [
ideConfigs.forEach((ideConfig) => {
const name = ideConfig.name + (qualifier === "stable" ? "" : "-" + qualifier);
const template = {
name: ideConfig.name,
displayName: ideConfig.displayName,
version: qualifier,
entrypoint: `/ide-desktop/jb-launcher`,
entrypointArgs: ["{DESKTOPIDEPORT}", ideConfig.name, `Open in ${ideConfig.displayName}`],
readinessProbe: {
Expand All @@ -63,8 +66,10 @@ const ideConfigs = [
GP_EXTERNAL_BROWSER: `/ide-desktop/${name}/bin/idea-cli preview`,
},
prebuild: {
name: `GITPOD_JB_WARMUP_TASK`,
entrypointArgs: ["warmup"],
args: ["warmup", ideConfig.name],
env: {
JETBRAINS_BACKEND_QUALIFIER: qualifier,
},
},
};
fs.writeFileSync(`supervisor-ide-config_${name}.json`, JSON.stringify(template, null, 2), "utf-8");
Expand Down
24 changes: 17 additions & 7 deletions components/ide/jetbrains/image/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
# See License.AGPL.txt in the project root for license information.

FROM cgr.dev/chainguard/wolfi-base:latest@sha256:5dcb7597e50978fc9dea77d96665bcd47ab0600386710c6e8dab35adf1102122 as base_builder
RUN mkdir /ide-desktop
ARG JETBRAINS_DOWNLOAD_QUALIFIER
ARG SUPERVISOR_IDE_CONFIG
ARG JETBRAINS_BACKEND_VERSION

RUN apk add --no-cache jq

COPY ${SUPERVISOR_IDE_CONFIG} /tmp/supervisor-ide-config-template.json
RUN jq --arg JETBRAINS_BACKEND_VERSION "$JETBRAINS_BACKEND_VERSION" '.version = $JETBRAINS_BACKEND_VERSION' /tmp/supervisor-ide-config-template.json > /tmp/supervisor-ide-config.json

RUN mkdir /ide-desktop \
&& mkdir /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER} \
# for backward compatibility with older supervisor, remove in the future
&& cp /tmp/supervisor-ide-config.json /ide-desktop/supervisor-ide-config.json \
&& cp /tmp/supervisor-ide-config.json /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/supervisor-ide-config.json

# for debugging
# FROM cgr.dev/chainguard/wolfi-base:latest@sha256:5dcb7597e50978fc9dea77d96665bcd47ab0600386710c6e8dab35adf1102122
FROM scratch
ARG JETBRAINS_DOWNLOAD_QUALIFIER
ARG JETBRAINS_BACKEND_QUALIFIER
ARG JETBRAINS_BACKEND_VERSION
ARG SUPERVISOR_IDE_CONFIG
ARG JETBRAINS_DOWNLOAD_QUALIFIER
# 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/${JETBRAINS_DOWNLOAD_QUALIFIER}/backend
COPY --chown=33333:33333 components-ide-jetbrains-cli--app/cli /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli
COPY components-ide-jetbrains-image--download-${JETBRAINS_DOWNLOAD_QUALIFIER}/backend /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/backend
COPY components-ide-jetbrains-cli--app/cli /ide-desktop/${JETBRAINS_DOWNLOAD_QUALIFIER}/bin/idea-cli

LABEL "io.gitpod.ide.version"=$JETBRAINS_BACKEND_VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "clion",
"displayName": "CLion",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/clion-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"clion"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_clion.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "clion",
"displayName": "CLion",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/clion/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"clion"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "goland",
"displayName": "GoLand",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/goland-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"goland"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_goland.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "goland",
"displayName": "GoLand",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/goland/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"goland"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "intellij",
"displayName": "IntelliJ IDEA",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/intellij-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"intellij"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_intellij.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "intellij",
"displayName": "IntelliJ IDEA",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/intellij/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"intellij"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "phpstorm",
"displayName": "PhpStorm",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/phpstorm-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"phpstorm"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_phpstorm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "phpstorm",
"displayName": "PhpStorm",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/phpstorm/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"phpstorm"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "pycharm",
"displayName": "PyCharm",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/pycharm-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"pycharm"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_pycharm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "pycharm",
"displayName": "PyCharm",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/pycharm/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"pycharm"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "rider",
"displayName": "Rider",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/rider-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"rider"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
14 changes: 10 additions & 4 deletions components/ide/jetbrains/image/supervisor-ide-config_rider.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "rider",
"displayName": "Rider",
"version": "stable",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/rider/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"rider"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "stable"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "rubymine",
"displayName": "RubyMine",
"version": "latest",
"entrypoint": "/ide-desktop/jb-launcher",
"entrypointArgs": [
"{DESKTOPIDEPORT}",
Expand All @@ -22,9 +25,12 @@
"GP_EXTERNAL_BROWSER": "/ide-desktop/rubymine-latest/bin/idea-cli preview"
},
"prebuild": {
"name": "GITPOD_JB_WARMUP_TASK",
"entrypointArgs": [
"warmup"
]
"args": [
"warmup",
"rubymine"
],
"env": {
"JETBRAINS_BACKEND_QUALIFIER": "latest"
}
}
}
Loading

0 comments on commit 8cd3514

Please sign in to comment.