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/07/17 12:28:08 UTC
[incubator-dlab] branch DLAB-627 updated: [DLAB-627] Bugfixing
This is an automated email from the ASF dual-hosted git repository.
dmysakovets pushed a commit to branch DLAB-627
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-627 by this push:
new 24b3904 [DLAB-627] Bugfixing
24b3904 is described below
commit 24b39040a8410aa1a41e2bd335321f66495477d0
Author: Dyoma33 <de...@gmail.com>
AuthorDate: Wed Jul 17 15:25:53 2019 +0300
[DLAB-627] Bugfixing
---
.../src/general/scripts/gcp/edge_prepare.py | 4 +--
.../scripts/gcp/jupyter-docker_configure.py | 30 ++++++++++++++++++----
.../general/scripts/os/jupyter_container_start.py | 4 +--
3 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/edge_prepare.py b/infrastructure-provisioning/src/general/scripts/gcp/edge_prepare.py
index a0aa2b6..27b4726 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/edge_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/edge_prepare.py
@@ -222,7 +222,7 @@ if __name__ == "__main__":
},
{
'IPProtocol': 'tcp',
- 'ports': ['80', '443']
+ 'ports': ['22', '80', '443']
}
]
egress_rule['allowed'] = rules
@@ -237,7 +237,7 @@ if __name__ == "__main__":
rules = [
{
'IPProtocol': 'tcp',
- 'ports': ['22', '389', '8888', '8080', '8787', '6006', '20888', '8042', '8088', '18080', '50070',
+ 'ports': ['389', '8888', '8080', '8787', '6006', '20888', '8042', '8088', '18080', '50070',
'8085', '8081', '4040-4045']
}
]
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/jupyter-docker_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/jupyter-docker_configure.py
index a344df9..3c25e8f 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/jupyter-docker_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/jupyter-docker_configure.py
@@ -149,18 +149,18 @@ if __name__ == "__main__":
try:
logging.info('[CONFIGURE JUPYTER NOTEBOOK INSTANCE]')
print('[CONFIGURE JUPYTER NOTEBOOK INSTANCE]')
- params = "--hostname {} --keyfile {} " \
+ params = "--hostname {} --keyfile {} --edge_ip {} " \
"--region {} --spark_version {} " \
"--hadoop_version {} --os_user {} " \
"--scala_version {} --r_mirror {} " \
- "--exploratory_name {}" "--edge_ip {} ".\
- format(instance_hostname, notebook_config['ssh_key_path'],
+ "--exploratory_name {}".\
+ format(instance_hostname, notebook_config['ssh_key_path'], edge_instance_private_ip,
os.environ['gcp_region'], os.environ['notebook_spark_version'],
os.environ['notebook_hadoop_version'], notebook_config['dlab_ssh_user'],
os.environ['notebook_scala_version'], os.environ['notebook_r_mirror'],
- notebook_config['exploratory_name'], edge_instance_private_ip)
+ notebook_config['exploratory_name'],)
try:
- local("~/scripts/{}.py {}".format('configure_jupyter_node', params))
+ local("~/scripts/{}.py {}".format('configure_jupyter-docker_node', params))
except:
traceback.print_exc()
raise Exception
@@ -258,6 +258,26 @@ if __name__ == "__main__":
GCPActions().remove_instance(notebook_config['instance_name'], notebook_config['zone'])
sys.exit(1)
+ try:
+ print('[STARTING JUPYTER CONTAINER]')
+ logging.info('[STARTING JUPYTER CONTAINER]')
+ params = "--hostname {} " \
+ "--keyfile {} " \
+ "--os_user {} ". \
+ format(instance_hostname,
+ notebook_config['ssh_key_path'],
+ notebook_config['dlab_ssh_user'])
+ try:
+ local("~/scripts/jupyter_container_start.py {}".format(params))
+ except:
+ traceback.print_exc()
+ raise Exception
+ except Exception as err:
+ print('Error: {0}'.format(err))
+ append_result("Failed to start Jupyter container.", 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'])
jupyter_ip_url = "http://" + ip_address + ":8888/{}/".format(notebook_config['exploratory_name'])
diff --git a/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py b/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
index 7f1af69..edbda2c 100644
--- a/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
+++ b/infrastructure-provisioning/src/general/scripts/os/jupyter_container_start.py
@@ -40,10 +40,10 @@ def start_jupyter_container(jupyter_dir):
with cd('{}'.format(jupyter_dir)):
run('docker volume create -d local-persist \
-o mountpoint=/home/{} --name=jup_volume'.format(args.os_user))
- run('docker build -file Dockerfile_jupyter -t jupyter-lab .'.format(args.os_user))
+ run('docker build --file Dockerfile_jupyter -t jupyter-lab .'.format(args.os_user))
run('docker run -d --restart unless-stopped -p 8888:8888 \
-v jup_volume:/opt/legion/repository \
- -v /home/{}/.ssh/:/home/nb_user/.ssh/ \
+ -v /home/{0}/.ssh/:/home/{0}/.ssh/ \
jupyter-lab:latest'.format(args.os_user))
except: sys.exit(1)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org