Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Spark Engine on Kubernetes integration test
- Loading branch information
1 parent
8f2b735
commit f6dda43
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