Commit Graph

34 Commits

Author SHA1 Message Date
xuanyandong e37c5d2aff remove unicode from code
Change-Id: I4cf57785a3d2e6121fbb470b57a1ba48a3549ef6
2021-01-03 16:21:39 +08:00
Hervé Beraud 10ce88ed2b Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
  (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
  (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: Ib18f38dbec90c62e870307bf22a8b4f193237bce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:26:37 +02:00
melissaml a6d7025bfc Fix pygments style
New theme of docs respects pygments_style.

more info: http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: Ia2a26e5824bfd4465e85134ac893ff5644c2b78f
2020-06-04 15:01:32 +08:00
Zuul 0940a70cf9 Merge "Add release notes links to doc index" 2020-05-26 13:51:51 +00:00
Andreas Jaeger 3803ff29db Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering

Update Sphinx version as well.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

Set openstackdocs_auto_name to use 'project' as name.

Depends-On: https://review.opendev.org/728938
Change-Id: I4f21de08de3bfd89bf8e331b6c819932cde8ca2f
2020-05-18 20:54:17 +02:00
Hervé Beraud f4f9e80a7e Add release notes links to doc index
Change-Id: Ib1e6b220ffe771ccb29513d10252ed8b871c1340
2020-04-16 15:56:45 +02:00
Andreas Jaeger 5f184f1f5e Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Update classifiers
- Cleanup doc/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme version

Change-Id: I2c59ca525fa329b91720149cff3faee00fafff97
2020-04-13 11:18:16 +02:00
Hervé Beraud 65e2aa81b8 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I3ea32bcc39d887d296d70b080a90c536debd91b3
2020-02-03 18:35:41 +01:00
caoyuan 4a78c31863 tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: I7b4cc4b171e5605f2967378e9949d31ac0e1290c
2019-10-25 23:26:01 +08:00
Zuul 046507db14 Merge "Polish usage.rst" 2019-08-30 11:51:59 +00:00
Zuul 41186e6163 Merge "restart: don't stop process on sighup when mutating" 2019-08-30 11:51:58 +00:00
Eric Fried f48b15020a Polish usage.rst
- Use some more :roles: to make more things linky.
- Add some ``decoration`` around literals.
- Fix up some grammar.

Change-Id: I6b51a8774e502a34757a50aef5f4bc1fb37d8b96
2019-08-29 15:29:40 -05:00
Mohammed Naser e7dd291689 restart: don't stop process on sighup when mutating
It seems that the code for handling SIGHUP currently calls stop()
on the service, then calls reset(), then calls start() on it again.

This is effectively a full service restart, which breaks the whole
point behind using SIGHUP for hot and quick reloads.  It also breaks
our downstream projects in a few ways where they lose RPC on reload
due to the fact that they don't expect to have stop() called on a
reset().

This patch removes the stop and start when the restart_method is
set to 'mutate' because in that case we should just be signaling
the service to check for changes in its mutable config options.
It also changes the signal sent to children in that case to
SIGHUP, since SIGTERM will cause unnecessary restarts of child
processes.

The previous behavior is maintained for the 'reload' restart_method
since that does a complete reload of the service config, which is
not safe to do without restarting the service completely.

Change-Id: I86a34c22d41d87a9cce2d4ac6d95562d05823ecf
Closes-Bug: #1794708
Co-Authored-By: Ben Nemec <bnemec@redhat.com>
2019-08-29 14:30:58 -05:00
caoyuan d9ffc59031 Move doc related modules to doc/requirements.txt
Change-Id: I995f7c4e0152a19d2ae2890d6940419f30638444
2019-08-24 09:49:33 +08:00
jacky06 539885155a Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I4e964925d5a024545fc99f7fddbea3d9605b30d3
2019-04-30 13:48:51 +08:00
venkata anil a04daefbb1 Profile Oslo Service processes
This patch enables profiling (capturing function call trace like
cProfile [1]) worker processes on the fly while service is running.
User requests the oslo service process to start profiling by writing
"prof()" command to backdoor socket, once the service (like
neutron-server) finishes expected processing (example finishing API
call), user again writes "prof()" command with file name as argument
to dump the function calltrace stats. Stats file (in pstat format
with user provided filename by adding .prof) will be generated in
temp directory.

For example, to profile neutron server process,
1) echo "prof()" | nc localhost 8002
2) Issue neutron command (or run rally scenarios tests)
   neutron net-create n1
   neutron port-create --name p1 n1
   neutron port-delete p1
   neutron net-delete n1
3) echo "prof('neutron')" | nc localhost 8002
where 8002 is the port which we set like below in neutron.conf
backdoor_port=8002

We can later print the stats from the trace file like below
stats = pstats.Stats('/tmp/neutron.prof')
stats.print_stats()
The trace file will look like in (for above neutron API calls) [2].

We use Yappi with context set to greenlet [3] to profile greenlets.
We can't use GreenletProfiler [4], which does the same [5]
1) as it is no more maintained
2) Also compiling yappi source inside GreenletProfiler is failing for
   python3.

[1] https://docs.python.org/2/library/profile.html
[2] https://gist.github.com/venkataanil/64d5e672bf0206dc151e73fc1058a983
[3] https://bitbucket.org/sumerc/yappi/pull-requests/3
[4] https://pypi.org/project/GreenletProfiler/
[5] https://emptysqua.re/blog/greenletprofiler/

Depends-On: Ibea0cdb732923f1b53d5cb6aeeb4041fb5973494
Change-Id: Id2418093494f1e233a653f6c73bd6894e4a40184
2019-01-16 07:38:13 -05:00
Eric Fried b85d9353fb Fixture to mock loopingcall wait()
Consumers of loopingcall may wish to exercise their code in test cases
without incurring actual wall clock sleep time in their test runs.
Heretofore, this required digging into the internals of the loopingcall
module and mocking something private (or something hidden by something
private).

This patch exposes a public oslo_service.fixture.SleepFixture for this
purpose. It can be maintained opaquely as internals change without
affecting its consumers.

See [1] for (one example of) the motivation behind this change.

[1] https://review.openstack.org/#/c/615724/

Change-Id: I0089c7778957456db66599abffaaad3a5332243c
2018-11-07 09:34:51 -06:00
Akihiro Motoki 21de4a7c51 rearrange existing documentation to fit the new standard layout
Change-Id: I920d02fd4843c21f41c57f0effed31441ec5998e
2017-07-01 19:52:23 +09:00
Akihiro Motoki 343ce056ea switch from oslosphinx to openstackdocstheme
Change-Id: I068331d11e661ed28001607d66a761292699026c
2017-07-01 19:11:26 +09:00
ZhiQiang Fan b83ec523b4 [Trivial] Remove executable privilege of doc/source/conf.py
It is a configuration file, rather than a script.

Change-Id: Ie5bf4a871938873fe5300a28ddadfde33323951f
2016-04-29 20:15:35 +08:00
Marian Horban 15d0290a9a Document graceful_shutdown_timeout config option
In change I0dfbf2d0a4943337da24c0904a1ed6f0cdccd77b
option graceful_shutdown_timeout was added.

Change-Id: I7564fc97dbe8fbbfc9f3b36e4dfbfabc078495e2
2015-10-27 14:42:14 -04:00
Joshua Harlow 91a92f0db1 Add doc8 to py27 tox env and fix raised issues
Fixes a bunch of long lines and ensures that doc8
will not complain about any future issues by adding it
to the commands performed during running the py27 tox
environment.

Change-Id: I9ae2f2a05a408dbfe105bf38ea0ae235701fbe0e
2015-10-15 16:54:33 -07:00
Elena Ezhova f566c54864 Document termination of children on SIGHUP
Change I3e7264a1efcbf66a9afc69d8ed20f600c985c296 chenged behavior of
services when they receive SIGHUP. This needs to be documented.

Change-Id: I5a8de19ba4d7a5e2b27d88da8668f6171b7b2112
2015-10-14 14:13:54 +03:00
Jenkins fa759a0165 Merge "Expand README and clean up intro to sphinx docs" 2015-09-25 18:44:04 +00:00
Joshua Harlow 36b98af288 Move 'history' -> release notes section
This seems to better match what the other oslo
libraries are calling this section, so we might as
well call it that to.

Change-Id: I4121c980e586233b12d582085a66625dd62b87e7
2015-09-25 08:26:15 -07:00
Doug Hellmann 9102073850 Expand README and clean up intro to sphinx docs
Expand the description of the library in the README and the introduction
in the sphinx documentation.

Change-Id: Iab72b27f37e589eaaf354b93271d366285b97f71
2015-09-25 11:44:57 +00:00
Joshua Harlow 5c9d0d4511 add auto-generated docs for config options
Add automatically generated documentation for the configuration options
using oslo_config.sphinxext.

Change-Id: Ie698129e855dd35b2d0a4a1be625c2137f15f5e7
2015-09-24 18:43:55 +00:00
Marian Horban 6dd3ad50b6 Added wsgi functionality
Because of copy-pasted wsgi functionality in projects(nova, cinder,
glance, etc.) it is added to oslo.service with perspective to remove
it from other projects.
DocImpact

Change-Id: If8840168f10cc3561f4f01e6d456d6b4fd1de8b5
2015-08-19 12:01:40 +00:00
Elena Ezhova 0e3c918e88 Update "Signal handling" section of usage docs
* Add SIGINT to the list of handled signals.
* Add a note that SIGHUP is not supported on Windows.

Change-Id: I90a1b422e00a5d2978e74f3798e17d58a58572bc
Related-Bug: #1481607
2015-08-13 16:06:14 +03:00
Elena Ezhova a6cd5df347 Add usage documentation for oslo_service.service module
This change adds description of various ways of launching a service
and provides information on supported signals.

Description of launcher classes is moved from oslo_service.service.py
to usage.rst

Change-Id: I7b6a5337de4c25ad16bd33be48daa8ef8bf3b6f5
2015-07-14 16:00:39 +03:00
Sergey Vilgelm 1971e8bdb3 Documentation on the use of the oslo-config-generator
Describe the entry points of the oslo.service library for the oslo.config generator.

Change-Id: I88016e24bd982bfe56c5eb7f9528eb8acbb73a14
Closes-Bug: 1469066
2015-06-26 22:19:25 +02:00
Elena Ezhova 12bf0dbf81 Add documentation for the service module
Change-Id: I95564dd00dc57d47bf3accfcca13f74b594c5aa5
2015-06-15 14:41:42 +03:00
Elena Ezhova 050974ddc4 Add oslo.service documentation
Updated library's description in README.rst with one that is used
on Launchpad and PyPi.

Added API documentation for oslo_serive modules.

Updated usage documentation with information with the adoption
guidelines.

DocImpact
bp graduate-oslo-service

Change-Id: I4beaf30f47fb007b311e5a45ed7953c0f8df97c3
2015-06-11 16:06:54 +03:00
Elena Ezhova dd2f334781 exported from oslo-incubator by graduate.sh 2015-05-21 16:51:40 +03:00