You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by lf...@apache.org on 2020/03/04 09:47:40 UTC

[incubator-dlab] branch DLAB-1539 updated: DLAB-1539 added check if custom tag is defined

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

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


The following commit(s) were added to refs/heads/DLAB-1539 by this push:
     new a7c9a81  DLAB-1539 added check if custom tag is defined
a7c9a81 is described below

commit a7c9a8116000c5d6b23bcb08a8523974d121e18f
Author: Frolov Leonid <fr...@gmail.com>
AuthorDate: Wed Mar 4 11:47:19 2020 +0200

    DLAB-1539 added check if custom tag is defined
---
 .../scripts/gcp/common_notebook_configure_dataengine-service.py    | 5 ++---
 .../src/general/scripts/gcp/common_prepare_notebook.py             | 5 ++---
 .../src/general/scripts/gcp/dataengine-service_prepare.py          | 5 ++---
 .../src/general/scripts/gcp/dataengine_prepare.py                  | 7 +++----
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py b/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
index 010fad9..14edcdf 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_notebook_configure_dataengine-service.py
@@ -70,7 +70,6 @@ if __name__ == "__main__":
     else:
         notebook_config['user_tag'] = additional_tags['user_tag']
 
-    notebook_config['custom_tag'] = additional_tags['custom_tag']
     notebook_config['cluster_labels'] = {
         os.environ['notebook_instance_name']: "configured",
         "name": notebook_config['cluster_name'],
@@ -82,8 +81,8 @@ if __name__ == "__main__":
         "product": "dlab",
         "computational_name": (os.environ['computational_name']).lower().replace('_', '-')
     }
-    if notebook_config['custom_tag'] != '':
-        notebook_config['cluster_labels'].update({'custom_tag': notebook_config['custom_tag']})
+    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
+        notebook_config['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     try:
         logging.info('[INSTALLING KERNELS INTO SPECIFIED NOTEBOOK]')
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
index 39c93e1..ea41d99 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
@@ -139,7 +139,6 @@ if __name__ == "__main__":
     else:
         notebook_config['user_tag'] = additional_tags['user_tag']
 
-    notebook_config['custom_tag'] = additional_tags['custom_tag']
     print('Additional tags will be added: {}'.format(additional_tags))
     notebook_config['labels'] = {"name": notebook_config['instance_name'],
                                  "sbn": notebook_config['service_base_name'],
@@ -149,8 +148,8 @@ if __name__ == "__main__":
                                  "product": "dlab"
                                  }
 
-    if notebook_config['custom_tag'] != '':
-        notebook_config['labels'].update({'custom_tag': notebook_config['custom_tag']})
+    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
+        notebook_config['labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     # launching instance for notebook server
     try:
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
index 17fc776..cbeb85c 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_prepare.py
@@ -83,7 +83,6 @@ if __name__ == "__main__":
     else:
         dataproc_conf['user_tag'] = additional_tags['user_tag']
 
-    dataproc_conf['custom_tag'] = additional_tags['custom_tag']
     dataproc_conf['cluster_labels'] = {
         os.environ['notebook_instance_name']: "not-configured",
         "name": dataproc_conf['cluster_name'],
@@ -95,8 +94,8 @@ if __name__ == "__main__":
         "product": "dlab",
         "computational_name": dataproc_conf['computational_name']
     }
-    if dataproc_conf['custom_tag'] != '':
-        dataproc_conf['cluster_labels'].update({'custom_tag': dataproc_conf['custom_tag']})
+    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
+        dataproc_conf['cluster_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     dataproc_conf['dataproc_service_account_name'] = '{0}-{1}-ps'.format(dataproc_conf['service_base_name'],
                                                                          dataproc_conf['project_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
index 4046abb..a546592 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_prepare.py
@@ -150,7 +150,6 @@ if __name__ == "__main__":
     else:
         data_engine['user_tag'] = additional_tags['user_tag']
 
-    data_engine['custom_tag'] = additional_tags['custom_tag']
     data_engine['slave_labels'] = {"name": data_engine['cluster_name'],
                                    "sbn": data_engine['service_base_name'],
                                    "user": data_engine['user_tag'],
@@ -167,9 +166,9 @@ if __name__ == "__main__":
                                     "type": "master",
                                     "notebook_name": data_engine['notebook_name'],
                                     "product": "dlab"}
-    if data_engine['custom_tag'] != '':
-        data_engine['slave_labels'].update({'custom_tag': data_engine['custom_tag']})
-        data_engine['master_labels'].update({'custom_tag': data_engine['custom_tag']})
+    if additional_tags['custom_tag'] and additional_tags['custom_tag'] != '':
+        data_engine['slave_labels'].update({'custom_tag': additional_tags['custom_tag']})
+        data_engine['master_labels'].update({'custom_tag': additional_tags['custom_tag']})
 
     try:
         logging.info('[CREATE MASTER NODE]')


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