Skip to content

Commit

Permalink
[SPARK-31819][K8S][DOCS][TESTS][2.4] Add a workaround for Java 8u251+…
Browse files Browse the repository at this point in the history
…/K8s 1.17 and update integration test cases

### What changes were proposed in this pull request?

This PR aims to add a workaround `HTTP2_DISABLE=true` to the document and to update the K8s integration test.

### Why are the changes needed?

SPARK-31786 reported fabric8 kubernetes-client library fails to talk K8s 1.17.x client on Java 8u251+ environment. It's fixed at Apache Spark 3.0.0 by upgrading the library, but it turns out that we can not use the same way in `branch-2.4` (#28625)

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

Yes. This will provide a workaround at the document and testing environment.

### How was this patch tested?

This PR is irrelevant to Jenkins UT because it's only updating docs and integration tests. We need to the followings.
- [x] Pass the Jenkins K8s IT with old JDK8 and K8s versions (#28638 (comment))
- [x] Manually run K8s IT on K8s 1.17/Java 8u251+ with `export HTTP2_DISABLE=true`.

**K8s v1.17.6 / JDK 1.8.0_252**
```
KubernetesSuite:
- Run SparkPi with no resources
- Run SparkPi with a very long application name.
- Use SparkLauncher.NO_RESOURCE
- Run SparkPi with a master URL without a scheme.
- Run SparkPi with an argument.
- Run SparkPi with custom labels, annotations, and environment variables.
- Run extraJVMOptions check on driver
- Run SparkRemoteFileTest using a remote data file
- Run SparkPi with env and mount secrets.
- Run PySpark on simple pi.py example
- Run PySpark with Python2 to test a pyfiles example
- Run PySpark with Python3 to test a pyfiles example
- Run PySpark with memory customization
- Run in client mode.
Run completed in 5 minutes, 7 seconds.
Total number of tests run: 14
Suites: completed 2, aborted 0
Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
```

Closes #28638 from dongjoon-hyun/SPARK-31819.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
  • Loading branch information
dongjoon-hyun committed May 26, 2020
1 parent 1d1a207 commit 48ba885
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Note that support for Java 7, Python 2.6 and old Hadoop versions before 2.6.5 we
Support for Scala 2.10 was removed as of 2.3.0. Support for Scala 2.11 is deprecated as of Spark 2.4.1
and will be removed in Spark 3.0.

For Java 8u251+, `HTTP2_DISABLE=true` and `spark.kubernetes.driverEnv.HTTP2_DISABLE=true` are required additionally for fabric8 `kubernetes-client` library to talk to Kubernetes clusters. This prevents `KubernetesClientException` when `kubernetes-client` library uses `okhttp` library internally.

# Running the Examples and Shell

Spark comes with several sample programs. Scala, Java, Python and R examples are in the
Expand Down
2 changes: 2 additions & 0 deletions resource-managers/kubernetes/integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The simplest way to run the integration tests is to install and run Minikube, th

dev/dev-run-integration-tests.sh

For Java 8u251+, `HTTP2_DISABLE=true` and `spark.kubernetes.driverEnv.HTTP2_DISABLE=true` are required additionally for fabric8 `kubernetes-client` library to talk to Kubernetes clusters. This prevents `KubernetesClientException` when `kubernetes-client` library uses `okhttp` library internally.

The minimum tested version of Minikube is 0.23.0. The kube-dns addon must be enabled. Minikube should
run with a minimum of 3 CPUs and 4G of memory:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
*/
package org.apache.spark.deploy.k8s.integrationtest

import org.scalatest.concurrent.Eventually
import scala.collection.JavaConverters._

import io.fabric8.kubernetes.api.model.EnvVar
import org.scalatest.concurrent.Eventually

import org.apache.spark.deploy.k8s.integrationtest.KubernetesSuite.{k8sTestTag, INTERVAL, TIMEOUT}

private[spark] trait ClientModeTestsSuite { k8sSuite: KubernetesSuite =>
Expand Down Expand Up @@ -66,6 +68,7 @@ private[spark] trait ClientModeTestsSuite { k8sSuite: KubernetesSuite =>
.withName("spark-example")
.withImage(image)
.withImagePullPolicy("IfNotPresent")
.withEnv(new EnvVar("HTTP2_DISABLE", "true", null))
.withCommand("/opt/spark/bin/run-example")
.addToArgs("--master", s"k8s://https://kubernetes.default.svc")
.addToArgs("--deploy-mode", "client")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ private[spark] class KubernetesSuite extends SparkFunSuite
.set("spark.kubernetes.container.image", image)
.set("spark.kubernetes.driver.pod.name", driverPodName)
.set("spark.kubernetes.driver.label.spark-app-locator", appLocator)
.set("spark.kubernetes.driverEnv.HTTP2_DISABLE", "true")
.set("spark.kubernetes.executor.label.spark-app-locator", appLocator)
if (!kubernetesTestComponents.hasUserSpecifiedNamespace) {
kubernetesTestComponents.createNamespace()
Expand Down

0 comments on commit 48ba885

Please sign in to comment.