Documentation update for Django
1. install.rst 2. README.md 3. Minor fixed for network and environment models docstrings 4. Already not used helpers ( _underscored - was implemented in early devops 3, KeyPolicy) has been dropped completely. Change-Id: I36b537915e019193f28b452dbac13ee1c9ab289e
This commit is contained in:
parent
ba03574ff0
commit
ab8c98e639
12
README.md
12
README.md
|
@ -12,7 +12,7 @@ other customizations with a few lines of code in system tests.
|
|||
|
||||
Installation
|
||||
-------------
|
||||
The installation procedure can be implemented via PyPI in Python virtual environment (suppose you are using Ubuntu 12.04 or Ubuntu 14.04):
|
||||
The installation procedure can be implemented via PyPI in Python virtual environment (suppose you are using Ubuntu 12.04, Ubuntu 14.04 or Ubuntu 16.04):
|
||||
|
||||
Before using it, please install the following required dependencies:
|
||||
|
||||
|
@ -116,5 +116,11 @@ Testing
|
|||
==========
|
||||
There are next test targets that can be run to validate the code.
|
||||
|
||||
tox -e pep8 - style guidelines enforcement
|
||||
tox -e py27 - unit and integration testing
|
||||
tox -e pep8 - style guidelines enforcement
|
||||
tox -e pylint - static analisys of code quality
|
||||
tox -e py27 - unit and integration testing on Python 2.7 (if available)
|
||||
tox -e py34 - unit and integration testing on Python 3.4 (if available)
|
||||
tox -e py35 - unit and integration testing on Python 3.5 (if available)
|
||||
tox -e cover - tests coverage check
|
||||
tox -e docs - documentation consistency check
|
||||
|
||||
|
|
|
@ -229,21 +229,6 @@ def get_slave_ip(env, node_mac_address):
|
|||
return get_ip_from_json(js, node_mac_address)
|
||||
|
||||
|
||||
class KeyPolicy(paramiko.WarningPolicy):
|
||||
def __init__(self):
|
||||
warn(
|
||||
'devops.helpers.KeyPolicy is deprecated '
|
||||
'and will be removed soon', DeprecationWarning)
|
||||
logger.warning(
|
||||
'devops.helpers.KeyPolicy is deprecated '
|
||||
'and will be removed soon'
|
||||
)
|
||||
super(KeyPolicy, self).__init__()
|
||||
|
||||
def missing_host_key(self, client, hostname, key):
|
||||
return
|
||||
|
||||
|
||||
def ssh(*args, **kwargs):
|
||||
warn(
|
||||
'devops.helpers.ssh is deprecated '
|
||||
|
@ -325,15 +310,6 @@ def underscored(*args):
|
|||
return '_'.join(filter(bool, list(args)))
|
||||
|
||||
|
||||
def _underscored(*args):
|
||||
logger.warning(
|
||||
'_underscored has been deprecated in favor of underscored')
|
||||
warn(
|
||||
'_underscored has been deprecated in favor of underscored',
|
||||
DeprecationWarning)
|
||||
return underscored(*args)
|
||||
|
||||
|
||||
def get_nodes(admin_ip):
|
||||
keystone_auth = V2Password(
|
||||
auth_url="http://{}:5000/v2.0".format(admin_ip),
|
||||
|
|
|
@ -296,7 +296,8 @@ class Environment(BaseModel):
|
|||
|
||||
:param full_config: object that describes all the parameters of
|
||||
created environment
|
||||
:rtype: Environment
|
||||
|
||||
:rtype: Environment
|
||||
"""
|
||||
|
||||
config = full_config['template']['devops_settings']
|
||||
|
|
|
@ -51,6 +51,7 @@ class AddressPool(ParamedModel, BaseModel):
|
|||
|
||||
Template example (address_pools):
|
||||
---------------------------------
|
||||
|
||||
address_pools:
|
||||
|
||||
fuelweb_admin-pool01:
|
||||
|
@ -294,7 +295,7 @@ class NetworkPool(BaseModel):
|
|||
different AddressPools can be specified for each node group:
|
||||
|
||||
Template example (network_pools):
|
||||
-----------------
|
||||
---------------------------------
|
||||
|
||||
groups:
|
||||
- name: default
|
||||
|
@ -341,19 +342,24 @@ class NetworkPool(BaseModel):
|
|||
|
||||
For fuel-qa compatibility, default values are used if the range_name
|
||||
was not set:
|
||||
:param relative_start: int, default value for start of 'range_name'.
|
||||
relative from address_pool.ip_network, default=2
|
||||
:param relavite_end: int, default value for end of 'range_name'.
|
||||
relative from address_pool.ip_network, default=-2
|
||||
|
||||
:return: touple of two IPs for the range - ('x.x.x.x', 'y.y.y.y')
|
||||
:param relative_start:
|
||||
int, default value for start of 'range_name'.
|
||||
relative from address_pool.ip_network, default=2
|
||||
|
||||
:param relative_end:
|
||||
int, default value for end of 'range_name'.
|
||||
relative from address_pool.ip_network, default=-2
|
||||
|
||||
:return: tuple of two IPs for the range - ('x.x.x.x', 'y.y.y.y')
|
||||
|
||||
If 'range_name' is None: group.name is used as a default range.
|
||||
If 'range_name' not found in self.address_pool.ip_ranges:
|
||||
- IPs for the range are calculated using relative_start and
|
||||
relative_end values for the self.address_pool.ip_network.
|
||||
- Calculated range is stored in self.address_pool.ip_ranges for
|
||||
further usage. (for fuel-qa compatibility)
|
||||
- IPs for the range are calculated using relative_start and
|
||||
relative_end values for the self.address_pool.ip_network.
|
||||
|
||||
- Calculated range is stored in self.address_pool.ip_ranges for
|
||||
further usage. (for fuel-qa compatibility)
|
||||
"""
|
||||
if range_name is None:
|
||||
range_name = self.group.name
|
||||
|
|
|
@ -97,7 +97,7 @@ setup.py in fuel-devops repository does everything required.
|
|||
.. _DevOpsConf:
|
||||
|
||||
Configuration
|
||||
--------------
|
||||
-------------
|
||||
|
||||
Basically *devops* requires that the following system-wide settings are
|
||||
configured:
|
||||
|
@ -108,7 +108,7 @@ configured:
|
|||
* [Optional] Nested Paging is enabled
|
||||
|
||||
Configuring libvirt pool
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Create libvirt's pool
|
||||
|
||||
|
@ -119,7 +119,7 @@ Create libvirt's pool
|
|||
sudo virsh pool-start default
|
||||
|
||||
Permissions to run KVM VMs with libvirt with current user
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Give current user permissions to use libvirt: do not forget to log out and log
|
||||
back in.
|
||||
|
@ -129,12 +129,12 @@ back in.
|
|||
sudo usermod $(whoami) -a -G libvirtd,sudo
|
||||
|
||||
Configuring database
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can configure PostgreSQL database or as an alternative SQLite.
|
||||
|
||||
Configuring PostgreSQL
|
||||
+++++++++++++++++++++++
|
||||
++++++++++++++++++++++
|
||||
|
||||
Install postgresql package:
|
||||
|
||||
|
@ -160,7 +160,7 @@ Set local peers to be trusted by default, create user and db and load fixtures.
|
|||
sudo -u postgres createdb fuel_devops -O fuel_devops
|
||||
|
||||
Configuring SQLite3 database
|
||||
+++++++++++++++++++++++++++++
|
||||
++++++++++++++++++++++++++++
|
||||
|
||||
Install SQLite3 library:
|
||||
|
||||
|
@ -176,15 +176,25 @@ Export the path to the SQLite3 database as the database name:
|
|||
export DEVOPS_DB_ENGINE="django.db.backends.sqlite3
|
||||
|
||||
Configuring Django
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
After the database setup, we can install the django tables and data:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# For fuel-devops < 3.0 only:
|
||||
django-admin.py syncdb --settings=devops.settings
|
||||
|
||||
# For all versions of fuel-devops:
|
||||
django-admin.py migrate devops --settings=devops.settings
|
||||
|
||||
.. note:: Devops 3.0.0 is still allows to start both commands in queue, but
|
||||
in later versions command ::
|
||||
|
||||
syncdb
|
||||
|
||||
will be dropped and run of it will cause exception.
|
||||
|
||||
.. note:: Depending on your Linux distribution,
|
||||
`django-admin <http://django-admin-tools.readthedocs.org>`_ may refer
|
||||
to system-wide django installed from package. If this happens you could get
|
||||
|
@ -226,7 +236,7 @@ The result should be:
|
|||
|
||||
|
||||
Environment creation via Devops + Fuel_QA or Fuel_main
|
||||
-------------------------------------------------------
|
||||
------------------------------------------------------
|
||||
|
||||
Depending on the Fuel release, you may need a different repository.
|
||||
|
||||
|
@ -380,7 +390,7 @@ Run tests ::
|
|||
.. _How to migrate:
|
||||
|
||||
Upgrade from system-wide devops to devops in Python virtual environment
|
||||
------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
To migrate from older devops, follow these steps:
|
||||
|
||||
|
@ -413,9 +423,11 @@ see the section :ref:`_DevOpsSystemDependencies`
|
|||
|
||||
2. Update fuel-devops and Python venv on CI servers
|
||||
|
||||
To update fuel-devops, you can use the following examples:
|
||||
* Update fuel-devops versions 2.5 - 2.9
|
||||
|
||||
.. code-block:: bash
|
||||
To update fuel-devops, you can use the following examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# DevOps 2.5.x for system tests from 'fuel-main' repository
|
||||
if [ -f ~/venv-nailgun-tests/bin/activate ]; then
|
||||
|
@ -443,6 +455,59 @@ To update fuel-devops, you can use the following examples:
|
|||
django-admin.py migrate devops --settings=devops.settings --noinput
|
||||
deactivate
|
||||
|
||||
.. note:: Devops 3.0 has incompatible internal API with previous versions, so upgrade procedure is different.
|
||||
|
||||
* Upgrade fuel-devops 3.0 and upper
|
||||
|
||||
* Upgrade from devops versions < 3.0 requires additional step and it's always destructive:
|
||||
|
||||
.. note:: You should drop **ALL** virtual environments before processing!
|
||||
If you want to use both 2.9 and 3.0 environments - you should use separate databases.
|
||||
|
||||
Drop environments:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
source ~/venv-nailgun-tests-2.9/bin/activate
|
||||
dos.py list # get environments
|
||||
dos.py erase $env_name # substitute correct $env name manually
|
||||
deactivate
|
||||
|
||||
Recreate database:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo -u postgres dropdb fuel_devops
|
||||
sudo -u postgres createdb fuel_devops -O fuel_devops
|
||||
|
||||
Update:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# DevOps 3.0.x for system tests from 'fuel-qa' repository using old dir
|
||||
if [ -f ~/venv-nailgun-tests-2.9/bin/activate ]; then
|
||||
echo "Python virtual env exist"
|
||||
else
|
||||
rm -rf ~/venv-nailgun-tests-2.9
|
||||
virtualenv --no-site-packages ~/venv-nailgun-tests-2.9
|
||||
fi
|
||||
source ~/venv-nailgun-tests-2.9/bin/activate
|
||||
pip install -r https://raw.githubusercontent.com/openstack/fuel-qa/master/fuelweb_test/requirements.txt --upgrade
|
||||
django-admin.py migrate devops --settings=devops.settings --noinput
|
||||
deactivate
|
||||
|
||||
# DevOps 3.0.x for system tests from 'fuel-qa' repository using new dir
|
||||
if [ -f ~/venv-nailgun-tests-3.0/bin/activate ]; then
|
||||
echo "Python virtual env exist"
|
||||
else
|
||||
rm -rf ~/venv-nailgun-tests-3.0
|
||||
virtualenv --no-site-packages ~/venv-nailgun-tests-3.0
|
||||
fi
|
||||
source ~/venv-nailgun-tests-3.0/bin/activate
|
||||
pip install -r https://raw.githubusercontent.com/openstack/fuel-qa/master/fuelweb_test/requirements.txt --upgrade
|
||||
django-admin.py migrate devops --settings=devops.settings --noinput
|
||||
deactivate
|
||||
|
||||
3. Setup new repository of system tests for 6.1 release
|
||||
|
||||
All system tests for 6.1 and higher were moved to
|
||||
|
|
2
setup.py
2
setup.py
|
@ -49,6 +49,6 @@ setup(
|
|||
'pytest>=2.7.1',
|
||||
'pytest-django >= 2.8.0',
|
||||
'mock>=1.2',
|
||||
'tox'
|
||||
'tox>=2.0'
|
||||
],
|
||||
)
|
||||
|
|
9
tox.ini
9
tox.ini
|
@ -4,9 +4,11 @@
|
|||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
minversion = 1.6
|
||||
envlist = pep8, py{27,34,35}, pylint, pylint-py{27,34,35}, cover
|
||||
minversion = 2.0
|
||||
envlist = pep8, py{27,34,35}, pylint, pylint-py{27,34,35}, cover, docs
|
||||
skipsdist = True
|
||||
skip_missing_interpreters = True
|
||||
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
|
@ -70,7 +72,6 @@ count = True
|
|||
DJANGO_SETTINGS_MODULE=devops.test_settings
|
||||
|
||||
[testenv:docs]
|
||||
changedir = docs
|
||||
deps =
|
||||
sphinx
|
||||
commands = sphinx-build -b html -d build/doctrees source build/html
|
||||
commands = python setup.py build_sphinx
|
||||
|
|
Loading…
Reference in New Issue