-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-cluster.sh
58 lines (55 loc) · 4.02 KB
/
start-cluster.sh
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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
IFS=: read -r FILESYSTEM HOMEMOUNT <<< $(findmnt -n -o SOURCE --target /home/$USER)
WORKSPACE=$(dirname $HOMEMOUNT)
WORKSPACE=$(dirname $WORKSPACE)
helm install $SPARK_CHART_NAME /opt/spark \
--set image.registry=${SPARK_CLUSTER_IMAGE_REGISTRY:-ghcr.io} \
--set image.repository=${SPARK_CLUSTER_IMAGE_REPO:-ucsd-ets/spark-node} \
--set image.tag=${SPARK_CLUSTER_IMAGE_TAG:-fa22-3} \
--set image.pullPolicy=Always \
--set serviceAccount.name=default \
--set serviceAccount.create=false \
--set master.podSecurityContext.runAsUser=$UID \
--set master.containerSecurityContext.runAsUser=$UID \
--set worker.replicaCount=${SPARK_CLUSTER_REPLICAS:-3} \
--set worker.podSecurityContext.runAsUser=$UID \
--set worker.containerSecurityContext.runAsUser=$UID \
--set master.podSecurityContext.runAsGroup=${SPARK_CLUSTER_RUNASGROUP:-0} \
--set master.podSecurityContext.fsGroup=${SPARK_CLUSTER_FSGROUP:-0} \
--set worker.podSecurityContext.runAsGroup=${SPARK_CLUSTER_RUNASGROUP:-0} \
--set worker.podSecurityContext.fsGroup=${SPARK_CLUSTER_FSGROUP:-0} \
--set worker.resources.requests.memory=${SPARK_CLUSTER_WORKER_MEM:-20G} \
--set worker.resources.limits.memory=${SPARK_CLUSTER_WORKER_MEM:-20G} \
--set worker.coreLimit=${SPARK_CLUSTER_WORKER_CPU:-2} \
--set worker.resources.limits.cpu=${SPARK_CLUSTER_WORKER_CPU:-2} \
--set worker.resources.requests.cpu=${SPARK_CLUSTER_WORKER_CPU:-2} \
--set master.resources.limits.cpu=${SPARK_CLUSTER_MASTER_CPU:-2} \
--set master.resources.requests.cpu=${SPARK_CLUSTER_MASTER_CPU:-2} \
--set master.resources.limits.memory=${SPARK_CLUSTER_MASTER_MEM:-8G} \
--set master.resources.requests.memory=${SPARK_CLUSTER_MASTER_MEM:-8G} \
--set master.memoryLimit=${SPARK_CLUSTER_MASTER_MEM:-8G} \
--set worker.memoryLimit=${SPARK_CLUSTER_WORKER_APP_MEM:-18G} \
--set-json="worker.extraVolumes[0]={\"name\":\"course-workspace\",\"nfs\":{\"server\":\"${FILESYSTEM}\",\"path\":\"${WORKSPACE}\"}}" \
--set-json='worker.extraVolumes[1]={"name":"home","persistentVolumeClaim":{"claimName":"home"}}' \
--set-json="worker.extraVolumes[2]={\"name\":\"datasets\",\"nfs\":{\"server\":\"its-dsmlp-fs01.ucsd.edu\",\"path\":\"/export/datasets\"}}" \
--set-json='worker.extraVolumeMounts[0]={"name":"course-workspace","mountPath":"/home/${USER}"}' \
--set worker.extraVolumeMounts[0].mountPath=/home/$USER \
--set worker.extraVolumeMounts[0].subPath=home/$USER \
--set-json='worker.extraVolumeMounts[1]={"name":"course-workspace","mountPath":"/home/${USER}/public"}' \
--set worker.extraVolumeMounts[1].mountPath=/home/$USER/public \
--set worker.extraVolumeMounts[1].subPath=public \
--set-json='worker.extraVolumeMounts[2]={"name":"home","mountPath":"/home/${USER}/private"}' \
--set worker.extraVolumeMounts[2].mountPath=/home/$USER/private \
--set-json='worker.extraVolumeMounts[3]={"name":"datasets","mountPath":"/datasets"}' \
--set-json="master.extraVolumes[0]={\"name\":\"course-workspace\",\"nfs\":{\"server\":\"${FILESYSTEM}\",\"path\":\"${WORKSPACE}\"}}" \
--set-json='master.extraVolumes[1]={"name":"home","persistentVolumeClaim":{"claimName":"home"}}' \
--set-json="master.extraVolumes[2]={\"name\":\"datasets\",\"nfs\":{\"server\":\"its-dsmlp-fs01.ucsd.edu\",\"path\":\"/export/datasets\"}}" \
--set-json='master.extraVolumeMounts[0]={"name":"course-workspace","mountPath":"/home/${USER}"}' \
--set master.extraVolumeMounts[0].mountPath=/home/$USER \
--set master.extraVolumeMounts[0].subPath=home/$USER \
--set-json='master.extraVolumeMounts[1]={"name":"course-workspace","mountPath":"/home/${USER}/public"}' \
--set master.extraVolumeMounts[1].mountPath=/home/$USER/public \
--set master.extraVolumeMounts[1].subPath=public \
--set-json='master.extraVolumeMounts[2]={"name":"home","mountPath":"/home/${USER}/private"}' \
--set-json='master.extraVolumeMounts[3]={"name":"datasets","mountPath":"/datasets"}' \
--set master.extraVolumeMounts[2].mountPath=/home/$USER/private