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/05/21 14:06:38 UTC

[incubator-dlab] branch DLAB-433 updated: [DLAB-433] Demo-version(bugfix[3])

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

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


The following commit(s) were added to refs/heads/DLAB-433 by this push:
     new 87388c8  [DLAB-433] Demo-version(bugfix[3])
87388c8 is described below

commit 87388c8199deece7840c3d7112a6fc0016c4df52
Author: Dyoma33 <de...@gmail.com>
AuthorDate: Tue May 21 17:06:31 2019 +0300

    [DLAB-433] Demo-version(bugfix[3])
---
 .../src/general/files/aws/jupyter-docker_description.json         | 6 +++---
 infrastructure-provisioning/src/general/lib/os/fab.py             | 6 ++++++
 .../src/general/scripts/aws/jupyter-docker_configure.py           | 8 ++++----
 .../src/general/scripts/os/jupyter_container_start.py             | 3 ++-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/infrastructure-provisioning/src/general/files/aws/jupyter-docker_description.json b/infrastructure-provisioning/src/general/files/aws/jupyter-docker_description.json
index 053e71d..487586f 100644
--- a/infrastructure-provisioning/src/general/files/aws/jupyter-docker_description.json
+++ b/infrastructure-provisioning/src/general/files/aws/jupyter-docker_description.json
@@ -19,10 +19,10 @@
   "exploratory_environment_versions" :
   [
     {
-      "template_name": "Containerized Jupyter notebook 5.7.4",
-      "description": "Base image with Jupyter node creation routines",
+      "template_name": "JupyterLab 0.35.6",
+      "description": "Base image with JupyterLab node creation routines",
       "environment_type": "exploratory",
-      "version": "jupyter_notebook-5.7.4",
+      "version": "jupyter_lab-0.35.6",
       "vendor": "AWS"
     }
   ]
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 016c010..807fce4 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -213,6 +213,11 @@ def configure_docker(os_user, http_file, https_file):
             sudo('usermod -a -G docker ' + os_user)
             sudo('update-rc.d docker defaults')
             sudo('update-rc.d docker enable')
+            sudo('wget https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh && chmod +x install.sh')
+            sudo('sed -i "66s/curl/sudo curl/g" install.sh')
+            sudo('sed -i "s/sudo curl/sudo -E curl/g" install.sh')
+            run('sudo -E ./install.sh')
+            sudo('rm install.sh')
             sudo('touch /home/{}/.ensure_dir/docker_ensured'.format(os_user))
     except Exception as err:
         print('Failed to configure Docker:', str(err))
@@ -247,6 +252,7 @@ def ensure_jupyter_docker_files(os_user, jupyter_dir, jupyter_conf_file, docker_
             sudo('echo \'c.NotebookApp.cookie_secret = b"{0}"\' >> {1}'.format(id_generator(), jupyter_conf_file))
             sudo('''echo "c.NotebookApp.token = u''" >> {}'''.format(jupyter_conf_file))
             sudo('echo \'c.KernelSpecManager.ensure_native_kernel = False\' >> {}'.format(jupyter_conf_file))
+            sudo('chown dlab-user:dlab-user /opt')
 #            sudo('touch {}'.format(spark_script))
 #            sudo('echo "#!/bin/bash" >> {}'.format(spark_script))
 #            sudo(
diff --git a/infrastructure-provisioning/src/general/scripts/aws/jupyter-docker_configure.py b/infrastructure-provisioning/src/general/scripts/aws/jupyter-docker_configure.py
index eeb8d64..abf899d 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/jupyter-docker_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/jupyter-docker_configure.py
@@ -310,8 +310,8 @@ if __name__ == "__main__":
     print("Image name: {}".format(notebook_config['notebook_image_name']))
     print("Profile name: {}".format(notebook_config['role_profile_name']))
     print("SG name: {}".format(notebook_config['security_group_name']))
-    print("Jupyter URL: {}".format(jupyter_ip_url))
-    print("Jupyter URL: {}".format(jupyter_dns_url))
+    print("JupyterLab URL: {}".format(jupyter_ip_url))
+    print("JupyterLab URL: {}".format(jupyter_dns_url))
     print("Ungit URL: {}".format(ungit_ip_url))
     print("ReverseProxyNotebook".format(jupyter_notebook_acces_url))
     print("ReverseProxyUngit".format(jupyter_ungit_acces_url))
@@ -329,11 +329,11 @@ if __name__ == "__main__":
                "notebook_image_name": notebook_config['notebook_image_name'],
                "Action": "Create new notebook server",
                "exploratory_url": [
-                   {"description": "Jupyter",
+                   {"description": "JupyterLab",
                     "url": jupyter_notebook_acces_url},
                    {"description": "Ungit",
                     "url": jupyter_ungit_acces_url},
-                   {"description": "Jupyter (via tunnel)",
+                   {"description": "JupyterLab (via tunnel)",
                     "url": jupyter_ip_url},
                    {"description": "Ungit (via tunnel)",
                     "url": ungit_ip_url}
diff --git a/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py b/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
index 6f1e32c..da156f8 100644
--- a/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
+++ b/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
@@ -38,8 +38,9 @@ jupyter_dir = '/home/' + args.os_user + '/.jupyter/'
 def start_jupyter_container(jupyter_dir):
     try:
         with cd('{}'.format(jupyter_dir)):
+            run('docker volume create -d local-persist -o mountpoint=/opt --name=jup_volume')
             run('docker build --file /home/{}/.jupyter/Dockerfile_jupyter -t jupyter-notebook .'.format(args.os_user))
-            run('docker run -d --restart unless-stopped -p 8888:8888 jupyter-notebook:latest')
+            run('docker run -d --restart unless-stopped -p 8888:8888 -v jup_volume:/opt/repo jupyter-notebook:latest')
     except: sys.exit(1)
 
 if __name__ == "__main__":


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