From 44d50bcd48f004ea6cef54c9ee618c21273def38 Mon Sep 17 00:00:00 2001 From: "Cornelius A. Ludmann" Date: Mon, 15 Nov 2021 08:56:36 +0000 Subject: [PATCH] [server] Add and use supervisor image config --- chart/templates/server-ide-configmap.yaml | 3 ++- components/gitpod-protocol/src/workspace-instance.ts | 3 +++ components/server/src/ide-config.ts | 10 ++++++++-- components/server/src/workspace/workspace-starter.ts | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/chart/templates/server-ide-configmap.yaml b/chart/templates/server-ide-configmap.yaml index 6d7c905552156f..71a48943ee0e5d 100644 --- a/chart/templates/server-ide-configmap.yaml +++ b/chart/templates/server-ide-configmap.yaml @@ -48,6 +48,7 @@ data: "ideVersion": "{{ .Values.components.workspace.codeImage.stableVersion }}", "ideImageRepo": "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage) }}", "ideImageAliases": {{ (include "ide-images-aliases" (dict "root" . "gp" $.Values)) | fromYaml | toJson }}, - "desktopIdeImageAliases": {{ (include "desktop-ide-images-aliases" (dict "root" . "gp" $.Values)) | fromYaml | toJson }} + "desktopIdeImageAliases": {{ (include "desktop-ide-images-aliases" (dict "root" . "gp" $.Values)) | fromYaml | toJson }}, + "supervisorImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.supervisor) }}" } {{- end }} \ No newline at end of file diff --git a/components/gitpod-protocol/src/workspace-instance.ts b/components/gitpod-protocol/src/workspace-instance.ts index da5d9015278491..e935e0cf7b18d4 100644 --- a/components/gitpod-protocol/src/workspace-instance.ts +++ b/components/gitpod-protocol/src/workspace-instance.ts @@ -209,4 +209,7 @@ export interface WorkspaceInstanceConfiguration { // desktopIdeImage is the ref of the desktop IDE image this instance uses. desktopIdeImage?: string + + // supervisorImage is the ref of the supervisor image this instance uses. + supervisorImage?: string; } diff --git a/components/server/src/ide-config.ts b/components/server/src/ide-config.ts index 7182e6d31cc7ee..efc36a42e8e0aa 100644 --- a/components/server/src/ide-config.ts +++ b/components/server/src/ide-config.ts @@ -18,6 +18,7 @@ interface RawIDEConfig { ideImageRepo: string; ideImageAliases?: { [index: string]: string }; desktopIdeImageAliases?: { [index: string]: string }; + supervisorImage: string; } const scheme = { "type": "object", @@ -36,10 +37,14 @@ const scheme = { "type": "object", "additionalProperties": { "type": "string" } }, + "supervisorImage": { + "type": "string" + }, }, "required": [ "ideVersion", - "ideImageRepo" + "ideImageRepo", + "supervisorImage", ] }; @@ -49,6 +54,7 @@ export interface IDEConfig { ideImageAliases: { [index: string]: string }; desktopIdeImageAliases: { [index: string]: string }; ideImage: string; + supervisorImage: string; } @injectable() @@ -120,7 +126,7 @@ export class IDEConfigService { }, desktopIdeImageAliases: { ...raw.desktopIdeImageAliases - } + }, } } diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 843df86e23f159..23aad7ae748c94 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -309,6 +309,7 @@ export class WorkspaceStarter { const configuration: WorkspaceInstanceConfiguration = { theiaVersion: ideConfig.ideVersion, ideImage: ideConfig.ideImage, + supervisorImage: ideConfig.supervisorImage, }; const ideChoice = user.additionalData?.ideSettings?.defaultIde; @@ -747,6 +748,7 @@ export class WorkspaceStarter { const startWorkspaceSpecIDEImage = new IDEImage(); startWorkspaceSpecIDEImage.setWebRef(ideImage); startWorkspaceSpecIDEImage.setDesktopRef(instance.configuration?.desktopIdeImage || ""); + startWorkspaceSpecIDEImage.setSupervisorRef(instance.configuration?.supervisorImage || ""); spec.setIdeImage(startWorkspaceSpecIDEImage); spec.setDeprecatedIdeImage(ideImage); spec.setWorkspaceImage(instance.workspaceImage);