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

mgr/dashboard: OSD Creation Workflow initial works #45116

Conversation

nizamial09
Copy link
Member

@nizamial09 nizamial09 commented Feb 22, 2022

Depends on #45190
This is kind of a skeleton PR. As per the design of the feature, backend needs to provide frontend all the data's and UI will just present it to the user. So I'll wait for the backend to setup first to adapt the frontend. Currently, the frontend design is just static.

Also, the current OSD Creation is moved to the Advanced Mode Option

Introducing the Cost/Capacity Optimized deployment option
Used bootstrap accordion
Adapted the e2e but not written new tests for the deployment option

Deployment Scenarios
Screenshot 2022-04-07 222512

Advanced Mode
Screenshot 2022-04-07 222523

View from Cluster Expansion wizard
Screenshot 2022-04-07 222543

Fixes: https://tracker.ceph.com/issues/54340
Fixes: https://tracker.ceph.com/issues/54563
Signed-off-by: Nizamudeen A nia@redhat.com
Co-authored-by: Sarthak0702 sarthak.0702@gmail.com

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

@nizamial09 nizamial09 added this to In progress in Dashboard via automation Feb 22, 2022
@nizamial09 nizamial09 changed the title mgr/dashboard: OSD Creation Workflow initial works mgr/dashboard: OSD Creation Workflow initial works Feb 22, 2022
@nizamial09
Copy link
Member Author

jenkins test dashboard cephadm

@nizamial09
Copy link
Member Author

jenkins test dashboard

@nizamial09
Copy link
Member Author

Jenkins retest this please

@github-actions
Copy link

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

@Sarthak0702 Sarthak0702 self-requested a review March 21, 2022 18:48
@nizamial09 nizamial09 marked this pull request as ready for review March 22, 2022 09:12
@nizamial09 nizamial09 requested a review from a team March 22, 2022 09:12
@nizamial09 nizamial09 requested a review from a team as a code owner March 22, 2022 09:12
@nizamial09
Copy link
Member Author

@sunilangadi2 Can you also test this one? keep in mind as of now only the cost-capacity optimized option is testable.

Dashboard automation moved this from In progress to Review in progress Mar 29, 2022
@nizamial09 nizamial09 requested a review from epuertat April 1, 2022 09:59
Copy link
Contributor

@pereman2 pereman2 left a comment

Choose a reason for hiding this comment

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

Is this type of behaviour expected in the accordion component?

Ceph_.Expand.Cluster.mp4

Copy link
Member

@epuertat epuertat left a comment

Choose a reason for hiding this comment

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

Nice progress @nizamial09 ! More feedback from my end :D Have a nice weekend!

src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
Comment on lines 81 to 82
OsdDeploymentOptions.COST_CAPACITY.value:
DeploymentOption(OsdDeploymentOptions.COST_CAPACITY.value),
Copy link
Member

Choose a reason for hiding this comment

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

Just a comment on code: don't feel this hard to read. First of all, there are 2 classes with very similar names (OsdDeploymentOptions and DeploymentOption), and I'd expect that both are connected (the plural "...Options" is just an list containing multiple "DeploymentOption"s), but that's not the case.

If you ever end up writing a chunk of code that is as unintuitive to read as this one, please consider that as a smell that something going wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed the function name for clarity

src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
Comment on lines 58 to 70
const deploymentOptions: DeploymentOptions = {
options: {
cost_capacity: {
name: OsdDeploymentOptions.COST_CAPACITY,
available: true,
capacity: 0,
used: 0,
hdd_used: 0,
ssd_used: 0,
nvme_used: 0,
option_name: 'Cost/Capacity-optimized',
msg: 'All the available HDDs are selected'
},
Copy link
Member

Choose a reason for hiding this comment

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

All the things mentioned for the back-end data structs apply here, and they're more evident since most of these fields are not needed in the UI (ssd_used?), only the recommended option, right? That means that we're coupling in the back-end 2 or more different data classes.

The class we'd need here is what, at back-end, I defined as:

# Named tuples allows us to quickly prototype immutable objects with initialization, defaults and asdict()
class OsdDeploymentOption(NamedTuple):
  id: str
  title: str
  desc: str

If we need some extra data (like total capacity, or number of disks), we could append some "hints" to this class (e.g.: the getDeploymentRecommendation() service returns the recommended DeploymentOption + extras: available + capacity + etc.).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we decided on this in the previous PR #45190, and fields like hdd_used etc are needed on the later iterations when we try to fill the pie chart in the frontend (to visualize the storage used infos).

@nizamial09
Copy link
Member Author

Is this type of behaviour expected in the accordion component?

Yup, https://getbootstrap.com/docs/4.6/components/collapse/#accordion-example. But I removed the focus so we don't have a broken border when clicking it. @pereman2

@nizamial09 nizamial09 force-pushed the osd-creation-cost-optimized branch 3 times, most recently from c8d034a to d3714c5 Compare April 7, 2022 17:01
@nizamial09
Copy link
Member Author

jenkins test dashboard

</div>
</div>
</fieldset>
<!-- DB slots -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what these extra spaces for..maybe can be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@avanthakkar Those are indendation changes to proper align it and it was not a mistake. If I remove it it will be misaligned with the above and below lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

@avanthakkar Those are indendation changes to proper align it and it was not a mistake. If I remove it it will be misaligned with the above and below lines.

@epuertat
Copy link
Member

Screenshot 2022-04-07 222512

@nizamial09 based on the above screenshot it looks like the Advanced mode is "additional" to the first 3 modes, while in reality it should be exclusive (either you select the simple modes or the advanced modes). Wouldn't it be better to display that in a 4th option?

@nizamial09
Copy link
Member Author

Screenshot 2022-04-07 222512

@nizamial09 based on the above screenshot it looks like the Advanced mode is "additional" to the first 3 modes, while in reality it should be exclusive (either you select the simple modes or the advanced modes). Wouldn't it be better to display that in a 4th option?

@epuertat But either the Advanced mode or the Deployment option is visible at a time. If the user clicks on ADvanced mode then the Deployment option will be hidden. (The Feature on the other hand will be always shown)

src/pybind/mgr/dashboard/services/osd.py Outdated Show resolved Hide resolved
src/pybind/mgr/dashboard/controllers/osd.py Outdated Show resolved Hide resolved
Copy link
Contributor

@avanthakkar avanthakkar 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

@sunilangadi2 sunilangadi2 left a comment

Choose a reason for hiding this comment

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

Thanks, @nizamial09 ! changes look good to me.

@nizamial09 nizamial09 moved this from Review in progress to Ready-to-merge in Dashboard Apr 27, 2022
Introducing the Cost/Capacity Optimized deployment option
Used bootstrap accordion
Adapted the e2e but not written new tests for the deployment option

Fixes: https://tracker.ceph.com/issues/54340
Fixes: https://tracker.ceph.com/issues/54563
Signed-off-by: Nizamudeen A <nia@redhat.com>
Signed-off-by: Sarthak0702 <sarthak.0702@gmail.com>
@nizamial09
Copy link
Member Author

jenkins test make check

1 similar comment
@nizamial09
Copy link
Member Author

jenkins test make check

@epuertat epuertat merged commit 1330ffc into ceph:feature-54330-osd-creation-workflow Apr 27, 2022
10 of 11 checks passed
Dashboard automation moved this from Ready-to-merge to Done Apr 27, 2022
@epuertat epuertat deleted the osd-creation-cost-optimized branch April 27, 2022 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Dashboard
  
Done
7 participants