|
40 | 40 | from boto import ec2 |
41 | 41 |
|
42 | 42 | DEFAULT_SPARK_VERSION = "1.1.0" |
| 43 | +SPARK_EC2_DIR = os.path.dirname(os.path.realpath(__file__)) |
43 | 44 |
|
44 | 45 | # A URL prefix from which to fetch AMI information |
45 | 46 | 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): |
586 | 587 | ssh(master, opts, "rm -rf spark-ec2 && git clone https://github.com/mesos/spark-ec2.git -b v4") |
587 | 588 |
|
588 | 589 | 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 | + ) |
590 | 598 |
|
591 | 599 | print "Running setup on master..." |
592 | 600 | setup_spark_cluster(master, opts) |
@@ -718,12 +726,16 @@ def get_num_disks(instance_type): |
718 | 726 | return 1 |
719 | 727 |
|
720 | 728 |
|
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. |
726 | 729 | 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 | + """ |
727 | 739 | active_master = master_nodes[0].public_dns_name |
728 | 740 |
|
729 | 741 | num_disks = get_num_disks(opts.instance_type) |
|
0 commit comments