Skip to content

Commit

Permalink
[ws-scheduler] Set supervisor ref for ghosts
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann authored and roboquat committed Nov 16, 2021
1 parent c52f8a0 commit 16a23fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion chart/templates/ws-scheduler-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 8 additions & 6 deletions components/ee/ws-scheduler/pkg/scaler/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions installer/pkg/components/ws-scheduler/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 16a23fd

Please sign in to comment.