Skip to content

Commit

Permalink
Merge pull request #113 from arthurprevot/deploy_err_handling
Browse files Browse the repository at this point in the history
Give cluster info if failing to add steps to cluster.
  • Loading branch information
arthurprevot authored May 27, 2024
2 parents 44a66d9 + 7767a99 commit 255be33
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions yaetos/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ def run_direct(self):
self.start_spark_cluster(c, self.emr_version)
logger.info("cluster name: %s, and id: %s" % (self.pipeline_name, self.cluster_id))
self.step_run_setup_scripts(c)
try:
self.step_run_setup_scripts(c)
except botocore.exceptions.ClientError as e:
self.describe_status(c)
logger.error(f"botocore.exceptions.ClientError : {e}")
raise
else:
logger.info("Reusing existing cluster, name: %s, and id: %s" % (cluster['name'], cluster['id']))
self.cluster_id = cluster['id']
Expand Down Expand Up @@ -456,6 +462,10 @@ def describe_status_until_terminated(self, c):
logger.info('Cluster state:' + state)
time.sleep(30) # Prevent ThrottlingException by limiting number of requests

def describe_status(self, c):
description = c.describe_cluster(ClusterId=self.cluster_id)
logger.info(f'Cluster description: {description}')

def step_run_setup_scripts(self, c):
"""
:param c:
Expand Down

0 comments on commit 255be33

Please sign in to comment.