Skip to content

Remove ghost from the codebase #8363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions chart/templates/workspace-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ data:
"probe.yaml": |
{{ dict | merge ($comp.templates.probe | default dict) (include "coreWorkspaceAffinity" (dict "comp" $comp "tpe" "probe") | fromYaml) | toJson | indent 4 }}
{{- end }}
{{ if (or $comp.templates.regular $comp.affinity) }}
"ghost.yaml": |
{{ dict | merge ($comp.templates.ghost | default dict) (include "coreWorkspaceAffinity" (dict "comp" $comp "tpe" "ghost") | fromYaml) | toJson | indent 4 }}
{{- end }}
{{ if (or $comp.templates.imagebuild $comp.affinity) }}
"imagebuild.yaml": |
{{ dict | merge ($comp.templates.imagebuild | default dict) (include "coreWorkspaceAffinity" (dict "comp" $comp "tpe" "imagebuild") | fromYaml) | toJson | indent 4 }}
Expand Down
1 change: 0 additions & 1 deletion chart/templates/ws-manager-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ data:
{{- if $wscomp.templates }}
{{ if (or $wscomp.templates.prebuild $wscomp.affinity) -}}"prebuildPath": "/workspace-template/prebuild.yaml",{{- end }}
{{ if (or $wscomp.templates.probe $wscomp.affinity) -}}"probePath": "/workspace-template/probe.yaml",{{- end }}
{{ if (or $wscomp.templates.ghost $wscomp.affinity) -}}"ghostPath": "/workspace-template/ghost.yaml",{{- end }}
{{ if (or $wscomp.templates.imagebuild $wscomp.affinity) -}}"imagebuildPath": "/workspace-template/imagebuild.yaml",{{- end }}
{{ if (or $wscomp.templates.regular $wscomp.affinity) -}}"regularPath": "/workspace-template/regular.yaml",{{- end }}
{{ end -}}
Expand Down
14 changes: 0 additions & 14 deletions components/common-go/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,6 @@ func IsHeadlessWorkspace(pod *corev1.Pod) bool {
return ok && val == "true"
}

func IsGhostWorkspace(pod *corev1.Pod) bool {
if !IsWorkspace(pod) {
return false
}

val, ok := pod.ObjectMeta.Labels[TypeLabel]
return ok && val == "ghost"
}

func IsRegularWorkspace(pod *corev1.Pod) bool {
if !IsWorkspace(pod) {
return false
Expand All @@ -146,11 +137,6 @@ func IsRegularWorkspace(pod *corev1.Pod) bool {
return ok && val == "regular"
}

func IsNonGhostWorkspace(pod *corev1.Pod) bool {
return IsWorkspace(pod) &&
!IsGhostWorkspace(pod)
}

func GetWorkspaceType(pod *corev1.Pod) string {
val, ok := pod.ObjectMeta.Labels[TypeLabel]
if !ok {
Expand Down
35 changes: 0 additions & 35 deletions components/supervisor/cmd/ghost.go

This file was deleted.

5 changes: 2 additions & 3 deletions components/ws-manager-api/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,8 @@ enum WorkspaceType {
// interact with users directly.
PROBE = 2;

// Ghost workspaces are placeholders that pre-scale a cluster for faster workspace startup. They request the same amount of resources
// as a regular workspace, but run no actual load. They're removed at will to make space for an actual workspace.
GHOST = 3;
// DEPRECATED Ghost workspaces
reserved 3;

// Imagebuild workspaces build a workspace, incl. their Gitpod layer. They run headless and have no direct user-interaction.
IMAGEBUILD = 4;
Expand Down
3 changes: 0 additions & 3 deletions components/ws-manager-api/go/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ type WorkspacePodTemplateConfiguration struct {
PrebuildPath string `json:"prebuildPath,omitempty"`
// ProbePath is a path to an additional workspace pod template YAML file for probe workspaces
ProbePath string `json:"probePath,omitempty"`
// GhostPath is a path to an additional workspace pod template YAML file for ghost workspaces
GhostPath string `json:"ghostPath,omitempty"`
// ImagebuildPath is a path to an additional workspace pod template YAML file for imagebuild workspaces
ImagebuildPath string `json:"imagebuildPath,omitempty"`
}
Expand Down Expand Up @@ -206,7 +204,6 @@ func (c *Configuration) Validate() error {
validation.Field(&c.WorkspacePodTemplate.DefaultPath, validPodTemplate),
validation.Field(&c.WorkspacePodTemplate.PrebuildPath, validPodTemplate),
validation.Field(&c.WorkspacePodTemplate.ProbePath, validPodTemplate),
validation.Field(&c.WorkspacePodTemplate.GhostPath, validPodTemplate),
validation.Field(&c.WorkspacePodTemplate.RegularPath, validPodTemplate),
)
if err != nil {
Expand Down
127 changes: 61 additions & 66 deletions components/ws-manager-api/go/core.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions components/ws-manager-api/typescript/src/core_pb.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License-AGPL.txt in the project root for license information.
*/
Expand Down Expand Up @@ -1039,6 +1039,5 @@ export enum WorkspaceType {
REGULAR = 0,
PREBUILD = 1,
PROBE = 2,
GHOST = 3,
IMAGEBUILD = 4,
}
3 changes: 1 addition & 2 deletions components/ws-manager-api/typescript/src/core_pb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression we shouldn't update these (ref)

Copy link
Member

@geropl geropl Feb 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 ☝️ But this is a generated file, so not sure it is relevant. 🤷

* Licensed under the GNU Affero General Public License (AGPL).
* See License-AGPL.txt in the project root for license information.
*/
Expand Down Expand Up @@ -8001,7 +8001,6 @@ proto.wsman.WorkspaceType = {
REGULAR: 0,
PREBUILD: 1,
PROBE: 2,
GHOST: 3,
IMAGEBUILD: 4
};

Expand Down
6 changes: 2 additions & 4 deletions components/ws-manager-bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { inject, injectable, interfaces } from "inversify";
import { MessageBusIntegration } from "./messagebus-integration";
import { Disposable, WorkspaceInstance, Queue, WorkspaceInstancePort, PortVisibility, RunningWorkspaceInfo, DisposableCollection } from "@gitpod/gitpod-protocol";
import { WorkspaceStatus, WorkspacePhase, GetWorkspacesRequest, WorkspaceConditionBool, PortVisibility as WsManPortVisibility, WorkspaceType, PromisifiedWorkspaceManagerClient } from "@gitpod/ws-manager/lib";
import { WorkspaceStatus, WorkspacePhase, GetWorkspacesRequest, WorkspaceConditionBool, PortVisibility as WsManPortVisibility, PromisifiedWorkspaceManagerClient } from "@gitpod/ws-manager/lib";
import { WorkspaceDB } from "@gitpod/gitpod-db/lib/workspace-db";
import { UserDB } from "@gitpod/gitpod-db/lib/user-db";
import { log } from '@gitpod/gitpod-protocol/lib/util/logging';
Expand Down Expand Up @@ -135,9 +135,7 @@ export class WorkspaceManagerBridge implements Disposable {
log.warn("Received invalid status update", status);
return;
}
if (status.spec.type === WorkspaceType.GHOST) {
return;
}

log.debug("Received status update", status);

const span = TraceContext.startSpan("handleStatusUpdate", ctx);
Expand Down
Loading