-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Make inline spark properties available via ConfigMap. Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Co-authored-by: Andrew Kenworthy <andrew.kenworthy@stackable.de>
- Loading branch information
1 parent
b6ccc79
commit 6ffe634
Showing
20 changed files
with
5,391 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cm-job-arguments # <1> | ||
data: | ||
job-args.txt: | | ||
s3a://nyc-tlc/trip data/yellow_tripdata_2021-07.csv # <2> |
43 changes: 43 additions & 0 deletions
43
docs/modules/ROOT/examples/example-sparkapp-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
apiVersion: spark.stackable.tech/v1alpha1 | ||
kind: SparkApplication | ||
metadata: | ||
name: ny-tlc-report-configmap | ||
namespace: default | ||
spec: | ||
version: "1.0" | ||
sparkImage: docker.stackable.tech/stackable/spark-k8s:3.2.1-hadoop3.2-stackable0.4.0 | ||
mode: cluster | ||
mainApplicationFile: s3a://stackable-spark-k8s-jars/jobs/ny-tlc-report-1.1.0.jar # <3> | ||
mainClass: tech.stackable.demo.spark.NYTLCReport | ||
volumes: | ||
- name: job-deps | ||
persistentVolumeClaim: | ||
claimName: pvc-ksv | ||
- name: cm-job-arguments | ||
configMap: | ||
name: cm-job-arguments # <4> | ||
args: | ||
- "--input /arguments/job-args.txt" # <5> | ||
sparkConf: | ||
"spark.hadoop.fs.s3a.aws.credentials.provider": "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider" | ||
"spark.driver.extraClassPath": "/dependencies/jars/hadoop-aws-3.2.0.jar:/dependencies/jars/aws-java-sdk-bundle-1.11.375.jar" | ||
"spark.executor.extraClassPath": "/dependencies/jars/hadoop-aws-3.2.0.jar:/dependencies/jars/aws-java-sdk-bundle-1.11.375.jar" | ||
driver: | ||
cores: 1 | ||
coreLimit: "1200m" | ||
memory: "512m" | ||
volumeMounts: | ||
- name: job-deps | ||
mountPath: /dependencies | ||
- name: cm-job-arguments # <6> | ||
mountPath: /arguments # <7> | ||
executor: | ||
cores: 1 | ||
instances: 3 | ||
memory: "512m" | ||
volumeMounts: | ||
- name: job-deps | ||
mountPath: /dependencies | ||
- name: cm-job-arguments # <6> | ||
mountPath: /arguments # <7> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cm-job-arguments | ||
data: | ||
job-args.txt: | | ||
s3a://nyc-tlc/trip data/yellow_tripdata_2021-07.csv | ||
--- | ||
apiVersion: spark.stackable.tech/v1alpha1 | ||
kind: SparkApplication | ||
metadata: | ||
name: ny-tlc-report-configmap | ||
namespace: default | ||
spec: | ||
version: "1.0" | ||
sparkImage: docker.stackable.tech/stackable/spark-k8s:3.2.1-hadoop3.2-stackable0.4.0 | ||
mode: cluster | ||
mainApplicationFile: s3a://stackable-spark-k8s-jars/jobs/ny-tlc-report-1.1.0.jar | ||
mainClass: tech.stackable.demo.spark.NYTLCReport | ||
volumes: | ||
- name: job-deps | ||
persistentVolumeClaim: | ||
claimName: pvc-ksv | ||
- name: cm-job-arguments | ||
configMap: | ||
name: cm-job-arguments | ||
args: | ||
- "--input /arguments/job-args.txt" | ||
sparkConf: | ||
"spark.hadoop.fs.s3a.aws.credentials.provider": "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider" | ||
"spark.driver.extraClassPath": "/dependencies/jars/hadoop-aws-3.2.0.jar:/dependencies/jars/aws-java-sdk-bundle-1.11.375.jar" | ||
"spark.executor.extraClassPath": "/dependencies/jars/hadoop-aws-3.2.0.jar:/dependencies/jars/aws-java-sdk-bundle-1.11.375.jar" | ||
driver: | ||
cores: 1 | ||
coreLimit: "1200m" | ||
memory: "512m" | ||
volumeMounts: | ||
- name: job-deps | ||
mountPath: /dependencies | ||
- name: cm-job-arguments | ||
mountPath: /arguments | ||
executor: | ||
cores: 1 | ||
instances: 3 | ||
memory: "512m" | ||
volumeMounts: | ||
- name: job-deps | ||
mountPath: /dependencies | ||
- name: cm-job-arguments | ||
mountPath: /arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
metadata: | ||
name: minio | ||
timeout: 300 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: test-minio | ||
labels: | ||
app: minio | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: minio-mc | ||
status: | ||
readyReplicas: 1 | ||
replicas: 1 |
23 changes: 23 additions & 0 deletions
23
tests/templates/kuttl/spark-ny-public-s3/00-s3-upload-container.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: minio-mc | ||
labels: | ||
app: minio-mc | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: minio-mc | ||
template: | ||
metadata: | ||
labels: | ||
app: minio-mc | ||
spec: | ||
containers: | ||
- name: minio-mc | ||
image: bitnami/minio:2022-debian-10 | ||
command: ["/bin/sh"] | ||
stdin: true | ||
tty: true |
12 changes: 12 additions & 0 deletions
12
tests/templates/kuttl/spark-ny-public-s3/00-setup-minio.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: >- | ||
helm install test-minio | ||
--namespace $NAMESPACE | ||
--set mode=standalone | ||
--set replicas=1 | ||
--set persistence.enabled=false | ||
--set buckets[0].name=my-bucket,buckets[0].policy=public | ||
--repo https://charts.min.io/ minio |
15 changes: 15 additions & 0 deletions
15
tests/templates/kuttl/spark-ny-public-s3/01-prepare-bucket.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: >- | ||
kubectl exec -n $NAMESPACE minio-mc-0 -- | ||
sh -c 'mc alias set test-minio http://test-minio:9000/' | ||
- script: kubectl cp -n $NAMESPACE ny-tlc-report-1.1.0.jar minio-mc-0:/tmp | ||
- script: kubectl cp -n $NAMESPACE yellow_tripdata_2021-07.csv minio-mc-0:/tmp | ||
- script: >- | ||
kubectl exec -n $NAMESPACE minio-mc-0 -- | ||
mc cp /tmp/ny-tlc-report-1.1.0.jar test-minio/my-bucket | ||
- script: >- | ||
kubectl exec -n $NAMESPACE minio-mc-0 -- | ||
mc cp /tmp/yellow_tripdata_2021-07.csv test-minio/my-bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
metadata: | ||
name: spark-ny-deps-job | ||
timeout: 300 | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: spark-ny-deps-job | ||
status: | ||
succeeded: 1 |
48 changes: 48 additions & 0 deletions
48
tests/templates/kuttl/spark-ny-public-s3/02-deps-volume.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: spark-ny-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: spark-ny-deps-job | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
volumes: | ||
- name: job-deps | ||
persistentVolumeClaim: | ||
claimName: spark-ny-pvc | ||
containers: | ||
- name: aws-deps | ||
image: docker.stackable.tech/stackable/tools:0.2.0-stackable0 | ||
env: | ||
- name: DEST_DIR | ||
value: "/dependencies/jars" | ||
- name: AWS | ||
value: "1.11.375" | ||
- name: HADOOP | ||
value: "3.2" | ||
command: | ||
[ | ||
"bash", | ||
"-x", | ||
"-o", | ||
"pipefail", | ||
"-c", | ||
"mkdir -p ${DEST_DIR} && curl -L https://search.maven.org/remotecontent?filepath=org/apache/hadoop/hadoop-aws/${HADOOP}.0/hadoop-aws-${HADOOP}.0.jar -o ${DEST_DIR}/hadoop-aws-${HADOOP}.0.jar && curl -L https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-bundle/${AWS}/aws-java-sdk-bundle-${AWS}.jar -o ${DEST_DIR}/aws-java-sdk-bundle-${AWS}.jar && chown -R stackable:stackable ${DEST_DIR} && chmod -R a=,u=rwX ${DEST_DIR}", | ||
] | ||
volumeMounts: | ||
- name: job-deps | ||
mountPath: /dependencies | ||
securityContext: | ||
runAsUser: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: list-jars-job | ||
status: | ||
succeeded: 1 |
Oops, something went wrong.