You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dg...@apache.org on 2020/06/03 13:47:16 UTC

[incubator-dlab] branch DLAB-1737 created (now 9696092)

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

dgnatyshyn pushed a change to branch DLAB-1737
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 9696092  [DLAB-1737]: Allowed for notebook based on GPU allow only GPU computational resource and vice-versa

This branch includes the following new commits:

     new 9696092  [DLAB-1737]: Allowed for notebook based on GPU allow only GPU computational resource and vice-versa

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@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1737]: Allowed for notebook based on GPU allow only GPU computational resource and vice-versa

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

dgnatyshyn pushed a commit to branch DLAB-1737
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 9696092dd4775b9a87980906425df0ffbb429fe3
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Jun 3 16:46:23 2020 +0300

    [DLAB-1737]: Allowed for notebook based on GPU allow only GPU computational resource and vice-versa
---
 ...mputational-resource-create-dialog.component.ts | 29 ++++++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

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 414f483..39951e4 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
@@ -76,6 +76,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
   ngOnInit() {
     this.loading = true;
     this.notebook_instance = this.data.notebook;
+    console.log(this.data.notebook);
     this.resourcesList = this.data.full_list;
     this.initFormModel();
     this.getTemplates(this.notebook_instance.project, this.notebook_instance.endpoint, this.notebook_instance.cloud_provider);
@@ -83,6 +84,8 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
 
   public selectImage($event) {
     this.selectedImage = $event;
+    console.log( this.selectedImage);
+    this.filterShapes();
     this.getComputationalResourceLimits();
 
     if ($event.templates && $event.templates.length)
@@ -253,10 +256,8 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
         this.clusterTypes.forEach((cluster, index) => this.clusterTypes[index].computation_resources_shapes =
           SortUtils.shapesSort(cluster.computation_resources_shapes));
         this.selectedImage = clusterTypes.templates[0];
-
         if (this.selectedImage) {
           this._ref.detectChanges();
-
           this.filterShapes();
           this.resourceForm.get('template_name').setValue(this.selectedImage.template_name);
           this.getComputationalResourceLimits();
@@ -267,9 +268,13 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
   }
 
   private filterShapes(): void {
+    const allowed: any = ['GPU optimized'];
     if (this.notebook_instance.template_name.toLowerCase().indexOf('tensorflow') !== -1
-      || this.notebook_instance.template_name.toLowerCase().indexOf('deep learning') !== -1) {
-      const allowed: any = ['GPU optimized'];
+      || this.notebook_instance.template_name.toLowerCase().indexOf('deep learning') !== -1
+      || this.notebook_instance.shape === 'n1-standard-2'
+      || this.notebook_instance.shape === 'n1-highcpu-8'
+      || this.notebook_instance.shape === 'n1-highmem-32'
+    ) {
       const filtered = Object.keys(
         SortUtils.shapesSort(this.selectedImage.computation_resources_shapes))
         .filter(key => allowed.includes(key))
@@ -277,13 +282,27 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
           obj[key] = this.selectedImage.computation_resources_shapes[key];
           return obj;
         }, {});
-
+      console.log('Only GPU');
       if (this.PROVIDER !== 'azure') {
         const images = this.clusterTypes.filter(image => image.image === 'docker.dlab-dataengine');
         this.clusterTypes = images;
         this.selectedImage = this.clusterTypes[0];
       }
       this.selectedImage.computation_resources_shapes = filtered;
+    } else if (this.notebook_instance.shape !== 'n1-standard-2'
+      && this.notebook_instance.shape !== 'n1-highcpu-8'
+      && this.notebook_instance.shape !== 'n1-highmem-32') {
+      const filtered = Object.keys(
+        SortUtils.shapesSort(this.selectedImage.computation_resources_shapes))
+        .filter(key => !(allowed.includes(key)))
+        .reduce((obj, key) => {
+          obj[key] = this.selectedImage.computation_resources_shapes[key];
+          return obj;
+        }, {});
+      this.selectedImage.computation_resources_shapes = filtered;
+      console.log('Bez GPU');
+    }else{
+      console.log('On GPU');
     }
   }
 


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