Skip to content
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

[gp-cli] provide workspace class info in top command #12338

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Aug 24, 2022

Description

Show workspace class info in gp top command, support --json flag

Related Issue(s)

Fixes #10572

How to test

  • Open a workspace in preview env https://mustard-mh3cbcc192a7.preview.gitpod-dev.com
  • Exec command gp top and gp top --json to see if workspace class displayed
  • Switch prefer workspace class in settings
  • Start another workspace to check if data changed (manually change server config to add new type)

image

Release Notes

[gp-cli] provide workspace class info in `gp top` command

Documentation

Werft options:

  • /werft with-preview

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-mustard-mh-gp-cli-gp-command-to-10572.1 because the annotations in the pull request description changed
(with .werft/ from main)

@mustard-mh mustard-mh changed the title [gp-cli] support workspace class in top command [gp-cli] support workspace class field in top command Aug 24, 2022
@mustard-mh mustard-mh marked this pull request as ready for review August 24, 2022 14:20
@mustard-mh mustard-mh requested a review from a team August 24, 2022 14:20
@mustard-mh
Copy link
Contributor Author

mustard-mh commented Aug 24, 2022

How can users know their workspace's limit(show in command? or in document)? How to ask if they want to upgrade their plan (when CPU/MEM is nearly full?)

i.e. g1-standard Up to 4 vCPU, 8GB memory, 30GB disk

 {
      "id": "g1-standard",
      "category": "GENERAL PURPOSE",
      "displayName": "Standard",
      "description": "Up to 4 vCPU, 8GB memory, 30GB disk"
}

@mustard-mh
Copy link
Contributor Author

For comment #12338 (comment) above

cc @loujaybee @akosyakov

@akosyakov
Copy link
Member

How to ask if they want to upgrade their plan (when CPU/MEM is nearly full?)

I don't think we need to ask. Maybe just add a link to the plan page for now? cc @loujaybee

@mustard-mh mustard-mh marked this pull request as draft August 24, 2022 14:54
@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch from 8fd8d7e to ef7ea8d Compare August 24, 2022 17:21
@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch from 0d2d237 to 2e73822 Compare August 24, 2022 18:15
@mustard-mh mustard-mh changed the title [gp-cli] support workspace class field in top command [gp-cli] provide workspace class info in top command Aug 25, 2022
@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch 3 times, most recently from 7ed537f to afadaf5 Compare August 25, 2022 03:27
@filiptronicek
Copy link
Member

@filiptronicek In production, id default will display with Standard (old): Up to 6 vCPU, 12GB memory, 30GB disk. You can see all classes in cm server-config

Thanks for pointing this out, Huiwen. I am having some issues with the command you mentioned but I don't think it matters, it makes sense in how you implemented this.

@akosyakov
Copy link
Member

@Furisto Could you review it please?

@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch from 114bd2d to 6f57d80 Compare August 26, 2022 12:39
@mustard-mh
Copy link
Contributor Author

mustard-mh commented Aug 26, 2022

Fource push to

  • Fix workspaceClassInfo not exists ( try with previous commit and run go run main.go top in gitpod-cli folder will get it)
  • Change json flag's description
  • Change command option var name
  • Remove Fatal in workspace info query

See diff here

@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch from 6f57d80 to 5b3c843 Compare August 26, 2022 12:49
@mustard-mh mustard-mh force-pushed the mustard-mh/gp-cli-gp-command-to-10572 branch from 5b3c843 to 871fc46 Compare August 26, 2022 12:52
@Furisto Furisto self-assigned this Aug 26, 2022
@akosyakov
Copy link
Member

suggestion (non-blocking): add an option to disable this

I think it is important for people to know why they have such limits. I don't see one line as a bloat.

@filiptronicek
Copy link
Member

filiptronicek commented Aug 26, 2022

suggestion (non-blocking): add an option to disable this

I think it is important for people to know why they have such limits. I don't see one line as a bloat.

@akosyakov touché. I meant with it that I personally would not find this much useful, and a one-off command like mentioned in #10572 (comment).

Copy link
Contributor

@jenting jenting left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

lgtm

@akosyakov
Copy link
Member

@mustard-mh You can unhold it?

@mustard-mh
Copy link
Contributor Author

/unhold

@mustard-mh
Copy link
Contributor Author

@gitpod-io/engineering-webapp Could someone review this PR?

@akosyakov akosyakov requested a review from geropl August 29, 2022 15:40
@roboquat roboquat merged commit 95fa443 into main Aug 30, 2022
@roboquat roboquat deleted the mustard-mh/gp-cli-gp-command-to-10572 branch August 30, 2022 08:25
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed: IDE IDE change is running in production labels Aug 30, 2022
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/XXL team: IDE team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gp cli] gp command to print/show workspace class
8 participants