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 2021/06/15 13:49:54 UTC

[incubator-datalab] branch DATALAB-2420 created (now 8d41e00)

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

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


      at 8d41e00  [DATALAB-2420]: fixed status in case if lib is already installed

This branch includes the following new commits:

     new 2e3e05d  [DATALAB-2420]: changed one of lib installation temporary files name
     new 8d41e00  [DATALAB-2420]: fixed status in case if lib is already installed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


[incubator-datalab] 01/02: [DATALAB-2420]: changed one of lib installation temporary files name

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2e3e05dc4809045e80882e6f22ffbd46395b9a95
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Jun 15 13:17:17 2021 +0300

    [DATALAB-2420]: changed one of lib installation temporary files name
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 484bcf2..e798c16 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -103,7 +103,8 @@ def install_pip_pkg(requisites, pip_version, lib_group):
     status = list()
     error_parser = "Could not|No matching|ImportError:|failed|EnvironmentError:|requires|FileNotFoundError:|RuntimeError:|error:"
     try:
-        venv_install_command = 'source /opt/python/python{0}/bin/activate && /opt/python/python{0}/bin/pip{1}'.format(os.environ['notebook_python_venv_version'], os.environ['notebook_python_venv_version'][:3])
+        venv_install_command = 'source /opt/python/python{0}/bin/activate && /opt/python/python{0}/bin/pip{1}'.format(
+            os.environ['notebook_python_venv_version'], os.environ['notebook_python_venv_version'][:3])
         #if pip_version == 'pip3' and not exists(conn, '/bin/pip3'):
         #    for v in range(4, 8):
         #        if exists(conn, '/bin/pip3.{}'.format(v)):
@@ -120,17 +121,21 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                 version = pip_pkg[1]
                 pip_pkg = "{}=={}".format(pip_pkg[0], pip_pkg[1])
             conn.sudo(
-                '''bash -l -c '{0} install -U {1} --use-deprecated=legacy-resolver --no-cache-dir 2>&1 | tee /tmp/tee.tmp; if ! grep -w -i -E  "({2})" /tmp/tee.tmp > /tmp/{4}install_{3}.log; then  echo "" > /tmp/{4}install_{3}.log;fi' '''.format(
+                '''bash -l -c '{0} install -U {1} --use-deprecated=legacy-resolver --no-cache-dir 2>&1 | '''
+                '''tee /tmp/tee.tmp; if ! grep -w -i -E  "({2})" /tmp/tee.tmp > /tmp/{4}install_{3}.log; '''
+                '''then  echo "" > /tmp/{4}install_{3}.log;fi' '''.format(
                     venv_install_command, pip_pkg, error_parser, name, pip_version))
             err = conn.sudo('cat /tmp/{0}install_{1}.log'.format(pip_version, pip_pkg.split("==")[0])).stdout.replace(
                 '"', "'").replace('\n', ' ')
             conn.sudo(
-                '''bash -l -c '{0} freeze --all | if ! grep -w -i {1} > /tmp/{2}install_{1}.list; then  echo "not_found" > /tmp/{2}install_{1}.list;fi' '''.format(
+                '''bash -l -c '{0} freeze --all | if ! grep -w -i {1} > /tmp/{2}install_{1}.list; '''
+                '''then  echo "not_found" > /tmp/{2}install_{1}.list;fi' '''.format(
                     venv_install_command, name, pip_version))
             res = conn.sudo('''bash -l -c 'cat /tmp/{0}install_{1}.list' '''.format(pip_version, name)).stdout.replace(
                 '\n', '')
             conn.sudo(
-                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep "Successfully installed" > /tmp/{0}install_{1}.list; then  echo "not_installed" > /tmp/{0}install_{1}.list;fi' '''.format(
+                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep "Successfully installed" > /tmp/{0}install_{1}.list; then  '''
+                '''echo "not_installed" > /tmp/{0}install_{1}.list;fi' '''.format(
                     pip_version, name))
             installed_out = conn.sudo(
                 '''bash -l -c 'cat /tmp/{0}install_{1}.list' '''.format(pip_version, name)).stdout.replace('\n', '')
@@ -169,9 +174,10 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                     versions = []
 
             conn.sudo(
-                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep -w -i -E  "Installing collected packages:" > /tmp/{0}install_{1}.log; then  echo "" > /tmp/{0}install_{1}.log;fi' '''.format(
+                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep -w -i -E  "Installing collected packages:" > '''
+                '''/tmp/{0}install_{1}.dep; then  echo "" > /tmp/{0}install_{1}.dep;fi' '''.format(
                     pip_version, name))
-            dep = conn.sudo('cat /tmp/{0}install_{1}.log'.format(pip_version, name)).stdout.replace('\n', '').strip()[31:]
+            dep = conn.sudo('cat /tmp/{0}install_{1}.dep'.format(pip_version, name)).stdout.replace('\n', '').strip()[31:]
             if dep == '':
                 dep = []
             else:

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


[incubator-datalab] 02/02: [DATALAB-2420]: fixed status in case if lib is already installed

Posted by lf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8d41e00887402ce2bae157c7115c95999741d2ac
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Tue Jun 15 16:49:34 2021 +0300

    [DATALAB-2420]: fixed status in case if lib is already installed
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index e798c16..10420b8 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -134,8 +134,8 @@ def install_pip_pkg(requisites, pip_version, lib_group):
             res = conn.sudo('''bash -l -c 'cat /tmp/{0}install_{1}.list' '''.format(pip_version, name)).stdout.replace(
                 '\n', '')
             conn.sudo(
-                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep "Successfully installed" > /tmp/{0}install_{1}.list; then  '''
-                '''echo "not_installed" > /tmp/{0}install_{1}.list;fi' '''.format(
+                '''bash -l -c 'cat /tmp/tee.tmp | if ! grep -w -i -E "(Successfully installed|up-to-date)" > '''
+                '''/tmp/{0}install_{1}.list; then  echo "not_installed" > /tmp/{0}install_{1}.list;fi' '''.format(
                     pip_version, name))
             installed_out = conn.sudo(
                 '''bash -l -c 'cat /tmp/{0}install_{1}.list' '''.format(pip_version, name)).stdout.replace('\n', '')

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