Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-2065] [EC2] give launched instances names #1043

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def get_spark_shark_version(opts):
sys.exit(1)
return (version, spark_shark_map[version])


# Attempt to resolve an appropriate AMI given the architecture and
# region of the request.
def get_spark_ami(opts):
Expand Down Expand Up @@ -418,6 +419,16 @@ def launch_cluster(conn, opts, cluster_name):
master_nodes = master_res.instances
print "Launched master in %s, regid = %s" % (zone, master_res.id)

# Give the instances descriptive names
for master in master_nodes:
master.add_tag(
key='Name',
value='spark-{cn}-master-{iid}'.format(cn=cluster_name, iid=master.id))
for slave in slave_nodes:
slave.add_tag(
key='Name',
value='spark-{cn}-slave-{iid}'.format(cn=cluster_name, iid=slave.id))

# Return all the instances
return (master_nodes, slave_nodes)

Expand Down