You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2022/11/02 08:47:05 UTC
[incubator-datalab] 04/09: [DATALAB-3073]: moved client creation after image creation
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch epm-v2.5.2.1
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit f674ac7278909b6040fe1fd7e432fd02c27f5346
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Thu Oct 13 11:13:25 2022 +0300
[DATALAB-3073]: moved client creation after image creation
---
.../src/general/scripts/gcp/jupyter_configure.py | 48 +++++++++++-----------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
index 4fa87fb5c..04cbcba92 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/jupyter_configure.py
@@ -207,6 +207,30 @@ if __name__ == "__main__":
GCPActions.remove_instance(notebook_config['instance_name'], notebook_config['zone'])
sys.exit(1)
+ if notebook_config['image_enabled'] == 'true':
+ try:
+ logging.info('[CREATING IMAGE]')
+ primary_image_id = GCPMeta.get_image_by_name(notebook_config['expected_primary_image_name'])
+ if primary_image_id == '':
+ logging.info("Looks like it's first time we configure notebook server. Creating images.")
+ image_id_list = GCPActions.create_image_from_instance_disks(
+ notebook_config['expected_primary_image_name'], notebook_config['expected_secondary_image_name'],
+ notebook_config['instance_name'], notebook_config['zone'], notebook_config['image_labels'],
+ notebook_config['gcp_wrapped_csek'])
+ if image_id_list and image_id_list[0] != '':
+ logging.info("Image of primary disk was successfully created. It's ID is {}".format(image_id_list[0]))
+ else:
+ logging.info("Looks like another image creating operation for your template have been started a "
+ "moment ago.")
+ if image_id_list and image_id_list[1] != '':
+ logging.info("Image of secondary disk was successfully created. It's ID is {}".format(image_id_list[1]))
+ except Exception as err:
+ datalab.fab.append_result("Failed creating image.", str(err))
+ GCPActions.remove_instance(notebook_config['instance_name'], notebook_config['zone'])
+ GCPActions.remove_image(notebook_config['expected_primary_image_name'])
+ GCPActions.remove_image(notebook_config['expected_secondary_image_name'])
+ sys.exit(1)
+
if os.environ['notebook_create_keycloak_client'] == 'True':
try:
logging.info('[SETUP KEYCLOAK CLIENT]')
@@ -247,30 +271,6 @@ if __name__ == "__main__":
GCPActions.remove_instance(notebook_config['instance_name'], notebook_config['zone'])
sys.exit(1)
- if notebook_config['image_enabled'] == 'true':
- try:
- logging.info('[CREATING IMAGE]')
- primary_image_id = GCPMeta.get_image_by_name(notebook_config['expected_primary_image_name'])
- if primary_image_id == '':
- logging.info("Looks like it's first time we configure notebook server. Creating images.")
- image_id_list = GCPActions.create_image_from_instance_disks(
- notebook_config['expected_primary_image_name'], notebook_config['expected_secondary_image_name'],
- notebook_config['instance_name'], notebook_config['zone'], notebook_config['image_labels'],
- notebook_config['gcp_wrapped_csek'])
- if image_id_list and image_id_list[0] != '':
- logging.info("Image of primary disk was successfully created. It's ID is {}".format(image_id_list[0]))
- else:
- logging.info("Looks like another image creating operation for your template have been started a "
- "moment ago.")
- if image_id_list and image_id_list[1] != '':
- logging.info("Image of secondary disk was successfully created. It's ID is {}".format(image_id_list[1]))
- except Exception as err:
- datalab.fab.append_result("Failed creating image.", str(err))
- GCPActions.remove_instance(notebook_config['instance_name'], notebook_config['zone'])
- GCPActions.remove_image(notebook_config['expected_primary_image_name'])
- GCPActions.remove_image(notebook_config['expected_secondary_image_name'])
- sys.exit(1)
-
if os.environ['gpu_enabled'] == 'True':
try:
logging.info('[INSTALLING GPU DRIVERS]')
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org