You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dm...@apache.org on 2019/10/16 14:46:07 UTC

[incubator-dlab] branch DLAB-1107 updated: [DLAB-1107] Added image_enabled parameter and shared image functionality[All clouds]

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

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


The following commit(s) were added to refs/heads/DLAB-1107 by this push:
     new a5c77b3  [DLAB-1107] Added image_enabled parameter and shared image functionality[All clouds]
a5c77b3 is described below

commit a5c77b349b7f7a32df4b60d6550af112cfd3ca1a
Author: Demyan Mysakovets <de...@gmail.com>
AuthorDate: Wed Oct 16 17:45:47 2019 +0300

    [DLAB-1107] Added image_enabled parameter and shared image functionality[All clouds]
---
 .../general/scripts/aws/common_prepare_notebook.py | 16 ++++------
 .../general/scripts/aws/deeplearning_configure.py  |  4 +--
 .../src/general/scripts/aws/jupyter_configure.py   |  4 +--
 .../src/general/scripts/aws/rstudio_configure.py   |  4 +--
 .../scripts/aws/tensor-rstudio_configure.py        |  4 +--
 .../src/general/scripts/aws/tensor_configure.py    |  4 +--
 .../src/general/scripts/aws/zeppelin_configure.py  |  4 +--
 .../scripts/azure/deeplearning_configure.py        | 36 +++++++++++++++++-----
 .../src/general/scripts/azure/jupyter_configure.py |  4 +--
 .../src/general/scripts/azure/rstudio_configure.py | 36 +++++++++++++++++-----
 .../src/general/scripts/azure/tensor_configure.py  | 36 +++++++++++++++++-----
 .../general/scripts/azure/zeppelin_configure.py    | 36 +++++++++++++++++-----
 .../general/scripts/gcp/common_prepare_notebook.py | 18 ++++++++---
 .../general/scripts/gcp/deeplearning_configure.py  | 32 +++++++++++++------
 .../src/general/scripts/gcp/jupyter_configure.py   |  4 +--
 .../src/general/scripts/gcp/rstudio_configure.py   | 33 ++++++++++++++------
 .../scripts/gcp/tensor-rstudio_configure.py        | 33 ++++++++++++++------
 .../src/general/scripts/gcp/tensor_configure.py    | 32 +++++++++++++------
 .../src/general/scripts/gcp/zeppelin_configure.py  | 33 ++++++++++++++------
 19 files changed, 262 insertions(+), 111 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
index 654e161..922625c 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/common_prepare_notebook.py
@@ -75,23 +75,19 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
 
-    if os.environ['conf_image_enabled'] == 'true' and os.environ['conf_shared_image_enabled'] == 'false':
+    if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(notebook_config['service_base_name'],
                                                                                          os.environ['endpoint_name'],
                                                                                          os.environ['project_name'],
                                                                                          os.environ['application'])
-        notebook_config['notebook_image_name'] = (lambda x: '{0}-{1}-{2}-{3}'.format(notebook_config['service_base_name'],
-                                                                                     os.environ['project_name'],
-                                                                                     os.environ['application'],
-                                                                                     os.environ['notebook_image_name'].lower().replace('_', '-')) if (x != 'None' and x != '')
-        else notebook_config['expected_image_name'])(str(os.environ.get('notebook_image_name')))
     else:
-          notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(notebook_config['service_base_name'],
+        notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(notebook_config['service_base_name'],
                                                                                        os.environ['endpoint_name'],
                                                                                        os.environ['application'])
-          notebook_config['notebook_image_name'] = (lambda x: '{0}-{1}-{2}'.format(notebook_config['service_base_name'],
-                                                                                      os.environ['application'],
-                                                                                      os.environ['notebook_image_name'].lower().replace('_', '-')) if (x != 'None' and x != '')
+    notebook_config['notebook_image_name'] = (lambda x: '{0}-{1}-{2}-{3}'.format(notebook_config['service_base_name'],
+                                                                                 os.environ['project_name'],
+                                                                                 os.environ['application'],
+                                                                                 os.environ['notebook_image_name'].lower().replace('_', '-')) if (x != 'None' and x != '')
         else notebook_config['expected_image_name'])(str(os.environ.get('notebook_image_name')))
     print('Searching pre-configured images')
     notebook_config['ami_id'] = get_ami_id(os.environ['aws_{}_image_name'.format(os.environ['conf_os_family'])])
diff --git a/infrastructure-provisioning/src/general/scripts/aws/deeplearning_configure.py b/infrastructure-provisioning/src/general/scripts/aws/deeplearning_configure.py
index 0be7104..42fae19 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/deeplearning_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/deeplearning_configure.py
@@ -57,6 +57,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -75,8 +77,6 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     notebook_config['ip_address'] = get_instance_ip_address(notebook_config['tag_name'], notebook_config['instance_name']).get('Private')
 
     # generating variables regarding EDGE proxy on Notebook instance
diff --git a/infrastructure-provisioning/src/general/scripts/aws/jupyter_configure.py b/infrastructure-provisioning/src/general/scripts/aws/jupyter_configure.py
index d77463c..d00daff 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/jupyter_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/jupyter_configure.py
@@ -57,6 +57,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(notebook_config['service_base_name'],
                                                                                          os.environ['endpoint_name'],
@@ -73,8 +75,6 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
     notebook_config['ip_address'] = get_instance_ip_address(notebook_config['tag_name'], notebook_config['instance_name']).get('Private')
 
     # generating variables regarding EDGE proxy on Notebook instance
diff --git a/infrastructure-provisioning/src/general/scripts/aws/rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/aws/rstudio_configure.py
index 031bf41..6eaa737 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/rstudio_configure.py
@@ -58,6 +58,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -77,8 +79,6 @@ if __name__ == "__main__":
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['rstudio_pass'] = id_generator()
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     notebook_config['ip_address'] = get_instance_ip_address(notebook_config['tag_name'], notebook_config['instance_name']).get('Private')
 
     # generating variables regarding EDGE proxy on Notebook instance
diff --git a/infrastructure-provisioning/src/general/scripts/aws/tensor-rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/aws/tensor-rstudio_configure.py
index 087dac3..deaff6c 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/tensor-rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/tensor-rstudio_configure.py
@@ -59,6 +59,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -77,8 +79,6 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     notebook_config['ip_address'] = get_instance_ip_address(notebook_config['tag_name'],
                                                             notebook_config['instance_name']).get('Private')
     tag = {"Key": notebook_config['tag_name'],
diff --git a/infrastructure-provisioning/src/general/scripts/aws/tensor_configure.py b/infrastructure-provisioning/src/general/scripts/aws/tensor_configure.py
index 44406e9..0cdbde7 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/tensor_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/tensor_configure.py
@@ -59,6 +59,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -77,8 +79,6 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     tag = {"Key": notebook_config['tag_name'],
            "Value": "{}-{}-subnet".format(notebook_config['service_base_name'], os.environ['project_name'])}
     notebook_config['subnet_cidr'] = get_subnet_by_tag(tag)
diff --git a/infrastructure-provisioning/src/general/scripts/aws/zeppelin_configure.py b/infrastructure-provisioning/src/general/scripts/aws/zeppelin_configure.py
index 846346a..2b6d196 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/zeppelin_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/zeppelin_configure.py
@@ -59,6 +59,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{}-{}-nb-{}-{}'.format(notebook_config['service_base_name'],
                                                                os.environ['project_name'],
                                                                notebook_config['exploratory_name'], args.uuid)
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if os.environ['conf_shared_image_enabled'] == 'false':
         notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -77,8 +79,6 @@ if __name__ == "__main__":
                                                                   os.environ['project_name'])
     notebook_config['tag_name'] = '{}-Tag'.format(notebook_config['service_base_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     notebook_config['ip_address'] = get_instance_ip_address(notebook_config['tag_name'], notebook_config['instance_name']).get('Private')
 
     region = os.environ['aws_region']
diff --git a/infrastructure-provisioning/src/general/scripts/azure/deeplearning_configure.py b/infrastructure-provisioning/src/general/scripts/azure/deeplearning_configure.py
index db51380..86b4030 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/deeplearning_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/deeplearning_configure.py
@@ -57,11 +57,32 @@ if __name__ == "__main__":
         notebook_config['instance_name'] = '{}-{}-nb-{}'.format(notebook_config['service_base_name'],
                                                                 notebook_config['project_name'],
                                                                 notebook_config['exploratory_name'])
-        notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
-            notebook_config['service_base_name'],
-            notebook_config['endpoint_name'],
-            notebook_config['project_name'],
-            os.environ['application'])
+        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+        if notebook_config['shared_image_enabled'] == 'false':
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                notebook_config['project_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "project_tag": notebook_config['project_tag'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
+        else:
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
         notebook_config['notebook_image_name'] = str(os.environ.get('notebook_image_name'))
         notebook_config['security_group_name'] = '{}-{}-nb-sg'.format(notebook_config['service_base_name'],
                                                                       notebook_config['project_name'])
@@ -73,7 +94,6 @@ if __name__ == "__main__":
                                    "endpoint_tag": notebook_config['endpoint_tag'],
                                    "Exploratory": notebook_config['exploratory_name'],
                                    os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
-        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         notebook_config['ip_address'] = AzureMeta().get_private_ip_address(notebook_config['resource_group_name'],
                                                         notebook_config['instance_name'])
 
@@ -237,7 +257,7 @@ if __name__ == "__main__":
         AzureActions().remove_instance(notebook_config['resource_group_name'], notebook_config['instance_name'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             image = AzureMeta().get_image(notebook_config['resource_group_name'], notebook_config['expected_image_name'])
@@ -248,7 +268,7 @@ if __name__ == "__main__":
                                                           notebook_config['instance_name'],
                                                           os.environ['azure_region'],
                                                           notebook_config['expected_image_name'],
-                                                          json.dumps(notebook_config['tags']))
+                                                          json.dumps(notebook_config['image_tags']))
                 print("Image was successfully created.")
                 local("~/scripts/{}.py".format('common_prepare_notebook'))
                 instance_running = False
diff --git a/infrastructure-provisioning/src/general/scripts/azure/jupyter_configure.py b/infrastructure-provisioning/src/general/scripts/azure/jupyter_configure.py
index 76b4be7..273352a 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/jupyter_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/jupyter_configure.py
@@ -56,6 +56,8 @@ if __name__ == "__main__":
         notebook_config['instance_name'] = '{}-{}-nb-{}'.format(notebook_config['service_base_name'],
                                                                 notebook_config['project_name'],
                                                                 notebook_config['exploratory_name'])
+        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         if notebook_config['shared_image_enabled'] == 'false':
             notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
             notebook_config['service_base_name'],
@@ -91,8 +93,6 @@ if __name__ == "__main__":
                                    "endpoint_tag": notebook_config['endpoint_tag'],
                                    "Exploratory": notebook_config['exploratory_name'],
                                    os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
-        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         notebook_config['ip_address'] = AzureMeta().get_private_ip_address(notebook_config['resource_group_name'],
                                                         notebook_config['instance_name'])
 
diff --git a/infrastructure-provisioning/src/general/scripts/azure/rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/azure/rstudio_configure.py
index 98a904b..c67423b 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/rstudio_configure.py
@@ -57,11 +57,32 @@ if __name__ == "__main__":
         notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                 notebook_config['project_name'],
                                                                 notebook_config['exploratory_name'])
-        notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
-            notebook_config['service_base_name'],
-            notebook_config['endpoint_name'],
-            notebook_config['project_name'],
-            os.environ['application'])
+        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+        if notebook_config['shared_image_enabled'] == 'false':
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                notebook_config['project_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "project_tag": notebook_config['project_tag'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
+        else:
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
         notebook_config['notebook_image_name'] = str(os.environ.get('notebook_image_name'))
         notebook_config['security_group_name'] = '{}-{}-nb-sg'.format(notebook_config['service_base_name'],
                                                                       notebook_config['project_name'])
@@ -73,7 +94,6 @@ if __name__ == "__main__":
                                    "endpoint_tag": notebook_config['endpoint_tag'],
                                    "Exploratory": notebook_config['exploratory_name'],
                                    os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
-        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         notebook_config['ip_address'] = AzureMeta().get_private_ip_address(notebook_config['resource_group_name'],
                                                                            notebook_config['instance_name'])
 
@@ -239,7 +259,7 @@ if __name__ == "__main__":
         AzureActions().remove_instance(notebook_config['resource_group_name'], notebook_config['instance_name'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             image = AzureMeta().get_image(notebook_config['resource_group_name'], notebook_config['expected_image_name'])
@@ -250,7 +270,7 @@ if __name__ == "__main__":
                                                           notebook_config['instance_name'],
                                                           os.environ['azure_region'],
                                                           notebook_config['expected_image_name'],
-                                                          json.dumps(notebook_config['tags']))
+                                                          json.dumps(notebook_config['image_tags']))
                 print("Image was successfully created.")
                 local("~/scripts/{}.py".format('common_prepare_notebook'))
                 instance_running = False
diff --git a/infrastructure-provisioning/src/general/scripts/azure/tensor_configure.py b/infrastructure-provisioning/src/general/scripts/azure/tensor_configure.py
index cc1f3ac..e8b5b3c 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/tensor_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/tensor_configure.py
@@ -59,11 +59,32 @@ if __name__ == "__main__":
         notebook_config['instance_name'] = '{}-{}-nb-{}'.format(notebook_config['service_base_name'],
                                                                 notebook_config['project_name'],
                                                                 notebook_config['exploratory_name'])
-        notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
-            notebook_config['service_base_name'],
-            notebook_config['endpoint_name'],
-            notebook_config['project_name'],
-            os.environ['application'])
+        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+        if notebook_config['shared_image_enabled'] == 'false':
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                notebook_config['project_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "project_tag": notebook_config['project_tag'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
+        else:
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
         notebook_config['notebook_image_name'] = str(os.environ.get('notebook_image_name'))
         notebook_config['security_group_name'] = '{}-{}-nb-sg'.format(notebook_config['service_base_name'],
                                                                       notebook_config['project_name'])
@@ -75,7 +96,6 @@ if __name__ == "__main__":
                                    "endpoint_tag": notebook_config['endpoint_tag'],
                                    "Exploratory": notebook_config['exploratory_name'],
                                    os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
-        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         notebook_config['ip_address'] = AzureMeta().get_private_ip_address(notebook_config['resource_group_name'],
                                                         notebook_config['instance_name'])
 
@@ -235,7 +255,7 @@ if __name__ == "__main__":
         AzureActions().remove_instance(notebook_config['resource_group_name'], notebook_config['instance_name'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             image = AzureMeta().get_image(notebook_config['resource_group_name'], notebook_config['expected_image_name'])
@@ -246,7 +266,7 @@ if __name__ == "__main__":
                                                           notebook_config['instance_name'],
                                                           os.environ['azure_region'],
                                                           notebook_config['expected_image_name'],
-                                                          json.dumps(notebook_config['tags']))
+                                                          json.dumps(notebook_config['image_tags']))
                 print("Image was successfully created.")
                 local("~/scripts/{}.py".format('common_prepare_notebook'))
                 instance_running = False
diff --git a/infrastructure-provisioning/src/general/scripts/azure/zeppelin_configure.py b/infrastructure-provisioning/src/general/scripts/azure/zeppelin_configure.py
index 93c914e..749c73e 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/zeppelin_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/zeppelin_configure.py
@@ -58,11 +58,32 @@ if __name__ == "__main__":
         notebook_config['instance_name'] = '{}-{}-nb-{}'.format(notebook_config['service_base_name'],
                                                                 notebook_config['project_name'],
                                                                 notebook_config['exploratory_name'])
-        notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
-            notebook_config['service_base_name'],
-            notebook_config['endpoint_name'],
-            notebook_config['project_name'],
-            os.environ['application'])
+        notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+        if notebook_config['shared_image_enabled'] == 'false':
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-{3}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                notebook_config['project_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "project_tag": notebook_config['project_tag'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
+        else:
+            notebook_config['expected_image_name'] = '{0}-{1}-{2}-notebook-image'.format(
+                notebook_config['service_base_name'],
+                notebook_config['endpoint_name'],
+                os.environ['application'])
+            notebook_config['image_tags'] = {"Name": notebook_config['instance_name'],
+                                             "SBN": notebook_config['service_base_name'],
+                                             "User": notebook_config['user_name'],
+                                             "endpoint_tag": notebook_config['endpoint_tag'],
+                                             "Exploratory": notebook_config['exploratory_name'],
+                                             os.environ['conf_billing_tag_key']: os.environ['conf_billing_tag_value']}
         notebook_config['notebook_image_name'] = str(os.environ.get('notebook_image_name'))
         notebook_config['security_group_name'] = '{}-{}-nb-sg'.format(notebook_config['service_base_name'],
                                                                       notebook_config['project_name'])
@@ -74,7 +95,6 @@ if __name__ == "__main__":
                                    "endpoint_tag": notebook_config['endpoint_tag'],
                                    "Exploratory": notebook_config['exploratory_name'],
                                    "product": "dlab"}
-        notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
         notebook_config['ip_address'] = AzureMeta().get_private_ip_address(notebook_config['resource_group_name'],
                                                         notebook_config['instance_name'])
 
@@ -250,7 +270,7 @@ if __name__ == "__main__":
         AzureActions().remove_instance(notebook_config['resource_group_name'], notebook_config['instance_name'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             image = AzureMeta().get_image(notebook_config['resource_group_name'], notebook_config['expected_image_name'])
@@ -261,7 +281,7 @@ if __name__ == "__main__":
                                                           notebook_config['instance_name'],
                                                           os.environ['azure_region'],
                                                           notebook_config['expected_image_name'],
-                                                          json.dumps(notebook_config['tags']))
+                                                          json.dumps(notebook_config['image_tags']))
                 print("Image was successfully created.")
                 local("~/scripts/{}.py".format('common_prepare_notebook'))
                 instance_running = False
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 e9ed0a8..c91a871 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/common_prepare_notebook.py
@@ -89,11 +89,19 @@ if __name__ == "__main__":
     notebook_config['primary_disk_size'] = (lambda x: '30' if x == 'deeplearning' else '12')(os.environ['application'])
     notebook_config['secondary_disk_size'] = os.environ['notebook_disk_size']
 
-
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
     notebook_config['notebook_primary_image_name'] = (lambda x: os.environ['notebook_primary_image_name'] if x != 'None'
         else notebook_config['expected_primary_image_name'])(str(os.environ.get('notebook_primary_image_name')))
     print('Searching pre-configured images')
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
index 052bb74..8bc9d03 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
@@ -53,10 +53,27 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "project_tag": notebook_config['project_tag'],
+                                           "product": "dlab"}
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "product": "dlab"}
     # generating variables regarding EDGE proxy on Notebook instance
     instance_hostname = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     edge_instance_name = '{0}-{1}-edge'.format(notebook_config['service_base_name'], notebook_config['project_name'])
@@ -66,10 +83,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['image_labels'] = {"sbn": notebook_config['service_base_name'],
-                                       "project_tag": notebook_config['project_tag'],
-                                       "endpoint_tag": notebook_config['endpoint_tag'],
-                                       "product": "dlab"}
+
     try:
         if os.environ['conf_os_family'] == 'debian':
             initial_user = 'ubuntu'
@@ -190,7 +204,7 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             primary_image_id = GCPMeta().get_image_by_name(notebook_config['expected_primary_image_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
index 92fdce7..759fc62 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
@@ -53,6 +53,8 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
     if notebook_config['shared_image_enabled'] == 'false':
         notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
                                                         notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'], os.environ['application'])
@@ -77,8 +79,6 @@ if __name__ == "__main__":
     notebook_config['ssh_key_path'] = '{0}{1}.pem'.format(os.environ['conf_key_dir'], os.environ['conf_key_name'])
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
     notebook_config['zone'] = os.environ['gcp_zone']
-    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
 
     try:
         if os.environ['conf_os_family'] == 'debian':
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
index 38d82c0..63c8dee 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
@@ -54,10 +54,27 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "project_tag": notebook_config['project_tag'],
+                                           "product": "dlab"}
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "product": "dlab"}
     # generating variables regarding EDGE proxy on Notebook instance
     instance_hostname = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     edge_instance_name = '{0}-{1}-edge'.format(notebook_config['service_base_name'], notebook_config['project_name'])
@@ -68,11 +85,7 @@ if __name__ == "__main__":
     notebook_config['zone'] = os.environ['gcp_zone']
     notebook_config['ip_address'] = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     notebook_config['rstudio_pass'] = id_generator()
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
-    notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
-                                       "project_tag": notebook_config['project_tag'],
-                                       "endpoint_tag": notebook_config['endpoint_tag'],
-                                       "product": "dlab"}
+
     try:
         if os.environ['conf_os_family'] == 'debian':
             initial_user = 'ubuntu'
@@ -195,7 +208,7 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
         
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             primary_image_id = GCPMeta().get_image_by_name(notebook_config['expected_primary_image_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/tensor-rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/tensor-rstudio_configure.py
index 12621fa..c6a39c2 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/tensor-rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/tensor-rstudio_configure.py
@@ -59,10 +59,27 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "project_tag": notebook_config['project_tag'],
+                                           "product": "dlab"}
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "product": "dlab"}
 
     # generating variables regarding EDGE proxy on Notebook instance
     instance_hostname = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
@@ -73,11 +90,7 @@ if __name__ == "__main__":
     notebook_config['dlab_ssh_user'] = os.environ['conf_os_user']
     notebook_config['zone'] = os.environ['gcp_zone']
     notebook_config['rstudio_pass'] = id_generator()
-    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
-    notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
-                                       "project_tag": notebook_config['project_tag'],
-                                       "endpoint_tag": notebook_config['endpoint_tag'],
-                                       "product": "dlab"}
+
     try:
         if os.environ['conf_os_family'] == 'debian':
             initial_user = 'ubuntu'
@@ -198,7 +211,7 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             primary_image_id = GCPMeta().get_image_by_name(notebook_config['expected_primary_image_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
index a813067..053cfc7 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
@@ -55,10 +55,27 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "project_tag": notebook_config['project_tag'],
+                                           "product": "dlab"}
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "product": "dlab"}
     # generating variables regarding EDGE proxy on Notebook instance
     instance_hostname = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     edge_instance_name = '{0}-{1}-edge'.format(notebook_config['service_base_name'], notebook_config['project_name'])
@@ -68,10 +85,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['image_labels'] = {"sbn": notebook_config['service_base_name'],
-                                       "project_tag": notebook_config['project_tag'],
-                                       "endpoint_tag": notebook_config['endpoint_tag'],
-                                       "product": "dlab"}
+
     try:
         if os.environ['conf_os_family'] == 'debian':
             initial_user = 'ubuntu'
@@ -189,7 +203,7 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             primary_image_id = GCPMeta().get_image_by_name(notebook_config['expected_primary_image_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
index 8952177..d0f2fe5 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
@@ -55,10 +55,27 @@ if __name__ == "__main__":
     notebook_config['instance_name'] = '{0}-{1}-nb-{2}'.format(notebook_config['service_base_name'],
                                                                notebook_config['project_name'],
                                                                notebook_config['exploratory_name'])
-    notebook_config['expected_primary_image_name'] = '{}-{}-notebook-primary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
-    notebook_config['expected_secondary_image_name'] = '{}-{}-notebook-secondary-image'.format(
-                                                        notebook_config['service_base_name'], os.environ['application'])
+    notebook_config['image_enabled'] = os.environ['conf_image_enabled']
+    notebook_config['shared_image_enabled'] = os.environ['conf_shared_image_enabled']
+    if notebook_config['shared_image_enabled'] == 'false':
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], notebook_config['project_name'],
+            os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "project_tag": notebook_config['project_tag'],
+                                           "product": "dlab"}
+    else:
+        notebook_config['expected_primary_image_name'] = '{}-{}-{}-primary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['expected_secondary_image_name'] = '{}-{}-{}-secondary-image'.format(
+            notebook_config['service_base_name'], notebook_config['endpoint_tag'], os.environ['application'])
+        notebook_config['image_labels'] = {"sbn": notebook_config['service_base_name'],
+                                           "endpoint_tag": notebook_config['endpoint_tag'],
+                                           "product": "dlab"}
     # generating variables regarding EDGE proxy on Notebook instance
     instance_hostname = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     edge_instance_name = '{0}-{1}-edge'.format(notebook_config['service_base_name'], notebook_config['project_name'])
@@ -67,11 +84,7 @@ if __name__ == "__main__":
     notebook_config['ssh_key_path'] = '{0}{1}.pem'.format(os.environ['conf_key_dir'], os.environ['conf_key_name'])
     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['image_labels'] = {"sbn": notebook_config['service_base_name'],
-                                       "project_tag": notebook_config['project_tag'],
-                                       "endpoint_tag": notebook_config['endpoint_tag'],
-                                       "product": "dlab"}
+
     try:
         if os.environ['conf_os_family'] == 'debian':
             initial_user = 'ubuntu'
@@ -207,7 +220,7 @@ if __name__ == "__main__":
         sys.exit(1)
 
 
-    if notebook_config['shared_image_enabled'] == 'true':
+    if notebook_config['image_enabled'] == 'true':
         try:
             print('[CREATING IMAGE]')
             primary_image_id = GCPMeta().get_image_by_name(notebook_config['expected_primary_image_name'])


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