Skip to content

Commit

Permalink
[docs] Deploy cyborg api under WSGI server
Browse files Browse the repository at this point in the history
This patch adds the docs for deploying cyborg api under WSGI server
and fixes a few small mistakes.

Change-Id: I51529d0f0fbaeac34b39e4fb84396e08263ef499
  • Loading branch information
YumengBao committed Oct 24, 2018
1 parent 4475cc9 commit f3a017d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
46 changes: 46 additions & 0 deletions doc/source/admin/config-wsgi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Installing Cyborg API via WSGI
==============================

Cyborg-api service can be run either as a Python command that runs a web serve
or As a WSGI application hosted by uwsgi. This document is a guide to deploy
cyborg-api using uwsgi. In devstack, uwsgi is used by default for development.

WSGI Application
----------------

The function ``cyborg.api.wsgi_app.init_application`` will setup a WSGI
application to run behind uwsgi.

Watcher API behind uwsgi
------------------------

Create a ``cyborg-api-uwsgi`` file with content below:

.. code-block:: ini
[uwsgi]
chmod-socket = 666
socket = /var/run/uwsgi/cyborg-wsgi-api.socket
lazy-apps = true
add-header = Connection: close
buffer-size = 65535
hook-master-start = unix_signal:15 gracefully_kill_them_all
thunder-lock = true
plugins = python
enable-threads = true
worker-reload-mercy = 90
exit-on-reload = false
die-on-term = true
master = true
processes = 2
wsgi-file = /usr/local/bin/cyborg-wsgi-api
.. end
Start cyborg-api:

.. code-block:: console
# uwsgi --ini /etc/cyborg/cyborg-api-uwsgi.ini
.. end
2 changes: 1 addition & 1 deletion doc/source/contributor/devstack_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Enable services
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service quantum
enable_service neutron
enable_service n-novnc
enable_plugin cyborg git://git.openstack.org/openstack/cyborg
NOVA_VNC_ENABLED=True
Expand Down
1 change: 1 addition & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Installation
:maxdepth: 1

install/installation
admin/config-wsgi

API
~~~
Expand Down
4 changes: 2 additions & 2 deletions doc/source/install/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Installation

At the command line::

$ pip install cyborg
$ pip install openstack-cyborg

Or, if you have virtualenvwrapper installed::

$ mkvirtualenv cyborg
$ pip install cyborg
$ pip install openstack-cyborg

0 comments on commit f3a017d

Please sign in to comment.