diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..9869847c3 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,38 @@ +# +# 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. +# + +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + builder: html + configuration: docs/conf.py + +# Build documentation with MkDocs +#mkdocs: +# configuration: mkdocs.yml + +# Optionally build your docs in additional formats such as PDF +formats: + - pdf + - epub + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: docs/requirements.txt diff --git a/docs/conf.py b/docs/conf.py index f7487604a..fb78ce17e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,6 +20,7 @@ sys.path.insert(0, os.path.abspath('.')) import sphinx_rtd_theme html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +import sphinx_markdown_tables import recommonmark from recommonmark.transform import AutoStructify from recommonmark.parser import CommonMarkParser @@ -66,6 +67,7 @@ extensions = [ 'sphinx.ext.mathjax', 'recommonmark', 'sphinx_markdown_tables', + 'notfound.extension', ] master_doc = 'index' diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..0e92da353 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +sphinx==3.2.1 +sphinx_rtd_theme==0.5.0 +sphinx-markdown-tables==0.0.15 +recommonmark==0.6.0 +sphinx-notfound-page==0.5 diff --git a/kyuubi-main/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala b/kyuubi-main/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala index ec181f20c..5c01853b9 100644 --- a/kyuubi-main/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala +++ b/kyuubi-main/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala @@ -23,7 +23,7 @@ import org.apache.kyuubi._ import org.apache.kyuubi.config.KyuubiConf import org.apache.kyuubi.ha.HighAvailabilityConf._ import org.apache.kyuubi.ha.server.EmbeddedZkServer -import org.apache.kyuubi.service.{AbstractBackendService, Serverable} +import org.apache.kyuubi.service.{AbstractBackendService, KinitAuxiliaryService, Serverable} import org.apache.kyuubi.util.SignalRegister object KyuubiServer extends Logging { @@ -77,5 +77,11 @@ class KyuubiServer(name: String) extends Serverable(name) { override private[kyuubi] val backendService: AbstractBackendService = new KyuubiBackendService() + override def initialize(conf: KyuubiConf): Unit = { + val kinit = new KinitAuxiliaryService() + addService(kinit) + super.initialize(conf) + } + override protected def stopServer(): Unit = KyuubiServer.zkServer.stop() } diff --git a/kyuubi-main/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala b/kyuubi-main/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala index 4a7078235..2f1e1976c 100644 --- a/kyuubi-main/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala +++ b/kyuubi-main/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala @@ -35,7 +35,7 @@ class KyuubiServerSuite extends KyuubiFunSuite { server.initialize(conf) assert(server.getServiceState === INITIALIZED) - val backendService = server.getServices.head.asInstanceOf[KyuubiBackendService] + val backendService = server.getServices(1).asInstanceOf[KyuubiBackendService] assert(backendService.getServiceState == INITIALIZED) assert(backendService.getServices.forall(_.getServiceState === INITIALIZED)) assert(server.connectionUrl.split(":").length === 2)