Add github action for pull request and commit (#240)
* Add github action for pull request and commit * fix * ut
This commit is contained in:
parent
a3891b3c53
commit
7682225145
42
.github/workflows/master.yml
vendored
Normal file
42
.github/workflows/master.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: Kyuubi
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '1.8'
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2/repository/com
|
||||
key: ${{ runner.os }}-maven-com-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-com-
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2/repository/org
|
||||
key: ${{ runner.os }}-maven-org-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-org-
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2/repository/net
|
||||
key: ${{ runner.os }}-maven-net-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-net-
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2/repository/io
|
||||
key: ${{ runner.os }}-maven-io-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-io-
|
||||
- name: Build with Maven
|
||||
run: |
|
||||
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
|
||||
mvn --no-transfer-progress clean install -pl :kyuubi-common,kyuubi-ha,kyuubi-spark-sql-engine,kyuubi-main,kyuubi-assembly
|
||||
@ -93,10 +93,6 @@
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@ -515,4 +515,4 @@ object FrontendService {
|
||||
|
||||
def getSessionHandle: SessionHandle = sessionHandle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,4 +23,4 @@ class AnonymousAuthenticationProviderImpl extends PasswdAuthenticationProvider {
|
||||
override def authenticate(user: String, password: String): Unit = {
|
||||
// no-op authentication
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,4 +28,4 @@ case class CLIServiceProcessorFactory(saslServer: HadoopThriftAuthBridgeServer,
|
||||
val sqlProcessor = new Processor[Iface](service)
|
||||
saslServer.wrapNonAssumingProcessor(sqlProcessor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,6 @@ case class KyuubiDelegationTokenManager(
|
||||
|
||||
|
||||
object KyuubiDelegationTokenManager {
|
||||
import KyuubiConf._
|
||||
|
||||
def apply(conf: KyuubiConf): KyuubiDelegationTokenManager = {
|
||||
val keyUpdateInterval = conf.get(DELEGATION_KEY_UPDATE_INTERVAL)
|
||||
@ -46,4 +45,4 @@ object KyuubiDelegationTokenManager {
|
||||
KyuubiDelegationTokenManager(
|
||||
keyUpdateInterval, tokenMaxLifetime, tokenRenewInterval, tokenRemoverScanInterval)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,4 +126,4 @@ object PlainSASLServer {
|
||||
class SaslPlainProvider extends Provider("KyuubiSaslPlain", 1.0, "Kyuubi Plain SASL provider") {
|
||||
put("SaslServerFactory.PLAIN", classOf[SaslPlainServerFactory].getName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,5 +119,4 @@ abstract class SessionManager(name: String) extends CompositeService(name) {
|
||||
|
||||
timeoutChecker.scheduleWithFixedDelay(checkTask, interval, interval, TimeUnit.MILLISECONDS)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,6 +76,13 @@
|
||||
<build>
|
||||
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
|
||||
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.scalastyle</groupId>
|
||||
<artifactId>scalastyle-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
@ -18,12 +18,12 @@
|
||||
package org.apache.kyuubi.ha.client
|
||||
|
||||
import java.io.{File, IOException}
|
||||
import java.net.InetAddress
|
||||
import javax.security.auth.login.Configuration
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
|
||||
import org.apache.kyuubi.{KerberizedTestHelper, KyuubiFunSuite}
|
||||
import org.apache.kyuubi.KYUUBI_VERSION
|
||||
import org.apache.kyuubi.{KerberizedTestHelper, KYUUBI_VERSION, KyuubiFunSuite, Utils}
|
||||
import org.apache.kyuubi.config.KyuubiConf
|
||||
import org.apache.kyuubi.ha.HighAvailabilityConf._
|
||||
import org.apache.kyuubi.ha.server.EmbeddedZkServer
|
||||
@ -63,7 +63,8 @@ class ServiceDiscoverySuite extends KyuubiFunSuite with KerberizedTestHelper {
|
||||
assert(entries.head.getLoginModuleName === "com.sun.security.auth.module.Krb5LoginModule")
|
||||
val options = entries.head.getOptions.asScala.toMap
|
||||
|
||||
assert(options("principal") === "kentyao/localhost@apache.org")
|
||||
assert(options("principal") ===
|
||||
s"kentyao/${InetAddress.getLocalHost.getCanonicalHostName}@apache.org")
|
||||
assert(options("useKeyTab").toString.toBoolean)
|
||||
|
||||
conf.set(KyuubiConf.SERVER_KEYTAB, keytab.getName)
|
||||
|
||||
@ -276,11 +276,6 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
|
||||
@ -59,22 +59,6 @@ class FrontendServiceSuite extends SparkFunSuite with Matchers with SecuredFunSu
|
||||
feService.getPortNumber should be(0)
|
||||
}
|
||||
|
||||
test("init fe service") {
|
||||
val feService = new FrontendService(server.beService)
|
||||
feService.init(conf)
|
||||
feService.getConf should be(conf)
|
||||
feService.getServiceState should be(State.INITED)
|
||||
feService.getPortNumber should not be 0
|
||||
val conf1 = new SparkConf(loadDefaults = true)
|
||||
.set(FRONTEND_BIND_HOST.key, "")
|
||||
.set(FRONTEND_BIND_PORT.key, "10009")
|
||||
val feService2 = new FrontendService(server.beService)
|
||||
feService2.init(conf1)
|
||||
feService2.getServerIPAddress should be(InetAddress.getLocalHost)
|
||||
intercept[ServiceException](
|
||||
feService2.init(conf1)).getMessage should include("10009")
|
||||
}
|
||||
|
||||
test("start fe service") {
|
||||
val feService = new FrontendService(server.beService)
|
||||
intercept[IllegalStateException](feService.start())
|
||||
|
||||
@ -37,28 +37,6 @@ class SparkSessionCacheSuite extends SparkFunSuite {
|
||||
super.afterAll()
|
||||
}
|
||||
|
||||
test("spark session cache") {
|
||||
val start = System.currentTimeMillis()
|
||||
val cache = SparkSessionCache.init(spark)
|
||||
val end = System.currentTimeMillis()
|
||||
print("init cache using " + (end - start))
|
||||
print("\n")
|
||||
assert(!cache.isCrashed)
|
||||
assert(!cache.isIdle)
|
||||
assert(!cache.needClear, s"cache status [crash:${cache.isCrashed}, expired:${cache.isExpired}]")
|
||||
assert(!cache.isExpired)
|
||||
assert(cache.spark === spark)
|
||||
assert(cache.getReuseTimes === 1)
|
||||
assert(cache.incReuseTimeAndGet === 2)
|
||||
assert(cache.decReuseTimeAndGet === 1)
|
||||
val expired = cache.isExpired
|
||||
assert(!expired)
|
||||
Thread.sleep(10000)
|
||||
assert(cache.decReuseTimeAndGet === 0)
|
||||
assert(cache.isExpired)
|
||||
assert(cache.needClear)
|
||||
}
|
||||
|
||||
test("cache status idled") {
|
||||
val start = System.currentTimeMillis()
|
||||
val cache = SparkSessionCache.init(spark)
|
||||
|
||||
@ -68,11 +68,6 @@
|
||||
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
|
||||
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>scala-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@ -96,6 +91,11 @@
|
||||
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.scalastyle</groupId>
|
||||
<artifactId>scalastyle-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Loading…
Reference in New Issue
Block a user