Ways to install Watcher¶
This document describes some ways to install Watcher in order to use it. If you are intending to develop on or with Watcher, please read Set up a development environment manually.
The source install instructions specifically avoid using platform specific packages, instead using the source for the code and the Python Package Index (PyPi).
Your system shall also have some additional system libraries:
On Ubuntu (tested on 16.04LTS):$ sudo apt-get install python-dev libssl-dev libmysqlclient-dev libffi-dev
On Fedora-based distributions e.g., Fedora/RHEL/CentOS/Scientific Linux (tested on CentOS 7.1):$ sudo yum install gcc python-devel openssl-devel libffi-devel mysql-devel
Installing from Source¶
Clone the Watcher repository:
$ git clone https://opendev.org/openstack/watcher.git $ cd watcher
Install the Watcher modules:
# python setup.py install
The following commands should be available on the command-line path:
watcher-apithe Watcher Web service used to handle RESTful requests
watcher-decision-enginethe Watcher Decision Engine used to build action plans, according to optimization goals to achieve.
watcher-applierthe Watcher Applier module, used to apply action plan
watcher-db-manageused to bootstrap Watcher data
You will find sample configuration files in
Install the Watcher modules dependencies:
# pip install -r requirements.txt
From here, refer to Configuring Watcher to declare Watcher as a new service into Keystone and to configure its different modules. Once configured, you should be able to run the Watcher services by issuing these commands:
$ watcher-api $ watcher-decision-engine $ watcher-applier
By default, this will show logging on the console from which it was started. Once started, you can use the Watcher Client to play with Watcher service.
Installing from packages: PyPI¶
Watcher package is available on PyPI repository. To install Watcher on your system:
$ sudo pip install python-watcher
The Watcher services along with its dependencies should then be automatically installed on your system.
Once installed, you still need to declare Watcher as a new service into Keystone and to configure its different modules, which you can find described in Configuring Watcher.
Installing from packages: Debian (experimental)¶
Here is single Dockerfile snippet you can use to run your Docker container:
FROM debian:experimental MAINTAINER David TARDIVEL <email@example.com> RUN apt-get update RUN apt-get dist-upgrade RUN apt-get install vim net-tools RUN apt-get install experimental watcher-api CMD ["/usr/bin/watcher-api"]
Build your container from this Dockerfile:
$ docker build -t watcher/api .
To run your container, execute this command:
$ docker run -d -p 9322:9322 watcher/api
Check in your logs Watcher API is started
$ docker logs <container ID>
You can run similar container with Watcher Decision Engine (package
watcher-decision-engine) and with the Watcher Applier (package