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

commit e03a116d1ace7e7530e59021247177db838cecca
Author: Marian_Hladun <[email protected]>
AuthorDate: Thu Feb 17 17:04:52 2022 +0200

    jupyterlab
---
 infrastructure-provisioning/src/general/lib/os/fab.py          | 10 +++++-----
 .../general/templates/os/debian/jupyterlab-notebook.service    |  2 +-
 .../scripts/configure_tensor-jupyterlab_node.py                |  7 ++++---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py 
b/infrastructure-provisioning/src/general/lib/os/fab.py
index 52f6a6e..ff97980 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -1048,8 +1048,8 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, 
templates_dir, jupyterla
     if not exists(conn, '/home/' + os_user + 
'/.ensure_dir/jupyterlab_ensured'):
         try:
             # conn.sudo('pip3 install notebook=={} 
--no-cache-dir'.format(jupyter_version))
-            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('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))
             conn.run('jupyter lab --generate-config')
             #conn.run('mkdir -p ~/.jupyter/custom/')
@@ -1082,8 +1082,8 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, 
templates_dir, jupyterla
                 java_home = conn.run("update-alternatives --query java | grep 
-o --color=never \'/.*/java-11.*/bin/java\'").stdout.splitlines()[0]
             else:
                 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('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('chown -R {0}:{0} /home/{0}/.local'.format(os_user))
             conn.sudo('mkdir -p /mnt/var')
@@ -1108,7 +1108,7 @@ def configure_jupyterlab(os_user, jupyterlab_conf_file, 
templates_dir, jupyterla
             sys.exit(1)
 
 
-def ensure_py3spark_local_kernel(os_user, py3spark_local_path_dir, 
templates_dir, spark_version, python_venv_path,
+]def ensure_py3spark_local_kernel(os_user, py3spark_local_path_dir, 
templates_dir, spark_version, python_venv_path,
                                  python_venv_version):
     if not exists(conn, '/home/' + os_user + 
'/.ensure_dir/py3spark_local_kernel_ensured'):
         try:
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 97efa1f..4b6556f 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 ". /opt/python/python3.7.12/bin/activate && jupyter lab"
+ExecStart=/bin/bash -c "/usr/local/bin/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
diff --git 
a/infrastructure-provisioning/src/tensor-jupyterlab/scripts/configure_tensor-jupyterlab_node.py
 
b/infrastructure-provisioning/src/tensor-jupyterlab/scripts/configure_tensor-jupyterlab_node.py
index 4aa7d71..da2317d 100644
--- 
a/infrastructure-provisioning/src/tensor-jupyterlab/scripts/configure_tensor-jupyterlab_node.py
+++ 
b/infrastructure-provisioning/src/tensor-jupyterlab/scripts/configure_tensor-jupyterlab_node.py
@@ -71,7 +71,7 @@ cuda_version = os.environ['notebook_cuda_version']
 cuda_file_name = os.environ['notebook_cuda_file_name']
 cudnn_version = os.environ['notebook_cudnn_version']
 cudnn_file_name = os.environ['notebook_cudnn_file_name']
-venv_libs = 'numpy scipy matplotlib pandas scikit-learn opencv-python 
jupyterlab==3.2.9 tensorflow==2.5.0' # tflite==2.4.0 python3-opencv
+venv_libs = 'numpy scipy matplotlib pandas scikit-learn opencv-python 
tensorflow==2.5.0' # tflite==2.4.0 python3-opencv
 jupyterlab_pip = 'jupyterlab'
 
 ##############
@@ -113,6 +113,9 @@ if __name__ == "__main__":
     install_keras(args.os_user, keras_version)
 
     # INSTALL JUPYTER NOTEBOOK
+    print("Configure jupyterlab with tensorflow,tflite")
+    configure_jupyterlab(args.os_user, jupyterlab_conf_file, templates_dir, 
jupyterlab_version, args.exploratory_name)
+
     #print("Install Jupyter")
     #configure_jupyterlab(args.os_user, jupyterlab_conf_file, templates_dir, 
jupyterlab_version, args.exploratory_name)
 
@@ -155,8 +158,6 @@ if __name__ == "__main__":
     ensure_venv_libs(args.os_user, venv_libs)
     ensure_venv_libs(args.os_user, '--extra-index-url 
https://google-coral.github.io/py-repo/ tflite_runtime==2.5.0')
 
-    print("Configure jupyterlab with tensorflow,tflite")
-    configure_jupyterlab(args.os_user, jupyterlab_conf_file, templates_dir, 
jupyterlab_version, args.exploratory_name)
 
     #POST INSTALLATION PROCESS
     print("Updating pyOpenSSL library")

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

Reply via email to