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/06 08:02:31 UTC
[incubator-datalab] branch DATALAB-2490 created (now f879e50)
This is an automated email from the ASF dual-hosted git repository.
ytykhun pushed a change to branch DATALAB-2490
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.
at f879e50 [DATALAB-2490] added t-shirt sizes for dataproc and apache standalone cluster
This branch includes the following new commits:
new f879e50 [DATALAB-2490] added t-shirt sizes for dataproc and apache standalone cluster
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-2490] added t-shirt sizes for
dataproc and apache standalone cluster
Posted by yt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ytykhun pushed a commit to branch DATALAB-2490
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit f879e508c1cb1ddbf3f6000cfcb47fa5c0b805ce
Author: Yurii Tykhun <ty...@gmail.com>
AuthorDate: Tue Jul 6 11:02:11 2021 +0300
[DATALAB-2490] added t-shirt sizes for dataproc and apache standalone cluster
---
.../resources/webapp/src/app/core/util/helpUtils.ts | 17 +++++++++++++++--
.../computational-resource-create-dialog.component.html | 8 ++++----
.../computational-resource-create-dialog.component.ts | 4 +++-
.../create-environment/create-environment.component.ts | 14 +-------------
4 files changed, 23 insertions(+), 20 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 1ebed41..e078fde 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
@@ -36,10 +36,23 @@ export class HelpUtils {
}
}
- public static sortGpuTypes(gpuType: Array<string>): Array<string> {
+ public static 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 static sortGpuTypes(gpuType: Array<string> = []): Array<string> {
let sortedTypes = [];
- gpuType.forEach(type => checkType(type));
+ gpuType?.forEach(type => checkType(type));
function checkType(type) {
switch (type) {
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 00c7a9c..461c6ad 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
@@ -170,9 +170,9 @@
<mat-select formControlName="master_GPU_type" disableOptionCentering
placeholder="Select master GPU type"
[disabled]="!resourceForm.controls['shape_master'].value">
- <mat-option *ngFor="let type of selectedImage.computationGPU"
+ <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU)"
[value]="type" >
- {{ type }}
+ <strong class="highlight icon-label">{{ addSizeToGpuType(type) }}</strong> {{ type }}
</mat-option>
<mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
Master GPU types list is empty
@@ -223,8 +223,8 @@
<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">
- {{ type }}
+ <mat-option *ngFor="let type of sortGpuTypes(selectedImage.computationGPU)" [value]="type">
+ <strong class="highlight icon-label">{{ addSizeToGpuType(type) }}</strong> {{ type }}
</mat-option>
<mat-option *ngIf="!selectedImage.computationGPU?.length" class="multiple-select ml-10" disabled>
Slave GPU types list is empty
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 2d3fa9a..714eb92 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
@@ -24,7 +24,7 @@ import { ToastrService } from 'ngx-toastr';
import { ComputationalResourceModel } from './computational-resource-create.model';
import { UserResourceService } from '../../../core/services';
-import {HTTP_STATUS_CODES, PATTERNS, CheckUtils, SortUtils} from '../../../core/util';
+import {HTTP_STATUS_CODES, PATTERNS, CheckUtils, SortUtils, HelpUtils} from '../../../core/util';
import { DICTIONARY } from '../../../../dictionary/global.dictionary';
import { CLUSTER_CONFIGURATION } from './cluster-configuration-templates';
@@ -65,6 +65,8 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
spotInstances: false,
configuration: false,
};
+ public sortGpuTypes = HelpUtils.sortGpuTypes;
+ public addSizeToGpuType = HelpUtils.addSizeToGpuType;
constructor(
@Inject(MAT_DIALOG_DATA) public data: any,
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 7e4a90e..4468a18 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
@@ -54,6 +54,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
public selectedCloud: string = '';
public gpuCount: Array<number>;
public gpuTypes: Array<string> = [];
+ public addSizeToGpuType = HelpUtils.addSizeToGpuType;
public additionalParams = {
configurationNode: false,
@@ -150,19 +151,6 @@ 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'];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org