This is an automated email from the ASF dual-hosted git repository.
hshpak pushed a commit to branch gcp-jupyter-highgpu-template-1
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/gcp-jupyter-highgpu-template-1
by this push:
new 661042d added the ability to automatically select the type of GPU
new 4e2f654 Merge pull request #1450 from GennadiyShpak/jupiter-jpu
661042d is described below
commit 661042d2b9ab697f32ea0f7615c879bf56fc633d
Author: Hennadii_Shpak <[email protected]>
AuthorDate: Thu Mar 10 12:17:07 2022 +0200
added the ability to automatically select the type of GPU
---
.../main/resources/webapp/src/app/core/models/index.ts | 1 +
.../src/app/core/models/{index.ts => templates-name.ts} | 11 +++--------
.../create-environment/create-environment.component.ts | 17 ++++++++++++-----
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
b/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
index 9ab3bc6..9a5b460 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
@@ -24,4 +24,5 @@ export * from './computationalResourceImage.model';
export * from './computationalResourceApplicationTemplate.model';
export * from './computationalResourceApplication.model';
export * from './imageType.enum';
+export * from './templates-name';
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
b/services/self-service/src/main/resources/webapp/src/app/core/models/templates-name.ts
similarity index 69%
copy from
services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
copy to
services/self-service/src/main/resources/webapp/src/app/core/models/templates-name.ts
index 9ab3bc6..c067be1 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/models/templates-name.ts
@@ -17,11 +17,6 @@
* under the License.
*/
-export * from './resourceShapeTypes.model';
-export * from './resourceShape.model';
-export * from './exploratoryEnvironmentVersion.model';
-export * from './computationalResourceImage.model';
-export * from './computationalResourceApplicationTemplate.model';
-export * from './computationalResourceApplication.model';
-export * from './imageType.enum';
-
+export enum TemplateName {
+ jupyterJpu = 'docker.datalab-jupyter-gpu'
+}
\ No newline at end of file
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 a5bb5e1..7f73477 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
@@ -29,6 +29,7 @@ import { DICTIONARY } from
'../../../../dictionary/global.dictionary';
import { CLUSTER_CONFIGURATION } from
'../../computational/computational-resource-create-dialog/cluster-configuration-templates';
import { tap } from 'rxjs/operators';
import { timer } from 'rxjs';
+import { TemplateName } from '../../../core/models';
@Component({
selector: 'create-environment',
@@ -51,6 +52,7 @@ export class ExploratoryEnvironmentCreateComponent implements
OnInit {
selectedImage: any;
maxNotebookLength: number = 14;
maxCustomTagLength: number = 63;
+ templateName = TemplateName;
public areShapes: boolean;
public selectedCloud: string = '';
public gpuCount: Array<number>;
@@ -259,7 +261,7 @@ export class ExploratoryEnvironmentCreateComponent
implements OnInit {
});
} else {
- controls.forEach(control => {
+ controls.forEach(control => {
this.createExploratoryForm.controls[control].setValidators([Validators.required]);
this.createExploratoryForm.controls[control].updateValueAndValidity();
});
@@ -270,10 +272,15 @@ export class ExploratoryEnvironmentCreateComponent
implements OnInit {
}
public setInstanceSize() {
- const controls = ['gpu_type', 'gpu_count'];
- controls.forEach(control => {
- this.createExploratoryForm.controls[control].setValue(null);
- });
+ const {image, computationGPU} = this.currentTemplate
+ if(image === this.templateName.jupyterJpu) {
+ this.createExploratoryForm.get('gpu_count').setValue(computationGPU[0])
+ } else {
+ const controls = ['gpu_type', 'gpu_count'];
+ controls.forEach(control => {
+ this.createExploratoryForm.controls[control].setValue(null);
+ });
+ }
}
public setCount(type: any, gpuType: any): void {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]