Skip to content

Commit

Permalink
[SPARK-40304][K8S][TESTS] Add decomTestTag to K8s Integration Test
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This PR aims to add a new test tag, `decomTestTag`, to K8s Integration Test.

### Why are the changes needed?

Decommission-related tests took over 6 minutes (`363s`). It would be helpful we can run them selectively.
```
[info] - Test basic decommissioning (44 seconds, 51 milliseconds)
[info] - Test basic decommissioning with shuffle cleanup (44 seconds, 450 milliseconds)
[info] - Test decommissioning with dynamic allocation & shuffle cleanups (2 minutes, 43 seconds)
[info] - Test decommissioning timeouts (44 seconds, 389 milliseconds)
[info] - SPARK-37576: Rolling decommissioning (1 minute, 8 seconds)
```

### Does this PR introduce _any_ user-facing change?

No, this is a test-only change.

### How was this patch tested?

Pass the CIs and test manually.
```
$ build/sbt -Psparkr -Pkubernetes -Pkubernetes-integration-tests \
-Dspark.kubernetes.test.deployMode=docker-desktop "kubernetes-integration-tests/test" \
-Dtest.exclude.tags=minikube,local,decom
...
[info] KubernetesSuite:
[info] - Run SparkPi with no resources (12 seconds, 441 milliseconds)
[info] - Run SparkPi with no resources & statefulset allocation (11 seconds, 949 milliseconds)
[info] - Run SparkPi with a very long application name. (11 seconds, 999 milliseconds)
[info] - Use SparkLauncher.NO_RESOURCE (11 seconds, 846 milliseconds)
[info] - Run SparkPi with a master URL without a scheme. (11 seconds, 176 milliseconds)
[info] - Run SparkPi with an argument. (11 seconds, 868 milliseconds)
[info] - Run SparkPi with custom labels, annotations, and environment variables. (11 seconds, 858 milliseconds)
[info] - All pods have the same service account by default (11 seconds, 5 milliseconds)
[info] - Run extraJVMOptions check on driver (5 seconds, 757 milliseconds)
[info] - Verify logging configuration is picked from the provided SPARK_CONF_DIR/log4j2.properties (12 seconds, 467 milliseconds)
[info] - Run SparkPi with env and mount secrets. (21 seconds, 119 milliseconds)
[info] - Run PySpark on simple pi.py example (13 seconds, 129 milliseconds)
[info] - Run PySpark to test a pyfiles example (14 seconds, 937 milliseconds)
[info] - Run PySpark with memory customization (12 seconds, 195 milliseconds)
[info] - Run in client mode. (11 seconds, 343 milliseconds)
[info] - Start pod creation from template (11 seconds, 975 milliseconds)
[info] - SPARK-38398: Schedule pod creation from template (11 seconds, 901 milliseconds)
[info] - Run SparkR on simple dataframe.R example (14 seconds, 305 milliseconds)
...
```

Closes apache#37755 from dongjoon-hyun/SPARK-40304.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
  • Loading branch information
dongjoon-hyun committed Sep 1, 2022
1 parent b2e38e1 commit fd0498f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.apache.spark.internal.config.PLUGINS
private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>

import DecommissionSuite._
import KubernetesSuite.k8sTestTag
import KubernetesSuite.{decomTestTag, k8sTestTag}

def runDecommissionTest(f: () => Unit): Unit = {
val logConfFilePath = s"${sparkHomeDir.toFile}/conf/log4j2.properties"
Expand All @@ -61,7 +61,7 @@ private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>
}
}

test("Test basic decommissioning", k8sTestTag) {
test("Test basic decommissioning", k8sTestTag, decomTestTag) {
runDecommissionTest(() => {
sparkAppConf
.set(config.DECOMMISSION_ENABLED.key, "true")
Expand Down Expand Up @@ -91,7 +91,7 @@ private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>
})
}

test("Test basic decommissioning with shuffle cleanup", k8sTestTag) {
test("Test basic decommissioning with shuffle cleanup", k8sTestTag, decomTestTag) {
runDecommissionTest(() => {
sparkAppConf
.set(config.DECOMMISSION_ENABLED.key, "true")
Expand Down Expand Up @@ -122,7 +122,8 @@ private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>
})
}

test("Test decommissioning with dynamic allocation & shuffle cleanups", k8sTestTag) {
test("Test decommissioning with dynamic allocation & shuffle cleanups",
k8sTestTag, decomTestTag) {
runDecommissionTest(() => {
sparkAppConf
.set(config.DECOMMISSION_ENABLED.key, "true")
Expand Down Expand Up @@ -183,7 +184,7 @@ private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>
})
}

test("Test decommissioning timeouts", k8sTestTag) {
test("Test decommissioning timeouts", k8sTestTag, decomTestTag) {
runDecommissionTest(() => {
sparkAppConf
.set(config.DECOMMISSION_ENABLED.key, "true")
Expand Down Expand Up @@ -216,7 +217,7 @@ private[spark] trait DecommissionSuite { k8sSuite: KubernetesSuite =>
})
}

test("SPARK-37576: Rolling decommissioning", k8sTestTag) {
test("SPARK-37576: Rolling decommissioning", k8sTestTag, decomTestTag) {
runDecommissionTest(() => {
sparkAppConf
.set("spark.kubernetes.container.image", pyImage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ private[spark] object KubernetesSuite {
val k8sTestTag = Tag("k8s")
val localTestTag = Tag("local")
val schedulingTestTag = Tag("schedule")
val decomTestTag = Tag("decom")
val rTestTag = Tag("r")
val MinikubeTag = Tag("minikube")
val SPARK_PI_MAIN_CLASS: String = "org.apache.spark.examples.SparkPi"
Expand Down

0 comments on commit fd0498f

Please sign in to comment.