Skip to content

Commit 752f958

Browse files
committed
specify deploy.generic path absolutely
1 parent bcdf6a5 commit 752f958

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

ec2/spark_ec2.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from boto import ec2
4141

4242
DEFAULT_SPARK_VERSION = "1.1.0"
43+
SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__))
4344

4445
# A URL prefix from which to fetch AMI information
4546
AMI_PREFIX = "https://raw.github.com/mesos/spark-ec2/v2/ami-list"
@@ -586,7 +587,14 @@ def setup_cluster(conn, master_nodes, slave_nodes, opts, deploy_ssh_key):
586587
ssh(master, opts, "rm -rf spark-ec2 && git clone https://github.com/mesos/spark-ec2.git -b v4")
587588

588589
print "Deploying files to master..."
589-
deploy_files(conn, "deploy.generic", opts, master_nodes, slave_nodes, modules)
590+
deploy_files(
591+
conn=conn,
592+
root_dir=SPARK_EC2_DIR + "/" + "deploy.generic",
593+
opts=opts,
594+
master_nodes=master_nodes,
595+
slave_nodes=slave_nodes,
596+
modules=modules
597+
)
590598

591599
print "Running setup on master..."
592600
setup_spark_cluster(master, opts)
@@ -718,12 +726,16 @@ def get_num_disks(instance_type):
718726
return 1
719727

720728

721-
# Deploy the configuration file templates in a given local directory to
722-
# a cluster, filling in any template parameters with information about the
723-
# cluster (e.g. lists of masters and slaves). Files are only deployed to
724-
# the first master instance in the cluster, and we expect the setup
725-
# script to be run on that instance to copy them to other nodes.
726729
def deploy_files(conn, root_dir, opts, master_nodes, slave_nodes, modules):
730+
"""
731+
Deploy the configuration file templates in a given local directory to
732+
a cluster, filling in any template parameters with information about the
733+
cluster (e.g. lists of masters and slaves). Files are only deployed to
734+
the first master instance in the cluster, and we expect the setup
735+
script to be run on that instance to copy them to other nodes.
736+
737+
root_dir should be an absolute path to the directory with the files we want to deploy.
738+
"""
727739
active_master = master_nodes[0].public_dns_name
728740

729741
num_disks = get_num_disks(opts.instance_type)

0 commit comments

Comments
 (0)