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/08/26 09:14:49 UTC

[incubator-dlab] 02/02: [DLAB-2009]: Removed r package group for Spark cluster on TensorFlow with Jupyter

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

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

commit 9296b2fdd3f2039ce00129825d41fff2c109d469
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Aug 26 12:14:24 2020 +0300

    [DLAB-2009]: Removed r package group for Spark cluster on TensorFlow with Jupyter
---
 .../install-libraries.component.html                |  8 ++++----
 .../install-libraries.component.ts                  | 21 ++++++++++++++-------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
index 517d221..5e2fa7c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
@@ -30,11 +30,11 @@
     </div>
     <div *ngIf="notebook?.status === 'running'" class="top-wrapper">
       <div class="loading-block" *ngIf="!libs_uploaded && uploading && data.status === 'running'">
-      <div class="uploading">
-        <p>Please wait until DLab loads full list of available libraries for you...</p>
-        <img src="assets/img/gif-spinner.gif" alt="loading">
+        <div class="uploading">
+          <p>Please wait until DLab loads full list of available libraries for you...</p>
+          <img src="assets/img/gif-spinner.gif" alt="loading">
+        </div>
       </div>
-    </div>
       <div *ngIf="notebook?.status === 'running' && !uploading" class="lib-view-wrap">
       <div class="search-box">
         <div class="search-form">
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
index d7afd5f..668bfab 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
@@ -22,7 +22,7 @@ import {Component, OnInit, ViewChild, ViewEncapsulation, ChangeDetectorRef, Inje
 import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { FormControl } from '@angular/forms';
 import { ToastrService } from 'ngx-toastr';
-import {debounceTime, take, takeUntil} from 'rxjs/operators';
+import {debounceTime, filter, take, takeUntil} from 'rxjs/operators';
 
 import { InstallLibrariesModel } from './install-libraries.model';
 import { LibrariesInstallationService } from '../../../core/services';
@@ -125,7 +125,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
     this.uploading = true;
     this.librariesInstallationService.getGroupsList(this.notebook.project, this.notebook.name, this.model.computational_name)
       .pipe(
-        takeUntil(this.unsubscribe$)
+        takeUntil(this.unsubscribe$),
       )
       .subscribe(
         response => {
@@ -161,12 +161,18 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   }
 
   public filterGroups(groupsList) {
-    const PREVENT_TEMPLATES = ['rstudio', 'rstudio with tensorflow'];
     const CURRENT_TEMPLATE = this.notebook.template_name.toLowerCase();
-    const templateCheck = PREVENT_TEMPLATES.some(template => CURRENT_TEMPLATE.indexOf(template) !== -1);
 
+    if (CURRENT_TEMPLATE.indexOf('jupyter with tensorflow') !== -1) {
+      const filtered = groupsList.filter(group => group !== 'r_pkg');
+      return SortUtils.libGroupsSort(filtered);
+    }
+
+    const PREVENT_TEMPLATES = ['rstudio', 'rstudio with tensorflow'];
+    const templateCheck = PREVENT_TEMPLATES.some(template => CURRENT_TEMPLATE.indexOf(template) !== -1);
     const filteredGroups = templateCheck ? groupsList.filter(group => group !== 'java') : groupsList;
     return SortUtils.libGroupsSort(filteredGroups);
+
   }
 
   public onUpdate($event) {
@@ -319,7 +325,6 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
         this.changeDetector.markForCheck();
         this.filterConfiguration.group = this.createFilterList(this.notebookLibs.map(v => this.groupsListMap[v.group]));
         this.filterConfiguration.group = SortUtils.libFilterGroupsSort(this.filterConfiguration.group);
-        console.log(this.filterConfiguration.group);
         this.filterConfiguration.resource = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.resource)));
         this.filterConfiguration.resourceType = this.createFilterList(this.notebookLibs.map(lib =>
           lib.status.map(status => status.resourceType)));
@@ -365,9 +370,11 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
               this.filteredList = [libs];
               this.filteredList.forEach(lib => {
                 lib.isInSelectedList = this.model.selectedLibs
-                  .some(el => lib.name.toLowerCase() === el.name.substring(0, el.name.lastIndexOf(':')).toLowerCase());
+                  .some(el => {
+                    return lib.name.toLowerCase() === el.name.toLowerCase();
+                  });
                 lib.isInstalled = this.notebookLibs.some(libr => {
-                    return lib.name.toLowerCase() === libr.name.substring(0, libr.name.lastIndexOf(':')).toLowerCase() &&
+                    return lib.name.toLowerCase() === libr.name.toLowerCase() &&
                       this.group === libr.group &&
                       libr.status.some(res => res.resource === this.destination.name);
                   }


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