You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2022/02/14 17:23:06 UTC

[incubator-datalab] 02/04: [DATALAB-2698]: added venv libs install

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

lfrolov pushed a commit to branch DATALAB-2698
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit bf6d18f0358aa7a490ab87becb28f325a50cedeb
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Mon Feb 14 18:41:50 2022 +0200

    [DATALAB-2698]: added venv libs install
---
 .../src/general/lib/os/debian/notebook_lib.py                      | 5 +++++
 .../src/tensor/scripts/configure_tensor_node.py                    | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
index 7c094e1..4e9bdbd 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -395,6 +395,11 @@ def install_tensor(os_user, cuda_version, cuda_file_name,
             sys.exit(1)
 
 
+def ensure_pytorch(os_user, libs):
+    if not exists(datalab.fab.conn, '/home/' + os_user + '/.ensure_dir/venv_libs_ensured'):
+        datalab.fab.conn.install_venv_pip_pkg(libs)
+        datalab.fab.conn.sudo('touch /home/' + os_user + '/.ensure_dir/venv_libs_ensured')
+
 def ensure_pytorch(os_user, gpu=True):
     if not exists(datalab.fab.conn, '/home/' + os_user + '/.ensure_dir/pytorch_ensured'):
         if gpu:
diff --git a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
index 3566518..3686231 100644
--- a/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
+++ b/infrastructure-provisioning/src/tensor/scripts/configure_tensor_node.py
@@ -69,7 +69,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'
 
 ##############
 # Run script #
@@ -147,7 +147,10 @@ if __name__ == "__main__":
         ensure_pytorch(args.os_user)
     print("Install Matplotlib")
     ensure_matplot(args.os_user)
-    
+
+    print("Install python venv required libs")
+    ensure_venv_libs(args.os_user, venv_libs)
+
     #POST INSTALLATION PROCESS
     print("Updating pyOpenSSL library")
     update_pyopenssl_lib(args.os_user)

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