You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2019/12/12 14:52:38 UTC

[incubator-dlab] branch DLAB-1376 created (now c2e24a4)

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

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


      at c2e24a4  [DLAB-1376]: Added local endpoint check

This branch includes the following new commits:

     new c2e24a4  [DLAB-1376]: Added local endpoint check

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@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1376]: Added local endpoint check

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

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

commit c2e24a4d601e69613ecdd6a9f6dfead9d49c0fd1
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Thu Dec 12 16:52:23 2019 +0200

    [DLAB-1376]: Added local endpoint check
---
 .../src/general/scripts/aws/project_prepare.py     | 25 ++++++++++++----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py b/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
index a5e8a79..899ff54 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
@@ -100,6 +100,7 @@ if __name__ == "__main__":
     project_conf['elastic_ip_name'] = '{0}-{1}-edge-EIP'.format(project_conf['service_base_name'],
                                                              os.environ['project_name'])
     project_conf['provision_instance_ip'] = None
+    project_conf['local_endpoint'] = False
     try:
         project_conf['provision_instance_ip'] = get_instance_ip_address(
             project_conf['tag_name'], '{0}-{1}-endpoint'.format(project_conf['service_base_name'],
@@ -107,6 +108,7 @@ if __name__ == "__main__":
     except:
         project_conf['provision_instance_ip'] = get_instance_ip_address(project_conf['tag_name'], '{0}-ssn'.format(
             project_conf['service_base_name'])).get('Private') + "/32"
+        project_conf['local_endpoint'] = True
     if 'aws_user_predefined_s3_policies' not in os.environ:
         os.environ['aws_user_predefined_s3_policies'] = 'None'
 
@@ -141,17 +143,18 @@ if __name__ == "__main__":
                                                                                        project_conf['endpoint_tag'])
     print('Additional tags will be added: {}'.format(os.environ['conf_additional_tags']))
 
-    # attach project_tag and endpoint_tag to endpoint
-    try:
-        endpoint_id = get_instance_by_name(project_conf['tag_name'], project_conf['endpoint_name'])
-        print("Endpoint id: " + endpoint_id)
-        ec2 = boto3.client('ec2')
-        ec2.create_tags(Resources=[endpoint_id], Tags=[{'Key': 'project_tag', 'Value': project_conf['project_tag']},
-                                                       {'Key': 'endpoint_tag', 'Value': project_conf['endpoint_tag']}])
-    except Exception as err:
-        print("Failed to attach Project tag to Endpoint", str(err))
-#        traceback.print_exc()
-#        sys.exit(1)
+    if project_conf['local_endpoint']:
+        # attach project_tag and endpoint_tag to endpoint
+        try:
+            endpoint_id = get_instance_by_name(project_conf['tag_name'], project_conf['endpoint_name'])
+            print("Endpoint id: " + endpoint_id)
+            ec2 = boto3.client('ec2')
+            ec2.create_tags(Resources=[endpoint_id], Tags=[{'Key': 'project_tag', 'Value': project_conf['project_tag']},
+                                                           {'Key': 'endpoint_tag', 'Value': project_conf['endpoint_tag']}])
+        except Exception as err:
+            print("Failed to attach Project tag to Endpoint", str(err))
+            traceback.print_exc()
+            sys.exit(1)
 
     try:
         project_conf['vpc2_id'] = os.environ['aws_vpc2_id']


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