Commit Graph

53 Commits

Author SHA1 Message Date
Kefu Chai
f481f86aa3 doc: render release with mermaid gantt
for better readability

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-06-15 00:38:22 -04:00
Josh Durgin
5ecc3d9776 doc/releases: remove dev and pre-nautilus releases from timeline
Improve readability of the table - all this information is still
preserved in older branches.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2022-01-13 19:52:20 -05:00
Yehuda Sadeh
50ab91473e doc/rgw: fix docs build
Workaround rgw modules conflict, as there are two separate modules named
rgw: src/pybind/rgw, src/pybind/mgr/rgw

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2021-11-30 10:57:14 -08:00
Kefu Chai
81716438ec doc/_ext: print out the module which fails the build
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-05 17:50:12 +08:00
Sage Weil
b18427da4b Merge PR #41509 into master
* refs/pull/41509/head:
	common/cmdparse: fix CephBool validation for tell commands
	mgr/nfs: fix 'nfs export create' argument order
	common/cmdparse: emit proper json
	mon/MonCommands: add -- seperator to example
	qa/tasks/cephfs/test_nfs: fix export create test
	mgr: make mgr commands compat with pre-quincy mon
	doc/_ext/ceph_commands: handle non-positional args in docs
	mgr: fix reweight-by-utilization cephbool flag
	mon/MonCommands: convert some CephChoices to CephBool
	mgr/k8sevents: fix help strings
	pybind/mgr/mgr_module: fix help desc formatting
	mgr/orchestrator: clean up 'orch {daemon add,apply} rgw' args
	mgr/orchestrator: add end_positional to a few methods
	mgr/orchestrator: reformat a few methods
	pybind/ceph_argparse: stop parsing when we run out of positional args
	pybind/ceph_argparse: remove dead code
	pybind/mgr/mgr_module: infer non-positional args
	pybind/mgr/mgr_module: add separator for non-positional args
	command/cmdparse: use -- to separate positional from non-positional args
	pybind/ceph_argparse: adjust help text for non-positional args
	pybind/ceph_argparse: track a 'positional' property on cli args

Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-06-07 10:02:52 -04:00
Sage Weil
295a5f2827 doc/_ext/ceph_commands: handle non-positional args in docs
Signed-off-by: Sage Weil <sage@newdream.net>
2021-06-04 16:56:17 -04:00
Kefu Chai
a4c278a3a4 doc/_ext: render :example: field of an option
some options have this fields in their document, let's render it as
well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-25 20:56:37 +08:00
Kefu Chai
ecc332248b
Merge pull request #41245 from tchaikov/wip-doc-confval-ext
doc/_ext: fixes related to mgr option rendering

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-05-13 09:21:51 +08:00
Kefu Chai
80eb4f42fb doc/_ext: print "default" using "literal" filter
there is chance that the default value of an option is empty, before
this change the rendered result would be "````", and sphinx is confused
at seeing this:

Unexpected section title or transition.

as it takes it as a notion of section title. after this change,
the "literal" filter is always applied to the default value, so an empty
string is rendered like "<empty string>" instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 16:05:04 +08:00
Kefu Chai
44e611ce30 doc/_ext: define a helper for current_module()
less repeating this way, this change also addresses the missing option
issue if the option to be rendered is the first option in a document,
and there is no "mgr_module" directive before it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 16:05:04 +08:00
Kefu Chai
f948b5acf7 doc/_ext: do not require "mgr_module" at end of document
before this change,

.. mgr_module:: None

is required at end of a mgr module document to reset the context, so
the builder env is not polluted when processing the next document.

after this change, this ending directive is not needed anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
8c4c5eb8e1 doc/_ext: do not load all modules for a certain module
instead of collecting all options from all modules, just load the
options from the specified module, this addresses the issue where
options with the same name are overriden by the options defined by
another mgr module.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
c1d6fc0f5d doc/_ext: add "module" option to confval
in addition to "mgr_module" directive, add the "module" option to
confval. this allows a certain option to specify its own module without
being nested in a "mgr_module" directive pair.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
1c9aef07fc doc/_ext: use str for mgr module options by default
sometimes, they don't specify the option type and just default to "str".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
73dfb8d5a8 doc/_ext: compose name using cur_module and option name
so a mgr option can be referenced using
`mgr/<module_name>/<option_name>`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 15:43:59 +08:00
Kefu Chai
f84504464a doc/_ext: render constraint and policies if available
they are used by rbd options.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-10 20:57:00 +08:00
Kefu Chai
e6254a9dcb doc/_ext: rewrite directive using ObjectDescription
which allows us to use different scheme when defining an option,

without this change, if two options in different mgr module share the
same name we cannot differentiate them, after this change, their id
would prefixed with the module name.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-06 22:21:43 +08:00
Kefu Chai
98dc0d4e85 doc/_ext: load options defined by mgr modules
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-06 20:54:42 +08:00
Kefu Chai
659d01dcb5 doc/_ext: ignore desc if it is unavailable
there is chance that we don't have desc, desc_long or fmt_desc, in that
case, we should just skip desc before checking its length. so, just use
'if desc' which is able to check for None or empty string.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 19:57:29 +08:00
Kefu Chai
ab7cb630ae doc/_ext: check "default" for None
default could be None and we don't reference the default value using
`opt.default`, so this variable is always defined. to avoid printing
a None default value, check for a None value. see
https://jinja.palletsprojects.com/en/2.11.x/templates/#none

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 18:17:02 +08:00
Kefu Chai
d1aacf555e doc/_ext: print 0B if option value is 0
before this change, the rendered Default is "0Ei" if the default size is 0,
would be more readable if it is "0B" or "0".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 17:50:38 +08:00
Kefu Chai
a2ed53a7fa doc/_ext/ceph_confval: print "false" default values
before this change, we check the exisitence of default value of an
option using "if default", but this is wrong. what if "default" is an
empty string or a numeric value of 0, or just False?

after this change, its exisitence is checked using "if default is
defined", so all "false" default values are rendered as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-28 10:39:12 +08:00
Kefu Chai
977ed06f9e doc/_ext/ceph_confval: print out option name if it does not render
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-22 13:00:43 +08:00
Kefu Chai
fffa02706b doc/_ext: use iec_size() instead of filesizeformat()
to format size options in the same format supported by our C++
strict_iec_cast() parser. so they are more consistent from user's
perspective.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:46 +08:00
Kefu Chai
76fb3d147d doc: use "confsec" role for configure section
and rename confval_section to confsec for shorter name

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
02a15a81d8 doc: use ":confval:" role to reference options defined using confval
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
d1c6182fa2 doc/_ext: render see_also field
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
1128f4e22f doc/_ext: render more fields in an option
* print "enum_value" as a list
* print "note" and "warning"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-19 17:08:45 +08:00
Kefu Chai
4da18aaf57 common/options,doc: extract formatted desc into .yaml.in
* add a field named "fmt_desc", which is the description formatted using
  reStructuredText. it is preserved as it is if it's different from the
  desc or long_desc of an option. we can consolidate it with long_desc
  in future, and use pretty printer which has minimal support for
  reStructuredText for printing the formatted descriptions for a better
  user experience of command line. but at this moment, fmt_desc has
  only one consumer: the "ceph_confval" sphinx extension which extracts
  and translate the options yaml file to reStructuredText, which is in
  turn rendered by sphinx.
* remove unused options from the doc
  - journal_queue_max_ops
  - journal_queue_max_bytes

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-17 00:02:45 +08:00
Kefu Chai
bd9b597242 doc: add "confval_section" directive
instead of reusing "confval" directive, define a new directive just
for configration sections

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-16 20:27:24 +08:00
Kefu Chai
4b6a3f8161 doc/_ext: extract confval into an extension
better readability this way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-15 00:37:45 +08:00
Kefu Chai
d867d07890 doc/_ext: claim ceph_releses ext to be parallel read safe
so we can pass `-j auto` to sphinx-build to speed up the build

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-14 18:41:38 +08:00
Sage Weil
2602ea916a doc/releases: reorg
- move current release table to index
- add table for past releases and actual EOL
- move past release timeline too
- make timeline less wide (avoid wrapping)
- use full dates, not just month + year
- clean up left-side toctree
- capitalize release names

Signed-off-by: Sage Weil <sage@newdream.net>
2021-03-31 13:58:28 -05:00
Kefu Chai
2bb6821f50 mgr/diskprediction_local: add Predictor abstract class
to make the interface more explicit, also pave the road to mypy.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-20 14:51:26 +08:00
Kefu Chai
7fdd7564fa doc: wrap example command
otherwise the field name in the field list would be rendered with a
small width.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-14 12:32:42 +08:00
Kefu Chai
1dbc32f69a doc: define command properties using field list
the rendering is more compacted this way, and the parameters can be
aligned.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-13 10:18:58 +08:00
Kefu Chai
642158fd38 doc: group commands by prefix
as there are lots commands, the toc in sidebar is clutterred with them,
so would be better to group them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-13 10:18:58 +08:00
Kefu Chai
a3153bd53f doc: split the argdesc pair at the first '='
there is chance that the value of of the argdesc's kv pair contains
"=". for instance, the goodchars regexp could contain '='. so we should
stop at the first '='.

this change fixes the parsing of "osd pool application set" command.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-13 10:18:58 +08:00
Sebastian Wagner
a3555a22c8 doc: add rook_client._helper to mock_imports
This is due to `mgr/rook` now also includes `._helper`

Co-authored-by Kefu Chai <kchai@redhat.com>

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
2021-01-31 11:19:01 +08:00
Kefu Chai
620e318b2e doc/_ext: use iterator of tuple to build dict
As suggested by Ernesto Puerta <epuertat@redhat.com>

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-15 17:25:27 +08:00
Kefu Chai
0fb8a988df doc/_ext: PEP8 compliance
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-15 17:25:27 +08:00
Kefu Chai
d25ed64449 doc/_ext: do not mock ceph_argparse
this module is used for convert argspec to argdesc by
CLICommand.load_func_metadata()

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-15 17:25:27 +08:00
Kefu Chai
925c4d8d04 doc/_ext: add python_path option to ceph-mgr-commands
so we can add more python paths in addition to the one used for finding
mgr modules.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-15 17:25:27 +08:00
Kefu Chai
fbbe4474ac doc/_ext: parse prefix and args for command signature
unlike the commands defined by C++, the commands defined by python
now uses "prefix" and "args" properties of elements in COMMAND class
attribute to define their command and arguments. the "cmd" property is
still available for the ceph CLI.

but the ceph_command sphinx extension should now use "prefix" and "args"
for printing out the usage of commands implemented using python. in
this change, the extension is updated to read "prefix" and "args"
properties of command defined by python modules.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-15 17:25:27 +08:00
Kefu Chai
ef281f6b55 doc/_ext: accept params separated with ", "
"mon enable_stretch_mode" command's arg descriptors are delimited with
", ", so we should ignore empty kv when split the params with ",".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-08 11:35:42 +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
be26c566e5 doc: remove edit_on_github sphinx extension
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-01 15:41:45 +08:00
Kefu Chai
9442683f61 doc: drop py2 support
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-07-05 10:58:28 +08:00
Nathan Cutler
ad6304149e doc/releases/schedule.rst: drop dumpling from Timeline
The "dumpling" column goes past the right margin and looks wrong.
Also, this modification shortens the table by 10 rows or so, which
can't be a bad thing.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2019-09-17 17:42:50 +02:00
Torben Hørup
42a04ff114 Doc: update release schedule
Added nautilus + the latest releases from mimic and luminous
in order to keep dumpling column, ceph_releases is modified to allow 13 columns

Signed-off-by: Torben Hørup <th@synack.fo>
2019-06-13 01:12:42 +08:00