From 16a23fd8f03736af027d6e153762d5d9530c723c Mon Sep 17 00:00:00 2001 From: "Cornelius A. Ludmann" Date: Mon, 15 Nov 2021 21:24:25 +0000 Subject: [PATCH] [ws-scheduler] Set supervisor ref for ghosts --- chart/templates/ws-scheduler-configmap.yaml | 3 ++- components/ee/ws-scheduler/pkg/scaler/driver.go | 14 ++++++++------ installer/pkg/components/ws-scheduler/configmap.go | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/chart/templates/ws-scheduler-configmap.yaml b/chart/templates/ws-scheduler-configmap.yaml index 9bbf149f7f911d..c9940f895b5df2 100644 --- a/chart/templates/ws-scheduler-configmap.yaml +++ b/chart/templates/ws-scheduler-configmap.yaml @@ -50,7 +50,8 @@ data: } }, "workspaceImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.defaultImage) }}", - "ideImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.theiaImage) }}", + "ideImage": "{{ template "gitpod.comp.imageRepo" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.codeImage) }}:{{ .Values.components.workspace.codeImage.stableVersion }}", + "supervisorImage": "{{ template "gitpod.comp.imageFull" (dict "root" . "gp" $.Values "comp" .Values.components.workspace.supervisor) }}", "maxGhostWorkspaces": {{ $comp.scaler.maxGhostWorkspaces | default 0 }}, "schedulerInterval": "{{ $comp.scaler.schedulerInterval | default "5s" }}", "renewal": { diff --git a/components/ee/ws-scheduler/pkg/scaler/driver.go b/components/ee/ws-scheduler/pkg/scaler/driver.go index 61242ff670ddca..904667e61db1e3 100644 --- a/components/ee/ws-scheduler/pkg/scaler/driver.go +++ b/components/ee/ws-scheduler/pkg/scaler/driver.go @@ -34,11 +34,12 @@ const ( // WorkspaceManagerPrescaleDriverConfig configures a ws-manager based prescale driver type WorkspaceManagerPrescaleDriverConfig struct { - WsManager WorkspaceManagerConfig `json:"wsman"` - GhostOwner string `json:"ghostOwner"` - WorkspaceImage string `json:"workspaceImage"` - IDEImage string `json:"ideImage"` - FeatureFlags []api.WorkspaceFeatureFlag `json:"featureFlags"` + WsManager WorkspaceManagerConfig `json:"wsman"` + GhostOwner string `json:"ghostOwner"` + WorkspaceImage string `json:"workspaceImage"` + IDEImage string `json:"ideImage"` + SupervisorImage string `json:"supervisorImage"` + FeatureFlags []api.WorkspaceFeatureFlag `json:"featureFlags"` MaxGhostWorkspaces int `json:"maxGhostWorkspaces"` SchedulerInterval util.Duration `json:"schedulerInterval"` @@ -291,7 +292,8 @@ func (wspd *WorkspaceManagerPrescaleDriver) startGhostWorkspaces(ctx context.Con }, DeprecatedIdeImage: wspd.Config.IDEImage, IdeImage: &api.IDEImage{ - WebRef: wspd.Config.IDEImage, + WebRef: wspd.Config.IDEImage, + SupervisorRef: wspd.Config.SupervisorImage, }, Initializer: &csapi.WorkspaceInitializer{ Spec: &csapi.WorkspaceInitializer_Empty{ diff --git a/installer/pkg/components/ws-scheduler/configmap.go b/installer/pkg/components/ws-scheduler/configmap.go index ef0e8cc28a88da..65c58e010d67be 100644 --- a/installer/pkg/components/ws-scheduler/configmap.go +++ b/installer/pkg/components/ws-scheduler/configmap.go @@ -83,6 +83,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { }, WorkspaceImage: common.ImageName("", workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion), IDEImage: common.ImageName(ctx.Config.Repository, workspace.IDEImageRepo, ctx.VersionManifest.Components.Workspace.CodeImage.Version), + SupervisorImage: common.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version), FeatureFlags: nil, MaxGhostWorkspaces: 10, SchedulerInterval: util.Duration(time.Second * 5),