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 2021/05/31 09:33:47 UTC

[incubator-datalab] branch DataLab-keycloak_deployment_fixes created (now 36ccd2f)

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

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


      at 36ccd2f  [DATALAB-Keycloak_deployment-fixes] - Connection fixed

This branch includes the following new commits:

     new 36ccd2f  [DATALAB-Keycloak_deployment-fixes] - Connection fixed

The 1 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/01: [DATALAB-Keycloak_deployment-fixes] - Connection fixed

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

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

commit 36ccd2fa81344b9513f2f5115265fbd7210699a3
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Mon May 31 12:33:28 2021 +0300

    [DATALAB-Keycloak_deployment-fixes] - Connection fixed
---
 .../scripts/deploy_keycloak/deploy_keycloak.py     | 33 +++++++++++++---------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py b/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
index 7547985..1050fda 100644
--- a/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
+++ b/infrastructure-provisioning/scripts/deploy_keycloak/deploy_keycloak.py
@@ -96,21 +96,26 @@ if __name__ == "__main__":
 
     print("Configure connections")
     if args.public_ip_address != '':
-        try:
-            env['connection_attempts'] = 100
-            env.key_filename = [args.keyfile]
-            env.host_string = '{}@{}'.format(args.os_user, args.public_ip_address)
-        except Exception as err:
-            print("Failed establish connection. Excpeption: " + str(err))
-            sys.exit(1)
+        hostname = args.public_ip_address
     else:
-        try:
-            env['connection_attempts'] = 100
-            env.key_filename = [args.keyfile]
-            env.host_string = '{}@{}'.format(args.os_user, private_ip_address)
-        except Exception as err:
-            print("Failed establish connection. Excpeption: " + str(err))
-            sys.exit(1)
+        hostname = private_ip_address
+    try:
+        global conn
+        attempt = 0
+        while attempt < 10:
+            print('connection attempt {}'.format(attempt))
+            conn = Connection(host = hostname, user = args.os_user, connect_kwargs={'key_filename': args.keyfile})
+            conn.config.run.echo = True
+            try:
+                conn.run('ls')
+                conn.config.run.echo = True
+                return conn
+            except:
+                attempt += 1
+                time.sleep(10)
+    except:
+        traceback.print_exc()
+        sys.exit(1)
 
     print("Install Java")
     ensure_jre_jdk(args.os_user)

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