The following instructions have been tested on Ubuntu 15.10 and 16.04.
First, you need to install all the required ubuntu packages. For this, please follow the steps below:
$ sudo apt-get install python3-dev python3-setuptools python3-pip python3-sqlalchemy libmysqlclient-dev mysql-server git
$ sudo pip3 install --upgrade requests gunicorn jsonschema pymysql flask flask-restplus Flask-SQLAlchemy
Now you have to clone this repository and all the submodules. Submodules include components that are part of the orchestrator but that are being developed in different repositories. This lead to the necessity to clone them as well in the right folders, under the FROG4 orchestrator root. For this, please follow the steps below:
$ git clone https://github.com/netgroup-polito/frog4-orchestrator.git
$ cd frog4-orchestrator
$ git submodule init && git submodule update
The frog4-orchestrator uses the DoubleDecker messaging system to communicate with the domain orchestrators. Then, you need to install the DoubleDecker client.
$ git clone https://github.com/Acreo/DoubleDecker-py.git
$ cd DoubleDecker-py
$ git reset --hard dc556c7eb30e4c90a66e2e00a70dfb8833b2a652
$ cp -r [frog4-orchestrator]/patches .
$ git am patches/doubledecker_client_python/0001-version-protocol-rollbacked-to-v3.patch
Now you can install the DoubleDecker as follows:
; install dependencies
$ sudo apt-get update
$ sudo apt-get install python3-setuptools python3-nacl python3-zmq python3-urwid python3-tornado
; install the doubledecker module and scripts
$ sudo python3 setup.py install
The FROG4 orchestrator uses a local mySQL database that has to be created and initialized by executing the steps below.
-
Create database and user for orchestrator database:
mysql -u root -p mysql> CREATE DATABASE orchestrator; mysql> GRANT ALL PRIVILEGES ON orchestrator.* TO 'orch-user'@'localhost' IDENTIFIED BY 'orch-pwd'; mysql> GRANT ALL PRIVILEGES ON orchestrator.* TO 'orch-user'@'%' IDENTIFIED BY 'orch-pwd'; mysql> exit;
where orch-user
and orch-pwd
can be replaced respectively by the username and the password that the FROG4-orchestator will use to access to the SQL database.
-
Create tables in the orchestrator db (all the initialization parameters are stored in the
db.sql
file):$ cd [frog4-orchestrator] $ mysql -u orch-user -p -Dorchestrator < db.sql
When it asks the password, enter that used above (i.e.,
orch-pwd
). The process may take some seconds.The script above also adds in the database the
admin
user (username:admin
,password:admin
).
To create a new user, run:
$ cd [frog4-orchestrator]
$ python3 -m scripts.create_user
To add a new user on the database
For this, you need to modify the config/default-config.ini file according to your preferences. Important parameters to be properly set are the following:
- broker address: this line must point to the broker previously installed;
- dd_keyfile: this line must point to a local file containing the key to be used on the message bus;
- db connection: this line must be changed so that
orch-user
andorch-pwd
are set to the value chose above when creating the SQL database.
Moreover, in this file you can set the TCP port to be used to interact with the FROG4-orchestrator through its REST API.
You can launch the FROG4-orchestrator by executing the following script in the orchestrator root folder, optionally specifying the configuration file (example: conf/config.ini):
$ cd [frog4-orchestrator]
$ ./start_orchestrator.sh [--d conf-file]
A description of the API exposed by the FROG4-orchestrator is available at the URL: ip_address:port/api_docs
(e.g., 127.0.0.1:9000/api_docs
).
It is possible to configure the FROG4 GUI, so that it can be used to interact with the FROG4-orchestrator (e.g., to deploye new service graphs, or to read the service graphs currently deployed). To install the GUI, follows the instructions provided with the repository.
You can find some helpful scripts inside the scripts folder. For example, if you need to clean all sessions and graphs currently stored in the database, you can launch the following script:
$ cd [frog4-orchestrator]
$ python3 -m scripts.clean_db_nffgs
The same applies for other similar scripts like clean_domains_and_info that will remove data related to the domains connected to the orchestrator from the database. You just need to replace "clean_db_nffgs" with "clean_domains_and_info" in the previous command.