Commit Graph

79 Commits

Author SHA1 Message Date
Ken Dreyer
9b539494e6 admin/build-doc: use venv module again
Commit 690ca1c562 accidentally
re-introduced virtualenv. Switch back to the venv module in stdlib.

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2021-09-01 17:40:35 -04:00
Kefu Chai
690ca1c562 admin/build-doc: rebuild venv if md5 does not match
we should rebuild the venv if any of the requirements change.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-05 09:08:56 +08:00
Kefu Chai
90c4995c99 admin/build-doc: s/virtualenv/python3 -m venv/
so we don't need to use virtualenv python package for creating a
virtualenv, the "venv" module in Python3 would suffice.

see also https://docs.python.org/3/library/venv.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-31 22:34:05 +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
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
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
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
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
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
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
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
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
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
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
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
Kefu Chai
ace8cb15a6 admin/build-doc: use python3
to address https://github.com/sphinx-doc/sphinx/issues/3620, we need to
use sphinx with its fix at
e049f86b2d
in other words, we need to use sphinx v2.0.0 and up. but sphinx 2.0
requires python >= 3.5, so we have to use python3 for building the
documents.

in this change:

* doc-requirements.txt: install python3 packages on debian derivatives
* build-doc: install python3.6 packages from EPEL7, and use python3
  venv for using sphinx2
* doc-requirements.txt: bump up all python packages to latest
  stable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-08-07 17:55:06 +08:00
Kefu Chai
d185c46a43 admin,doc/_ext/ceph_releases.py: use yaml.safe_load()
see
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-09 22:20:14 +08:00
Samuel Just
7915c89e19 admin/build-doc: use PeeringState* for gen_state_diagram.py
Signed-off-by: Samuel Just <sjust@redhat.com>
2019-05-01 11:22:29 -07:00
Abhishek Lekshmanan
6b6d6ccab8 tools: admin/build-doc: keep-going when finding warnings
This allows the build to fail, but also report a list of warnings so that
multiple runs are not required to find all the errors in doc changes

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2019-03-19 13:49:53 +01:00
Noah Watkins
bb887b78f8 doc: show edit on github links and version warnings
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2018-11-02 14:49:15 -07:00
Aleksei Gutikov
649545e5d8 doc: compile dot into svg
Png images included into docs are useless because of small resolution.
http://docs.ceph.com/docs/master/dev/peering/#state-model

While SVG is vector and supported by Sphinx.

Signed-off-by: Aleksei Gutikov <aleksey.gutikov@synesis.ru>
2018-07-23 10:53:52 +03:00
Boris Ranto
93cd098103 build-doc: Upgrade ceph python libraries
If you have python ceph bindings installed on your system, the doc-build
script will fail since pip detects them and fails to install the updated
bindings in the virtualenv. This fixes the issue by adding --upgrade
flag to pip so that it overrides the system-installed libraries.

Signed-off-by: Boris Ranto <branto@redhat.com>
2018-03-05 22:46:39 +01:00
Jason Dillaman
f309180b96 admin/build-doc: support renamed python2 RPMs
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2018-01-04 09:55:16 -05:00
Kefu Chai
f8cc72ff1c admon/build-doc: be compatible with py3
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-11 23:05:26 +08:00
Alfredo Deza
d3543ef8b0 admin: do not allow errors or warnings from doc build
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-08-16 08:20:00 -04:00
Yu Shengzuo
e97f6eb081 doc: correct the package name in ceph/admin/build-doc
In document, it is called 'libxml2-devel', one of the dependent
package of CentOS/RHEL7. But the 'build-doc' check 'libxml-devel'.
And it id also called 'libxml2-devel' in software of yum repo .
So correct the checked package name in ceph/admin/build-doc.

Signed-off-by: Yu Shengzuo <yu.shengzuo@99cloud.net>
2017-04-20 05:14:29 +00:00
Abhishek Lekshmanan
a69efc7760 script: build-doc use python2 only for virtualenv
This is because the sphinx-ditaa package and ceph's rbd/rgw/rados pybind
require python2

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2017-04-10 19:15:25 +02:00
Kefu Chai
5b9ec53512 admin/build-doc: support optional argument for specifying sphinx builders
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-03-21 13:47:05 +08:00
Kefu Chai
8fd95430fe doc: add doc for pybind of rgw
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-11-09 21:07:29 +08:00
Kefu Chai
133d2f9fb4 admin/build-doc: s/iquote /iquote/
currently this works fine, but we ran into this problem before. and
technically "-iquote<dir>" is the valid syntax, and "-iquote <dir>"
is not. see https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-09 17:08:45 +08:00
Kefu Chai
333877023e doc,pybind: bypass sanity check if building doc
the empty .so file does not compile at all, so we need to bypass the
sanity check, if we are building docs. and what sphinx needs is just the
docstrings.

Fixes: http://tracker.ceph.com/issues/16940
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-09 17:08:45 +08:00