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

[incubator-dlab] branch DLAB-1516 created (now fcd9794)

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

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


      at fcd9794  [DLAB-1516]: Subnet search should be by CIDR according to VPC ID

This branch includes the following new commits:

     new fcd9794  [DLAB-1516]: Subnet search should be by CIDR according to VPC ID

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-1516]: Subnet search should be by CIDR according to VPC ID

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

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

commit fcd97943d4eac4207300e304d72e2659a1fc473c
Author: Mykola_Bodnar1 <bo...@gmail.com>
AuthorDate: Fri Feb 7 16:02:04 2020 +0200

    [DLAB-1516]: Subnet search should be by CIDR according to VPC ID
---
 .../src/general/scripts/aws/dataengine-service_create.py              | 4 ++--
 .../src/general/scripts/aws/dataengine_prepare.py                     | 4 ++--
 .../src/general/scripts/aws/project_prepare.py                        | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_create.py b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_create.py
index 8a61270..6017968 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_create.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_create.py
@@ -339,7 +339,7 @@ def build_emr_cluster(args):
                     ReleaseLabel=args.release_label,
                     Instances={'Ec2KeyName': args.ssh_key,
                                'KeepJobFlowAliveWhenNoSteps': not args.auto_terminate,
-                               'Ec2SubnetId': get_subnet_by_cidr(args.subnet),
+                               'Ec2SubnetId': get_subnet_by_cidr(args.subnet, os.environ['aws_notebook_vpc_id']),
                                'InstanceGroups': [
                                    {'Market': 'SPOT',
                                     'BidPrice': args.bid_price[:5],
@@ -377,7 +377,7 @@ def build_emr_cluster(args):
                                'Ec2KeyName': args.ssh_key,
                                # 'Placement': {'AvailabilityZone': args.availability_zone},
                                'KeepJobFlowAliveWhenNoSteps': not args.auto_terminate,
-                               'Ec2SubnetId': get_subnet_by_cidr(args.subnet),
+                               'Ec2SubnetId': get_subnet_by_cidr(args.subnet, os.environ['aws_notebook_vpc_id']),
                                'AdditionalMasterSecurityGroups': [
                                    get_security_group_by_name(
                                        args.additional_emr_sg)
diff --git a/infrastructure-provisioning/src/general/scripts/aws/dataengine_prepare.py b/infrastructure-provisioning/src/general/scripts/aws/dataengine_prepare.py
index 6163d83..62b6a95 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/dataengine_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/dataengine_prepare.py
@@ -151,7 +151,7 @@ if __name__ == "__main__":
             .format(data_engine['master_node_name'], data_engine['ami_id'], data_engine['master_size'],
                     data_engine['key_name'],
                     get_security_group_by_name(data_engine['dataengine_master_security_group_name']),
-                    get_subnet_by_cidr(data_engine['subnet_cidr']),
+                    get_subnet_by_cidr(data_engine['subnet_cidr'], os.environ['aws_notebook_vpc_id']),
                     data_engine['notebook_dataengine_role_profile_name'], data_engine['tag_name'],
                     data_engine['master_node_name'], data_engine['primary_disk_size'], data_engine['instance_class'])
         try:
@@ -179,7 +179,7 @@ if __name__ == "__main__":
                 .format(slave_name, data_engine['ami_id'], data_engine['slave_size'],
                         data_engine['key_name'],
                         get_security_group_by_name(data_engine['dataengine_slave_security_group_name']),
-                        get_subnet_by_cidr(data_engine['subnet_cidr']),
+                        get_subnet_by_cidr(data_engine['subnet_cidr'], os.environ['aws_notebook_vpc_id']),
                         data_engine['notebook_dataengine_role_profile_name'], data_engine['tag_name'],
                         slave_name, data_engine['primary_disk_size'], data_engine['instance_class'])
             try:
diff --git a/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py b/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
index 7ab8a85..1f3504e 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/project_prepare.py
@@ -184,7 +184,7 @@ if __name__ == "__main__":
     tag = {"Key": project_conf['tag_name'],
            "Value": "{0}-{1}-subnet".format(project_conf['service_base_name'], project_conf['project_name'])}
     project_conf['private_subnet_cidr'] = get_subnet_by_tag(tag)
-    subnet_id = get_subnet_by_cidr(project_conf['private_subnet_cidr'])
+    subnet_id = get_subnet_by_cidr(project_conf['private_subnet_cidr'], project_conf['vpc2_id'])
     print('subnet id: {}'.format(subnet_id))
 
     print('NEW SUBNET CIDR CREATED: {}'.format(project_conf['private_subnet_cidr']))


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