Skip to content

Remove fixed resources #11838

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
Aug 4, 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
1 change: 0 additions & 1 deletion components/gitpod-protocol/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ export interface UserFeatureSettings {
*/
export const WorkspaceFeatureFlags = {
full_workspace_backup: undefined,
fixed_resources: undefined,
persistent_volume_claim: undefined,
protected_secrets: undefined,
};
Expand Down
15 changes: 0 additions & 15 deletions components/server/ee/src/user/eligibility-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,6 @@ export class EligibilityService {
}
}

/**
* Returns true if the user is never subject to CPU limiting
*/
async hasFixedWorkspaceResources(user: User, date: Date = new Date()): Promise<boolean> {
const subscriptions = await this.subscriptionService.getNotYetCancelledSubscriptions(user, date.toISOString());
const eligblePlans = [
Plans.PROFESSIONAL_EUR,
Plans.PROFESSIONAL_USD,
Plans.TEAM_PROFESSIONAL_EUR,
Plans.TEAM_PROFESSIONAL_USD,
].map((p) => p.chargebeeId);

return subscriptions.filter((s) => eligblePlans.includes(s.planId!)).length > 0;
}

/**
* Returns true if the user ought to land on a workspace cluster that provides more resources
* compared to the default case.
Expand Down
15 changes: 1 addition & 14 deletions components/server/ee/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
* See License.enterprise.txt in the project root folder.
*/

import {
Workspace,
User,
WorkspaceInstance,
WorkspaceInstanceConfiguration,
NamedWorkspaceFeatureFlag,
} from "@gitpod/gitpod-protocol";
import { Workspace, User, WorkspaceInstance, NamedWorkspaceFeatureFlag } from "@gitpod/gitpod-protocol";
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing";
import { inject, injectable } from "inversify";
import { IDEConfig } from "../../../src/ide-config";
Expand Down Expand Up @@ -44,13 +38,6 @@ export class WorkspaceStarterEE extends WorkspaceStarter {
ideConfig,
forcePVC,
);
if (await this.eligibilityService.hasFixedWorkspaceResources(user)) {
const config: WorkspaceInstanceConfiguration = instance.configuration!;
const ff = config.featureFlags || [];
ff.push("fixed_resources");
config.featureFlags = ff;
instance.configuration = config;
}

return instance;
}
Expand Down
4 changes: 2 additions & 2 deletions components/ws-manager-api/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ enum WorkspaceFeatureFlag {
// the registry facade and back them up using regular "hardlink backups".
FULL_WORKSPACE_BACKUP = 4;

// FixedResources ensures this workspace is not subject to ws-daemon's dynamic resource limits.
// Was used to ensure a workspace is not subject to ws-daemon's dynamic resource limits.
// In this sence it's akin to "guaranteed" (as compared to burstable) resources for workspaces.
FIXED_RESOURCES = 5;
reserved 5;

// Was used for UserNamespace
reserved 6;
Expand Down
176 changes: 85 additions & 91 deletions components/ws-manager-api/go/core.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion components/ws-manager-api/typescript/src/core_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,6 @@ export enum WorkspacePhase {
export enum WorkspaceFeatureFlag {
NOOP = 0,
FULL_WORKSPACE_BACKUP = 4,
FIXED_RESOURCES = 5,
PERSISTENT_VOLUME_CLAIM = 7,
PROTECTED_SECRETS = 8,
}
Expand Down
1 change: 0 additions & 1 deletion components/ws-manager-api/typescript/src/core_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -9804,7 +9804,6 @@ proto.wsman.WorkspacePhase = {
proto.wsman.WorkspaceFeatureFlag = {
NOOP: 0,
FULL_WORKSPACE_BACKUP: 4,
FIXED_RESOURCES: 5,
PERSISTENT_VOLUME_CLAIM: 7,
PROTECTED_SECRETS: 8
};
Expand Down
10 changes: 0 additions & 10 deletions components/ws-manager/pkg/manager/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,6 @@ func (m *Manager) createDefiniteWorkspacePod(startContext *startWorkspaceContext
removeVolume(&pod, workspaceVolumeName)
pod.Labels[fullWorkspaceBackupLabel] = util.BooleanTrueString

case api.WorkspaceFeatureFlag_FIXED_RESOURCES:
var cpuLimit string
for _, c := range pod.Spec.Containers {
if c.Name != "workspace" {
continue
}
cpuLimit = c.Resources.Limits.Cpu().String()
}
pod.Annotations[wsk8s.CPULimitAnnotation] = cpuLimit

case api.WorkspaceFeatureFlag_NOOP:

case api.WorkspaceFeatureFlag_PERSISTENT_VOLUME_CLAIM:
Expand Down
266 changes: 0 additions & 266 deletions components/ws-manager/pkg/manager/testdata/cdwp_fixedresources.golden

This file was deleted.

Loading