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/22 14:48:32 UTC

[incubator-datalab] branch DATALAB-2091 updated (88d50ff -> 19c4149)

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

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


    from 88d50ff  [DATALAB-2091]: removed some prints
     new 092500b  [DATALAB-2091]: fixed path.exists usage
     new 19c4149  [DATALAB-2091]: fixed key and ip_addresses format

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.


Summary of changes:
 .../src/general/scripts/azure/common_create_subnet.py                 | 4 ++--
 .../src/general/scripts/azure/project_prepare.py                      | 3 ++-
 infrastructure-provisioning/src/ssn/scripts/docker_build.py           | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

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


[incubator-datalab] 01/02: [DATALAB-2091]: fixed path.exists usage

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

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

commit 092500b793945626696be8802bb593a04208b07b
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Apr 22 17:45:49 2021 +0300

    [DATALAB-2091]: fixed path.exists usage
---
 infrastructure-provisioning/src/ssn/scripts/docker_build.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/docker_build.py b/infrastructure-provisioning/src/ssn/scripts/docker_build.py
index 0511e02..310c2f4 100644
--- a/infrastructure-provisioning/src/ssn/scripts/docker_build.py
+++ b/infrastructure-provisioning/src/ssn/scripts/docker_build.py
@@ -27,6 +27,7 @@ import traceback
 import subprocess
 from fabric import *
 from os.path import exists
+from os import path
 
 src_path = '/opt/datalab/sources/infrastructure-provisioning/src/'
 if sys.argv[1] == 'all':
@@ -57,7 +58,7 @@ def image_build(src_path, node):
             cloud_provider = 'aws'
         elif subprocess.run("uname -r | awk -F '-' '{print $3}'", capture_output=True, shell=True, check=True).stdout.decode('UTF-8').rstrip("\n\r") == 'azure':
             cloud_provider = 'azure'
-            if not exists(conn,'{}base/azure_auth.json'.format(src_path)):
+            if not path.exists('{}base/azure_auth.json'.format(src_path)):
                 subprocess.run('cp /home/datalab-user/keys/azure_auth.json {}base/azure_auth.json'.format(src_path), shell=True, check=True)
         else:
             cloud_provider = 'gcp'

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


[incubator-datalab] 02/02: [DATALAB-2091]: fixed key and ip_addresses format

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

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

commit 19c4149af3e0ba768d25024c10ab9c6bc995ca0b
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Apr 22 17:46:34 2021 +0300

    [DATALAB-2091]: fixed key and ip_addresses format
---
 .../src/general/scripts/azure/common_create_subnet.py                 | 4 ++--
 .../src/general/scripts/azure/project_prepare.py                      | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/azure/common_create_subnet.py b/infrastructure-provisioning/src/general/scripts/azure/common_create_subnet.py
index 0698645..6345565 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/common_create_subnet.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/common_create_subnet.py
@@ -41,7 +41,7 @@ if __name__ == "__main__":
     try:
         empty_vpc = False
         private_subnet_size = ipaddress.ip_network(u'0.0.0.0/{}'.format(args.prefix)).num_addresses
-        first_vpc_ip = int(ipaddress.IPv4Address(args.vpc_cidr.split('/')[0].decode("utf-8")))
+        first_vpc_ip = int(ipaddress.IPv4Address(args.vpc_cidr.split('/')[0]))
         subnets_cidr = []
         subnets = AzureMeta().list_subnets(args.resource_group_name, args.vpc_name)
         for subnet in subnets:
@@ -52,7 +52,7 @@ if __name__ == "__main__":
 
         last_ip = first_vpc_ip
         for cidr in sorted_subnets_cidr:
-            first_ip = int(ipaddress.IPv4Address(cidr.split('/')[0].decode("utf-8")))
+            first_ip = int(ipaddress.IPv4Address(cidr.split('/')[0]))
             if first_ip - last_ip < private_subnet_size:
                 subnet_size = ipaddress.ip_network(u'{}'.format(cidr)).num_addresses
                 last_ip = first_ip + subnet_size - 1
diff --git a/infrastructure-provisioning/src/general/scripts/azure/project_prepare.py b/infrastructure-provisioning/src/general/scripts/azure/project_prepare.py
index 0fee636..29fce72 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/project_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/project_prepare.py
@@ -99,7 +99,7 @@ if __name__ == "__main__":
                                                                                    project_conf['endpoint_name'])
         ssh_key_path = os.environ['conf_key_dir'] + os.environ['conf_key_name'] + '.pem'
         key = RSA.importKey(open(ssh_key_path, 'rb').read())
-        project_conf['public_ssh_key'] = key.publickey().exportKey("OpenSSH")
+        project_conf['public_ssh_key'] = key.publickey().exportKey("OpenSSH").decode('UTF-8')
         project_conf['instance_storage_account_type'] = 'Premium_LRS'
         project_conf['image_name'] = os.environ['azure_{}_image_name'.format(os.environ['conf_os_family'])]
         project_conf['instance_tags'] = {"Name": project_conf['instance_name'],
@@ -144,6 +144,7 @@ if __name__ == "__main__":
         logging.info(json.dumps(project_conf))
     except Exception as err:
         datalab.fab.append_result("Failed to generate variables dictionary.", str(err))
+        traceback.print_exc()
         sys.exit(1)
 
     try:

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