Commit Graph

107 Commits

Author SHA1 Message Date
Kefu Chai
4968baa252 admin/doc-requirements.txt: pin sphinx and sphinx_rtd_theme to a certain version
to ensure that we can have reproducible builds

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-14 23:24:38 +08:00
Kefu Chai
f4b0742a35 admin/build-doc: use htmldir builder for livehtml
otherwise livehtml uses the default html builder. so we can copy and
paste the partial URL to cross check the rendering result.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-14 18:41:38 +08:00
Kefu Chai
6dea67ac2d admin: require sphinx>=3.2.1
loosen the required sphinx version.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-14 09:03:03 +08:00
Sage Weil
144bf1a73c admin/build-doc: do not rebuild venv every time
Downside is you have to delete and re-run if the deps change.  The venv
install is suuuuper slow for me, though, so this is a win.

Signed-off-by: Sage Weil <sage@newdream.net>
2021-03-31 13:58:16 -05:00
Kefu Chai
35413b8ae2 admin/build-doc: build man page in proper directory
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-25 01:03:34 +08:00
Kefu Chai
275c6bd1b7 doc: switch to sphinx_rtd_theme
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-04 19:00:47 +08:00
Kefu Chai
202b805aaf doc: build mon_command_api.rst using a homebrew extension
so we can build the command doc using ReadTheDoc infra, without adding
the generated rst file to the source repo.

before this change, all the commands are ordered alphabetically. after
this change, command docs are generated by two directives, and are
ordered separately. we could restructure the directives and merge them.

but let's leave it for a future change if this is important.

for more details on writing sphinx directives, see
https://www.sphinx-doc.org/en/master/extdev/markupapi.html and
https://docutils.sourceforge.io/docs/howto/rst-directives.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-08 11:35:42 +08:00
Kefu Chai
2f1f16ed86 admin/doc-requirements.txt: require breathe >= 4.20
to be compatible with Sphinx 3.2
see https://github.com/michaeljones/breathe/tree/v4.20.0#change-log

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-14 16:26:49 +08:00
Kefu Chai
140f6c5c28 admin/build-doc: drop comments for building dummy C bindings
we don't build dummy C bindings since
2235c2db0e

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-12 16:49:21 +08:00
Kefu Chai
703ba9e7cb admin/build-doc: revert "upgrade pip setuptools first"
per Radoslow Zarzynski, the build failure was due to missing Python.h
for the python version he was using on the system.

This reverts commit bc73204812.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-12 16:29:20 +08:00
Kefu Chai
5cb9d54587 admin/build-doc: stop passing --use-feature=2020-resolver to pip
to silence the warning of

WARNING: --use-feature=2020-resolver no longer has any effect, since it is now the default dependency resolver in pip. This will become an error in pip 21.0.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-12 16:28:56 +08:00
Kefu Chai
6fb4aff5ad admin/build-doc: consolidate the build deps into admin/doc-pybind.txt
since all the python bindings are required for building the doc, extract
them into admin/doc-pybind.txt.

because the pybind python extensions require Cython python module to build,
we have to move them  into another requirement file, and install them after
Cython is installed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-12 16:27:20 +08:00
Kefu Chai
bc73204812 admin/build-doc: upgrade pip setuptools first
on certain distros, buggy pip and setuptools are used, so we need to
upgrade them first.

see also: googleapis/google-cloud-python#2990 and pypa/setuptools#885

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-12 00:23:32 +08:00
Kefu Chai
34f74e8a37 admin/build-doc: add livehtml target
it is time-consuming to rebuild the python bindings every time we
rebuild the document, it'd be ideal if we could just build document.

in this change, in addition to "html" and "doc", "livehtml" argument is
now supported by build-doc script, so one can just use

./build-doc livehtml

to build and start a web server. whenever a change in doc/ is detected,
the document is rebuilt. for more details, see
https://pypi.org/project/sphinx-autobuild/

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-11 22:30:56 +08:00
Kefu Chai
670efdd3c7 doc: build api docs with Read the Docs
since we are able to build the python bindings using the stub
implementation of C binding, let's enable the API docs build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-05 22:09:22 +08:00
Kefu Chai
2235c2db0e admin/build-doc: do not build stub C binding anymore
since the python binding is able to build the stub by themselves, there
is no need to do this manually.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-05 22:09:22 +08:00
Kefu Chai
b1c4a821b6 doc/conf: generate releases.json in conf.py
pave the road to build all the ingredients of the document using RTD
facility.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai
23626401e9 doc: write releases.json to _static
this follows the convention of sphinx, so we can also customise this
path in future using "html_static_path". see also
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-20 12:59:22 +08:00
Kefu Chai
3c0bc49875 doc: pass graphviz options in conf.py
easier to maintain the options of sphinx extensions in a single place.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Kefu Chai
cc5864234e doc: generate peering graph in conf.py
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-19 17:00:29 +08:00
Kefu Chai
70caf0dfe8 admin: be compatible with pip shipped by distro older than v20.2
pip v20.2 introduced a new option named --use-feature, which is not
available with <20.2. so we need to check for it before using it. see
also
https://pip.pypa.io/en/stable/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020

Fixes: https://tracker.ceph.com/issues/47636
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-10-03 00:45:39 +08:00
Kefu Chai
60949c9b1a
Merge pull request #37392 from tchaikov/wip-doc-pip
admin: pass --use-feature=2020-resolver to pip

Reviewed-by: Neha Ojha <nojha@redhat.com>
2020-10-02 01:54:07 +08:00
Courtney Caldwell
ca2261781e
mgr/dashboard/api: generate offline API docs
Generate Sphinx documentation from OpenAPI YAML spec:
- Fixed Docs controller doc generation
- Now dashboard Python doesn't fails if dashboard/frontend/dist doesn't exist
- OpenAPI added to @ceph/api CODEOWNERS
- Renamed Ceph-Dashboard API to Ceph REST or RESTful API.
- OpenAPI Docs: fixed decorators and docstrings.
- Sphinx Docs: updated dashboard and dev ones.

Co-authored-by: Ernesto Puerta <epuertat@redhat.com>
Fixes: https://tracker.ceph.com/issues/45863
Signed-off-by: Courtney Caldwell <ccaldwel@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2020-09-28 12:03:03 +02:00
Kefu Chai
bc00a8feb0 admin: pass --use-feature=2020-resolver to pip
to silence the warning like

follow the suggestion from pip

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

Fixes: https://tracker.ceph.com/issues/47636
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-09-24 19:59:58 +08:00
Kefu Chai
7ca85e77d0 doc: replace luminous with |stable-release|
"luminous" is a magic number in these contexts, and we should use a
constant for representing it.

the "sphinx_substitution_extensions" sphinx extension is introduced for
performing the global subsitution.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-09-01 09:53:17 +08:00
Kefu Chai
fce56ad60c admin/doc-requirements: bump up sphinx to 3.2.1
* use the latest stable sphinx
* unpin breathe, sphinx-autodoc-typehints, so pip can choose the
  compatible versions without worrying about the compile failures.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-28 20:35:21 +08:00
Kefu Chai
b83be6f33b admin: move python-common deps out of doc-requirements.txt
to address the build failure of

python -m pip install --exists-action=w --no-cache-dir -r admin/doc-requirements.txt
ERROR: ../src/python-common is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-07-06 19:19:22 +08:00
Kefu Chai
83d03234ef admin/doc-requirements: pin sphinx-autodoc-typehints to 1.10.3
to silence following error:

ERROR: sphinx-autodoc-typehints 1.11.0 has requirement Sphinx>=3.0, but you'll have sphinx 2.4.3 which is incompatible.

* update breathe to the latest release, 4.14.2, which supports sphinx <
  3.0
* pin sphinx to 2.4.4 the last sphinx before 3.0.0. as if sphinx >= 3.0
is used, we have errors like:

Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 18]
  CEPH_RADOS_API int rados_aio_append (rados_ioctx_t io, const char *oid, rados_completion_t completion, const char *buf, size_t len)
  ------------------^

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-22 10:37:57 +08:00
Sebastian Wagner
47330807dc doc/api: Add a generated reference of all mon commands.
Generate a ReST document which contains all mon commands.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-05-05 12:51:50 +02:00
Kefu Chai
8bd8a8badb doc: add in-doc search from read the docs
readthedocs-sphinx-search features better user experience than the
builtin search offered by sphinx

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-10 08:38:06 +08:00
Kefu Chai
0cb56e0f13 doc: use plantweb as fallback of sphinx-ditaa
RTD does not support installing system packages, the only ways to install
dependencies are setuptools and pip. while ditaa is a tool written in
Java. so we need to find a native python tool allowing us to render ditaa
images. plantweb is able to the web service for rendering the ditaa
diagram. so let's use it as a fallback if "ditaa" is not around.

also start a new line after the directive, otherwise planweb server will
return 500 at seeing the diagram.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-10 08:38:06 +08:00
Kefu Chai
c0615a4d27
Merge pull request #33911 from tchaikov/wip-cephfs-doc
pybind/cephfs, doc: add python binding doc

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2020-03-24 23:01:16 +08:00
Kefu Chai
58270ebaf7 admin/build-doc: add dot to the check list
also print the missing list in stderr

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-15 12:50:45 +08:00
Kefu Chai
c20e074efa admin/build-doc: add optional "_" prefix before function names to match
as compilers targeting ELF does not add the leading "_" to symbol names,
while clang on OSX always do this.

and remove the underscore from the symbol name when generating the
function name, as the compiler will add it back for us.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-15 12:50:45 +08:00
Kefu Chai
ea67a42f99 admin/build-doc: drop --no-as-needed on Darwin
which is not supported by ld on OSX.

also, pass the rpath argument as a new command line argument instead
using -rpath=foo, which is not supported by llvm linker.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-15 12:50:45 +08:00
Kefu Chai
e88f8eeaf8 admin/install-doc: error out if missing deps
we should not `set -e` at the very beginning of this script, which fails
the script if any dependency is missing without printing out error
messages.

in this change `set -e` is removed. and refactor the code to print the
error message.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-15 10:56:10 +08:00
Kefu Chai
7357fde070 doc/cephfs: add python binding doc
and restructure cephfs/api to move the javadoc for cephfs to this
directory

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-12 18:46:48 +08:00
Kefu Chai
b9e282f0e3 admin/build-doc: use "ceph" for prefix of functions defined by libcephfs
if some python module tries to `import cephfs`, it should not fail.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-11 22:43:08 +08:00
Kefu Chai
1183f26719 admin/build-doc: pass -rpath to linker
to make sure the dummy cythonized python binding is able to find the dummy C binding.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-03-11 22:43:08 +08:00
Brad Hubbard
8ccf43bce9 admin/serve-doc: Switch to python3 only
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2020-02-29 10:29:21 +10:00
Kefu Chai
6a93a30f0e
Merge pull request #33592 from tchaikov/wip-doc-search
doc,admin: fix the builtin search

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
2020-02-28 11:33:05 +08:00
Kefu Chai
afaba1640f admin/doc-requirements: bump sphinx version
to pick up the fix to address the search when using dirhtml builder

see https://github.com/sphinx-doc/sphinx/pull/6741

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-28 10:08:49 +08:00
Sebastian Wagner
30d415974c doc: Add sphinx_autodoc_typehints extension
`mgr/orchestrator_modules.rst` makes heavy use type hints.

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-27 13:16:00 +01:00
Sebastian Wagner
667f9e28ab doc: add prettytable to admin/doc-requirements.txt
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-02-17 10:24:01 +01:00
Varsha Rao
62f9b4d65c admin/build-doc: Fix doxygen typo
Signed-off-by: Varsha Rao <varao@redhat.com>
2020-01-09 17:14:47 +05:30
Kefu Chai
b87781c120 admin/build-doc: always install python3-* for build deps
since we've dropped the support of python36-*, i.e. python packages
provided by EPEL7 before RHEL7/CentOS7 included python3. as before the
inclusion of python3 as supported python3, python packages are named
python36-*. and they don't provide python3-*. so we had to install
python36-* explicitly. now that we are able to use the python3-*
packages, we can just install python3-*.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-01-04 17:05:06 +08:00
Kefu Chai
35909b8dff
Merge pull request #32301 from tchaikov/wip-build-doc
admin/doc-requirements.txt: bump up Sphinx and breathe

Reviewed-by: Sage Weil <sage@redhat.com>
2019-12-17 23:27:21 +08:00
Sage Weil
92595f3f9d admin/build-doc: do not use system site-packages
Don't use site-packages, since the host might have the same version, and
it won't have the ditaa and breathe.

Require Cython to make the venv sufficient.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-17 08:47:25 -06:00
Kefu Chai
bb0c10e567 admin/doc-requirements.txt: bump Sphinx and breathe
* use the latest Sphinx
* use the latest breathe. also, since there is no need to be compatible
  with python2. we can move to 4.14.0 which is python3 only.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-17 22:27:30 +08:00
Yuval Lifshitz
e17e4bfcc0 build-doc: allow building docs on fedora 30
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-09-04 16:14:56 +03:00