Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #2214] Add Spark Engine on Kubernetes integration test
### _Why are the changes needed?_ Rename `kyuubi-deployment-kubernetes-it` to `kyuubi-kubernetes-it` which include: - Kyuubi Server on Kubernetes it - Kyuubi Spark Engine on Kubernetes it Now, we use the package name to distingush the scope of it: - deployment package is for Kyuubi Server - spark package is for Spark Engine So it's easy to add Flink Engine on kubernetes it in future. Note that, this PR only supports Spark client mode on Kubernetes it. Since Spark only have two tags of docker image https://hub.docker.com/r/apache/spark/tags, this PR only test 3.2.1 version ### _How was this patch tested?_ - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2214 from ulysses-you/spark-on-k8s-client. Closes #2214 f6dda43 [ulysses-you] Add Spark Engine on Kubernetes integration test Authored-by: ulysses-you <ulyssesyou18@gmail.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
- Loading branch information
1 parent
c09cd65
commit 4f0323d
Showing
11 changed files
with
142 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
.../src/test/scala/org/apache/kyuubi/kubernetes/test/spark/SparkOnKubernetesTestsSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.kyuubi.kubernetes.test.spark | ||
|
||
import org.apache.kyuubi.{Logging, WithKyuubiServer} | ||
import org.apache.kyuubi.config.KyuubiConf | ||
import org.apache.kyuubi.kubernetes.test.MiniKube | ||
import org.apache.kyuubi.operation.SparkQueryTests | ||
|
||
// TODO Support Spark Cluster mode | ||
abstract class SparkOnKubernetesSuiteBase | ||
extends WithKyuubiServer with SparkQueryTests with Logging { | ||
private val apiServerAddress = { | ||
MiniKube.getKubernetesClient.getMasterUrl.toString | ||
} | ||
|
||
protected def sparkOnK8sConf: KyuubiConf = { | ||
// TODO Support more Spark version | ||
// Spark official docker image: https://hub.docker.com/r/apache/spark/tags | ||
KyuubiConf().set("spark.master", s"k8s://$apiServerAddress") | ||
.set("spark.kubernetes.container.image", "apache/spark:v3.2.1") | ||
.set("spark.kubernetes.container.image.pullPolicy", "IfNotPresent") | ||
.set("spark.executor.instances", "1") | ||
.set("spark.executor.cores", "1") | ||
.set("spark.executor.memory", "512M") | ||
.set("spark.driver.memory", "512M") | ||
} | ||
|
||
override protected def jdbcUrl: String = getJdbcUrl | ||
} | ||
|
||
/** | ||
* This test is for Kyuubi Server with Spark engine on Kubernetes: | ||
* | ||
* Real World Kubernetes Pod | ||
* ------------------------------------------------------- --------------------- | ||
* | JDBC | | | | ||
* | Client ----> Kyuubi Server ----> Spark Driver | ----> | Spark Executors | | ||
* | | | | | ||
* ------------------------------------------------------- --------------------- | ||
*/ | ||
class SparkClientModeOnKubernetesSuite extends SparkOnKubernetesSuiteBase { | ||
override protected val conf: KyuubiConf = { | ||
sparkOnK8sConf.set("spark.submit.deployMode", "client") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters