Skip to content

Commit

Permalink
[server] Add and use supervisor image config
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann committed Nov 15, 2021
1 parent a7166da commit 259a3a1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion chart/templates/server-ide-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions components/gitpod-protocol/src/workspace-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
10 changes: 8 additions & 2 deletions components/server/src/ide-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface RawIDEConfig {
ideImageRepo: string;
ideImageAliases?: { [index: string]: string };
desktopIdeImageAliases?: { [index: string]: string };
supervisorImage: string;
}
const scheme = {
"type": "object",
Expand All @@ -36,10 +37,14 @@ const scheme = {
"type": "object",
"additionalProperties": { "type": "string" }
},
"supervisorImage": {
"type": "string"
},
},
"required": [
"ideVersion",
"ideImageRepo"
"ideImageRepo",
"supervisorImage",
]
};

Expand All @@ -49,6 +54,7 @@ export interface IDEConfig {
ideImageAliases: { [index: string]: string };
desktopIdeImageAliases: { [index: string]: string };
ideImage: string;
supervisorImage: string;
}

@injectable()
Expand Down Expand Up @@ -120,7 +126,7 @@ export class IDEConfigService {
},
desktopIdeImageAliases: {
...raw.desktopIdeImageAliases
}
},
}
}

Expand Down
2 changes: 2 additions & 0 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -745,6 +746,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);
Expand Down

0 comments on commit 259a3a1

Please sign in to comment.