Skip to content

Commit

Permalink
Add LogUri to emr bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
dacort committed Aug 22, 2023
1 parent 8559ab8 commit 64160dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/emr_cli/deployments/emr_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def create_environment(self):

def print_destroy_commands(self, cluster_id: str):
# fmt: off
print(f"aws emr terminate-clusters --cluster-ids {cluster_id}")
print(f"aws emr wait cluster-terminated --cluster-id {cluster_id}")
for bucket in set([self.log_bucket, self.code_bucket]):
print(f"aws s3 rm s3://{bucket} --recursive")
print(f"aws s3api delete-bucket --bucket {bucket}")
Expand All @@ -77,7 +79,6 @@ def print_destroy_commands(self, cluster_id: str):
print(f"aws iam delete-role-policy --role-name {role_name} --policy-name {name}") # noqa E501
print(f"aws iam delete-role --role-name {role_name}")
print(f"aws emr delete-security-configuration --name emr-cli-runtime-roles") # noqa E501
print(f"aws emr terminate-clusters --cluster-ids {cluster_id}")
# fmt: on

def _create_s3_buckets(self):
Expand Down Expand Up @@ -253,6 +254,7 @@ def _create_cluster(self, security_config_name: str, instance_profile_name: str)
response = self.emr_client.run_job_flow(
Name="emr-cli-demo",
ReleaseLabel="emr-6.9.0",
LogUri=f"s3://{self.log_bucket}/logs/emr/",
Applications=[
{"Name": "Spark"},
{"Name": "Livy"},
Expand Down Expand Up @@ -416,6 +418,7 @@ def run_job(
sys.exit(1)
except WaiterError as e:
console_log(f"ERR: While waiting for logs to appear: {e}")
sys.exit(1)

return step_id

Expand Down

0 comments on commit 64160dc

Please sign in to comment.