-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (39 loc) · 1.53 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
43
44
45
46
47
help:
@echo "Usage: make [help] [create] [shutdown] [reboot] [delete]\n"
@echo "help Print this help message"
@echo "create Create a dataproc on GKE cluster"
@echo "shutdown Delete dataproc cluster and resize GKE cluster to 0"
@echo "reboot Resize back the dataproc cluster and GKE cluster"
@echo "delelte Delete the GKE cluster completely"
create:
gcloud container clusters create gke \
--region asia-northeast3-a \
--num-nodes 3 \
--image-type UBUNTU \
--machine-type e2-standard-2
gcloud beta dataproc clusters create dataproc \
--gke-cluster=gke \
--region=asia-northeast3 \
--image-version=1.4.27-beta \
--bucket=matchy-bucket
reboot:
gcloud container clusters resize gke --num-nodes 1 \
--region asia-northeast3
gcloud beta dataproc clusters create dataproc \
--gke-cluster=gke \
--region=asia-northeast3 \
--image-version=1.4.27-beta \
--bucket=matchy-bucket
shutdown:
gcloud beta dataproc clusters delete dataproc --region asia-northeast3
gcloud container clusters resize gke --num-nodes 0 --region asia-northeast3
delete:
gcloud dataproc clusters delete dataproc --region asia-northeast3
gcloud container clusters resize gke --num-nodes 0 --region asia-northeast3
ls:
gsutil ls gs://matchy-bucket/inputs/
file=input1
submit_spark:
gcloud dataproc jobs submit pyspark \
./wordlettercount/spark-impl/sparkWordCount.py --cluster=dataproc \
-- gs://matchy-bucket/inputs/$(file)