-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgetting_started.sh
More file actions
executable file
·84 lines (75 loc) · 2.71 KB
/
getting_started.sh
File metadata and controls
executable file
·84 lines (75 loc) · 2.71 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
set -euo pipefail
# DO NOT EDIT THE SCRIPT
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
# This script contains all the code snippets from the guide, as well as some assert tests
# to test if the instructions in the guide work. The user *could* use it, but it is intended
# for testing only.
# The script will install the operators, create a superset instance and briefly open a port
# forward and connect to the superset instance to make sure it is up and running.
# No running processes are left behind (i.e. the port-forwarding is closed at the end)
if [ $# -eq 0 ]
then
echo "Installation method argument ('helm' or 'stackablectl') required."
exit 1
fi
cd "$(dirname "$0")"
case "$1" in
"helm")
echo "Installing Operators with Helm"
# tag::helm-install-operators[]
helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 0.0.0-dev
helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 0.0.0-dev
helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 0.0.0-dev
helm install --wait spark-k8s-operator oci://oci.stackable.tech/sdp-charts/spark-k8s-operator --version 0.0.0-dev
# end::helm-install-operators[]
;;
"stackablectl")
echo "installing Operators with stackablectl"
# tag::stackablectl-install-operators[]
stackablectl operator install \
commons=0.0.0-dev \
secret=0.0.0-dev \
listener=0.0.0-dev \
spark-k8s=0.0.0-dev
# end::stackablectl-install-operators[]
;;
*)
echo "Need to give 'helm' or 'stackablectl' as an argument for which installation method to use!"
exit 1
;;
esac
# TODO: Remove once https://github.com/stackabletech/issues/issues/828 has been
# implemented (see that issue for details).
until kubectl get crd sparkapplications.spark.stackable.tech >/dev/null 2>&1; do
echo "Waiting for CRDs to be installed"
sleep 1
done
until kubectl get crd sparkhistoryservers.spark.stackable.tech >/dev/null 2>&1; do
echo "Waiting for CRDs to be installed"
sleep 1
done
until kubectl get crd sparkconnectservers.spark.stackable.tech >/dev/null 2>&1; do
echo "Waiting for CRDs to be installed"
sleep 1
done
until kubectl get crd sparkapptemplates.spark.stackable.tech >/dev/null 2>&1; do
echo "Waiting for CRDs to be installed"
sleep 1
done
echo "Creating a Spark Application..."
# tag::install-sparkapp[]
kubectl apply -f application.yaml
# end::install-sparkapp[]
sleep 15
echo "Waiting for job to complete ..."
# tag::wait-for-job[]
if kubectl wait pods -l 'job-name=pyspark-pi' \
--for jsonpath='{.status.phase}'=Succeeded \
--timeout 300s; then
echo "job succeeded"
else
echo "job failed"
exit 1
fi
# end::wait-for-job[]