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/01 09:12:35 UTC

[incubator-datalab] branch DATALAB-2441 created (now ccd43cd)

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

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


      at ccd43cd  [DATALAB-2441] removed gpu count with value 8 for all available instances/GPU type

This branch includes the following new commits:

     new ccd43cd  [DATALAB-2441] removed gpu count with value 8 for all available instances/GPU type

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-2441] removed gpu count with value 8 for all available instances/GPU type

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

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

commit ccd43cd0f5fe65c9c53640e99cd1a5a1d6c6a907
Author: Yurii Tykhun <ty...@gmail.com>
AuthorDate: Thu Jul 1 12:12:10 2021 +0300

    [DATALAB-2441] removed gpu count with value 8 for all available instances/GPU type
---
 .../resources/webapp/src/app/core/util/helpUtils.ts | 20 --------------------
 ...putational-resource-create-dialog.component.html | 12 ++++++------
 ...omputational-resource-create-dialog.component.ts | 21 ++++-----------------
 .../create-environment.component.ts                 |  5 ++---
 4 files changed, 12 insertions(+), 46 deletions(-)

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 edd51c9..68178d5 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,24 +35,4 @@ export class HelpUtils {
         return;
     }
   }
-
-  public static setGPUCount(type, gpuType): Array<number> {
-    let count = [];
-    switch (type) {
-      case 'n1-highmem-32' || 'n1-highcpu-32':
-        count = [4, 8];
-        break;
-      case 'n1-highmem-16':
-        count = [2, 4, 8];
-        break;
-      default:
-        count = [1, 2, 4, 8];
-        break;
-    }
-    if (gpuType === 'nvidia-tesla-t4') {
-      count.pop();
-    }
-
-    return count;
-  }
 }
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 aa8d00b..00c7a9c 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
@@ -171,7 +171,7 @@
                                 placeholder="Select master GPU type"
                                 [disabled]="!resourceForm.controls['shape_master'].value">
                       <mat-option *ngFor="let type of selectedImage.computationGPU"
-                                  [value]="type" (click)="setCount('master', type)">
+                                  [value]="type" >
                         {{ type }}
                       </mat-option>
                       <mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
@@ -196,10 +196,10 @@
                   <mat-form-field>
                     <mat-label>Select master GPU count</mat-label>
                     <mat-select formControlName="master_GPU_count" disableOptionCentering [disabled]="!resourceForm.controls['master_GPU_type'].value">
-                      <mat-option *ngFor="let type of masterGPUcount" [value]="type">
+                      <mat-option *ngFor="let type of gpuCount" [value]="type">
                         {{ type }}
                       </mat-option>
-                      <mat-option *ngIf="!masterGPUcount?.length" class="multiple-select ml-10" disabled>Master GPU counts list is empty</mat-option>
+                      <mat-option *ngIf="!gpuCount?.length" class="multiple-select ml-10" disabled>Master GPU counts list is empty</mat-option>
                     </mat-select>
                     <button class="caret">
                       <i class="material-icons">keyboard_arrow_down</i>
@@ -223,7 +223,7 @@
                   <mat-form-field>
                     <mat-label>Select slave GPU type</mat-label>
                     <mat-select formControlName="slave_GPU_type" disableOptionCentering [disabled]="!resourceForm.controls['shape_slave'].value">
-                      <mat-option *ngFor="let type of selectedImage.computationGPU" [value]="type" (click)="setCount('slave', type)">
+                      <mat-option *ngFor="let type of selectedImage.computationGPU" [value]="type">
                         {{ type }}
                       </mat-option>
                       <mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
@@ -250,10 +250,10 @@
                   <mat-form-field>
                     <mat-label>Select slave GPU сount</mat-label>
                     <mat-select formControlName="slave_GPU_count" disableOptionCentering [disabled]="!resourceForm.controls['slave_GPU_type'].value">
-                      <mat-option *ngFor="let type of slaveGPUcount" [value]="type">
+                      <mat-option *ngFor="let type of gpuCount" [value]="type">
                         {{ type }}
                       </mat-option>
-                      <mat-option *ngIf="!slaveGPUcount?.length" class="multiple-select ml-10" disabled>
+                      <mat-option *ngIf="!gpuCount?.length" class="multiple-select ml-10" disabled>
                         Slave GPU counts list is empty
                       </mat-option>
                     </mat-select>
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..2d3fa9a 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
@@ -17,18 +17,17 @@
  * under the License.
  */
 
-import { Component, OnInit, ViewChild, Inject, ChangeDetectorRef } from '@angular/core';
-import {FormGroup, FormBuilder, Validators, FormControl} from '@angular/forms';
+import { Component, OnInit, Inject, ChangeDetectorRef } from '@angular/core';
+import {FormGroup, FormBuilder, Validators} from '@angular/forms';
 import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { ToastrService } from 'ngx-toastr';
 
 import { ComputationalResourceModel } from './computational-resource-create.model';
 import { UserResourceService } from '../../../core/services';
-import {HTTP_STATUS_CODES, PATTERNS, CheckUtils, SortUtils, HelpUtils} from '../../../core/util';
+import {HTTP_STATUS_CODES, PATTERNS, CheckUtils, SortUtils} from '../../../core/util';
 
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
 import { CLUSTER_CONFIGURATION } from './cluster-configuration-templates';
-import {Logger} from 'codelyzer/util/logger';
 
 @Component({
   selector: 'computational-resource-create-dialog',
@@ -59,8 +58,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
   public minSpotPrice: number = 0;
   public maxSpotPrice: number = 0;
   public resourceForm: FormGroup;
-  public masterGPUcount: Array<number>;
-  public slaveGPUcount: Array<number>;
+  public gpuCount: Array<number> = [1, 2, 4];
   public isSelected = {
     preemptible: false,
     gpu: false,
@@ -355,17 +353,6 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
     }
   }
 
-
-  public setCount(type: any, gpuType: any): void {
-    if (type === 'master') {
-      const masterShape = this.resourceForm.controls['shape_master'].value;
-      this.masterGPUcount = HelpUtils.setGPUCount(masterShape, gpuType);
-    } else {
-      const slaveShape = this.resourceForm.controls['shape_slave'].value;
-      this.slaveGPUcount = HelpUtils.setGPUCount(slaveShape, gpuType);
-    }
-  }
-
   public clearGpuType(type) {
     if (type === 'master') {
       this.resourceForm.controls['master_GPU_type'].setValue('');
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 4d2703d..7399018 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, HelpUtils} from '../../../core/util';
+import {CheckUtils, SortUtils, HTTP_STATUS_CODES, PATTERNS} 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';
@@ -284,8 +284,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
       this.createExploratoryForm.controls['gpu_count'].updateValueAndValidity();
     }
     // if (type === 'master') {
-      const masterShape = this.createExploratoryForm.controls['shape'].value;
-      this.gpuCount = HelpUtils.setGPUCount(masterShape, gpuType);
+      this.gpuCount = [1, 2, 4];
     // } else {
     //   const slaveShape = this.resourceForm.controls['shape_slave'].value;
     //   this.slaveGPUcount = HelpUtils.setGPUCount(slaveShape, gpuType);

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