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

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


The following commit(s) were added to refs/heads/DLAB-1546 by this push:
     new bdda302  [DLAB-1546]: added name convention changes
bdda302 is described below

commit bdda30228c252285cef14cf2a9c14fcb92cb3f26
Author: Oleh Martushevskyi <[email protected]>
AuthorDate: Mon Mar 2 19:22:37 2020 +0200

    [DLAB-1546]: added name convention changes
---
 infrastructure-provisioning/src/general/lib/gcp/meta_lib.py  | 12 ++++++------
 .../src/general/scripts/gcp/dataengine-service_configure.py  |  2 +-
 .../src/general/scripts/gcp/rstudio_configure.py             |  3 ++-
 .../src/rstudio/scripts/configure_rstudio_node.py            |  2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py 
b/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
index d31106e..26aad3e 100644
--- a/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
+++ b/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
@@ -210,7 +210,7 @@ class GCPMeta:
 
     def get_instance_public_ip_by_name(self, instance_name):
         try:
-            result = GCPMeta().get_instance(instance_name)
+            result = self.get_instance(instance_name)
             if result:
                 for i in result.get('networkInterfaces'):
                     for j in i.get('accessConfigs'):
@@ -274,7 +274,7 @@ class GCPMeta:
             traceback.print_exc(file=sys.stdout)
 
     def get_service_account(self, service_account_name, service_base_name):
-        unique_index = 
GCPMeta().get_index_by_service_account_name(service_account_name)
+        unique_index = 
self.get_index_by_service_account_name(service_account_name)
         if unique_index == '':
             service_account_email = 
"{}@{}.iam.gserviceaccount.com".format(service_base_name, self.project)
         else:
@@ -347,7 +347,7 @@ class GCPMeta:
 
     def get_private_ip_address(self, instance_name):
         try:
-            result = GCPMeta().get_instance(instance_name)
+            result = self.get_instance(instance_name)
             for i in result['networkInterfaces']:
                 return i['networkIP']
         except Exception as err:
@@ -704,7 +704,7 @@ class GCPMeta:
 
     def dataproc_waiter(self, labels):
         if os.path.exists(
-                '/response/.emr_creating_' + os.environ['exploratory_name']) 
or GCPMeta().get_not_configured_dataproc(
+                '/response/.emr_creating_' + os.environ['exploratory_name']) 
or self.get_not_configured_dataproc(
                 os.environ['notebook_instance_name']):
             with hide('stderr', 'running', 'warnings'):
                 local("echo 'Some Dataproc cluster is still being 
created/terminated, waiting..'")
@@ -742,10 +742,10 @@ class GCPMeta:
         try:
             private_list_ip = []
             if conf_type == 'edge_node' or conf_type == 'exploratory':
-                private_list_ip.append(GCPMeta().get_private_ip_address(
+                private_list_ip.append(self.get_private_ip_address(
                 instance_id))
             elif conf_type == 'computational_resource':
-                instance_list = GCPMeta().get_list_instances_by_label(
+                instance_list = self.get_list_instances_by_label(
                     os.environ['gcp_zone'], instance_id)
                 for instance in instance_list.get('items'):
                     
private_list_ip.append(instance.get('networkInterfaces')[0].get('networkIP'))
diff --git 
a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
 
b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
index d06e7b1..215fe65 100644
--- 
a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
+++ 
b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
@@ -149,7 +149,7 @@ if __name__ == "__main__":
         dataproc_conf['cluster_name'] = 
'{0}-{1}-{2}-des-{3}'.format(dataproc_conf['service_base_name'],
                                                                      
dataproc_conf['project_name'],
                                                                      
dataproc_conf['endpoint_name'],
-                                                                     
dataproc_conf['exploratory_name'])
+                                                                     
dataproc_conf['computational_name'])
         dataproc_conf['cluster_tag'] = 
'{0}-{1}-{2}-ps'.format(dataproc_conf['service_base_name'],
                                                                
dataproc_conf['project_name'],
                                                                
dataproc_conf['endpoint_name'])
diff --git 
a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py 
b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
index 5a25e39..fa551c0 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
@@ -92,6 +92,7 @@ if __name__ == "__main__":
         notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
         notebook_config['zone'] = os.environ['gcp_zone']
         notebook_config['shared_image_enabled'] = 
os.environ['conf_shared_image_enabled']
+        notebook_config['ip_address'] = 
GCPMeta.get_private_ip_address(notebook_config['instance_name'])
         notebook_config['rstudio_pass'] = dlab.fab.id_generator()
     except Exception as err:
         dlab.fab.append_result("Failed to generate variables dictionary", 
str(err))
@@ -165,7 +166,7 @@ if __name__ == "__main__":
         params = "--hostname {0}  --keyfile {1} " \
                  "--region {2} --rstudio_pass {3} " \
                  "--rstudio_version {4} --os_user {5} " \
-                 "--r_mirror {6} --ip_adress {7} --exploratory_name {8} 
--edge_ip {9}" \
+                 "--r_mirror {6} --ip_address {7} --exploratory_name {8} 
--edge_ip {9}" \
             .format(instance_hostname, notebook_config['ssh_key_path'],
                     os.environ['gcp_region'], notebook_config['rstudio_pass'],
                     os.environ['notebook_rstudio_version'], 
notebook_config['dlab_ssh_user'],
diff --git 
a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py 
b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
index a2878b8..638bac0 100644
--- a/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
+++ b/infrastructure-provisioning/src/rstudio/scripts/configure_rstudio_node.py
@@ -40,7 +40,7 @@ parser.add_argument('--os_user', type=str, default='')
 parser.add_argument('--rstudio_pass', type=str, default='')
 parser.add_argument('--rstudio_version', type=str, default='')
 parser.add_argument('--r_mirror', type=str, default='')
-parser.add_argument('--ip_adress', type=str, default='')
+parser.add_argument('--ip_address', type=str, default='')
 parser.add_argument('--exploratory_name', type=str, default='')
 parser.add_argument('--edge_ip', type=str, default='')
 args = parser.parse_args()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to