-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
42 lines (31 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
test ?= c3.large
run ?= c3.8xlarge
region ?= us-east-1
zone ?= us-east-1a
key = $(USER)-default
ec2_env = ~/ec2-environment.sh
p_key = ~/$(USER)-default.pem
$(ec2_env):
cd ~ && bash ~cs61c/ec2-init.sh
account: $(ec2_env)
launch-test: $(ec2_env)
source $< && \
spark-ec2 launch --slaves 3 --instance-type=$(test) --region=$(region) --zone=$(zone) $(USER)
launch-small: $(ec2_env)
source $< && \
spark-ec2 launch --slaves 5 --instance-type=$(run) --region=$(region) --zone=$(zone) $(USER)
launch-big: $(ec2_env)
source $< && \
spark-ec2 launch --slaves 10 --instance-type=$(run) --region=$(region) --zone=$(zone) $(USER)
resume: $(ec2_env)
source $< && spark-ec2 launch --resume $(USER)
master: $(ec2_env)
source $< && spark-ec2 get-$@ $(USER) | tail -n 1 | tee $@
login: $(ec2_env) master
python scp_env.py $(p_key) $<
source $< && spark-ec2 $@ $(USER)
destroy: $(ec2_env)
source $< && spark-ec2 destroy $(USER)
clean:
rm -rf master ~/.aws-* ~/.boto ~/.s3cfg $(ec2_env) $(p_key)
.PHONY: genenv launch master destory clean