From f17e61257bd21e1d125275ef81d11e621e98a95d Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Mon, 8 Mar 2021 16:15:50 +0000 Subject: [PATCH 1/3] Updated docs --- README.md | 14 ++++- docs/CMakeLists.txt | 104 +++++++++++++++++++++++++++++++++++ docs/Makefile | 20 +++++++ docs/assets/custom.css | 52 ++++++++++++++++++ docs/conf.py | 103 ++++++++++++++++++++++++++++++++++ docs/genindex.rst | 4 ++ docs/index.rst | 33 +++++++++++ docs/overview/quickstart.rst | 4 ++ docs/requirements-docs.txt | 7 +++ 9 files changed, 340 insertions(+), 1 deletion(-) create mode 100644 docs/CMakeLists.txt create mode 100755 docs/Makefile create mode 100644 docs/assets/custom.css create mode 100755 docs/conf.py create mode 100644 docs/genindex.rst create mode 100755 docs/index.rst create mode 100644 docs/overview/quickstart.rst create mode 100644 docs/requirements-docs.txt diff --git a/README.md b/README.md index 9dc1d78f..9bac3a90 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -# Tempo + +![GitHub](https://img.shields.io/badge/Version-0.1.0-green.svg) +![GitHub](https://img.shields.io/badge/Python-3.5—3.8-blue.svg) +![GitHub](https://img.shields.io/badge/License-Apache-black.svg)] + +# ⏳ Tempo: The Production MLOps Software Development Kit + +An open source SDK to streamline workflows to productionise machine learning models at scale. + +## Overview + +Tempo provides a unified interface to multiple MLOps projects that enable data scientists to deploy and productionise machine learning systems. + diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 00000000..c6bb09f4 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,104 @@ + +find_package(Doxygen REQUIRED) + +# Parameters to be replaced in Doxifile.in as "@VAR@" +file(GLOB_RECURSE DOXYGEN_INPUT_FILES_RAW + ${PROJECT_SOURCE_DIR}/src/include/kompute/*.hpp) +# Need to do a string replace as files have to be +# space separated and with double quotes +string(REPLACE ";" "\" \"" + DOXYGEN_INPUT_FILES "${DOXYGEN_INPUT_FILES_RAW}") +set(DOXYGEN_OUTPUT_DIR + ${CMAKE_CURRENT_BINARY_DIR}/doxygen) +# DOXIGEN_DOT_PATH is also set automatically + +# Parameters only used inside cmake script +set(DOXYGEN_INDEX_FILE + ${DOXYGEN_OUTPUT_DIR}/html/index.html) +set(DOXYGEN_XML_PATH + ${DOXYGEN_OUTPUT_DIR}/xml/) +set(DOXYFILE_IN + ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) +set(DOXYFILE_OUT + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) +set(SPHINX_SOURCE + ${CMAKE_CURRENT_SOURCE_DIR}) +set(SPHINX_BUILD + ${CMAKE_CURRENT_BINARY_DIR}/sphinx) +set(CODECOV_DOCS_DIR + ${SPHINX_BUILD}/codecov/) +set(CODECOV_DOCS_INDEX_FILE + ${CODECOV_DOCS_DIR}/index.html}) + +# Perform replacement with cmake vars inside Doxifine.in +configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) + +file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) +add_custom_command( + OUTPUT ${DOXYGEN_INDEX_FILE} + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} + MAIN_DEPENDENCY ${DOXYFILE_IN} ${DOXYFILE_OUT} + COMMENT "Generating docs" +) + +if(KOMPUTE_OPT_CODE_COVERAGE) + add_custom_target(gendoxygen ALL + DEPENDS ${DOXYGEN_INDEX_FILE} ${CODECOV_DOCS_INDEX_FILE}) +else() + add_custom_target(gendoxygen ALL + DEPENDS ${DOXYGEN_INDEX_FILE}) +endif() + +##################################################### +########### CODECOV DOCS ############### +##################################################### + +add_custom_command( + OUTPUT ${CODECOV_DOCS_INDEX_FILE} + COMMAND ${CMAKE_COMMAND} + -E copy_directory + ${CODECOV_DIR_HTML} + ${CODECOV_DOCS_DIR} + COMMAND ${CMAKE_COMMAND} + -E copy + ${PROJECT_SOURCE_DIR}/docs/assets/gcov.css + ${CODECOV_DOCS_DIR}/gcov.css + DEPENDS codecov_genhtml) + +##################################################### +########### Sphinx ############### +##################################################### + +find_package(Sphinx REQUIRED) + +add_custom_target(gensphinx ALL + COMMAND + ${SPHINX_EXECUTABLE} -b html + ${SPHINX_SOURCE} ${SPHINX_BUILD} + -Dbreathe_projects.Kompute=${DOXYGEN_XML_PATH} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS gendoxygen + COMMENT "Generating documentation with Sphinx") + +# Copy the output doxygen html files +add_custom_target(gendocsall ALL + COMMAND ${CMAKE_COMMAND} + -E copy_directory + ${DOXYGEN_OUTPUT_DIR}/html/ + ${SPHINX_BUILD}/doxygen/ +# Copy the CNAME file from the repo + COMMAND ${CMAKE_COMMAND} + -E copy + ${PROJECT_SOURCE_DIR}/CNAME + ${SPHINX_BUILD}/CNAME +# Create assets directory + COMMAND ${CMAKE_COMMAND} + -E make_directory + ${SPHINX_BUILD}/_static/assets/ +# Copy the custom asset folder + COMMAND ${CMAKE_COMMAND} + -E copy_directory + ${PROJECT_SOURCE_DIR}/docs/assets/ + ${SPHINX_BUILD}/_static/assets/ + DEPENDS gensphinx) + diff --git a/docs/Makefile b/docs/Makefile new file mode 100755 index 00000000..d4bb2cbb --- /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/assets/custom.css b/docs/assets/custom.css new file mode 100644 index 00000000..3fb4172b --- /dev/null +++ b/docs/assets/custom.css @@ -0,0 +1,52 @@ + +/* +@media (max-width: 1200px) { +.md-header-nav__button { + color: #fff; + background-color: #ef5350 !important; + border-radius: 5px; +} +} + +.md-nav__title--site { + display: none; +} + +h1, h2, h3, h4, h5, h6 { + color:white !important; +} + +.md-container, .md-main, .md-nav, .md-nav__list { + background-color: #252632 !important; + color: #fff; +} + +.md-header, .md-tabs { + background-color: #ad152c !important; +} + +pre, code { + background-color: #181820 !important; + color: #fff !important; +} + +a { + color: #ff9292; +} +a:hover { + color: #fff; +} + +.md-nav__item a { + color: #36D3D9; +} +.md-nav__item a:hover { + color: #0091ea; +} + +.md-source { + color: #fff; +} +*/ + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100755 index 00000000..191b43b5 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,103 @@ +# 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 +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- +import sys +import os +import kp +import sphinx_material + +project = 'Tempo MLOps' +copyright = '2020, Seldon Technologies' +html_title = "Tempo MLOps" +author = 'Seldon Technologies' + +# The full version, including alpha/beta/rc tags +release = '0.1.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", + # Creates .nojekyll config + 'sphinx.ext.githubpages', + # Converts markdown to rst + "m2r2" +] +source_suffix = ['.rst', '.md'] + +# 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. +# +# Chosen Themes: +# * https://github.com/bashtage/sphinx-material/ +# * https://github.com/myyasuda/sphinx_materialdesign_theme +html_theme = 'sphinx_material' + +if html_theme == 'sphinx_material': + html_theme_options = { + 'google_analytics_account': '', + 'base_url': 'https://tempo.seldon.io', + 'color_primary': 'teal', + 'color_accent': 'light-blue', + 'repo_url': 'https://github.com/SeldonIO/tempo/', + 'repo_name': 'Tempo', + 'globaltoc_depth': 2, + 'globaltoc_collapse': False, + 'globaltoc_includehidden': False, + "repo_type": "github", + "nav_links": [ + { + "href": "https://github.com/EthicalML/vulkan-kompute/", + "internal": False, + "title": "Tempo Repo", + }, + ] + } + + extensions.append("sphinx_material") + html_theme_path = sphinx_material.html_theme_path() + html_context = sphinx_material.get_html_context() + +html_sidebars = { + "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"] +} + +# 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'] + +html_css_files = [ + 'assets/custom.css', +] + + diff --git a/docs/genindex.rst b/docs/genindex.rst new file mode 100644 index 00000000..4eef4a23 --- /dev/null +++ b/docs/genindex.rst @@ -0,0 +1,4 @@ +.. This file is a placeholder and will be replaced + +Code index +########## diff --git a/docs/index.rst b/docs/index.rst new file mode 100755 index 00000000..1e2cafba --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,33 @@ + +Tempo Docs Home +========================================== + +Documentation Index (as per sidebar) +-------- + +.. toctree:: + :titlesonly: + :caption: Python Documentation: + + Quickstart + +.. toctree:: + :titlesonly: + :caption: Examples: + + Explainers + +.. toctree:: + :titlesonly: + :caption: Relevant Links: + + MLServer Documentation + Seldon Core Documentation + KFServing Documentation + + +High Level Overview (from README) +-------- + +.. mdinclude:: ../README.md + diff --git a/docs/overview/quickstart.rst b/docs/overview/quickstart.rst new file mode 100644 index 00000000..72f82947 --- /dev/null +++ b/docs/overview/quickstart.rst @@ -0,0 +1,4 @@ + +Tempo Quickstart Guide +########### + diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt new file mode 100644 index 00000000..d1fcac05 --- /dev/null +++ b/docs/requirements-docs.txt @@ -0,0 +1,7 @@ +Sphinx==3.2.1 +sphinx_material==0.0.30 +breathe==4.20.0 +m2r2==0.2.5 +nbsphinx==0.8.2 +nbsphinx-link==1.1.0 + From 50a3fb26e63671ddfe69b5d4742954e6dd52692a Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Mon, 8 Mar 2021 16:19:31 +0000 Subject: [PATCH 2/3] Updated quickstart --- docs/conf.py | 2 +- docs/overview/quickstart.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 191b43b5..20bcd308 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,7 +76,7 @@ "repo_type": "github", "nav_links": [ { - "href": "https://github.com/EthicalML/vulkan-kompute/", + "href": "https://github.com/SeldonIO/tempo", "internal": False, "title": "Tempo Repo", }, diff --git a/docs/overview/quickstart.rst b/docs/overview/quickstart.rst index 72f82947..cfaa6dca 100644 --- a/docs/overview/quickstart.rst +++ b/docs/overview/quickstart.rst @@ -1,4 +1,4 @@ Tempo Quickstart Guide -########### +######################### From 6dea91f7c33ff8852b8d02e1c36838c792a75678 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Mon, 8 Mar 2021 18:33:21 +0000 Subject: [PATCH 3/3] Added cmakelists --- docs/CMakeLists.txt | 104 -------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 docs/CMakeLists.txt diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt deleted file mode 100644 index c6bb09f4..00000000 --- a/docs/CMakeLists.txt +++ /dev/null @@ -1,104 +0,0 @@ - -find_package(Doxygen REQUIRED) - -# Parameters to be replaced in Doxifile.in as "@VAR@" -file(GLOB_RECURSE DOXYGEN_INPUT_FILES_RAW - ${PROJECT_SOURCE_DIR}/src/include/kompute/*.hpp) -# Need to do a string replace as files have to be -# space separated and with double quotes -string(REPLACE ";" "\" \"" - DOXYGEN_INPUT_FILES "${DOXYGEN_INPUT_FILES_RAW}") -set(DOXYGEN_OUTPUT_DIR - ${CMAKE_CURRENT_BINARY_DIR}/doxygen) -# DOXIGEN_DOT_PATH is also set automatically - -# Parameters only used inside cmake script -set(DOXYGEN_INDEX_FILE - ${DOXYGEN_OUTPUT_DIR}/html/index.html) -set(DOXYGEN_XML_PATH - ${DOXYGEN_OUTPUT_DIR}/xml/) -set(DOXYFILE_IN - ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) -set(DOXYFILE_OUT - ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) -set(SPHINX_SOURCE - ${CMAKE_CURRENT_SOURCE_DIR}) -set(SPHINX_BUILD - ${CMAKE_CURRENT_BINARY_DIR}/sphinx) -set(CODECOV_DOCS_DIR - ${SPHINX_BUILD}/codecov/) -set(CODECOV_DOCS_INDEX_FILE - ${CODECOV_DOCS_DIR}/index.html}) - -# Perform replacement with cmake vars inside Doxifine.in -configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY) - -file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) -add_custom_command( - OUTPUT ${DOXYGEN_INDEX_FILE} - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} - MAIN_DEPENDENCY ${DOXYFILE_IN} ${DOXYFILE_OUT} - COMMENT "Generating docs" -) - -if(KOMPUTE_OPT_CODE_COVERAGE) - add_custom_target(gendoxygen ALL - DEPENDS ${DOXYGEN_INDEX_FILE} ${CODECOV_DOCS_INDEX_FILE}) -else() - add_custom_target(gendoxygen ALL - DEPENDS ${DOXYGEN_INDEX_FILE}) -endif() - -##################################################### -########### CODECOV DOCS ############### -##################################################### - -add_custom_command( - OUTPUT ${CODECOV_DOCS_INDEX_FILE} - COMMAND ${CMAKE_COMMAND} - -E copy_directory - ${CODECOV_DIR_HTML} - ${CODECOV_DOCS_DIR} - COMMAND ${CMAKE_COMMAND} - -E copy - ${PROJECT_SOURCE_DIR}/docs/assets/gcov.css - ${CODECOV_DOCS_DIR}/gcov.css - DEPENDS codecov_genhtml) - -##################################################### -########### Sphinx ############### -##################################################### - -find_package(Sphinx REQUIRED) - -add_custom_target(gensphinx ALL - COMMAND - ${SPHINX_EXECUTABLE} -b html - ${SPHINX_SOURCE} ${SPHINX_BUILD} - -Dbreathe_projects.Kompute=${DOXYGEN_XML_PATH} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS gendoxygen - COMMENT "Generating documentation with Sphinx") - -# Copy the output doxygen html files -add_custom_target(gendocsall ALL - COMMAND ${CMAKE_COMMAND} - -E copy_directory - ${DOXYGEN_OUTPUT_DIR}/html/ - ${SPHINX_BUILD}/doxygen/ -# Copy the CNAME file from the repo - COMMAND ${CMAKE_COMMAND} - -E copy - ${PROJECT_SOURCE_DIR}/CNAME - ${SPHINX_BUILD}/CNAME -# Create assets directory - COMMAND ${CMAKE_COMMAND} - -E make_directory - ${SPHINX_BUILD}/_static/assets/ -# Copy the custom asset folder - COMMAND ${CMAKE_COMMAND} - -E copy_directory - ${PROJECT_SOURCE_DIR}/docs/assets/ - ${SPHINX_BUILD}/_static/assets/ - DEPENDS gensphinx) -