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

feat: Display resource managers information #8951

Merged
merged 3 commits into from
Mar 6, 2024
Merged

feat: Display resource managers information #8951

merged 3 commits into from
Mar 6, 2024

Conversation

gt2345
Copy link
Contributor

@gt2345 gt2345 commented Mar 4, 2024

Description

Update resource pool cards to show Resource Manager Name when there are multiple resource managers defined.
Update resource pool detail -> Configuration to include a section for resource manager.

Screenshot 2024-03-04 at 4 58 07 PM Screenshot 2024-03-05 at 1 16 44 PM

Test Plan

Setup the master to have multiple resource managers, with metadata.
Navigate to /det/clusters, should be able to see Resource Manager Name at the end of the resource pool cards. Note that this will only show up if we have at least 2 different resource managers configured.
Navigate to resource pool details -> Configuration, there should be a section containing resource manager information.

Commentary (optional)

A separate PR is used add the RM name to K8s pool

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

RM-10

@gt2345 gt2345 requested a review from a team as a code owner March 4, 2024 23:04
@gt2345 gt2345 requested a review from johnkim-det March 4, 2024 23:04
@cla-bot cla-bot bot added the cla-signed label Mar 4, 2024
Copy link

netlify bot commented Mar 4, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit e5bc0f3
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/65e8a77cd0438f000846cbe3
😎 Deploy Preview https://deploy-preview-8951--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 15.78947% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 42.33%. Comparing base (e8b0165) to head (e5bc0f3).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8951      +/-   ##
==========================================
- Coverage   48.55%   42.33%   -6.23%     
==========================================
  Files         749      429     -320     
  Lines      136692    97360   -39332     
  Branches     2237     2237              
==========================================
- Hits        66374    41214   -25160     
+ Misses      70160    55988   -14172     
  Partials      158      158              
Flag Coverage Δ
harness ?
web 42.54% <15.78%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
webui/react/src/stores/cluster.tsx 36.78% <66.66%> (+0.30%) ⬆️
webui/react/src/components/ResourcePoolCard.tsx 43.93% <14.28%> (-0.47%) ⬇️
...eact/src/pages/ResourcePool/ResourcepoolDetail.tsx 0.00% <0.00%> (ø)

... and 320 files with indirect coverage changes

@@ -183,6 +186,9 @@ class ClusterStore extends PollingStore {
getResourcePools({}, { signal: signal ?? canceler.signal })
.then((response) => {
this.#resourcePools.set(Loaded(response));
this.#multiResourceManagers.set(
Loaded(uniq(response.map((p) => p.resourceManagerName)).length > 1),
Copy link
Contributor

@ashtonG ashtonG Mar 6, 2024

Choose a reason for hiding this comment

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

this is derived from the resourcePools part of the response -- expose this info as a selection instead. Furthermore, uniq is unnecessary -- just put it in a set and get the resulting size:

public readonly multiResourceManagers = this.#resourcePools.select((resourcePools) =>
  Loadable.map(resourcePools, (r) => new Set(r.map((p) => p.resourceManagerName)).length > 1))

@@ -141,9 +143,12 @@ const ResourcePoolCard: React.FC<Props> = ({
if (pool.type === V1ResourcePoolType.K8S && attribute.key !== 'type') {
delete acc[attribute.label];
}
if (attribute.key === 'resourceManagerName' && !multiResourceManagers.getOrElse(false)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

merge this with the previous if statement, please:

if ((pool.type === V1ResourcePoolType.K8S && attribute.key !== 'type') ||
  (attribute.key === 'resourceManagerName' && !multiResourceManagers.getOrElse(false))) {

Comment on lines 157 to 161
<Fragment>
<Divider />
<div className={css.subTitle}>Resource Manager Metadata</div>
<JsonGlossary json={resourceManagerMetadata} translateLabel={camelCaseToSentence} />
</Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use the shorthand here

Suggested change
<Fragment>
<Divider />
<div className={css.subTitle}>Resource Manager Metadata</div>
<JsonGlossary json={resourceManagerMetadata} translateLabel={camelCaseToSentence} />
</Fragment>
<>
<Divider />
<div className={css.subTitle}>Resource Manager Metadata</div>
<JsonGlossary json={resourceManagerMetadata} translateLabel={camelCaseToSentence} />
</>

@gt2345 gt2345 requested a review from ashtonG March 6, 2024 17:29
Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

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

nice work!

@gt2345 gt2345 merged commit 4309f7f into main Mar 6, 2024
69 of 82 checks passed
@gt2345 gt2345 deleted the gt/rm-10-multi-rm branch March 6, 2024 19:41
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.

3 participants