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/06/17 09:40:14 UTC

[incubator-datalab] 01/01: [DATALAB-2431] added gpu for Apache cluster

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

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

commit dfdf27dce15851db853e47683252aaa54642ab1d
Author: Yurii Tykhun <ty...@gmail.com>
AuthorDate: Thu Jun 17 12:39:53 2021 +0300

    [DATALAB-2431] added gpu for Apache cluster
---
 ...utational-resource-create-dialog.component.html | 66 +++++++++++-----------
 ...mputational-resource-create-dialog.component.ts |  2 +
 .../computational-resource-create.model.ts         | 11 +++-
 3 files changed, 45 insertions(+), 34 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
index 948bc89..510a336 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
@@ -26,7 +26,7 @@
     <div class="content-box mat-reset">
       <form [formGroup]="resourceForm" *ngIf="clusterTypes.length && resourceForm; else placeholder">
 
-        <div class="form-wrapper" [ngClass]="{ compress: selectedImage?.image === 'docker.datalab-dataengine' }">
+        <div class="form-wrapper" [ngClass]="{ }">
             <div class="col">
                 <div class="control-group" *ngIf="PROVIDER !== 'azure'" [hidden]="clusterTypes.length === 1">
                     <label class="label">Select cluster type</label>
@@ -50,23 +50,7 @@
               </div>
             </div>
 
-            <div class="control-group" *ngIf="PROVIDER !== 'azure'" [hidden]="!selectedImage.templates.length">
-              <label class="label">Select template</label>
-              <div class="control selector-wrapper">
-                <mat-form-field>
-                  <mat-label>Select template</mat-label>
-                  <mat-select panelClass="scrolling" formControlName="version" disableOptionCentering>
-                    <mat-option *ngFor="let template of selectedImage.templates" [value]="template.version">
-                      {{ template.version }}</mat-option>
-                    <mat-option *ngIf="!selectedImage.templates" class="multiple-select ml-10" disabled>Templates list
-                      is empty</mat-option>
-                  </mat-select>
-                  <button class="caret">
-                    <i class="material-icons">keyboard_arrow_down</i>
-                  </button>
-                </mat-form-field>
-              </div>
-            </div>
+            
 
             <div class="control-group alias-name" *ngIf="selectedImage?.image">
               <label class="label">Cluster alias</label>
@@ -89,6 +73,26 @@
                 </span>
               </div>
             </div>
+
+            <div class="control-group" *ngIf="selectedImage?.image">
+              <label class="label">Master instance size</label>
+              <div class="control selector-wrapper">
+                <mat-form-field>
+                  <mat-label>Select instance size</mat-label>
+                  <mat-select panelClass="scrolling" formControlName="shape_master" disableOptionCentering>
+                    <mat-optgroup *ngFor="let item of (selectedImage.computation_resources_shapes | keys)"
+                      [label]="item.key | underscoreless">
+                      <mat-option *ngFor="let list_item of item.value" [value]="list_item.Type" (click)="clearGpuType('master')">
+                        <strong class="highlight icon-label">{{ list_item.Size }}</strong> {{ list_item.Type }}
+                      </mat-option>
+                    </mat-optgroup>
+                  </mat-select>
+                  <button class="caret">
+                    <i class="material-icons">keyboard_arrow_down</i>
+                  </button>
+                </mat-form-field>
+              </div>
+            </div>
           </div>
 
           <div class="col">
@@ -104,18 +108,16 @@
               </div>
             </div>
 
-            <div class="control-group" *ngIf="selectedImage?.image">
-              <label class="label">Master instance size</label>
+            <div class="control-group" *ngIf="PROVIDER !== 'azure'" [hidden]="!selectedImage.templates.length">
+              <label class="label">Select template</label>
               <div class="control selector-wrapper">
                 <mat-form-field>
-                  <mat-label>Select instance size</mat-label>
-                  <mat-select panelClass="scrolling" formControlName="shape_master" disableOptionCentering>
-                    <mat-optgroup *ngFor="let item of (selectedImage.computation_resources_shapes | keys)"
-                      [label]="item.key | underscoreless">
-                      <mat-option *ngFor="let list_item of item.value" [value]="list_item.Type" (click)="clearGpuType('master')">
-                        <strong class="highlight icon-label">{{ list_item.Size }}</strong> {{ list_item.Type }}
-                      </mat-option>
-                    </mat-optgroup>
+                  <mat-label>Select template</mat-label>
+                  <mat-select panelClass="scrolling" formControlName="version" disableOptionCentering>
+                    <mat-option *ngFor="let template of selectedImage.templates" [value]="template.version">
+                      {{ template.version }}</mat-option>
+                    <mat-option *ngIf="!selectedImage.templates" class="multiple-select ml-10" disabled>Templates list
+                      is empty</mat-option>
                   </mat-select>
                   <button class="caret">
                     <i class="material-icons">keyboard_arrow_down</i>
@@ -125,7 +127,7 @@
             </div>
 
               <div class="control-group" *ngIf="selectedImage?.image"
-                   [hidden]="selectedImage?.image === 'docker.datalab-dataengine'">
+                   >
                   <label class="label">Slave instance size</label>
                   <div class="control selector-wrapper">
                       <mat-form-field>
@@ -149,7 +151,7 @@
           </div>
         </div>
         <div class="checkbox-group control-group"
-             *ngIf="PROVIDER === 'gcp' && selectedImage?.image === 'docker.datalab-dataengine-service'">
+             *ngIf="PROVIDER === 'gcp'">
           <div class="d-flex cursor-pointer label m-bott-20" (click)="addAdditionalParams('gpu')">
             <div class="empty-checkbox ml-10" [ngClass]="{'checked': isSelected.gpu}">
               <span class="checked-checkbox" *ngIf="isSelected.gpu"></span>
@@ -312,7 +314,7 @@
             rises above your bid price, the Spot instance is reclaimed by AWS so that it can be given to another
             customer. Make sure to backup your data on periodic basis.</span>
         </div>
-          <div class="checkbox-group m-top-20 control-group"
+          <div class="checkbox-group control-group"
                [hidden]="PROVIDER === 'gcp' && selectedImage?.image === 'docker.datalab-dataengine-service'"
                *ngIf="notebook_instance?.image !== 'docker.datalab-zeppelin'">
               <div class="d-flex cursor-pointer label" (click)="addAdditionalParams('configuration')">
@@ -351,7 +353,7 @@
           <div class="text-center m-top-30">
               <button mat-raised-button type="button" (click)="dialogRef.close()" class="butt action">Cancel</button>
               <button mat-raised-button type="button" [disabled]="!resourceForm?.valid ||
-              (selectedImage?.image === 'docker.datalab-dataengine-service' && !resourceForm.value.shape_slave) ||
+              (!resourceForm.value.shape_slave) ||
               (selectedImage?.image === 'docker.datalab-dataengine-service' && !resourceForm.value.version)"
                       (click)="createComputationalResource(resourceForm.value)" class="butt butt-success action"
                       [ngClass]="{'not-allowed': !resourceForm?.valid ||
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
index 76852a9..70b24e2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
@@ -88,6 +88,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
 
   public selectImage($event) {
     this.selectedImage = $event;
+    this.selectedImage.computationGPU = ['tesla1', 'tesla2', 'tesla3'];
     this.filterShapes();
     this.getComputationalResourceLimits();
 
@@ -266,6 +267,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
         this.clusterTypes.forEach((cluster, index) => this.clusterTypes[index].computation_resources_shapes =
           SortUtils.shapesSort(cluster.computation_resources_shapes));
         this.selectedImage = this.clusterTypes[0];
+        this.selectedImage.computationGPU = ['tesla1', 'tesla2', 'tesla3'];
         if (this.selectedImage) {
           this._ref.detectChanges();
           this.filterShapes();
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create.model.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create.model.ts
index 9d9a613..cf533f6 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create.model.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create.model.ts
@@ -71,8 +71,15 @@ export class ComputationalResourceModel {
     } else {
       return this.userResourceService.createComputationalResource_Dataengine({
         name: parameters.cluster_alias_name,
-        dataengine_instance_count: parameters.instance_number,
-        dataengine_instance_shape: parameters.shape_master,
+        master_instance_count: 1,
+        slave_instance_count: parameters.instance_number - 1,
+        master_instance_shape: parameters.shape_master,
+        slave_instance_shape: parameters.shape_slave,
+        gpu_enabled: gpu,
+        master_gpu_type: gpu ? parameters.master_GPU_type : null,
+        slave_gpu_type: gpu ? parameters.slave_GPU_type : null,
+        master_gpu_count: gpu ? parameters.master_GPU_count : null,
+        slave_gpu_count: gpu ? parameters.slave_GPU_count : null,
         notebook_name: env.name,
         image: image.image,
         template_name: image.template_name,

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