From 0abf85dcb7c78274e9281692c1cb91c378c510f0 Mon Sep 17 00:00:00 2001 From: Kent Yao Date: Wed, 28 Oct 2020 15:28:24 +0800 Subject: [PATCH] doc init --- .gitignore | 1 + docs/Makefile | 20 ++++ docs/client/index.rst | 7 ++ docs/conf.py | 102 +++++++++++++++++++ docs/imgs/index.rst | 1 + docs/index.rst | 25 +++++ docs/integrations/index.rst | 9 ++ docs/{intergrations => integrations}/kudu.md | 0 docs/make.bat | 35 +++++++ docs/{ => quick_start}/building.md | 0 docs/quick_start/index.rst | 9 ++ docs/{ => server}/architecture.md | 0 docs/{ => server}/authentication.md | 0 docs/{ => server}/authorization.md | 0 docs/{ => server}/configurations.md | 0 docs/{ => server}/containerization.md | 0 docs/{ => server}/deploy.md | 0 docs/{ => server}/high_availability_guide.md | 2 +- docs/server/index.rst | 17 ++++ docs/{ => server}/metrics.md | 0 docs/{ => server}/trouble_shooting.md | 0 21 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 docs/Makefile create mode 100644 docs/client/index.rst create mode 100644 docs/conf.py create mode 100644 docs/imgs/index.rst create mode 100644 docs/index.rst create mode 100644 docs/integrations/index.rst rename docs/{intergrations => integrations}/kudu.md (100%) create mode 100644 docs/make.bat rename docs/{ => quick_start}/building.md (100%) create mode 100644 docs/quick_start/index.rst rename docs/{ => server}/architecture.md (100%) rename docs/{ => server}/authentication.md (100%) rename docs/{ => server}/authorization.md (100%) rename docs/{ => server}/configurations.md (100%) rename docs/{ => server}/containerization.md (100%) rename docs/{ => server}/deploy.md (100%) rename docs/{ => server}/high_availability_guide.md (99%) create mode 100644 docs/server/index.rst rename docs/{ => server}/metrics.md (100%) rename docs/{ => server}/trouble_shooting.md (100%) diff --git a/.gitignore b/.gitignore index 0fe4a26da..4a74ab8b1 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ embedded_zookeeper/ /externals/kyuubi-spark-sql-engine/kyuubi_operation_logs/ /externals/kyuubi-spark-sql-engine/spark-warehouse/ /work/ +/docs/_build/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..d4bb2cbb9 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/client/index.rst b/docs/client/index.rst new file mode 100644 index 000000000..df838377d --- /dev/null +++ b/docs/client/index.rst @@ -0,0 +1,7 @@ + +Kyuubi Client Documentation +=========================== + +.. toctree:: + :maxdepth: 2 + :numbered: 2 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 000000000..90e72f54b --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,102 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# + +import os +import sys +import shlex + +sys.path.insert(0, os.path.abspath('.')) + +import sphinx_rtd_theme +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +import recommonmark +from recommonmark.transform import AutoStructify +from recommonmark.parser import CommonMarkParser +source_parsers = { + '.md': CommonMarkParser, +} + +source_suffix = ['.rst', '.md'] + + + +# -- Project information ----------------------------------------------------- + +project = 'Kyuubi' +copyright = ''' +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. +''' + +author = 'Kent Yao' + +# The full version, including alpha/beta/rc tags +release = '1.0.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', + 'sphinx.ext.mathjax', + 'recommonmark', +] + +# master_doc = 'index' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' +pygments_style = 'sphinx' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] +htmlhelp_basename = 'Recommonmarkdoc' + +github_doc_root = 'https://github.com/yaooqinn/kyuubi/tree/master/docs/' +def setup(app): + app.add_config_value('recommonmark_config', { + 'url_resolver': lambda url: github_doc_root + url, + 'auto_toc_tree_section': 'Contents', + }, True) + app.add_transform(AutoStructify) \ No newline at end of file diff --git a/docs/imgs/index.rst b/docs/imgs/index.rst new file mode 100644 index 000000000..f3517b018 --- /dev/null +++ b/docs/imgs/index.rst @@ -0,0 +1 @@ +.. image:: ha.png \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..cb8f8c2cc --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,25 @@ +.. Kyuubi documentation master file, created by + sphinx-quickstart on Wed Oct 28 14:23:28 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Kyuubi's documentation! +================================== + +.. toctree:: + :maxdepth: 2 + :glob: + + quick_start/index + server/index + client/index + integrations/index + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/integrations/index.rst b/docs/integrations/index.rst new file mode 100644 index 000000000..aad5e9478 --- /dev/null +++ b/docs/integrations/index.rst @@ -0,0 +1,9 @@ + +Integrations +=========================== + +.. toctree:: + :maxdepth: 2 + :numbered: 2 + + kudu diff --git a/docs/intergrations/kudu.md b/docs/integrations/kudu.md similarity index 100% rename from docs/intergrations/kudu.md rename to docs/integrations/kudu.md diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 000000000..2119f5109 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/building.md b/docs/quick_start/building.md similarity index 100% rename from docs/building.md rename to docs/quick_start/building.md diff --git a/docs/quick_start/index.rst b/docs/quick_start/index.rst new file mode 100644 index 000000000..1e889e2aa --- /dev/null +++ b/docs/quick_start/index.rst @@ -0,0 +1,9 @@ + +Quick Start +=========== + +.. toctree:: + :maxdepth: 2 + :numbered: 2 + + building \ No newline at end of file diff --git a/docs/architecture.md b/docs/server/architecture.md similarity index 100% rename from docs/architecture.md rename to docs/server/architecture.md diff --git a/docs/authentication.md b/docs/server/authentication.md similarity index 100% rename from docs/authentication.md rename to docs/server/authentication.md diff --git a/docs/authorization.md b/docs/server/authorization.md similarity index 100% rename from docs/authorization.md rename to docs/server/authorization.md diff --git a/docs/configurations.md b/docs/server/configurations.md similarity index 100% rename from docs/configurations.md rename to docs/server/configurations.md diff --git a/docs/containerization.md b/docs/server/containerization.md similarity index 100% rename from docs/containerization.md rename to docs/server/containerization.md diff --git a/docs/deploy.md b/docs/server/deploy.md similarity index 100% rename from docs/deploy.md rename to docs/server/deploy.md diff --git a/docs/high_availability_guide.md b/docs/server/high_availability_guide.md similarity index 99% rename from docs/high_availability_guide.md rename to docs/server/high_availability_guide.md index 32c1755c4..a1b0f6379 100644 --- a/docs/high_availability_guide.md +++ b/docs/server/high_availability_guide.md @@ -21,7 +21,7 @@ The number of user concurrency and the size of your cluster may be two major ind Load balancing aims to optimize all Kyuubi service units usage, maximize throughput, minimize response time, and avoid overload of a single unit. Using multiple Kyuubi service units with load balancing instead of a single unit may increase reliability and availability through redundancy.
- +
With Hive JDBC Driver, a client can specify service discovery mode in JDBC connection string, i.e. `serviceDiscoveryMode=zooKeeper;` and set `zooKeeperNameSpace=kyuubiserver;`, then it can randomly pick one of the Kyuubi service uris from the specified ZooKeeper address in the `/kyuubiserver` path. diff --git a/docs/server/index.rst b/docs/server/index.rst new file mode 100644 index 000000000..b825a1827 --- /dev/null +++ b/docs/server/index.rst @@ -0,0 +1,17 @@ + +Server Documentation +=========================== + +.. toctree:: + :maxdepth: 2 + :numbered: 2 + + architecture + authentication + authorization + configurations + containerization + deploy + high_availability_guide + metrics + trouble_shooting diff --git a/docs/metrics.md b/docs/server/metrics.md similarity index 100% rename from docs/metrics.md rename to docs/server/metrics.md diff --git a/docs/trouble_shooting.md b/docs/server/trouble_shooting.md similarity index 100% rename from docs/trouble_shooting.md rename to docs/server/trouble_shooting.md