| 1 |
Common Configuration |
| 2 |
-------------------- |
| 3 |
|
| 4 |
Regardless of the package or code source you must do the following |
| 5 |
to properly setup the Accelerator Life Cycle Management service. |
| 6 |
A database, service credentials, and API endpoints must be created. |
| 7 |
|
| 8 |
#. To create the database, complete these steps: |
| 9 |
|
| 10 |
* Use the database access client to connect to the database |
| 11 |
server as the ``root`` user: |
| 12 |
|
| 13 |
.. code-block:: console |
| 14 |
|
| 15 |
$ mysql -u root -p |
| 16 |
.. |
| 17 |
|
| 18 |
* Create the ``cyborg`` database: |
| 19 |
|
| 20 |
.. code-block:: mysql |
| 21 |
|
| 22 |
CREATE DATABASE cyborg; |
| 23 |
.. |
| 24 |
|
| 25 |
* Grant proper access to the ``cyborg`` database: |
| 26 |
|
| 27 |
.. code-block:: mysql |
| 28 |
|
| 29 |
GRANT ALL PRIVILEGES ON cyborg.* TO 'cyborg'@'localhost' IDENTIFIED BY 'CYBORG_DBPASS'; |
| 30 |
.. |
| 31 |
|
| 32 |
Replace ``CYBORG_DBPASS`` with a suitable password. |
| 33 |
|
| 34 |
* Exit the database access client. |
| 35 |
|
| 36 |
.. code-block:: mysql |
| 37 |
|
| 38 |
exit; |
| 39 |
.. |
| 40 |
|
| 41 |
#. Source the ``admin`` credentials to gain access to |
| 42 |
admin-only CLI commands: |
| 43 |
|
| 44 |
.. code-block:: console |
| 45 |
|
| 46 |
$ . admin-openrc |
| 47 |
.. |
| 48 |
|
| 49 |
#. To create the service credentials, complete these steps: |
| 50 |
|
| 51 |
* Create the ``cyborg`` user: |
| 52 |
|
| 53 |
.. code-block:: console |
| 54 |
|
| 55 |
$ openstack user create --domain default --password-prompt cyborg |
| 56 |
.. |
| 57 |
|
| 58 |
* Add the ``admin`` role to the ``cyborg`` user: |
| 59 |
|
| 60 |
.. code-block:: console |
| 61 |
|
| 62 |
$ openstack role add --project service --user cyborg admin |
| 63 |
.. |
| 64 |
|
| 65 |
* Create the cyborg service entities: |
| 66 |
|
| 67 |
.. code-block:: console |
| 68 |
|
| 69 |
$ openstack service create --name cyborg --description "Acceleration Service" accelerator |
| 70 |
.. |
| 71 |
|
| 72 |
#. Create the Acceleration service API endpoints: |
| 73 |
|
| 74 |
* If cyborg-api service is deployed using uwsgi, create the following |
| 75 |
endpoints: |
| 76 |
|
| 77 |
.. code-block:: console |
| 78 |
|
| 79 |
$ openstack endpoint create --region RegionOne \ |
| 80 |
accelerator public http://<cyborg-ip>/accelerator/v2 |
| 81 |
$ openstack endpoint create --region RegionOne \ |
| 82 |
accelerator internal http://<cyborg-ip>/accelerator/v2 |
| 83 |
$ openstack endpoint create --region RegionOne \ |
| 84 |
accelerator admin http://<cyborg-ip>/accelerator/v2 |
| 85 |
.. |
| 86 |
|
| 87 |
* Otherwise, if cyborg-api service is running as a python process, create |
| 88 |
the following endpoints: |
| 89 |
|
| 90 |
.. code-block:: console |
| 91 |
|
| 92 |
$ openstack endpoint create --region RegionOne \ |
| 93 |
accelerator public http://<cyborg-ip>:6666/v2 |
| 94 |
$ openstack endpoint create --region RegionOne \ |
| 95 |
accelerator internal http://<cyborg-ip>:6666/v2 |
| 96 |
$ openstack endpoint create --region RegionOne \ |
| 97 |
accelerator admin http://<cyborg-ip>:6666/v2 |
| 98 |
.. |
| 99 |
|
| 100 |
.. note:: |
| 101 |
|
| 102 |
URLs (publicurl, internalurl and adminurl) may be different |
| 103 |
depending on your environment. |
| 104 |
|
| 105 |
.. |
| 106 |
|
| 107 |
Configure Cyborg |
| 108 |
----------------- |
| 109 |
|
| 110 |
#. Edit ``cyborg.conf`` with your favorite editor. Below is an example |
| 111 |
which contains basic settings you likely need to configure. |
| 112 |
|
| 113 |
.. code-block:: ini |
| 114 |
|
| 115 |
[DEFAULT] |
| 116 |
transport_url = rabbit://%RABBITMQ_USER%:%RABBITMQ_PASSWORD%@%OPENSTACK_HOST_IP%:5672/ |
| 117 |
use_syslog = False |
| 118 |
state_path = /var/lib/cyborg |
| 119 |
debug = True |
| 120 |
|
| 121 |
... |
| 122 |
|
| 123 |
[api] |
| 124 |
host_ip = 0.0.0.0 |
| 125 |
|
| 126 |
... |
| 127 |
|
| 128 |
[database] |
| 129 |
connection = mysql+pymysql://%DATABASE_USER%:%DATABASE_PASSWORD%@%OPENSTACK_HOST_IP%/cyborg |
| 130 |
|
| 131 |
... |
| 132 |
|
| 133 |
[service_catalog] |
| 134 |
cafile = /opt/stack/data/ca-bundle.pem |
| 135 |
project_domain_id = default |
| 136 |
user_domain_id = default |
| 137 |
project_name = service |
| 138 |
password = cyborg |
| 139 |
username = cyborg |
| 140 |
auth_url = http://%OPENSTACK_HOST_IP%/identity |
| 141 |
auth_type = password |
| 142 |
|
| 143 |
... |
| 144 |
|
| 145 |
[placement] |
| 146 |
project_domain_name = Default |
| 147 |
project_name = service |
| 148 |
user_domain_name = Default |
| 149 |
password = password |
| 150 |
username = placement |
| 151 |
auth_url = http://%OPENSTACK_HOST_IP%/identity |
| 152 |
auth_type = password |
| 153 |
auth_section = keystone_authtoken |
| 154 |
|
| 155 |
... |
| 156 |
|
| 157 |
[nova] |
| 158 |
project_domain_name = Default |
| 159 |
project_name = service |
| 160 |
user_domain_name = Default |
| 161 |
password = password |
| 162 |
username = nova |
| 163 |
auth_url = http://%OPENSTACK_HOST_IP%/identity |
| 164 |
auth_type = password |
| 165 |
auth_section = keystone_authtoken |
| 166 |
|
| 167 |
... |
| 168 |
|
| 169 |
[keystone_authtoken] |
| 170 |
memcached_servers = localhost:11211 |
| 171 |
signing_dir = /var/cache/cyborg/api |
| 172 |
cafile = /opt/stack/data/ca-bundle.pem |
| 173 |
project_domain_name = Default |
| 174 |
project_name = service |
| 175 |
user_domain_name = Default |
| 176 |
password = cyborg |
| 177 |
username = cyborg |
| 178 |
auth_url = http://%OPENSTACK_HOST_IP%/identity |
| 179 |
auth_type = password |
| 180 |
|
| 181 |
.. |
| 182 |
|
| 183 |
#. Create database tables for Cyborg. |
| 184 |
|
| 185 |
.. code-block:: console |
| 186 |
|
| 187 |
cyborg-dbsync --config-file /etc/cyborg/cyborg.conf upgrade |
| 188 |
.. |
| 189 |
|
| 190 |
#. Install Cyborg API via WSGI :doc:`api-uwsgi <../admin/config-wsgi>` |
| 191 |
|
| 192 |
.. note:: |
| 193 |
|
| 194 |
Cyborg-api service can also be run as a Python command that |
| 195 |
runs a web serve, which can be launched as follows with different |
| 196 |
Acceleration service API endpoints as mentioned in Prerequisites part. |
| 197 |
However, we would like to recommend you the uwsgi way since when a |
| 198 |
project provides a WSGI application the API service gains |
| 199 |
flexibility in terms of deployment, performance, configuration |
| 200 |
and scaling. BYW, if you choose devstack to deploy your acceleration |
| 201 |
service, uwsgi is a default choice. |
| 202 |
|
| 203 |
cyborg-api --config-file=/etc/cyborg/cyborg.conf |
| 204 |
|
| 205 |
#. Launch Cyborg Conductor, Cyborg Agent services. Open a separate |
| 206 |
terminal for each service since the console will be locked by |
| 207 |
a running process. |
| 208 |
|
| 209 |
.. code-block:: console |
| 210 |
|
| 211 |
cyborg-conductor --config-file=/etc/cyborg/cyborg.conf |
| 212 |
cyborg-agent --config-file=/etc/cyborg/cyborg.conf |
| 213 |
.. |