You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2019/03/13 12:49:00 UTC

[incubator-dlab] branch DLAB-253 updated: added reverse proxy to all notebooks and dataengine

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

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


The following commit(s) were added to refs/heads/DLAB-253 by this push:
     new 1426dfd  added reverse proxy to all notebooks and dataengine
1426dfd is described below

commit 1426dfd8f1a0ea32140200900ed394bdf1aaa453
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Wed Mar 13 14:48:52 2019 +0200

    added reverse proxy to all notebooks and dataengine
---
 .../scripts/aws/dataengine-service_configure.py    |  6 ++-
 .../scripts/gcp/dataengine-service_configure.py    | 18 +++++---
 .../general/scripts/gcp/dataengine_configure.py    | 51 ++++++++++++++++++++-
 .../general/scripts/gcp/deeplearning_configure.py  | 52 +++++++++++++++++++---
 .../src/general/scripts/gcp/jupyter_configure.py   | 14 +++++-
 .../src/general/scripts/gcp/rstudio_configure.py   | 43 +++++++++++++++++-
 .../src/general/scripts/gcp/tensor_configure.py    | 51 +++++++++++++++++++--
 .../src/general/scripts/gcp/zeppelin_configure.py  | 44 +++++++++++++++++-
 8 files changed, 255 insertions(+), 24 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
index 9f10d41..f5594b2 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/dataengine-service_configure.py
@@ -222,7 +222,7 @@ if __name__ == "__main__":
                                                                emr_conf['edge_instance_name']).get('Private')
     else:
         emr_conf['edge_instance_ip'] = get_instance_ip_address(emr_conf['tag_name'],
-                                                                             emr_conf['edge_instance_name']).get('Public')
+                                                               emr_conf['edge_instance_name']).get('Public')
     emr_conf['user_keyname'] = os.environ['edge_user_name']
     emr_conf['os_user'] = os.environ['conf_os_user']
     emr_conf['initial_user'] = 'ec2-user'
@@ -247,7 +247,9 @@ if __name__ == "__main__":
         logging.info('[SUMMARY]')
         ip_address = emr_conf['cluster_master_instances'][0].get('PrivateIpAddress')
         emr_master_url = "http://" + ip_address + ":8088"
-        emr_master_acces_url = "http://" + emr_conf['edge_instance_ip'] + "/{}/".format(emr_conf['exploratory_name'] + '_' + emr_conf['computational_name'])
+        emr_master_acces_url = "http://" + emr_conf['edge_instance_ip'] + "/{}/".format(emr_conf['exploratory_name'] +
+                                                                                        '_' +
+                                                                                        emr_conf['computational_name'])
         logging.info('[SUMMARY]')
         print('[SUMMARY]')
         print("Service base name: {}".format(emr_conf['service_base_name']))
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 29dcc26..02964cf 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine-service_configure.py
@@ -64,7 +64,8 @@ def configure_dataengine_service(instance, dataproc_conf):
             env.key_filename = "{}".format(dataproc_conf['key_path'])
             env.host_string = dataproc_conf['dlab_ssh_user'] + '@' + dataproc_conf['instance_ip']
             install_os_pkg(['python-pip', 'python3-pip'])
-            configure_data_engine_service_pip(dataproc_conf['instance_ip'], dataproc_conf['dlab_ssh_user'], dataproc_conf['key_path'])
+            configure_data_engine_service_pip(dataproc_conf['instance_ip'], dataproc_conf['dlab_ssh_user'],
+                                              dataproc_conf['key_path'])
         except:
             traceback.print_exc()
             raise Exception
@@ -98,11 +99,16 @@ if __name__ == "__main__":
     dataproc_conf['key_path'] = '{0}{1}.pem'.format(os.environ['conf_key_dir'], os.environ['conf_key_name'])
     dataproc_conf['region'] = os.environ['gcp_region']
     dataproc_conf['zone'] = os.environ['gcp_zone']
-    dataproc_conf['subnet'] = '{0}-{1}-subnet'.format(dataproc_conf['service_base_name'], dataproc_conf['edge_user_name'])
-    dataproc_conf['cluster_name'] = '{0}-{1}-des-{2}-{3}'.format(dataproc_conf['service_base_name'], dataproc_conf['edge_user_name'],
-                                                                 dataproc_conf['exploratory_name'], dataproc_conf['computational_name'])
-    dataproc_conf['cluster_tag'] = '{0}-{1}-ps'.format(dataproc_conf['service_base_name'], dataproc_conf['edge_user_name'])
-    dataproc_conf['bucket_name'] = '{}-{}-bucket'.format(dataproc_conf['service_base_name'], dataproc_conf['edge_user_name'])
+    dataproc_conf['subnet'] = '{0}-{1}-subnet'.format(dataproc_conf['service_base_name'],
+                                                      dataproc_conf['edge_user_name'])
+    dataproc_conf['cluster_name'] = '{0}-{1}-des-{2}-{3}'.format(dataproc_conf['service_base_name'],
+                                                                 dataproc_conf['edge_user_name'],
+                                                                 dataproc_conf['exploratory_name'],
+                                                                 dataproc_conf['computational_name'])
+    dataproc_conf['cluster_tag'] = '{0}-{1}-ps'.format(dataproc_conf['service_base_name'],
+                                                       dataproc_conf['edge_user_name'])
+    dataproc_conf['bucket_name'] = '{}-{}-bucket'.format(dataproc_conf['service_base_name'],
+                                                         dataproc_conf['edge_user_name'])
     dataproc_conf['release_label'] = os.environ['dataproc_version']
     dataproc_conf['cluster_label'] = {os.environ['notebook_instance_name']: "not-configured"}
     dataproc_conf['dataproc_service_account_name'] = '{0}-{1}-ps'.format(dataproc_conf['service_base_name'],
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_configure.py
index 43fe231..9104bde 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/dataengine_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/dataengine_configure.py
@@ -206,6 +206,7 @@ if __name__ == "__main__":
         master_node_hostname = GCPMeta().get_private_ip_address(data_engine['master_node_name'])
         edge_instance_name = '{0}-{1}-edge'.format(data_engine['service_base_name'],
                                                    data_engine['edge_user_name'])
+        edge_instance_hostname = GCPMeta().get_instance_public_ip_by_name(edge_instance_name)
         data_engine['dlab_ssh_user'] = os.environ['conf_os_user']
         keyfile_name = "{}{}.pem".format(os.environ['conf_key_dir'], os.environ['conf_key_name'])
     except Exception as err:
@@ -342,8 +343,49 @@ if __name__ == "__main__":
         GCPActions().remove_instance(data_engine['master_node_name'], data_engine['zone'])
         sys.exit(1)
 
+    try:
+        print('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        logging.info('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        notebook_instance_ip = GCPMeta().get_private_ip_address(data_engine['notebook_name'])
+        additional_info = {
+            "computational_name": data_engine['computational_name'],
+            "master_node_hostname": master_node_hostname,
+            "notebook_instance_ip": notebook_instance_ip,
+            "instance_count": data_engine['instance_count'],
+            "master_node_name": data_engine['master_node_name'],
+            "slave_node_name": data_engine['slave_node_name'],
+            "tensor": False
+        }
+        params = "--edge_hostname {} " \
+                 "--keyfile {} " \
+                 "--os_user {} " \
+                 "--type {} " \
+                 "--exploratory_name {} " \
+                 "--additional_info '{}'"\
+            .format(edge_instance_hostname,
+                    keyfile_name,
+                    data_engine['dlab_ssh_user'],
+                    'spark',
+                    data_engine['exploratory_name'],
+                    json.dumps(additional_info))
+        try:
+            local("~/scripts/{}.py {}".format('common_configure_reverse_proxy', params))
+        except:
+            append_result("Failed edge reverse proxy template")
+            raise Exception
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        for i in range(data_engine['instance_count'] - 1):
+            slave_name = data_engine['slave_node_name'] + '{}'.format(i + 1)
+            GCPActions().remove_instance(slave_name, data_engine['zone'])
+        GCPActions().remove_instance(data_engine['master_node_name'], data_engine['zone'])
+        sys.exit(1)
 
     try:
+        ip_address = GCPMeta().get_private_ip_address(data_engine['master_node_name'])
+        spark_master_url = "http://" + ip_address + ":8080"
+        spark_master_acces_url = "http://" + edge_instance_hostname + "/{}/".format(
+            data_engine['exploratory_name'] + '_' + data_engine['computational_name'])
         logging.info('[SUMMARY]')
         print('[SUMMARY]')
         print("Service base name: {}".format(data_engine['service_base_name']))
@@ -356,7 +398,14 @@ if __name__ == "__main__":
             res = {"hostname": data_engine['cluster_name'],
                    "instance_id": data_engine['master_node_name'],
                    "key_name": data_engine['key_name'],
-                   "Action": "Create new Data Engine"}
+                   "Action": "Create new Data Engine",
+                   "computational_url": [
+                       {"description": "Apache Spark Master",
+                        "url": spark_master_acces_url},
+                       # {"description": "Apache Spark Master (via tunnel)",
+                       # "url": spark_master_url}
+                   ]
+                   }
             print(json.dumps(res))
             result.write(json.dumps(res))
     except:
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
index 24a9d4e..6b87bb3 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/deeplearning_configure.py
@@ -53,6 +53,7 @@ if __name__ == "__main__":
     # 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['edge_user_name'])
+    edge_instance_hostname = GCPMeta().get_instance_public_ip_by_name(edge_instance_name)
     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']
@@ -177,12 +178,46 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
+    try:
+        print('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        logging.info('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        additional_info = {
+            'instance_hostname': instance_hostname,
+            'tensor': True
+        }
+        params = "--edge_hostname {} " \
+                 "--keyfile {} " \
+                 "--os_user {} " \
+                 "--type {} " \
+                 "--exploratory_name {} " \
+                 "--additional_info '{}'"\
+            .format(edge_instance_hostname,
+                    notebook_config['ssh_key_path'],
+                    notebook_config['dlab_ssh_user'],
+                    'jupyter',
+                    notebook_config['exploratory_name'],
+                    json.dumps(additional_info))
+        try:
+            local("~/scripts/{}.py {}".format('common_configure_reverse_proxy', params))
+        except:
+            append_result("Failed edge reverse proxy template")
+            raise Exception
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        append_result("Failed to set edge reverse proxy template.", str(err))
+        GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
+        sys.exit(1)
+
     # generating output information
     ip_address = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     tensorboard_url = "http://" + ip_address + ":6006/"
-    jupyter_url = 'http://' + ip_address + ':8888/{}/'.format(notebook_config['exploratory_name'])
+    jupyter_ip_url = 'http://' + ip_address + ':8888/{}/'.format(notebook_config['exploratory_name'])
     ungit_ip_url = "http://" + ip_address + ":8085/{}-ungit/".format(
         notebook_config['exploratory_name'])
+    jupyter_notebook_acces_url = "http://" + edge_instance_hostname + "/{}/".format(notebook_config['exploratory_name'])
+    jupyter_ungit_acces_url = "http://" + edge_instance_hostname + "/{}-ungit/".format(
+        notebook_config['exploratory_name'])
+    tensorboard_acces_url = "http://" + edge_instance_hostname + "/{}-tensor/".format(notebook_config['exploratory_name'])
     print('[SUMMARY]')
     logging.info('[SUMMARY]')
     print("Instance name: {}".format(notebook_config['instance_name']))
@@ -207,10 +242,17 @@ if __name__ == "__main__":
                "notebook_name": notebook_config['instance_name'],
                "Action": "Create new notebook server",
                "exploratory_url": [
-                   {"description": "TensorBoard",
-                    "url": tensorboard_url},
                    {"description": "Jupyter",
-                    "url": jupyter_ip_url},
+                    "url": jupyter_notebook_acces_url},
+                   {"description": "TensorBoard",
+                    "url": tensorboard_acces_url},
                    {"description": "Ungit",
-                    "url": ungit_ip_url}]}
+                    "url": jupyter_ungit_acces_url},
+                   {"description": "Jupyter (via tunnel)",
+                    "url": jupyter_ip_url},
+                   {"description": "TensorBoard (via tunnel)",
+                    "url": tensorboard_url},
+                   {"description": "Ungit (via tunnel)",
+                    "url": ungit_ip_url}
+               ]}
         result.write(json.dumps(res))
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
index a516485..30ead37 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
@@ -211,6 +211,9 @@ if __name__ == "__main__":
     ip_address = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     jupyter_ip_url = "http://" + ip_address + ":8888/{}/".format(notebook_config['exploratory_name'])
     ungit_ip_url = "http://" + ip_address + ":8085/{}-ungit/".format(notebook_config['exploratory_name'])
+    jupyter_notebook_acces_url = "http://" + edge_instance_hostname + "/{}/".format(notebook_config['exploratory_name'])
+    jupyter_ungit_acces_url = "http://" + edge_instance_hostname + "/{}-ungit/".format(
+        notebook_config['exploratory_name'])
     print('[SUMMARY]')
     logging.info('[SUMMARY]')
     print("Instance name: {}".format(notebook_config['instance_name']))
@@ -220,6 +223,8 @@ if __name__ == "__main__":
     print("User key name: {}".format(os.environ['edge_user_name']))
     print("Jupyter URL: {}".format(jupyter_ip_url))
     print("Ungit URL: {}".format(ungit_ip_url))
+    print("ReverseProxyNotebook".format(jupyter_notebook_acces_url))
+    print("ReverseProxyUngit".format(jupyter_ungit_acces_url))
     print('SSH access (from Edge node, via IP address): ssh -i {0}.pem {1}@{2}'.format(notebook_config['key_name'],
                                                                                        notebook_config['dlab_ssh_user'],
                                                                                        ip_address))
@@ -233,7 +238,12 @@ if __name__ == "__main__":
                "Action": "Create new notebook server",
                "exploratory_url": [
                    {"description": "Jupyter",
-                    "url": jupyter_ip_url},
+                    "url": jupyter_notebook_acces_url},
                    {"description": "Ungit",
-                    "url": ungit_ip_url}]}
+                    "url": jupyter_ungit_acces_url},
+                   {"description": "Jupyter (via tunnel)",
+                    "url": jupyter_ip_url},
+                   {"description": "Ungit (via tunnel)",
+                    "url": ungit_ip_url}
+               ]}
         result.write(json.dumps(res))
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
index 3b61352..11f0e0e 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/rstudio_configure.py
@@ -55,6 +55,7 @@ if __name__ == "__main__":
     # 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['edge_user_name'])
+    edge_instance_hostname = GCPMeta().get_instance_public_ip_by_name(edge_instance_name)
     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']
@@ -179,10 +180,43 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
+    try:
+        print('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        logging.info('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        additional_info = {
+            'instance_hostname': instance_hostname,
+            'tensor': False
+        }
+        params = "--edge_hostname {} " \
+                 "--keyfile {} " \
+                 "--os_user {} " \
+                 "--type {} " \
+                 "--exploratory_name {} " \
+                 "--additional_info '{}'"\
+            .format(edge_instance_hostname,
+                    notebook_config['ssh_key_path'],
+                    notebook_config['dlab_ssh_user'],
+                    'rstudio',
+                    notebook_config['exploratory_name'],
+                    json.dumps(additional_info))
+        try:
+            local("~/scripts/{}.py {}".format('common_configure_reverse_proxy', params))
+        except:
+            append_result("Failed edge reverse proxy template")
+            raise Exception
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        append_result("Failed to set edge reverse proxy template.", str(err))
+        GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
+        sys.exit(1)
+
     # generating output information
     ip_address = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     rstudio_ip_url = "http://" + ip_address + ":8787/"
     ungit_ip_url = "http://" + ip_address + ":8085/{}-ungit/".format(notebook_config['exploratory_name'])
+    rstudio_notebook_acces_url = "http://" + edge_instance_hostname + "/{}/".format(notebook_config['exploratory_name'])
+    rstudio_ungit_acces_url = "http://" + edge_instance_hostname + "/{}-ungit/".format(
+        notebook_config['exploratory_name'])
     print('[SUMMARY]')
     logging.info('[SUMMARY]')
     print("Instance name: {}".format(notebook_config['instance_name']))
@@ -207,9 +241,14 @@ if __name__ == "__main__":
                "Action": "Create new notebook server",
                "exploratory_url": [
                    {"description": "RStudio",
-                    "url": rstudio_ip_url},
+                    "url": rstudio_notebook_acces_url},
                    {"description": "Ungit",
-                    "url": ungit_ip_url}],
+                    "url": rstudio_ungit_acces_url},
+                   {"description": "RStudio (via tunnel)",
+                    "url": rstudio_ip_url},
+                   {"description": "Ungit (via tunnel)",
+                    "url": ungit_ip_url}
+               ],
                "exploratory_user": notebook_config['dlab_ssh_user'],
                "exploratory_pass": notebook_config['rstudio_pass']}
         result.write(json.dumps(res))
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
index da771c1..5058512 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/tensor_configure.py
@@ -56,6 +56,7 @@ if __name__ == "__main__":
     # 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['edge_user_name'])
+    edge_instance_hostname = GCPMeta().get_instance_public_ip_by_name(edge_instance_name)
     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']
@@ -175,11 +176,46 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
+    try:
+        print('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        logging.info('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        additional_info = {
+            'instance_hostname': instance_hostname,
+            'tensor': True
+        }
+        params = "--edge_hostname {} " \
+                 "--keyfile {} " \
+                 "--os_user {} " \
+                 "--type {} " \
+                 "--exploratory_name {} " \
+                 "--additional_info '{}'"\
+            .format(edge_instance_hostname,
+                    notebook_config['ssh_key_path'],
+                    notebook_config['dlab_ssh_user'],
+                    'jupyter',
+                    notebook_config['exploratory_name'],
+                    json.dumps(additional_info))
+        try:
+            local("~/scripts/{}.py {}".format('common_configure_reverse_proxy', params))
+        except:
+            append_result("Failed edge reverse proxy template")
+            raise Exception
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        append_result("Failed to set edge reverse proxy template.", str(err))
+        GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
+        sys.exit(1)
+
     # generating output information
     ip_address = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     tensorboard_url = "http://" + ip_address + ":6006/"
     jupyter_ip_url = "http://" + ip_address + ":8888/{}/".format(notebook_config['exploratory_name'])
     ungit_ip_url = "http://" + ip_address + ":8085/{}-ungit/".format(notebook_config['exploratory_name'])
+    jupyter_notebook_acces_url = "http://" + edge_instance_hostname + "/{}/".format(notebook_config['exploratory_name'])
+    tensorboard_acces_url = "http://" + edge_instance_hostname + "/{}-tensor/".format(
+        notebook_config['exploratory_name'])
+    jupyter_ungit_acces_url = "http://" + edge_instance_hostname + "/{}-ungit/".format(
+        notebook_config['exploratory_name'])
     print('[SUMMARY]')
     logging.info('[SUMMARY]')
     print("Instance name: {}".format(notebook_config['instance_name']))
@@ -204,10 +240,17 @@ if __name__ == "__main__":
                "notebook_name": notebook_config['instance_name'],
                "Action": "Create new notebook server",
                "exploratory_url": [
-                   {"description": "TensorBoard",
-                    "url": tensorboard_url},
                    {"description": "Jupyter",
-                    "url": jupyter_ip_url},
+                    "url": jupyter_notebook_acces_url},
+                   {"description": "TensorBoard",
+                    "url": tensorboard_acces_url},
                    {"description": "Ungit",
-                    "url": ungit_ip_url}]}
+                    "url": jupyter_ungit_acces_url},
+                   {"description": "Jupyter (via tunnel)",
+                    "url": jupyter_ip_url},
+                   {"description": "TensorBoard (via tunnel)",
+                    "url": tensorboard_url},
+                   {"description": "Ungit (via tunnel)",
+                    "url": ungit_ip_url}
+               ]}
         result.write(json.dumps(res))
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
index efeb4b2..8eddabd 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/zeppelin_configure.py
@@ -56,6 +56,7 @@ if __name__ == "__main__":
     # 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['edge_user_name'])
+    edge_instance_hostname = GCPMeta().get_instance_public_ip_by_name(edge_instance_name)
     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']
@@ -193,10 +194,44 @@ if __name__ == "__main__":
         GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
         sys.exit(1)
 
+    try:
+        print('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        logging.info('[SETUP EDGE REVERSE PROXY TEMPLATE]')
+        additional_info = {
+            'instance_hostname': instance_hostname,
+            'tensor': False
+        }
+        params = "--edge_hostname {} " \
+                 "--keyfile {} " \
+                 "--os_user {} " \
+                 "--type {} " \
+                 "--exploratory_name {} " \
+                 "--additional_info '{}'"\
+            .format(edge_instance_hostname,
+                    notebook_config['ssh_key_path'],
+                    notebook_config['dlab_ssh_user'],
+                    'zeppelin',
+                    notebook_config['exploratory_name'],
+                    json.dumps(additional_info))
+        try:
+            local("~/scripts/{}.py {}".format('common_configure_reverse_proxy', params))
+        except:
+            append_result("Failed edge reverse proxy template")
+            raise Exception
+    except Exception as err:
+        print('Error: {0}'.format(err))
+        append_result("Failed to set edge reverse proxy template.", str(err))
+        GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
+        sys.exit(1)
+
     # generating output information
     ip_address = GCPMeta().get_private_ip_address(notebook_config['instance_name'])
     zeppelin_ip_url = "http://" + ip_address + ":8080/"
     ungit_ip_url = "http://" + ip_address + ":8085/{}-ungit/".format(notebook_config['exploratory_name'])
+    zeppelin_notebook_acces_url = "http://" + edge_instance_hostname + "/{}/".format(
+        notebook_config['exploratory_name'])
+    zeppelin_ungit_acces_url = "http://" + edge_instance_hostname + "/{}-ungit/".format(
+        notebook_config['exploratory_name'])
     print('[SUMMARY]')
     logging.info('[SUMMARY]')
     print("Instance name: {}".format(notebook_config['instance_name']))
@@ -219,7 +254,12 @@ if __name__ == "__main__":
                "Action": "Create new notebook server",
                "exploratory_url": [
                    {"description": "Apache Zeppelin",
-                    "url": zeppelin_ip_url},
+                    "url": zeppelin_notebook_acces_url},
                    {"description": "Ungit",
-                    "url": ungit_ip_url}]}
+                    "url": zeppelin_ungit_acces_url},
+                   {"description": "Apache Zeppelin (via tunnel)",
+                    "url": zeppelin_ip_url},
+                   {"description": "Ungit (via tunnel)",
+                    "url": ungit_ip_url}
+               ]}
         result.write(json.dumps(res))
\ No newline at end of file


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