Skip to content

mgr/dashboard: add logs and daemon version to upgrade UI - #52395

Merged
nizamial09 merged 2 commits into
ceph:mainfrom
rhcs-dashboard:upgrade-ui-enhancements
Aug 7, 2023
Merged

nizamial09 merged 2 commits into
ceph:mainfrom
rhcs-dashboard:upgrade-ui-enhancements

Conversation

@nizamial09

@nizamial09 nizamial09 commented Jul 11, 2023 •

Copy link
Copy Markdown
Member

Follows #52351

scrnli_8_3_2023_11-22-11.AM.mp4

Shows Cluster Health
Shows the count of mgr daemons
Shows a table with all the daemon versions
Display the cluster logs

Fixes: https://tracker.ceph.com/issues/62016
Signed-off-by: Nizamudeen A [email protected]

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch 4 times, most recently from e3bada4 to 932e225 Compare July 14, 2023 08:05
@nizamial09
nizamial09 marked this pull request as ready for review July 14, 2023 08:06
@nizamial09
nizamial09 requested a review from a team as a code owner July 14, 2023 08:06
@nizamial09
nizamial09 requested review from aaSharma14 and pereman2 and removed request for a team July 14, 2023 08:06
@nizamial09 nizamial09 changed the title [WIP] mgr/dashboard: add logs and daemon version to upgrade UI mgr/dashboard: add logs and daemon version to upgrade UI Jul 14, 2023
@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch from 932e225 to 1ef981e Compare July 14, 2023 08:12
@cloudbehl

Copy link
Copy Markdown
Contributor

Can we make out some space to move the cluster logs bit up and not make the page scrollable?

Also in cluster logs do they have option to make it full screen?

@nizamial09

Copy link
Copy Markdown
Member Author

Can we make out some space to move the cluster logs bit up and not make the page scrollable?

Some of the space is taken by the Cluster logs header. Even if its removed the page will be scrollable!

Also in cluster logs do they have option to make it full screen?

Nope, Maybe I can redirect it to the Logs page, but there's no full screen option. And in this page it doesn't make sense for a full screen view maybe when the upgrade is in progress the contents will be less and the logs can have a better view!

@cloudbehl

Copy link
Copy Markdown
Contributor

Can we make out some space to move the cluster logs bit up and not make the page scrollable?

Some of the space is taken by the Cluster logs header. Even if its removed the page will be scrollable!

Also in cluster logs do they have option to make it full screen?

Nope, Maybe I can redirect it to the Logs page, but there's no full screen option. And in this page it doesn't make sense for a full screen view maybe when the upgrade is in progress the contents will be less and the logs can have a better view!

Yes I think we can give also a link to logs page, so if they want to see detailed logs. That would be good.

Just unrelated to this PR, could be good additions.
In the details,

  1. We can also add the versions available for upgrade to be visible
  2. Cluster FSID could be Cluster ID
  3. can we anyhow reduce size of upgrade status so we get more space and mention upgrade available in details?

@cloudbehl

Copy link
Copy Markdown
Contributor

Also we are letting user wait on the loading for a longer time. The wait is due the upgrade api taking time to respond.

Can we load the page and put the loading/skeleton on the upgrade status only, instead of whole page?

@cloudbehl

Copy link
Copy Markdown
Contributor

Tested the PR, mostly looks good.

Screencast.from.2023-07-19.13-14-58.webm

@epuertat

Copy link
Copy Markdown
Member

It's really great to see this coming!

My comments:

  • Shouldn't we print which version is the one available? Is it possible to (somehow) print release notes, so that admins can decide if the upgrade is worthy right now (security fixes), or can be impacting and postponed.
    image
  • What if there's more that 1 minor version available?
  • This doesn't work with major version upgrades, right?
  • Doesn't Cephadm provide a "progress event" so that we can print a progress bar in the tasks/notification tray? If not, we can use the number of migrated daemons as a measure of progress, in case we can (we should IMHO) print a progress bar (and probably an estimated time to completion, based on current time taken to migrate X daemons vs. total daemon count).
  • Can we replace this with regular cards and a single type of widget? I see there a card-like layout but without the inter-card margin, plus floating text (Cluster FSID, Release Image, ...), plus table (Daemon versions).
    image
    • I'd replace the daemon version table with something more concise: table with version vs. number of daemons in that version, or just the progress bar mentioned.
    • "Upgrade Status: Upgrade Available, Upgrade Now!" Too many "Upgrades", and all that in the "Upgrade" page. What about just: "Status: New Version x.y.z available. Upgrade Now"
    • Can we make the registry/release name editable? That would be helpful for testing purposes and customer with local registries/proxies. I assume that the registry credentials are stored/managed by Cephadm, right?
    • Why the "mgr count"? Is that important? Is not enough to have cluster health OK?
  • Scalability: does the daemon version table scale with, for example, 4000 daemons?

@nizamial09

nizamial09 commented Jul 19, 2023 •

Copy link
Copy Markdown
Member Author

It's really great to see this coming!

My comments:

  • Shouldn't we print which version is the one available? Is it possible to (somehow) print release notes, so that admins can decide if the upgrade is worthy right now (security fixes), or can be impacting and postponed.
    image

The upgrade doesn't get started from here. Upgrade now opens up a modal with versions that you can chose to start the upgrade with. Its being done here: #52493. Maybe we should name it better to convey it?

  • What if there's more that 1 minor version available?

The above answer answers this.

  • This doesn't work with major version upgrades, right?

I conditionally disabled it for now. But technically it could work though.

  • Doesn't Cephadm provide a "progress event" so that we can print a progress bar in the tasks/notification tray? If not, we can use the number of migrated daemons as a measure of progress, in case we can (we should IMHO) print a progress bar (and probably an estimated time to completion, based on current time taken to migrate X daemons vs. total daemon count).

Yup, we'll be providing a progress view. ceph orch upgrade status provides that. But we are doing it incrementally so once we finish with the upgrade start the next item will be to show the progress events.

  • Can we replace this with regular cards and a single type of widget? I see there a card-like layout but without the inter-card margin, plus floating text (Cluster FSID, Release Image, ...), plus table (Daemon versions).
    image

I basically copied this design from the OCP world with the patternfly. @cloudbehl was showing me a demo of their UI upgrades and it looked like this. So that was the inspiration point.

  • I'd replace the daemon version table with something more concise: table with version vs. number of daemons in that version, or just the progress bar mentioned.

Maybe the table with version vs. number of daemons in that version, better than listing the table with whole daemons.

  • "Upgrade Status: Upgrade Available, Upgrade Now!" Too many "Upgrades", and all that in the "Upgrade" page. What about just: "Status: New Version x.y.z available. Upgrade Now"

Agreed, I'll update it.

  • Can we make the registry/release name editable? That would be helpful for testing purposes and customer with local registries/proxies. I assume that the registry credentials are stored/managed by Cephadm, right?

I'll have to follow this up. With cephadm, if you want a different registry/release version, you should pass it like ceph orch upgrade start --image test-registry:test-image and that'll work. Not sure if they have the command to modify it. Maybe we'll need to modify it on the config-store.

  • Why the "mgr count"? Is that important? Is not enough to have cluster health OK?

2 mgr's are needed to start the upgrade. Otherwise you get an error. I assume majority of the cluster will have 2 mgrs but its a useful information though. And it shows warning as well if the number of osds is less.

  • Scalability: does the daemon version table scale with, for example, 4000 daemons?

with 4000 daemons the table won't look good. maybe I can show a summary like you mentioned above.

@cloudbehl

Copy link
Copy Markdown
Contributor

@epuertat Thanks, I agree with most of the things.

Few things to comment and others I'll let @nizamial09 get back:
We have follow up PR by Avan's PR to cover, which version a user chooses to install as part of this PR. #52493

Also the progress of update will be covered in notification and also in the page itself as well. You can partially look at the view from marvel design that Nizam created.
https://marvelapp.com/prototype/9iadg50/screen/92065487

@epuertat

Copy link
Copy Markdown
Member

Upgrade Now button

I wouldn't say "Upgrade Now". That's gonna sound intimidating to users. Upgrades are a critical operation, and I'd feel cheated if after getting everything ready for the upgrade (requesting a maintenance window, calling support engineers for overtime work, getting on-call support, consultants, etc....), I find out that the "Upgrade Now" button does NOT upgrade anything now, but opens a new modal... Why not just "Check versions" if that's what the modal does?

In any case, I'd rather show "Upgrade to x.y.z!" as a big button, and a smaller hyperlink below that button saying "Select another version...". Let's try to save extra-clicks, unless we're providing real value. For example: we can open a modal if we're showing the user the current status of their cluster, how it's gonna look like after the upgrade, the list of things improved/fixed in this release, ... But not just a dropdown to select meaningless version numbers.

Layout/widgets

Ok, if that comes from the Openshift world, I'd assume that there have been UX experts behind that. In that case, I'd just recommend that we properly implement that pattern.

image

The above doesn't look really professional: padding/margins/whitespacing is key to proper look & feel.

Same for horizontal and vertical text alignment: cards are usually made up of a card title section, which is pinned to the top of the squared element, and the card body, which might be vertically centered (or not).

Properly styling raw HTML elements into decently looking widgets is not a trivial task. Both Red Hat, SUSE, IBM, etc., have dedicated UI/UX teams to craft new UI widgets. Can't we use any of the existing Bootstrap/Patternfly/Carbon card implementations?

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good progress! Thanks for addressing my previous comments.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Regarding the ordering of the cards, I'd go for:

  • New available version (instead of Status), first because it's an actionable item (the other ones are read-only), and if the logic in this first item is properly implemented, the other 3 buttons should almost be unnecessary (if the cluster health is not OK, or the number of mgrs is not 2 or more, then this first button item should be disabled)
  • Current Version: probably we could put this together with the previous 1, but I guess that 3 cards basically broke the 2:2 layout.
  • Cluster Health
  • Mgr count

I'm dubious about these last 2 cards... Both could probably summarized in a single card, like "Upgrade Readiness" or something, and we could put there the Cluster Health and the Mgr Count together.

To keep the 4-card layout, we could convert the daemon table into a new card called "Upgraded Daemons" (I hate the term "daemon", it's too old fashioned and overly specific... why not "Services" or "Service Instances"), and there we show the percentage % or count of daemons migrated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree Current version and then Upgrade Status are the only one's required. If some conditions are not met we can skip the upgrade button and add the conditions that are not satisfied.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had some progress but it felt like it need more discussion especially for Service instances migration.
We can check if the daemons are migrated by comparing the daemon version with the current mgr version (which is what we consider as the cluster version). And as per cephadm implementation, you cannot upgrade any other daemons without first upgrading the mgr. So we are good there. I attached the screenshot below. There is also a tooltip which shows how many of the daemons are in new version.

I have removed those changes from the current PR. I'll open a tracker and track it for a different one after the discussions.

scrnli_7_31_2023_10-55-28.PM.mp4

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the mess: I mentioned the "service instances" thing because I feel like "daemon" is a very Linux-specific term, but as we talk about "daemons" all over the Dashboard, for consistency we should keep that until we choose "service instance" (perhaps too big :/) or something else that works better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No async for the 2nd observable?

Suggested change
*ngIf="{upgradeInfo: upgradeInfo$ | async, error: upgradeInfoError$ } as upgrade">
*ngIf="{upgradeInfo: upgradeInfo$ | async, error: upgradeInfoError$ | async} as upgrade">

BTW, looks like this observable is subscribed multiple times in this page... Being that the case, I'd put it in a parent element, to avoid calling it twice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If I put it in a parent class it would prevent the other cards from loading since this is only needed in two area's. But this won't call twice since I am sharing the pipe returns in other areas so it'll only gets called once and the results gets shared across the wherever its called.

Comment on lines 78 to 94

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I already mentioned this in Aashish' multi-site hierarchy PR, but this items floating in the void... feels weird.

image

Everything else is surrounded by lines (cards, tables). This creates an imbalance in the layout. In fact, one great to test that we are being consistent would be to use the gray background from the new landing page and see how it looks. "Card-like" layout ensures that the usually quickly identifies information buckets. By leaving sections of data detached from "visible containers", we make it feel like some CSS formatting went wrong or missing...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I followed the openshift designs which has it like this. There are room for improvements here though. For instance I'll need to provide the upgrade history some point later on when its implemented in cephadm. Once we add in those info probably this will be rectified. Meanwhile I put a video in the above comments by removing these details.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be disabled if the cluster health is ERR? In your screenrecording, it's in Cluster Health ERR, but allowing to upgrade. That's what I meant, that I'd remove the cluster health and mgr count if the Upgrade button is responsive to those conditions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope. Even if the cluster is unhealthy the upgrade will proceed. The health will flicker while the upgarde is in progress as well. When we designed this, we thought it would be nice to show the cluster health to the user upfront before proceeding with the upgrade.

@epuertat epuertat Jul 25, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Argghhh... we are keeping state by storing stuff in the localStorage? This is a very nasty hack (with downsides, like causing issues with multi-tab browsing), probably inherited from the original Dashboard. Keep in mind that the localStorage is a highly unsafe tool that should be banished from browsers. Data stored there is shared across all tabs (ALL mean any, even your P**nHub tabs can read what other pages put there).

Angular (and most web frameworks) provide mechanisms for pages to set/get state, and the browser itself manages this state through the browser history:

  • Exposing the state in the URL (e.g.: if we click on a tab, a #tabName is added to the URL). That way, whenever we browse back, we return to the exact same view.
    • This was a cumbersome task, as it's not trivial to instantiate an Angular component from the Router params at onInit stage. But, since Angular 16, this has dramatically improved, and now there's an option that allows to pass URL query params as the inputs for components.
  • Using routerLink state, to save custom data, which Angular automatically store in the browser history API.

There are other trickier approaches,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah.. this would need a quite a bit of refactoring. I just modified little bit to make it work/fix for my usecase. I'll create tracker and see if we can change the behvaiour

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@cloudbehl

Copy link
Copy Markdown
Contributor

Upgrade screen from openshift just for reference.

image

@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch 6 times, most recently from c815448 to 99dba7c Compare August 1, 2023 09:21
@avanthakkar

Copy link
Copy Markdown
Contributor

Does it makes sense to have a refresh button somewhere on upgrade page? Just to provide user to do hard refresh.
@nizamial09

@nizamial09

nizamial09 commented Aug 1, 2023 •

Copy link
Copy Markdown
Member Author

Does it makes sense to have a refresh button somewhere on upgrade page? Just to provide user to do hard refresh. @nizamial09

it would but i have some issues adding it to the component. Maybe I need to find a better implementation but definitely on my to-do list! https://tracker.ceph.com/issues/62266?

@cloudbehl

Copy link
Copy Markdown
Contributor

jenkins test make check

@epuertat epuertat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Another great piece of work @nizamial09! LGTM! Just a few observations (as usual) over there :P

Comment on lines 38 to 41

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How's scalable is this endpoint? On a very-large cluster (Pawsey-like) this may be 8k items.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We've not got issues on the daemon endpoint so far. We get the cached result from cephadm. And no processing as well! But I think this is the first time we are listing the entire daemons in a cluster (usually we filter them out either via hostname or service_name). So will need to test this with huge numbers to get some answers!
@pereman2 do you have any thoughts here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here: why is the body text so big? There should be some difference between header and body (size, text weight, ...).

image

Additionally, can we add some decoration/extra-value to the version? A link to the version release notes? Current URL is:

  • https://docs.ceph.com/en/latest/releases/quincy/#v17-2-6-quincy

Perhaps we can "discuss" with the docs team to add fixed anchors to those (removing the version code name from the reference, as it makes URL 100% deterministic/future-proof)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should aim at making the UI layer (dumb) Ceph-unaware (ideally you could plug it to any other distributed system and deal with it), and put all the smartness in the back-end.

Why:

  • It's more maintainable: the back-end is tightly coupled with the Ceph version. It even runs inside a Ceph daemon, so we can exploit all the available metadata, or even promote adding more metadata. If we encode "Ceph-knowledge" in the front-end, we need to keep that in sync across version (for any new added daemon that supports upgrades, we'll have to extend this list). But if we coordinate with the Cephadm team, perhaps we can share that common metadata between Cephadm and Dashboard codebases (this would apply to any other Ceph service).
  • It's more scalable: why sending a list of all the daemons to the front-end and then skipping some of them. "Let's just send to the front-end what the front-end needs".
  • It makes UI programming easier: the front-end should just know how deal with basic HTTP/CRUD endpoints (list resources, filter those, search, add/delete those). "Let's just send to the front-end what the front-end needs."
  • It makes our REST API more valuable: whenever we code Ceph quirks in the front-end, our back-end becomes less rich and smart, and adds little value vs CLI commands.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. I put the logic on backend. So now the frontend will only call with the list of daemons it want!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the mess: I mentioned the "service instances" thing because I feel like "daemon" is a very Linux-specific term, but as we talk about "daemons" all over the Dashboard, for consistency we should keep that until we choose "service instance" (perhaps too big :/) or something else that works better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a tiny change but it's consistent (next card is called "Current version") and it's extremely actionable:

Suggested change
cardTitle="Upgrade Status"
cardTitle="New Version"
Suggested change
cardTitle="Upgrade Status"
cardTitle="New Version Available"

As a reference:
image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

for Now I went with New Version because putting Available means that I'll have to put some extra conditions to handle the title when there's no update Available!

@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch 2 times, most recently from b797216 to 1fa63f8 Compare August 3, 2023 14:18
This will make the logs component easier to reuse for now in upgrade
component and later, wherever we want

Fixes: https://tracker.ceph.com/issues/62016
Signed-off-by: Nizamudeen A <[email protected]>
@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch from 1fa63f8 to fa5f632 Compare August 3, 2023 16:26
@cloudbehl

Copy link
Copy Markdown
Contributor

jenkins retest this please

@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch from fa5f632 to 1b7ee9c Compare August 4, 2023 12:59
Shows Cluster Health
Shows the count of mgr daemons
Shows a table with all the daemon versions
Display the cluster logs

Fixes: https://tracker.ceph.com/issues/62016
Signed-off-by: Nizamudeen A <[email protected]>
@nizamial09
nizamial09 force-pushed the upgrade-ui-enhancements branch from 1b7ee9c to 7dcb06d Compare August 4, 2023 17:35
@nizamial09
nizamial09 merged commit 3b6779f into ceph:main Aug 7, 2023
@nizamial09
nizamial09 deleted the upgrade-ui-enhancements branch August 7, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants