You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dm...@apache.org on 2019/11/21 19:44:53 UTC

[incubator-dlab] 01/01: [DLAB-1299] Fixed Jupyterlab creation

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

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

commit c585b476bc3188d0938201279d191399bca69737
Author: Demyan Mysakovets <de...@gmail.com>
AuthorDate: Thu Nov 21 21:44:35 2019 +0200

    [DLAB-1299] Fixed Jupyterlab creation
---
 infrastructure-provisioning/src/general/conf/dlab.ini                 | 2 +-
 infrastructure-provisioning/src/general/lib/os/fab.py                 | 4 ++--
 .../src/jupyterlab/scripts/configure_jupyterlab_node.py               | 3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/infrastructure-provisioning/src/general/conf/dlab.ini b/infrastructure-provisioning/src/general/conf/dlab.ini
index 82a5dc9..44e6dad 100644
--- a/infrastructure-provisioning/src/general/conf/dlab.ini
+++ b/infrastructure-provisioning/src/general/conf/dlab.ini
@@ -274,7 +274,7 @@ ivy_version = 2.4.0
 ### Matplotlib version
 matplotlib_version = 2.0.2
 ### JupyterLab image
-jupyterlab_image = legionplatformtest/jupyterlab:1.0.0-rc21
+jupyterlab_image = legionplatformtest\/jupyterlab:1.0.0-rc21
 
 #--- [emr] section contains all parameters that are using for emr provisioning ---#
 [emr]
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index f062f03..bbb5e39 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -223,7 +223,7 @@ def configure_docker(os_user, http_file, https_file):
         print('Failed to configure Docker:', str(err))
         sys.exit(1)
 
-def ensure_jupyterlab_files(os_user, jupyterlab_dir, jupyter_conf_file, jupyterlab_conf_file, exploratory_name, edge_ip):
+def ensure_jupyterlab_files(os_user, jupyterlab_dir, jupyterlab_image, jupyter_conf_file, jupyterlab_conf_file, exploratory_name, edge_ip):
     if not exists(jupyterlab_dir):
         try:
             sudo('mkdir {}'.format(jupyterlab_dir))
@@ -239,7 +239,7 @@ def ensure_jupyterlab_files(os_user, jupyterlab_dir, jupyter_conf_file, jupyterl
             sudo('mv /tmp/build.sh {}build.sh'.format(jupyterlab_dir))
             sudo('mv /tmp/start.sh {}start.sh'.format(jupyterlab_dir))
             sudo('sed -i \'s/nb_user/{}/g\' {}Dockerfile_jupyterlab'.format(os_user, jupyterlab_dir))
-            sudo('sed -i \'s/jupyterlab_image/{}/g\' {}Dockerfile_jupyterlab'.format(os.environ['notebook_jupyter_image'], jupyterlab_dir))
+            sudo('sed -i \'s/jupyterlab_image/{}/g\' {}Dockerfile_jupyterlab'.format(jupyterlab_image, jupyterlab_dir))
             sudo('sed -i \'s/nb_user/{}/g\' {}start.sh'.format(os_user, jupyterlab_dir))
 #            sudo('sed -i \'s/jup_version/{}/g\' {}Dockerfile_jupyterlab'.format(jupyter_version, jupyterlab_dir))
 #            sudo('sed -i \'s/hadoop_version/{}/g\' {}Dockerfile_jupyterlab'.format(os.environ['notebook_hadoop_version'], jupyterlab_dir))
diff --git a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
index f3ecf7a..4bee9af 100644
--- a/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
+++ b/infrastructure-provisioning/src/jupyterlab/scripts/configure_jupyterlab_node.py
@@ -58,6 +58,7 @@ docker_version = '18.09.4'
 http_file = '/etc/systemd/system/docker.service.d/http-proxy.conf'
 https_file = '/etc/systemd/system/docker.service.d/https-proxy.conf'
 legion_dir = '/home/' + args.os_user + '/legion/legion/'
+jupyterlab_image = os.environ['notebook_jupyterlab_image']
 jupyterlab_dir = '/home/' + args.os_user + '/.jupyterlab/'
 spark_script = jupyterlab_dir + 'spark.sh'
 pyspark_local_path_dir = '/home/' + args.os_user + '/.jupyterlab/kernels/pyspark_local/'
@@ -107,7 +108,7 @@ if __name__ == "__main__":
 
     # CONFIGURE JUPYTER FILES
     print("Configure jupyter files")
-    ensure_jupyterlab_files(args.os_user,  jupyterlab_dir, jupyter_conf_file, jupyterlab_conf_file, args.exploratory_name, args.edge_ip)
+    ensure_jupyterlab_files(args.os_user, jupyterlab_dir, jupyterlab_image, jupyter_conf_file, jupyterlab_conf_file, args.exploratory_name, args.edge_ip)
 
     # INSTALL UNGIT
     print("Install nodejs")


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