You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by my...@apache.org on 2020/12/17 09:26:41 UTC

[incubator-datalab] 01/01: [DataLab-1645] - Edge node recreate fixed

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

mykolabodnar pushed a commit to branch DataLab-1645
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 0162cc7102396f4cff1e63360918ddefce95779e
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Thu Dec 17 11:25:15 2020 +0200

    [DataLab-1645] - Edge node recreate fixed
---
 infrastructure-provisioning/src/project/fabfile.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/infrastructure-provisioning/src/project/fabfile.py b/infrastructure-provisioning/src/project/fabfile.py
index d60bfb8..851e837 100644
--- a/infrastructure-provisioning/src/project/fabfile.py
+++ b/infrastructure-provisioning/src/project/fabfile.py
@@ -64,4 +64,26 @@ def terminate():
     except Exception as err:
         traceback.print_exc()
         append_result("Failed terminating Edge node.", str(err))
+        sys.exit(1)
+
+# Main function for EDGE node creation if it was terminated or failed
+def recreate():
+    local_log_filename = "{}_{}_{}.log".format(os.environ['conf_resource'],  os.environ['project_name'], os.environ['request_id'])
+    local_log_filepath = "/logs/edge/" + local_log_filename
+    logging.basicConfig(format='%(levelname)-8s [%(asctime)s]  %(message)s',
+                        level=logging.DEBUG,
+                        filename=local_log_filepath)
+
+    try:
+        local("~/scripts/{}.py".format('project_prepare'))
+    except Exception as err:
+        traceback.print_exc()
+        append_result("Failed preparing Edge node.", str(err))
+        sys.exit(1)
+
+    try:
+        local("~/scripts/{}.py".format('edge_configure'))
+    except Exception as err:
+        traceback.print_exc()
+        append_result("Failed configuring Edge node.", str(err))
         sys.exit(1)
\ No newline at end of file


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