From 1b1d869f7775d2f0d1c8a1e45d0e278e6d980632 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Sun, 24 May 2020 13:00:42 -0700 Subject: [PATCH] [SPARK-31819][K8S][DOCS][TESTS] Add a workaround for Java 8u251+ and update integration test cases --- docs/index.md | 2 ++ resource-managers/kubernetes/integration-tests/README.md | 2 ++ .../deploy/k8s/integrationtest/ClientModeTestsSuite.scala | 5 ++++- .../spark/deploy/k8s/integrationtest/KubernetesSuite.scala | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 9a59097bb4efb..52f1a5a51978d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 diff --git a/resource-managers/kubernetes/integration-tests/README.md b/resource-managers/kubernetes/integration-tests/README.md index b3863e6b7d1af..20bd8b5689e93 100644 --- a/resource-managers/kubernetes/integration-tests/README.md +++ b/resource-managers/kubernetes/integration-tests/README.md @@ -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: diff --git a/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/ClientModeTestsSuite.scala b/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/ClientModeTestsSuite.scala index c8bd584516ea5..d1508e91616e7 100644 --- a/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/ClientModeTestsSuite.scala +++ b/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/ClientModeTestsSuite.scala @@ -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 => @@ -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") diff --git a/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala b/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala index e6840ce818c1f..d89343388186c 100644 --- a/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala +++ b/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala @@ -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()