Files
deb-keystone/doc/source/devref/development_environment.rst
Lance Bragstad 0c55bae655 Move development environment setup to contributor docs
The development environment setup docs were duplicated in two
separate places. This commit remove it from the "Getting Started"
section and into the contributor guide.

Change-Id: If243fd9896be286f9d4c80139eb3cb86600f0052
2017-07-18 16:31:00 +00:00

4.5 KiB

Setting up the Environment

This document describes getting the source from keystone's Git Repository and setting the environment up for development purposes.

To install keystone from packaging, refer instead to OpenStack's User Documentation.

Prerequisites

This document assumes you are using an Ubuntu, Fedora, or openSUSE platform and that you have the following tools pre-installed on your system:

  • python 2.7 and 3.5, as the programming language;
  • git, as the version control tool;

Reminder: If you are successfully using a different platform, or a different version of the above, please document your configuration here!

Installing from source

The source install instructions specifically avoid using platform specific packages. Instead, we recommend using the source for the code and the Python Package Index (PyPi) for development environment installations..

It's expected that your system already has python, pip, and git available.

Clone the keystone repository:

$ git clone https://git.openstack.org/openstack/keystone.git
$ cd keystone

Install the keystone web service:

$ pip install -e .

Note

This step is guaranteed to fail if you do not have the proper binary dependencies already installed on your development system. Maintaining a list of platform-specific dependencies is outside the scope of this documentation, but is within scope of DEVSTACK.

Development environment

For setting up the Python development environment and running tox testing environments, please refer to the Project Team Guide: Python Project Guide, the OpenStack guide on wide standard practices around the use of Python.

That documentation will help you configure your development environment and run keystone tests using tox, which uses virtualenv to isolate the Python environment. After running it, notice the existence of a .tox directory.

Deploying configuration files

You should be able to run keystone after installing via pip. Additional configuration files are required, however. The following files are required in order to run keystone:

  • keystone.conf
  • keystone-paste.ini

You can generate a sample configuration file using tox -e genconfig. You can also generate sample policy files using tox -e genpolicy. Please refer to ../configuration for guidance on specific configuration options or to view a sample paste file.

Bootstrapping a test deployment

You can use the keystone-manage bootstrap command to pre-populate the database with necessary data.

Verifying keystone is set up

Once set up, you should be able to invoke Python and import the libraries:

$ .tox/py27/bin/python -c "import keystone"

If you can import keystone without a traceback, you should be ready to move on to the next sections.

You can run keystone using a host of wsgi implementations or web servers. The following uses uwsgi:

$ uwsgi --http 127.0.0.1:35357 --wsgi-file $(which keystone-wsgi-admin)

Database setup

The script tools/test-setup.sh sets up databases as used by the unit tests.