Skip to content

[server] simplify workspace classes #15091

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
Dec 1, 2022
Merged

[server] simplify workspace classes #15091

merged 1 commit into from
Dec 1, 2022

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Dec 1, 2022

Based on & includes #15090

Description

This PR reduces complexity about what workspace classes is used by

  • removing user-level setting
  • removing deprecation
  • removing ws-class inheritence between ws sessions

Related Issue(s)

Fixes #15080
Related https://github.com/gitpod-io/ops/pull/7076

How to test

Create a project and try the workspace class selection in its settings.

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-payment
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-se-simplify-ws-classes.1 because the annotations in the pull request description changed
(with .werft/ from main)

@svenefftinge svenefftinge force-pushed the se/simplify-ws-classes branch from 13a7715 to afb4a52 Compare December 1, 2022 10:46
@svenefftinge svenefftinge marked this pull request as ready for review December 1, 2022 11:36
@svenefftinge svenefftinge requested review from a team December 1, 2022 11:36
@github-actions github-actions bot added team: devx team: webapp Issue belongs to the WebApp team labels Dec 1, 2022
WorkspaceClasses.validate(config.workspaceClasses);
if (config.workspaceClasses.filter((c) => c.isDefault).length !== 1) {
log.error(
"Exactly one default workspace class needs to be configured: " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could be clarified as "Exactly one workspace class should be configured as default: "

@@ -282,7 +282,6 @@ yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].categ
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].displayName "Small"
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].description "Small workspace class (20GB disk)"
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].powerups "2"
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].isDefault "false"
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.workspaceClasses[1].deprecated "false"
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops, did you mean to remove .deprecated instead of .isDefault here?

Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

Many thanks @svenefftinge! This second PR also looks good 👍 (modulo the rebase and previous comments to be addressed)

Also, holding due to one question: The UX generally works really well and is quite intuitive -- set class on project, get class on project workspaces 👍 not having a global user preference simplifies user mental model a lot. 💯

The only place where I'm a bit puzzled is workspaces based on prebuilds:

  • When I start a workspace, it always gets the class currently defined on project-level (regardless of any prebuild class)
  • This means that, when I switch from one class to another, various workspaces might get a different class to the prebuild they're based on
  • I guess this is generally fine (very simple and predictable behavior), but it could lead to problems e.g. when the prebuild backup size is larger than the current workspace class allows, right?

Anyway, this is 99% fine by me, and my point is mostly food for thought, but I'm raising it in case this wasn't intended or if we want to do anything about the error cases where you can't start a workspace due to a specified class that is not compatible with the prebuild's class.

/hold

simplified by
- removing user-level setting
- removing deprecation
- removing ws-class inheritence between ws sessions
@svenefftinge svenefftinge force-pushed the se/simplify-ws-classes branch from afb4a52 to 9cce255 Compare December 1, 2022 15:45
@svenefftinge
Copy link
Member Author

svenefftinge commented Dec 1, 2022

but it could lead to problems e.g. when the prebuild backup size is larger than the current workspace class allows, right?

Yes, the workspace start would fail and should tell you that the class is incompatible. It currently doesn't provide a great error message, but this situation would be a rare corner case, because the rebuild would need to have created a backup bigger than 20GB which is super rare.

@svenefftinge
Copy link
Member Author

/unhold

@roboquat roboquat merged commit a96cb7b into main Dec 1, 2022
@roboquat roboquat deleted the se/simplify-ws-classes branch December 1, 2022 16:59
@roboquat roboquat added the deployed: webapp Meta team change is running in production label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production release-note-none size/XXL team: devx team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove workspace class preference from user settings and only allow them on project settings
4 participants