You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/07/24 11:15:22 UTC

[incubator-dlab] branch DLAB-1961 updated (440c433 -> c27dd4e)

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

lfrolov pushed a change to branch DLAB-1961
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from 440c433  [DLAB-1961]: changed 'failed' status to 'installation_error'
     new ef44530  [DLAB-1961]: changed error message for java
     new c27dd4e  [DLAB-1962]: made new response in case of exception for apt yum pip R and java

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.


Summary of changes:
 .../src/general/lib/os/debian/notebook_lib.py      |  8 ++++++--
 .../src/general/lib/os/fab.py                      | 23 ++++++++++++++--------
 .../src/general/lib/os/redhat/notebook_lib.py      | 10 +++++++---
 3 files changed, 28 insertions(+), 13 deletions(-)


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


[incubator-dlab] 01/02: [DLAB-1961]: changed error message for java

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

lfrolov pushed a commit to branch DLAB-1961
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit ef44530811e0c75544d1b7451d36f5345e49317e
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Fri Jul 24 12:49:48 2020 +0300

    [DLAB-1961]: changed error message for java
---
 infrastructure-provisioning/src/general/lib/os/fab.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index b1e20e6..bdb8c5a 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -518,7 +518,7 @@ def install_java_pkg(requisites):
                 sudo('cp -f $(find {0} -name "*.jar" | xargs) {1}'.format(ivy_cache_dir, dest_dir))
                 status.append({"group": "java", "name": "{0}:{1}".format(group, artifact), "version": version, "status": "installed"})
             else:
-                status.append({"group": "java", "name": "{0}:{1}".format(group, artifact), "status": "failed", "error_message": err})
+                status.append({"group": "java", "name": "{0}:{1}".format(group, artifact), "status": "installation_error", "error_message": err})
         update_spark_jars()
         return status
     except Exception as err:


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


[incubator-dlab] 02/02: [DLAB-1962]: made new response in case of exception for apt yum pip R and java

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

lfrolov pushed a commit to branch DLAB-1961
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit c27dd4e10f21160d50f98f5dbc811d03b3d129f8
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Fri Jul 24 14:13:42 2020 +0300

    [DLAB-1962]: made new response in case of exception for apt yum pip R and java
---
 .../src/general/lib/os/debian/notebook_lib.py       |  8 ++++++--
 .../src/general/lib/os/fab.py                       | 21 ++++++++++++++-------
 .../src/general/lib/os/redhat/notebook_lib.py       | 10 +++++++---
 3 files changed, 27 insertions(+), 12 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 cc8a2b2..3b3ba3f 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/notebook_lib.py
@@ -412,8 +412,12 @@ def install_os_pkg(requisites):
         sudo('export LC_ALL=C')
         return status
     except Exception as err:
-        append_result("Failed to install OS packages", str(err))
-        sys.exit(1)
+        for os_pkg in requisites:
+            name, vers = os_pkg
+            status.append(
+                {"group": "os_pkg", "name": name, "version": vers, "status": 'failed', "error_message": err})
+        print("Failed to install OS packages: {}".format(requisites))
+        return status
 
 
 @backoff.on_exception(backoff.expo, SystemExit, max_tries=10)
diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index bdb8c5a..a277cf1 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -117,9 +117,11 @@ def install_pip_pkg(requisites, pip_version, lib_group):
                            "error_message": err, "available_versions": versions, "add_pkgs": dep})
         return status
     except Exception as err:
-        append_result("Failed to install {} packages".format(pip_version), str(err))
+        for pip_pkg in requisites:
+            name, vers = pip_pkg
+            status.append({"group": lib_group, "name": name, "version": vers, "status": 'installation_error', "error_message": err})
         print("Failed to install {} packages".format(pip_version))
-        sys.exit(1)
+        return status
 
 
 def id_generator(size=10, chars=string.digits + string.ascii_letters):
@@ -458,9 +460,12 @@ def install_r_pkg(requisites):
             status.append({"group": "r_pkg", "name": name, "version": version, "status": status_msg, "error_message": err, "available_versions": versions, "add_pkgs": dep})
         return status
     except Exception as err:
-        append_result("Failed to install R packages", str(err))
+        for r_pkg in requisites:
+            name, vers = r_pkg
+            status.append(
+                {"group": "r_pkg", "name": name, "version": vers, "status": 'installation_error', "error_message": err})
         print("Failed to install R packages")
-        sys.exit(1)
+        return status
 
 
 def update_spark_jars(jars_dir='/opt/jars'):
@@ -522,10 +527,12 @@ def install_java_pkg(requisites):
         update_spark_jars()
         return status
     except Exception as err:
-        append_result("Failed to install {} packages".format(requisites), str(err))
+        for java_pkg in requisites:
+            group, artifact, version, override = java_pkg
+            status.append({"group": "java", "name": "{0}:{1}".format(group, artifact), "status": "installation_error",
+                           "error_message": err})
         print("Failed to install {} packages".format(requisites))
-        sys.exit(1)
-
+        return status
 
 def get_available_r_pkgs():
     try:
diff --git a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
index 34bae34..93627fb 100644
--- a/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/redhat/notebook_lib.py
@@ -360,9 +360,13 @@ def install_os_pkg(requisites):
             except:
                 status.append({"group": "os_pkg", "name": os_pkg, "status": "failed", "error_message": err})
         return status
-    except:
-        return "Fail to install OS packages"
-
+    except Exception as err:
+        for os_pkg in requisites:
+            name, vers = os_pkg
+            status.append(
+                {"group": "os_pkg", "name": name, "version": vers, "status": 'failed', "error_message": err})
+        print("Failed to install OS packages: {}".format(requisites))
+        return status
 
 def remove_os_pkg(pkgs):
     try:


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