You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/03/14 16:12:58 UTC

[GitHub] [incubator-yunikorn-web] manirajv06 commented on a change in pull request #70: [YUNIKORN-955] Move the web UI calls to the new REST API endpoints

manirajv06 commented on a change in pull request #70:
URL: https://github.com/apache/incubator-yunikorn-web/pull/70#discussion_r826060878



##########
File path: src/app/services/scheduler/scheduler.service.ts
##########
@@ -237,52 +242,61 @@ export class SchedulerService {
   }
 
   private generateQueuesTree(data: any, currentQueue: QueueInfo) {
-    if (data && data.queues && data.queues.length > 0) {
+    if (data && data.children && data.children.length > 0) {
       const chilrenQs = [];
-      data.queues.forEach(queueData => {
+
+      data.children.forEach(queueData => {
         const childQueue = new QueueInfo();
-        childQueue.queueName = '' + queueData.queuename;
-        childQueue.state = queueData.status || 'RUNNING';
+
+        childQueue.queueName = queueData.queuename as string;
+        childQueue.status = queueData.status || 'n/a';

Review comment:
       Can you use constant "NOT_AVAILABLE" here as well?

##########
File path: src/app/services/scheduler/scheduler.service.ts
##########
@@ -167,68 +174,66 @@ export class SchedulerService {
     );
   }
 
-  public fetchNodeList(): Observable<NodeInfo[]> {
-    const nodesUrl = `${this.envConfig.getSchedulerWebAddress()}/ws/v1/nodes`;
+  fetchNodeList(partitionName: string): Observable<NodeInfo[]> {
+    const nodesUrl = `${this.envConfig.getSchedulerWebAddress()}/ws/v1/partition/${partitionName}/nodes`;
 
     return this.httpClient.get(nodesUrl).pipe(
       map((data: any) => {
         const result = [];
 
         if (data && data.length > 0) {
-          for (const info of data) {
-            const nodesInfoData = info.nodesInfo || [];
-
-            nodesInfoData.forEach(node => {
-              const nodeInfo = new NodeInfo(
-                node['nodeID'],
-                node['hostName'],
-                node['rackName'],
-                info['partitionName'],
-                this.formatCapacity(this.splitCapacity(node['capacity'], NOT_AVAILABLE)),
-                this.formatCapacity(this.splitCapacity(node['allocated'], NOT_AVAILABLE)),
-                this.formatCapacity(this.splitCapacity(node['occupied'], NOT_AVAILABLE)),
-                this.formatCapacity(this.splitCapacity(node['available'], NOT_AVAILABLE)),
-                []
-              );
-
-              const allocations = node['allocations'];
-              if (allocations && allocations.length > 0) {
-                const appAllocations = [];
-
-                allocations.forEach(alloc => {
-                  if (
-                    alloc.allocationTags &&
-                    alloc.allocationTags['kubernetes.io/meta/namespace'] &&
-                    alloc.allocationTags['kubernetes.io/meta/podName']
-                  ) {
-                    alloc[
-                      'displayName'
-                    ] = `${alloc.allocationTags['kubernetes.io/meta/namespace']}/${alloc.allocationTags['kubernetes.io/meta/podName']}`;
-                  } else {
-                    alloc['displayName'] = '<nil>';
-                  }
-                  appAllocations.push(
-                    new AllocationInfo(
-                      alloc['displayName'],
-                      alloc['allocationKey'],
-                      alloc['allocationTags'],
-                      alloc['uuid'],
-                      this.formatCapacity(this.splitCapacity(alloc['resource'], NOT_AVAILABLE)),
-                      alloc['priority'],
-                      alloc['queueName'],
-                      alloc['nodeId'],
-                      alloc['applicationId'],
-                      alloc['partition']
-                    )
-                  );
-                });
-
-                nodeInfo.setAllocations(appAllocations);
-              }
-
-              result.push(nodeInfo);
-            });
-          }
+          data.forEach(node => {
+            const nodeInfo = new NodeInfo(
+              node['nodeID'],
+              node['hostName'],
+              node['rackName'],
+              node['partition'] || NOT_AVAILABLE,

Review comment:
       Is node['partition'] available in response? Can you check?

##########
File path: src/app/components/queue-rack/queue-rack.component.ts
##########
@@ -61,21 +61,16 @@ export class QueueRackComponent implements OnInit {
     this.queueSelected.emit(queue);
   }
 
+  // FIXME: Implement using absolute usage value in new /{partition}/queues REST API.
+  // Currently absolute usage value is not available in /{partition}/queues REST API.

Review comment:
       Please raise a jira for this




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org