Skip to content

Commit 5ebd1d3

Browse files
authored
docs: getting started updates (#623)
1 parent dd157a4 commit 5ebd1d3

File tree

4 files changed

+51
-69
lines changed

4 files changed

+51
-69
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
apiVersion: spark.stackable.tech/v1alpha1
3+
kind: SparkApplication
4+
metadata:
5+
name: pyspark-pi # <1>
6+
namespace: default
7+
spec:
8+
sparkImage: # <2>
9+
productVersion: 3.5.7
10+
mode: cluster # <4>
11+
mainApplicationFile: local:///stackable/spark/examples/src/main/python/pi.py # <4>
12+
job: # <5>
13+
config:
14+
resources:
15+
cpu:
16+
min: "1"
17+
max: "2"
18+
memory:
19+
limit: "1Gi"
20+
driver: # <6>
21+
config:
22+
resources:
23+
cpu:
24+
min: "1"
25+
max: "2"
26+
memory:
27+
limit: "1Gi"
28+
executor: # <7>
29+
replicas: 1
30+
config:
31+
resources:
32+
cpu:
33+
min: "1"
34+
max: "2"
35+
memory:
36+
limit: "1Gi"

docs/modules/spark-k8s/examples/getting_started/getting_started.sh

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,7 @@ esac
4747

4848
echo "Creating a Spark Application..."
4949
# tag::install-sparkapp[]
50-
kubectl apply -f - <<EOF
51-
---
52-
apiVersion: spark.stackable.tech/v1alpha1
53-
kind: SparkApplication
54-
metadata:
55-
name: pyspark-pi
56-
namespace: default
57-
spec:
58-
sparkImage:
59-
productVersion: 3.5.7
60-
mode: cluster
61-
mainApplicationFile: local:///stackable/spark/examples/src/main/python/pi.py
62-
driver:
63-
config:
64-
resources:
65-
cpu:
66-
min: "1"
67-
max: "2"
68-
memory:
69-
limit: "1Gi"
70-
executor:
71-
replicas: 1
72-
config:
73-
resources:
74-
cpu:
75-
min: "1"
76-
max: "2"
77-
memory:
78-
limit: "1Gi"
79-
EOF
50+
kubectl apply -f application.yaml
8051
# end::install-sparkapp[]
8152

8253
sleep 15

docs/modules/spark-k8s/examples/getting_started/getting_started.sh.j2

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,7 @@ esac
4747

4848
echo "Creating a Spark Application..."
4949
# tag::install-sparkapp[]
50-
kubectl apply -f - <<EOF
51-
---
52-
apiVersion: spark.stackable.tech/v1alpha1
53-
kind: SparkApplication
54-
metadata:
55-
name: pyspark-pi
56-
namespace: default
57-
spec:
58-
sparkImage:
59-
productVersion: 3.5.7
60-
mode: cluster
61-
mainApplicationFile: local:///stackable/spark/examples/src/main/python/pi.py
62-
driver:
63-
config:
64-
resources:
65-
cpu:
66-
min: "1"
67-
max: "2"
68-
memory:
69-
limit: "1Gi"
70-
executor:
71-
replicas: 1
72-
config:
73-
resources:
74-
cpu:
75-
min: "1"
76-
max: "2"
77-
memory:
78-
limit: "1Gi"
79-
EOF
50+
kubectl apply -f application.yaml
8051
# end::install-sparkapp[]
8152

8253
sleep 15

docs/modules/spark-k8s/pages/getting_started/first_steps.adoc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,27 @@ A Spark application is made of up three components:
1212
* Driver: the driver starts the designated number of executors and removes them when the job is completed.
1313
* Executor(s): responsible for executing the job itself
1414

15-
Create a `SparkApplication`:
15+
Create a Spark application by running:
1616

1717
[source,bash]
1818
----
1919
include::example$getting_started/getting_started.sh[tag=install-sparkapp]
2020
----
2121

22-
Where:
22+
The application manifest file points to an application file that is to be started as well as it's configuration and resources needed.
2323

24-
* `metadata.name` contains the name of the SparkApplication
25-
* `spec.version`: SparkApplication version (1.0). This can be freely set by the users and is added by the operator as label to all workload resources created by the application.
26-
* `spec.sparkImage`: the image used by the job, driver and executor pods. This can be a custom image built by the user or an official Stackable image. Available official images are stored in the Stackable https://oci.stackable.tech/[image registry,window=_blank]. Information on how to browse the registry can be found xref:contributor:project-overview.adoc#docker-images[here,window=_blank].
27-
* `spec.mode`: only `cluster` is currently supported
28-
* `spec.mainApplicationFile`: the artifact (Java, Scala or Python) that forms the basis of the Spark job.
24+
[source,bash]
25+
----
26+
include::example$getting_started/application.yaml[Create a Spark application]
27+
----
28+
<1> `metadata.name` contains the name of the SparkApplication
29+
<2> `spec.sparkImage`: the image used by the job, driver and executor pods. This can be a custom image built by the user or an official Stackable image. Available official images are stored in the Stackable https://oci.stackable.tech/[image registry,window=_blank]. Information on how to browse the registry can be found xref:contributor:project-overview.adoc#docker-images[here,window=_blank].
30+
<3> `spec.mode`: only `cluster` is currently supported
31+
<4> `spec.mainApplicationFile`: the artifact (Java, Scala or Python) that forms the basis of the Spark job.
2932
This path is relative to the image, so in this case an example python script (that calculates the value of pi) is running: it is bundled with the Spark code and therefore already present in the job image
30-
* `spec.driver`: driver-specific settings.
31-
* `spec.executor`: executor-specific settings.
33+
<5> `spec.job`: submit command specific settings.
34+
<6> `spec.driver`: driver-specific settings.
35+
<7> `spec.executor`: executor-specific settings.
3236

3337
== Verify that it works
3438

0 commit comments

Comments
 (0)