You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by ol...@apache.org on 2022/02/15 16:22:26 UTC

[incubator-datalab] branch 2.5.1-tensor-jupyterlab updated: fixed dockerfile

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

olehmykolaishyn pushed a commit to branch 2.5.1-tensor-jupyterlab
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/2.5.1-tensor-jupyterlab by this push:
     new 1dcca3e  fixed dockerfile
1dcca3e is described below

commit 1dcca3e4ba0bdd52180f9a3532372e079a05156c
Author: oleh_mykolaishyn <ow...@gmail.com>
AuthorDate: Tue Feb 15 18:22:10 2022 +0200

    fixed dockerfile
---
 .../general/files/aws/tensor-jupyterlab_Dockerfile |  4 ++--
 .../src/general/lib/os/fab.py                      | 24 +++++++++++-----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/infrastructure-provisioning/src/general/files/aws/tensor-jupyterlab_Dockerfile b/infrastructure-provisioning/src/general/files/aws/tensor-jupyterlab_Dockerfile
index eee2fa3..dc3342e 100644
--- a/infrastructure-provisioning/src/general/files/aws/tensor-jupyterlab_Dockerfile
+++ b/infrastructure-provisioning/src/general/files/aws/tensor-jupyterlab_Dockerfile
@@ -24,11 +24,11 @@ FROM docker.datalab-base:latest
 
 ARG OS
 
-COPY tensor/ /root/
+COPY tensor-jupyterlab/ /root/
 COPY general/scripts/os/* /root/scripts/
 COPY general/scripts/aws/tensor_* /root/scripts/
 COPY general/lib/os/${OS}/notebook_lib.py /usr/lib/python3.8/datalab/notebook_lib.py
-COPY general/templates/os/${OS}/jupyterlab-notebook.service /root/templates/ # add jupyterlab-service  file
+COPY general/templates/os/${OS}/jupyterlab-notebook.service /root/templates/
 COPY general/templates/os/${OS}/ungit.service /root/templates/
 COPY general/templates/os/notebook_spark-defaults_local.conf /root/templates/
 COPY general/templates/os/pyspark_local_template.json /root/templates/
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 6d0c430..d6370d5 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -1073,15 +1073,15 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, templates_dir, jupyterla
             #            jupyter_conf_file))
             #conn.put(templates_dir + 'jupyter-notebook.service', '/tmp/jupyter-notebook.service')
             #conn.sudo("chmod 644 /tmp/jupyter-notebook.service")
-            if os.environ['application'] == 'tensor': # ?????
-                conn.sudo(
-                    "sed -i '/ExecStart/s|-c \"|-c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cudnn/lib64:/usr/local/cuda/lib64; |g' /tmp/jupyter-notebook.service")
-            elif os.environ['application'] == 'deeplearning' and os.environ['conf_deeplearning_cloud_ami'] == 'false':
-                conn.sudo(
-                    "sed -i '/ExecStart/s|-c \"|-c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cudnn/lib64:/usr/local/cuda/lib64:/usr/lib64/openmpi/lib: ; export PYTHONPATH=/home/" + os_user +
-                    "/caffe/python:/home/" + os_user + "/pytorch/build:$PYTHONPATH ; |g' /tmp/jupyter-notebook.service")
-            conn.sudo("sed -i 's|CONF_PATH|{}|' /tmp/jupyter-notebook.service".format(jupyter_conf_file))
-            conn.sudo("sed -i 's|OS_USR|{}|' /tmp/jupyter-notebook.service".format(os_user))
+            #if os.environ['application'] == 'tensor': # ?????
+            #    conn.sudo(
+            #        "sed -i '/ExecStart/s|-c \"|-c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cudnn/lib64:/usr/local/cuda/lib64; |g' /tmp/jupyter-notebook.service")
+            #elif os.environ['application'] == 'deeplearning' and os.environ['conf_deeplearning_cloud_ami'] == 'false':
+            #    conn.sudo(
+            #        "sed -i '/ExecStart/s|-c \"|-c \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cudnn/lib64:/usr/local/cuda/lib64:/usr/lib64/openmpi/lib: ; export PYTHONPATH=/home/" + os_user +
+            #        "/caffe/python:/home/" + os_user + "/pytorch/build:$PYTHONPATH ; |g' /tmp/jupyter-notebook.service")
+            #conn.sudo("sed -i 's|CONF_PATH|{}|' /tmp/jupyter-notebook.service".format(jupyter_conf_file))
+            #conn.sudo("sed -i 's|OS_USR|{}|' /tmp/jupyter-notebook.service".format(os_user))
             if os.environ['application'] == 'deeplearning' and os.environ['conf_cloud_provider'] == 'azure':
                 java_home = conn.run("update-alternatives --query java | grep -o --color=never \'/.*/java-11.*/bin/java\'").stdout.splitlines()[0]
             else:
@@ -1099,8 +1099,8 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, templates_dir, jupyterla
                 except Exception as err:
                     logging.error('Error:', str(err))
             conn.sudo("systemctl daemon-reload")
-            conn.sudo("systemctl enable jupyter-notebook")
-            conn.sudo("systemctl start jupyter-notebook")
+            conn.sudo("systemctl enable jupyterlab-notebook")
+            conn.sudo("systemctl start jupyterlab-notebook")
             conn.sudo('touch /home/{}/.ensure_dir/jupyter_ensured'.format(os_user))
         except Exception as err:
             logging.error('Function configure_jupyter error:', str(err))
@@ -1111,7 +1111,7 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, templates_dir, jupyterla
             conn.sudo(
                 'sed -i "s/c.NotebookApp.base_url =.*/c.NotebookApp.base_url = \'\/{0}\/\'/" {1}'.format(
                     exploratory_name, jupyter_conf_file))
-            conn.sudo("systemctl restart jupyter-notebook")
+            conn.sudo("systemctl restart jupyterlab-notebook")
         except Exception as err:
             logging.error('Function configure_jupyter error:', str(err))
             traceback.print_exc()

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