Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the CommonConfiguration structure for roles. #277

Merged
merged 24 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
161de94
wip
razvan Sep 1, 2023
23d0a1f
Re-add pod overrides for the submit pod.
razvan Sep 2, 2023
51c1b77
Unify driver and executor configurations.
razvan Sep 4, 2023
44afe45
Merge branch 'main' into refactor/config-overrides
razvan Sep 4, 2023
1894fae
Successful smoke tests.
razvan Sep 7, 2023
babbaa3
Rename config structs.
razvan Sep 7, 2023
70f8726
smoke tests pass on kind.
razvan Sep 7, 2023
4d569c8
Refactor, cleanup and split configuration between driver and executor…
razvan Sep 8, 2023
7a18c40
Merge branch 'main' into refactor/config-overrides
razvan Sep 8, 2023
019b18c
Update docs, examples and changelog.
razvan Sep 8, 2023
af28ea3
fix typo
razvan Sep 11, 2023
3f6f900
Move replicas under spec.executor.config in tests and examples.
razvan Sep 11, 2023
947e649
Merge branch 'main' into refactor/config-overrides
razvan Sep 11, 2023
d4e64ba
Merge branch 'main' into refactor/config-overrides
razvan Sep 14, 2023
36a41c0
Clean up tests.
razvan Sep 14, 2023
facfa0a
Apply suggestions
razvan Sep 14, 2023
6b3f78b
Remove old node selector struct
razvan Sep 14, 2023
1831437
Added module doc for roles.rs
razvan Sep 14, 2023
ed452e2
Use RoleGroup for executors to make replicas on the same level as exe…
razvan Sep 20, 2023
96edda9
Update tests with "replicas" directly under "executor".
razvan Sep 21, 2023
90c6e8a
Update docs/examples with "replicas" directly under "executor".
razvan Sep 21, 2023
ab9cecc
Merge branch 'main' into refactor/config-overrides
razvan Sep 21, 2023
9cf4441
Update rust/crd/src/roles.rs
razvan Sep 25, 2023
1ad997f
Implement review feedback.
razvan Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ All notable changes to this project will be documented in this file.
- `operator-rs` `0.44.0` -> `0.48.0` ([#267], [#275]).
- Removed usages of SPARK_DAEMON_JAVA_OPTS since it's not a reliable way to pass extra JVM options ([#272]).
- [BREAKING] use product image selection instead of version ([#275]).
- BREAKING refactored application roles to use `CommonConfiguration` structures from the operator framework ([#277]).

[#267]: https://github.com/stackabletech/spark-k8s-operator/pull/267
[#268]: https://github.com/stackabletech/spark-k8s-operator/pull/268
[#269]: https://github.com/stackabletech/spark-k8s-operator/pull/269
[#272]: https://github.com/stackabletech/spark-k8s-operator/pull/272
[#275]: https://github.com/stackabletech/spark-k8s-operator/pull/275
[#277]: https://github.com/stackabletech/spark-k8s-operator/pull/277

## [23.7.0] - 2023-07-14

Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ strum = { version = "0.25", features = ["derive"] }
tokio = { version = "1.29", features = ["full"] }
tracing = "0.1"
tracing-futures = { version = "0.2", features = ["futures-03"] }
indoc = "2"

# [patch."https://github.com/stackabletech/operator-rs.git"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
12 changes: 10 additions & 2 deletions deploy/config-spec/properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ properties:
- fromVersion: "0.0.0"
value: "30"
roles:
- name: "node"
- name: "submit"
required: true
- name: "driver"
required: true
- name: "executor"
required: true
asOfVersion: "0.0.0"
comment: "History server - TTL for successfully resolved domain names."
Expand All @@ -36,7 +40,11 @@ properties:
- fromVersion: "0.0.0"
value: "0"
roles:
- name: "node"
- name: "submit"
required: true
- name: "driver"
required: true
- name: "executor"
required: true
asOfVersion: "0.0.0"
comment: "History server - TTL for domain names that cannot be resolved."
Expand Down
12 changes: 10 additions & 2 deletions deploy/helm/spark-k8s-operator/configs/properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ properties:
- fromVersion: "0.0.0"
value: "30"
roles:
- name: "node"
- name: "submit"
required: true
- name: "driver"
required: true
- name: "executor"
required: true
asOfVersion: "0.0.0"
comment: "History server - TTL for successfully resolved domain names."
Expand All @@ -36,7 +40,11 @@ properties:
- fromVersion: "0.0.0"
value: "0"
roles:
- name: "node"
- name: "submit"
required: true
- name: "driver"
required: true
- name: "executor"
required: true
asOfVersion: "0.0.0"
comment: "History server - TTL for domain names that cannot be resolved."
Expand Down
2,099 changes: 1,088 additions & 1,011 deletions deploy/helm/spark-k8s-operator/crds/crds.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/spark-k8s/examples/example-history-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ spec:
credentials:
secretClass: history-credentials-class # <6>
executor:
instances: 1
replicas: 1
16 changes: 9 additions & 7 deletions docs/modules/spark-k8s/examples/example-sparkapp-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ spec:
sparkConf:
"spark.hadoop.fs.s3a.aws.credentials.provider": "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider"
driver:
volumeMounts:
- name: cm-job-arguments # <6>
mountPath: /arguments # <7>
config:
volumeMounts:
- name: cm-job-arguments # <6>
mountPath: /arguments # <7>
executor:
instances: 3
volumeMounts:
- name: cm-job-arguments # <6>
mountPath: /arguments # <7>
replicas: 3
config:
razvan marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: cm-job-arguments # <6>
mountPath: /arguments # <7>
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ spec:
persistentVolumeClaim:
claimName: pvc-ksv
driver:
volumeMounts:
- name: job-deps
mountPath: /dependencies # <6>
config:
volumeMounts:
- name: job-deps
mountPath: /dependencies # <6>
executor:
instances: 3
volumeMounts:
- name: job-deps
mountPath: /dependencies # <6>
replicas: 3
config:
razvan marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: job-deps
mountPath: /dependencies # <6>
41 changes: 22 additions & 19 deletions docs/modules/spark-k8s/examples/example-sparkapp-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,27 @@ spec:
sparkConf: # <5>
"spark.hadoop.fs.s3a.aws.credentials.provider": "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider"
job:
resources:
cpu:
min: "1"
max: "1"
memory:
limit: "1Gi"
config:
resources:
cpu:
min: "1"
max: "1"
memory:
limit: "1Gi"
driver:
resources:
cpu:
min: "1"
max: "1500m"
memory:
limit: "1Gi"
config:
resources:
cpu:
min: "1"
max: "1500m"
memory:
limit: "1Gi"
executor:
instances: 3
resources:
cpu:
min: "1"
max: "4"
memory:
limit: "2Gi"
replicas: 3
config:
razvan marked this conversation as resolved.
Show resolved Hide resolved
resources:
cpu:
min: "1"
max: "4"
memory:
limit: "2Gi"
16 changes: 9 additions & 7 deletions docs/modules/spark-k8s/examples/example-sparkapp-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ spec:
persistentVolumeClaim:
claimName: pvc-ksv
driver:
volumeMounts:
- name: job-deps
mountPath: /dependencies # <5>
config:
volumeMounts:
- name: job-deps
mountPath: /dependencies # <5>
executor:
instances: 3
volumeMounts:
- name: job-deps
mountPath: /dependencies # <5>
replicas: 3
config:
razvan marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: job-deps
mountPath: /dependencies # <5>
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ spec:
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"
executor:
instances: 3
replicas: 3
razvan marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 15 additions & 13 deletions docs/modules/spark-k8s/examples/example-sparkapp-streaming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ spec:
spark.kubernetes.driver.pod.name: "pyspark-streaming-driver"
spark.kubernetes.executor.podNamePrefix: "pyspark-streaming"
driver:
resources:
cpu:
min: "1"
max: "2"
memory:
limit: "1Gi"
config:
resources:
cpu:
min: "1"
max: "2"
memory:
limit: "1Gi"
executor:
instances: 1
resources:
cpu:
min: "1700m"
max: "3"
memory:
limit: "2Gi"
replicas: 1
config:
resources:
cpu:
min: "1700m"
max: "3"
memory:
limit: "2Gi"
40 changes: 21 additions & 19 deletions docs/modules/spark-k8s/pages/usage-guide/resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ If no resources are configured explicitly, the operator uses the following defau
[source,yaml]
----
job:
resources:
cpu:
min: '100m'
max: "400m"
memory:
limit: '512Mi'
config:
resources:
cpu:
min: '100m'
max: "400m"
memory:
limit: '512Mi'
driver:
resources:
cpu:
min: '250m'
max: "1"
memory:
limit: '1Gi'
config:
resources:
cpu:
min: '250m'
max: "1"
memory:
limit: '1Gi'
executor:
resources:
cpu:
min: '250m'
max: "1"
memory:
limit: '4Gi'
config:
resources:
cpu:
min: '250m'
max: "1"
memory:
limit: '4Gi'
----

For `SparkHistoryServer`s the following defaults are used:
Expand All @@ -48,4 +51,3 @@ For more details regarding Kubernetes CPU limits see: https://kubernetes.io/docs
Spark allocates a default amount of non-heap memory based on the type of job (JVM or non-JVM). This is taken into account when defining memory settings based exclusively on the resource limits, so that the "declared" value is the actual total value (i.e. including memory overhead). This may result in minor deviations from the stated resource value due to rounding differences.

NOTE: It is possible to define Spark resources either directly by setting configuration properties listed under `sparkConf`, or by using resource limits. If both are used, then `sparkConf` properties take precedence. It is recommended for the sake of clarity to use *_either_* one *_or_* the other.

16 changes: 9 additions & 7 deletions examples/ny-tlc-report-external-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ spec:
persistentVolumeClaim:
claimName: pvc-ksv
driver:
volumeMounts:
- name: job-deps
mountPath: /dependencies
config:
volumeMounts:
- name: job-deps
mountPath: /dependencies
executor:
instances: 3
volumeMounts:
- name: job-deps
mountPath: /dependencies
config:
replicas: 3
razvan marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: job-deps
mountPath: /dependencies
3 changes: 2 additions & 1 deletion examples/ny-tlc-report-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ spec:
sparkConf:
spark.hadoop.fs.s3a.aws.credentials.provider: "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider"
executor:
instances: 3
config:
replicas: 3
razvan marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 9 additions & 7 deletions examples/ny-tlc-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ spec:
sparkConf:
spark.hadoop.fs.s3a.aws.credentials.provider: "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider"
driver:
volumeMounts:
- name: cm-job-arguments
mountPath: /arguments
config:
volumeMounts:
- name: cm-job-arguments
mountPath: /arguments
executor:
instances: 3
volumeMounts:
- name: cm-job-arguments
mountPath: /arguments
config:
replicas: 3
razvan marked this conversation as resolved.
Show resolved Hide resolved
volumeMounts:
- name: cm-job-arguments
mountPath: /arguments
1 change: 1 addition & 0 deletions rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tracing.workspace = true
[dev-dependencies]
rstest.workspace = true
serde_yaml.workspace = true
indoc.workspace = true
Loading