Commit Graph

87 Commits

Author SHA1 Message Date
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
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
Alfredo Deza
7ab6a39005 tools: pin the version of breathe that works with Python2
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2019-04-23 09:09:09 -04: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
Kefu Chai
358e85be8a doc: bump up sphinx and pyyaml versions
* bump up pyyaml version to address CVE-2017-18342, see
  https://nvd.nist.gov/vuln/detail/CVE-2017-18342
* bump up sphinx to the latest stable

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-01-21 23:22:42 +08: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
Noah Watkins
c475484f43 doc: install build-doc deps without git clone
With `-e` the repository is cloned, leading to `git clean` skipping
the cloned dependencies due to the `.git` directory, and forcing manual
removal.

[nwatkins@daq ceph]$ git clean -dxf
Skipping repository build-doc/virtualenv/src/breathe
Skipping repository build-doc/virtualenv/src/sphinx-ditaa

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-10-03 15:49:27 -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
Kefu Chai
fda079d5ed doc: switch to upstream sphinx-ditaa
it works with setuptools and is now compatible with py3

the py3 branch is created to track the upstream's master branch

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-11 23:05:26 +08:00
Kefu Chai
c6056be36a doc: remove manpage-howto.txt
since manpages are built as part of "make" process, we can dispense with
the manual steps.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-08-22 11:11:17 +08:00
Alfredo Deza
88a1114cb3 admin: bump sphinx to 1.6
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2017-08-16 08:20:00 -04: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
10ff461fc0 script: serve-doc print the port we're serving
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
2017-04-10 19:16:56 +02: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