2010-11-04 02:06:28 -04:00
..
2011-01-04 16:58:08 -06:00
Copyright 2010-2011 United States Government as represented by the
2012-03-01 16:54:28 -05:00
Administrator of the National Aeronautics and Space Administration.
2010-11-04 02:06:28 -04:00
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
2015-05-14 14:57:54 -07:00
=======================
Development Quickstart
=======================
2010-11-04 02:06:28 -04:00
2014-07-24 14:46:15 -04:00
This page describes how to setup and use a working Python development
2012-03-01 16:54:28 -05:00
environment that can be used in developing nova on Ubuntu, Fedora or
2014-07-24 14:46:15 -04:00
Mac OS X. These instructions assume you're already familiar with git.
2012-03-01 16:54:28 -05:00
2014-07-24 14:46:15 -04:00
Following these instructions will allow you to build the documentation
and run the nova unit tests. If you want to be able to run nova (i.e.,
launch VM instances), you will also need to --- either manually or by
letting DevStack do it for you --- install libvirt and at least one of
the `supported hypervisors`_ . Running nova is currently only supported
on Linux, although you can run the unit tests on Mac OS X.
2012-03-01 16:54:28 -05:00
.. _supported hypervisors: http://wiki.openstack.org/HypervisorSupportMatrix
2011-11-26 08:43:16 -05:00
2011-11-19 17:30:40 -05:00
2015-05-14 14:57:54 -07:00
.. note :: For how to contribute to Nova, see
HowToContribute_.
Nova uses the Gerrit code review system, GerritWorkflow_.
.. _GerritWorkflow: http://docs.openstack.org/infra/manual/developers.html#development-workflow
.. _HowToContribute: http://docs.openstack.org/infra/manual/developers.html
2015-08-04 22:03:51 -07:00
.. _`docs.openstack.org`: http://docs.openstack.org
2015-05-14 14:57:54 -07:00
2014-07-24 14:46:15 -04:00
Setup
=====
There are two ways to create a development environment: using
DevStack, or explicitly installing and cloning just what you need.
Using DevStack
--------------
2012-03-01 16:54:28 -05:00
2015-05-13 15:34:11 -07:00
See `Devstack`_ Documentation. If you would like to use Vagrant, there is a `Vagrant`_ for DevStack.
2014-07-24 14:46:15 -04:00
2015-05-13 15:34:11 -07:00
.. _`Devstack`: http://docs.openstack.org/developer/devstack/
.. _`Vagrant`: https://github.com/openstack-dev/devstack-vagrant/blob/master/README.md
2013-02-09 09:14:49 -06:00
2015-05-13 15:34:11 -07:00
..
Until the vagrant markdown documents are rendered somewhere on .openstack.org, linking to github
2014-07-24 14:46:15 -04:00
Explicit Install/Clone
----------------------
2011-11-19 17:30:40 -05:00
2014-07-24 14:46:15 -04:00
DevStack installs a complete OpenStack environment. Alternatively,
you can explicitly install and clone just what you need for Nova
development.
The first step of this process is to install the system (not Python)
packages that are required. Following are instructions on how to do
this on Linux and on the Mac.
2010-11-23 12:49:28 -06:00
Linux Systems
2014-07-24 14:46:15 -04:00
`` ` ` ` ` ` ` ` ` ` ``
2010-11-23 12:49:28 -06:00
2012-03-01 16:54:28 -05:00
.. note ::
2014-09-15 20:07:18 -07:00
This section is tested for Nova on Ubuntu (14.04-64) and
2012-03-01 16:54:28 -05:00
Fedora-based (RHEL 6.1) distributions. Feel free to add notes and
change according to your experiences or operating system.
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
Install the prerequisite packages.
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
On Ubuntu::
2010-11-23 12:49:28 -06:00
2016-01-27 16:22:28 +00:00
sudo apt-get install python-dev libssl-dev python-pip git-core libxml2-dev libxslt-dev pkg-config libffi-dev libpq-dev libmysqlclient-dev graphviz libsqlite3-dev python-tox python3-dev python3 gettext
2012-10-19 15:58:47 +01:00
2011-11-19 17:30:40 -05:00
On Fedora-based distributions (e.g., Fedora/RHEL/CentOS/Scientific Linux)::
2010-11-23 12:49:28 -06:00
2016-01-27 16:22:28 +00:00
sudo yum install python-devel openssl-devel python-pip git gcc libxslt-devel mysql-devel postgresql-devel libffi-devel libvirt-devel graphviz sqlite-devel python3-devel python3 gettext
2013-09-10 09:06:21 -04:00
sudo pip-python install tox
2010-11-23 12:58:08 -06:00
2016-03-14 11:28:34 +01:00
On openSUSE-based distributions (SLES 12, openSUSE Leap 42.1 or Tumbleweed)::
2014-09-25 15:52:09 +02:00
2016-01-27 16:22:28 +00:00
sudo zypper in gcc git libffi-devel libmysqlclient-devel libvirt-devel libxslt-devel postgresql-devel python-devel python-pip python-tox python-virtualenv python3-devel python3 gettext-runtime
2014-09-25 15:52:09 +02:00
2011-11-26 08:43:16 -05:00
2011-11-19 17:30:40 -05:00
Mac OS X Systems
2014-07-24 14:46:15 -04:00
`` ` ` ` ` ` ` ` ` ` ` ` ` ``
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
Install virtualenv::
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
sudo easy_install virtualenv
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
Check the version of OpenSSL you have installed::
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
openssl version
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
The stock version of OpenSSL that ships with Mac OS X 10.6 (OpenSSL 0.9.8l)
2015-03-21 18:29:59 -04:00
or Mac OS X 10.7 (OpenSSL 0.9.8r) or Mac OS X 10.10.3 (OpenSSL 0.9.8zc) works
fine with nova. OpenSSL versions from brew like OpenSSL 1.0.1k work fine
as well.
2010-11-23 12:49:28 -06:00
2011-11-19 17:30:40 -05:00
Getting the code
2014-07-24 14:46:15 -04:00
`` ` ` ` ` ` ` ` ` ` ` ` ` ``
Once you have the prerequisite system packages installed, the next
step is to clone the code.
2014-09-15 20:07:18 -07:00
Grab the code from git::
2010-11-23 12:58:08 -06:00
2014-09-15 20:07:18 -07:00
git clone https://git.openstack.org/openstack/nova
2010-11-23 12:58:08 -06:00
cd nova
2010-11-23 12:49:28 -06:00
2014-07-24 14:46:15 -04:00
Building the Documentation
==========================
2015-07-06 15:18:59 -07:00
Install the prerequisite packages: graphviz
2014-07-24 14:46:15 -04:00
To do a full documentation build, issue the following command while
the nova directory is current.
.. code-block :: bash
tox -edocs
That will create a Python virtual environment, install the needed
Python prerequisites in that environment, and build all the
documentation in that environment.
2011-11-19 17:30:40 -05:00
Running unit tests
2014-07-24 14:46:15 -04:00
==================
2011-11-19 17:30:40 -05:00
2015-05-15 13:24:36 -07:00
See `Running Python Unit Tests`_ .
2011-11-19 17:30:40 -05:00
2015-05-15 13:24:36 -07:00
.. _`Running Python Unit Tests`: http://docs.openstack.org/infra/manual/python.html#running-python-unit-tests
2010-12-30 12:10:31 -05:00
2013-11-13 13:16:26 -08:00
Using a remote debugger
2014-07-24 14:46:15 -04:00
=======================
2013-11-13 13:16:26 -08:00
Some modern IDE such as pycharm (commercial) or Eclipse (open source) support remote debugging. In order to run nova with remote debugging, start the nova process
with the following parameters
--remote_debug-host <host IP where the debugger is running>
--remote_debug-port <port it is listening on>
Before you start your nova process, start the remote debugger using the instructions for that debugger.
For pycharm - http://blog.jetbrains.com/pycharm/2010/12/python-remote-debug-with-pycharm/
For Eclipse - http://pydev.org/manual_adv_remote_debugger.html
More detailed instructions are located here - http://novaremotedebug.blogspot.com
2013-12-13 17:03:19 +01:00
Using fake computes for tests
2014-07-24 14:46:15 -04:00
=============================
2013-12-13 17:03:19 +01:00
The number of instances supported by fake computes is not limited by physical
2014-07-22 12:14:41 +02:00
constraints. It allows you to perform stress tests on a deployment with few
2013-12-13 17:03:19 +01:00
resources (typically a laptop). But you must avoid using scheduler filters
limiting the number of instances per compute (like RamFilter, DiskFilter,
AggregateCoreFilter), otherwise they will limit the number of instances per
compute.
Fake computes can also be used in multi hypervisor-type deployments in order to
take advantage of fake and "real" computes during tests:
* create many fake instances for stress tests
* create some "real" instances for functional tests
Fake computes can be used for testing Nova itself but also applications on top
of it.