This is an automated email from the ASF dual-hosted git repository. lfrolov pushed a commit to branch DATALAB-3054 in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit 7f0d0b4b2d9b4bb7e0201738fb7ba604cf114641 Author: leonidfrolov <[email protected]> AuthorDate: Fri Sep 23 11:11:05 2022 +0300 [DATALAB-3054]: added cluster termination during instance deletion --- .../src/general/scripts/azure/common_terminate_notebook.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/infrastructure-provisioning/src/general/scripts/azure/common_terminate_notebook.py b/infrastructure-provisioning/src/general/scripts/azure/common_terminate_notebook.py index 77ef93f41..d63759c3c 100644 --- a/infrastructure-provisioning/src/general/scripts/azure/common_terminate_notebook.py +++ b/infrastructure-provisioning/src/general/scripts/azure/common_terminate_notebook.py @@ -32,6 +32,20 @@ import traceback def terminate_nb(resource_group_name, notebook_name): + logging.info("Terminating Dataengine-service clusters") + try: + clusters_list = AzureMeta.list_hdinsight_clusters(resource_group_name) + if clusters_list: + for cluster in clusters_list: + if "notebook_name" in cluster.tags and notebook_name == cluster.tags["notebook_name"]: + AzureActions.terminate_hdinsight_cluster(resource_group_name, cluster.name) + logging.info('The HDinsight cluster {} has been terminated successfully'.format(cluster.name)) + else: + logging.info("There are no HDinsight clusters to terminate.") + except Exception as err: + datalab.fab.append_result("Failed to terminate dataengine-service", str(err)) + sys.exit(1) + logging.info("Terminating data engine cluster") try: for vm in AzureMeta.compute_client.virtual_machines.list(resource_group_name): --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
