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/04/14 12:50:01 UTC

[incubator-datalab] branch DATALAB-2361 created (now 7b9262b)

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

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


      at 7b9262b  [DATALAB-2361]: added handling of instance.wait_until_running() max tries reached during aws notebook instance creation

This branch includes the following new commits:

     new b2c7b29  [DATALAB-2361]: added retries for luarocks install
     new 7b9262b  [DATALAB-2361]: added handling of instance.wait_until_running() max tries reached during aws notebook instance creation

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] 02/02: [DATALAB-2361]: added handling of instance.wait_until_running() max tries reached during aws notebook instance creation

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

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

commit 7b9262b4bfae74d066cef092f8f6efcf6706135e
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Apr 14 15:49:40 2021 +0300

    [DATALAB-2361]: added handling of instance.wait_until_running() max tries reached during aws notebook instance creation
---
 infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 9b0e7d2..4b6e97e 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -478,7 +478,10 @@ def create_instance(definitions, instance_tag, primary_disk_size=12):
                                              UserData=user_data)
         for instance in instances:
             print("Waiting for instance {} become running.".format(instance.id))
-            instance.wait_until_running()
+            try:
+                instance.wait_until_running()
+            except:
+                pass
             tag = {'Key': 'Name', 'Value': definitions.node_name}
             create_tag(instance.id, tag)
             create_tag(instance.id, instance_tag)

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


[incubator-datalab] 01/02: [DATALAB-2361]: added retries for luarocks install

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

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

commit b2c7b29dad964434eed4f0ce4030f85e5d03ff66
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Apr 14 15:48:43 2021 +0300

    [DATALAB-2361]: added retries for luarocks install
---
 .../src/general/lib/os/debian/edge_lib.py          | 32 +++++++++++++++++++---
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py
index d00454a..2a4cb9f 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/edge_lib.py
@@ -128,11 +128,35 @@ def install_nginx_lua(edge_ip, nginx_version, keycloak_auth_server_url, keycloak
             with cd('/tmp/src/luarocks-3.3.1/'):
                 sudo('./configure')
                 sudo('make install')
-                sudo('luarocks install lua-resty-jwt 0.2.2 --tree /usr/local/openresty/lualib/resty/')
-                sudo('luarocks install lua-resty-openidc --tree /usr/local/openresty/lualib/resty/')
+                try:
+                    allow = False
+                    counter = 0
+                    while not allow:
+                        if counter > 5:
+                            sys.exit(1)
+                        else:
+                            if 'Could not fetch' in sudo('luarocks install lua-resty-jwt 0.2.2 --tree /usr/local/openresty/lualib/resty/ 2>&1') or 'Could not fetch' in sudo('luarocks install lua-resty-openidc --tree /usr/local/openresty/lualib/resty/ 2>&1'):
+                                counter += 1
+                                time.sleep(10)
+                            else:
+                                allow = True
+                except:
+                    sys.exit(1)
 
-            sudo('luarocks install lua-resty-jwt 0.2.2')
-            sudo('luarocks install lua-resty-openidc')
+            try:
+                allow = False
+                counter = 0
+                while not allow:
+                    if counter > 5:
+                        sys.exit(1)
+                    else:
+                        if 'Could not fetch' in sudo('luarocks install lua-resty-jwt 0.2.2 2>&1') or 'Could not fetch' in sudo('luarocks install lua-resty-openidc 2>&1'):
+                            counter += 1
+                            time.sleep(10)
+                        else:
+                            allow = True
+            except:
+                sys.exit(1)
 
             sudo('useradd -r nginx')
 

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