You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by yt...@apache.org on 2021/07/02 11:47:21 UTC

[incubator-datalab] branch DATALAB-2442 created (now f9e96f2)

This is an automated email from the ASF dual-hosted git repository.

ytykhun pushed a change to branch DATALAB-2442
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.


      at f9e96f2  [DATALAB-2442] added t-shirt size for gpu types, hid the option for recreate node

This branch includes the following new commits:

     new f9e96f2  [DATALAB-2442] added t-shirt size for gpu types, hid the option for recreate node

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 01/01: [DATALAB-2442] added t-shirt size for gpu types, hid the option for recreate node

Posted by yt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ytykhun pushed a commit to branch DATALAB-2442
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit f9e96f2ff58c3761a0bbf2dbfa7bef6cb3f962ec
Author: Yurii Tykhun <ty...@gmail.com>
AuthorDate: Fri Jul 2 14:46:56 2021 +0300

    [DATALAB-2442] added t-shirt size for gpu types, hid the option for recreate node
---
 .../project-list/project-list.component.html       |  4 ++--
 .../webapp/src/app/core/util/helpUtils.ts          | 24 ++++++++++++++++++++++
 .../create-environment.component.html              |  2 +-
 .../create-environment.component.ts                | 18 ++++++++++++++--
 .../edge-action-dialog.component.ts                |  2 +-
 5 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
index 56e0719..e407d30 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
@@ -91,12 +91,12 @@
               Stop edge node
             </a>
           </li>
-          <li class="project-seting-item " *ngIf="element.areTerminatedNode" (click)="openEdgeDialog('recreate', element)">
+          <!-- <li class="project-seting-item " *ngIf="element.areTerminatedNode" (click)="openEdgeDialog('recreate', element)">
             <i class="material-icons">refresh</i>
             <a class="action">
               Recreate edge node
             </a>
-          </li>
+          </li> -->
           <li class="project-seting-item " *ngIf="element.areStoppedNode || element.areRunningNode" (click)="openEdgeDialog('terminate', element)">
             <i class="material-icons">phonelink_off</i>
             <a class="action">
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
index 68178d5..1ebed41 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/helpUtils.ts
@@ -35,4 +35,28 @@ export class HelpUtils {
         return;
     }
   }
+
+  public static sortGpuTypes(gpuType: Array<string>): Array<string> {
+    let sortedTypes = [];
+
+    gpuType.forEach(type => checkType(type));
+
+    function checkType(type) {
+      switch (type) {
+        case 'nvidia-tesla-t4':
+          sortedTypes[0] = type;
+          return;
+  
+        case 'nvidia-tesla-p100':
+          sortedTypes[1] = type;
+          return;
+  
+        case 'nvidia-tesla-v100':
+          sortedTypes[2] = type;
+          return;
+      }
+    }
+
+    return sortedTypes;
+  }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
index 289403e..aaa633c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
@@ -232,7 +232,7 @@
                   <mat-select formControlName="gpu_type" disableOptionCentering [disabled]="!createExploratoryForm.controls['shape'].value"
                               panelClass="create-resources-dialog" placeholder="GPU type">
                       <mat-option *ngFor="let list_item of gpuTypes" [value]="list_item" (click)="setCount('', list_item)">
-                        {{ list_item}}
+                        <strong class="highlight icon-label">{{ addSizeToGpuType(list_item) }}</strong> {{ list_item }}
                       </mat-option>
                       <mat-option *ngIf="!gpuTypes.length" class="multiple-select ml-10" disabled>
                         GPU list is empty
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
index 7399018..7e4a90e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
@@ -24,7 +24,7 @@ import { ToastrService } from 'ngx-toastr';
 
 import { Project } from '../../../administration/project/project.component';
 import { UserResourceService, ProjectService } from '../../../core/services';
-import {CheckUtils, SortUtils, HTTP_STATUS_CODES, PATTERNS} from '../../../core/util';
+import {CheckUtils, SortUtils, HTTP_STATUS_CODES, PATTERNS, HelpUtils} from '../../../core/util';
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
 import { CLUSTER_CONFIGURATION } from '../../computational/computational-resource-create-dialog/cluster-configuration-templates';
 import {tap} from 'rxjs/operators';
@@ -150,6 +150,19 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
 
   }
 
+  public addSizeToGpuType(gpuType: string): string {
+    switch (gpuType) {
+      case 'nvidia-tesla-t4':
+        return 'S';
+
+      case 'nvidia-tesla-p100':
+        return 'M';
+
+      case 'nvidia-tesla-v100':
+        return 'L';
+    }
+  }
+
   public getShapes(template) {
     this.selectedImage = null;
     const controls = ['notebook_image_name', 'shape', 'gpu_type', 'gpu_count'];
@@ -176,7 +189,8 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
         (template?.image === 'docker.datalab-jupyter' ||
         template?.image === 'docker.datalab-deeplearning' ||
         template?.image === 'docker.datalab-tensor')) {
-      this.gpuTypes = template?.computationGPU ? template.computationGPU : [];
+          
+      this.gpuTypes = template?.computationGPU ? HelpUtils.sortGpuTypes(template.computationGPU) : [];
 
       if(template?.image === 'docker.datalab-tensor' || template?.image === 'docker.datalab-deeplearning') {
         this.addGpuFields();
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
index 1fe8e66..244493d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
@@ -56,7 +56,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
           </ul>
         </div>
         <ng-template #oneNode>
-          Edge node <span class="strong">{{data.item[0].name}}</span> wil be {{data.type === 'stop' ? 'stopped' : 'recreated'}}
+          Edge node <span class="strong">{{data.item[0].name}}</span> wil be {{data.type === 'stop' ? 'stopped' : data.type === 'start' ? 'started' : 'recreated'}}
         </ng-template>
 
       <p class="m-top-20 action-text"><span class="strong">Do you want to proceed?</span></p>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org