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

mhladun 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 fb74e13  jupyterlab
fb74e13 is described below

commit fb74e13ef255e501ce5a0d1edc43afa11b687b2a
Author: Marian_Hladun <[email protected]>
AuthorDate: Thu Feb 17 16:03:05 2022 +0200

    jupyterlab
---
 infrastructure-provisioning/src/general/lib/os/fab.py      | 14 ++------------
 .../templates/os/debian/jupyterlab-notebook.service        |  2 +-
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index d6370d5..52f6a6e 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -1051,10 +1051,6 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, 
templates_dir, jupyterla
             conn.sudo('source /opt/python/python3.7.9/bin/activate')
             #conn.sudo('pip3 install jupyterlab --no-cache-dir')  # create 
external var with version
             conn.sudo('rm -rf {}'.format(jupyterlab_conf_file))
-            #elif os.environ['application'] != 'tensor':
-            #    conn.sudo('pip3 install environment_kernels')
-            #if os.environ['conf_cloud_provider'] == 'aws' and 
os.environ['application'] == 'deeplearning': #should be checked if for other 
applications any files have owner root:root in datalab-user homefolder and 
where it is changed to root:root on deeplearning
-            #    conn.sudo('chown -R {0}:{0} /home/{0}/.local'.format(os_user))
             conn.run('jupyter lab --generate-config')
             #conn.run('mkdir -p ~/.jupyter/custom/')
             #conn.run('echo "#notebook-container { width: auto; }" > 
~/.jupyter/custom/custom.css')
@@ -1088,22 +1084,16 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, 
templates_dir, jupyterla
                 java_home = conn.run("update-alternatives --query java | grep 
-o --color=never \'/.*/java-8.*/jre\'").stdout.splitlines()[0]
             conn.sudo('sed -i \'/\[Service\]/ a\Environment=\"JAVA_HOME={}\"\' 
 /tmp/jupyterlab-notebook.service'.format(
                 java_home))
-            conn.sudo('\cp /tmp/jupyterlab-notebook.service 
/etc/systemd/system/jupyterlab-notebook.service')
+            conn.sudo('cp /tmp/jupyterlab-notebook.service 
/etc/systemd/system/jupyterlab-notebook.service')
             conn.sudo('chown -R {0}:{0} /home/{0}/.local'.format(os_user))
             conn.sudo('mkdir -p /mnt/var')
             conn.sudo('chown {0}:{0} /mnt/var'.format(os_user))
-            if os.environ['application'] == 'jupyter' or 
os.environ['application'] == 'deeplearning':
-                try:
-                    conn.sudo('jupyter-kernelspec remove -f python3 || echo 
"Such kernel doesnt exists"')
-                    conn.sudo('jupyter-kernelspec remove -f python2 || echo 
"Such kernel doesnt exists"')
-                except Exception as err:
-                    logging.error('Error:', str(err))
             conn.sudo("systemctl daemon-reload")
             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))
+            logging.error('Function configure_jupyterlab error:', str(err))
             traceback.print_exc()
             sys.exit(1)
     else:
diff --git 
a/infrastructure-provisioning/src/general/templates/os/debian/jupyterlab-notebook.service
 
b/infrastructure-provisioning/src/general/templates/os/debian/jupyterlab-notebook.service
index c5e2225..97efa1f 100644
--- 
a/infrastructure-provisioning/src/general/templates/os/debian/jupyterlab-notebook.service
+++ 
b/infrastructure-provisioning/src/general/templates/os/debian/jupyterlab-notebook.service
@@ -25,7 +25,7 @@ Description=Jupyterlab notebook
 [Service]
 Type=simple
 PIDFile=/var/run/jupyterlab-notebook.pid
-ExecStart=/bin/bash -c "/usr/local/bin/jupyter lab
+ExecStart=/bin/bash -c ". /opt/python/python3.7.12/bin/activate && jupyter lab"
 ExecStop=/bin/bash -c "for i in $(ps aux | grep jupyter | grep -v grep | awk 
'{print $2}'); do kill -9 $i; done"
 User=OS_USR
 Group=OS_USR

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to