Skip to content

Commit e898a4e

Browse files
committed
Misc fix
* introduce the new field to both v1alpha1 and v1beta1 * remove unrelated typo fix * remove scala version from new e2e * update image for new e2e scenario * style fix
1 parent a710cf6 commit e898a4e

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

build-tools/helm/spark-kubernetes-operator/crds/sparkapplications.spark.apache.org-v1.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ spec:
5757
minExecutors:
5858
type: integer
5959
type: object
60+
resourceRetainDurationMillis:
61+
type: integer
6062
resourceRetainPolicy:
6163
enum:
6264
- Always
@@ -8734,6 +8736,8 @@ spec:
87348736
minExecutors:
87358737
type: integer
87368738
type: object
8739+
resourceRetainDurationMillis:
8740+
type: integer
87378741
resourceRetainPolicy:
87388742
enum:
87398743
- Always

docs/spark_custom_resources.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,13 @@ On the other hand, when developing an application, it's possible to configure
290290
applicationTolerations:
291291
# Acceptable values are 'Always', 'OnFailure', 'Never'
292292
# Setting this to 'OnFailure' would retain secondary resources if and only if the app fails
293-
resourceRetainPolicy: OnFailure
293+
resourceRetentionPolicy: OnFailure
294294
# Secondary resources would be garbage collected 10 minutes after app termination
295295
resourceRetainDurationMillis: 600000
296-
297296
```
298297

299298
to avoid operator attempt to delete driver pod and driver resources if app fails. Similarly,
300-
if resourceRetainPolicy is set to `Always`, operator would not delete driver resources
299+
if resourceRetentionPolicy is set to `Always`, operator would not delete driver resources
301300
when app ends. They would be by default kept with the same lifecycle as the App. It's also
302301
possible to configure `resourceRetainDurationMillis` to define the maximal retain duration for
303302
these resources. Note that this applies only to operator-created resources (driver pod, SparkConf

spark-operator/src/main/java/org/apache/spark/k8s/operator/reconciler/reconcilesteps/AppCleanUpStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public AppCleanUpStep(Supplier<ApplicationState> onDemandCleanUpReason) {
7575
* <li>When the application is being deleted on demand(e.g. being deleted) with a reason
7676
* <li>When the application is stopping
7777
* <li>When the application has terminated without releasing resources, but it has exceeded
78-
* configured retain duration
78+
* configured retention duration
7979
* </ul>
8080
*
8181
* <p>It would proceed to next steps with no actions for application in other states. Note that

tests/e2e/resource-retain-duration/chainsaw-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
bindings:
4040
- name: SPARK_APP_NAMESPACE
4141
value: default
42-
timeout: 60s
42+
timeout: 120s
4343
file: "../assertions/spark-application/spark-state-transition-with-retain-check.yaml"
4444
catch:
4545
- describe:
@@ -51,6 +51,6 @@ spec:
5151
env:
5252
- name: SPARK_APPLICATION_NAME
5353
value: ($SPARK_APPLICATION_NAME)
54-
timeout: 60s
54+
timeout: 120s
5555
content: |
5656
kubectl delete sparkapplication $SPARK_APPLICATION_NAME

tests/e2e/resource-retain-duration/spark-example-retain-duration.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ spec:
2828
resourceRetainDurationMillis: 10000
2929
sparkConf:
3030
spark.executor.instances: "1"
31-
spark.kubernetes.container.image: "apache/spark:4.0.0-scala2.13-java17-ubuntu"
31+
spark.kubernetes.container.image: "apache/spark:4.0.0-java21-scala"
3232
spark.kubernetes.authenticate.driver.serviceAccountName: "spark"
3333
runtimeVersions:
3434
sparkVersion: 4.0.0
35-
scalaVersion: "2.13"

0 commit comments

Comments
 (0)