-
Notifications
You must be signed in to change notification settings - Fork 354
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
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
webui/react/src/stores/cluster.tsx
Outdated
@@ -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), |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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))) {
<Fragment> | ||
<Divider /> | ||
<div className={css.subTitle}>Resource Manager Metadata</div> | ||
<JsonGlossary json={resourceManagerMetadata} translateLabel={camelCaseToSentence} /> | ||
</Fragment> |
There was a problem hiding this comment.
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
<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} /> | |
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
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.
Test Plan
Setup the master to have multiple resource managers, with metadata.
Navigate to
/det/clusters
, should be able to seeResource 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
docs/release-notes/
.See Release Note for details.
Ticket
RM-10