SONATA SDK command line interface tools
This set of command line tools are meant to aid the SONATA service developers on their tasks. The tools are briefly described as follows.
son-workspacecreates, configures and manages development workspaces and projects.
son-packagepackages a project, containing services and functions, to be instantiated in the SONATA Service Platform. All project components are syntatically validated and external dependencies are retrieved to produce a complete service package.
son-validatecan be used to validate the syntax, integrity and topology of SONATA service packages, projects, services and functions. Son-validate can be used through the CLI or as a micro-service running inside a docker container.
son-accessenables authenticating users to the Service Platform and integrates features to push and pull resources from the Service Platform Catalogues. It is used to upload the service package to the SDK emulator or the Service Platform Gatekeeper, so the service can be deployed in the respective environment.
son-monitorprovides tools to easily monitor/generate metrics for debugging and analyzing service performance.
son-profilesupports network service developers to automatically profile their network services and network functions.
To build the son-cli tools it is recommended the use of a virtual environment to avoid polluting your system and to offer isolation from the installed libraries on the host.
- python 3 (3.4 used for most of the development)
- docker (used by son-monitor)
- docker-compose (used by son-monitor)
Creating a virtualenv:
- Install virtualenvwrapper using your distribution repositories or the pip package. https://virtualenvwrapper.readthedocs.org/en/latest/
- Create a virtualenv for this project
mkvirtualenv -p /usr/bin/python34 sonata
Clone and build the project
activate the virtualenv for the project
workon sonata then clone the project and bootstrap and run buildout. This will download all the dependencies and creante the development environment.
git clone firstname.lastname@example.org:sonata-nfv/son-cli.git cd son-cli python bootstrap.py bin/buildout
The buildout generates the binaries for the tools
son-monitor. Information on how to use the tools is detailed in the wiki documentation.
The son-cli tools have the following dependencies:
- pyaml >= 15.8.2 (WTFPL)
- jsonschema >= 2.5.1 (MIT)
- validators >= 0.10.3 (BSD)
- requests >= 2.10 (Apache 2.0)
- coloredlogs <= 5.1.1 (MIT)
- paramiko >= 1.6 (LGPL)
- docker-compose >= 1.6.0 (Apache 2.0)
- PyJWT >= 1.4.0 (MIT)
- Flask >= 0.11.1 (BSD)
- Flask-Cors (MIT)
- flask_cache (BSD)
- numpy >= 1.11.3 (BSD)
- scipy >= 0.18.1 (BSD)
- matplotlib >= 2.0.1 (PSF)
- networkx <= 1.11 (BSD)
- pycrypto (Public Domain)
- prometheus_client (Apache 2.0)
- requests-toolbelt (Apache 2.0)
- termcolor (MIT)
- tabulate (MIT)
- redis (MIT)
- docker (Apache 2.0)
- watchdog (Apache 2.0)
All dependencies can be installed via a provided Ansible script:
sudo apt-get install ansible git aptitude sudo vim /etc/ansible/hosts Add: localhost ansible_connection=local cd son-cli/ansible sudo ansible-playbook install.yml
To contribute to son-cli the following sequence of steps should be followed:
- Fork this repository;
- Work on your proposed changes, preferably through submiting issues;
- Submit a Pull Request to the master branch;
- Follow/answer related issues (see Feedback-Chanel, below).
Ubuntu Trusty (14.04) and Xenial (16.04)
To install the SONATA CLI toolset in Ubuntu follow these steps:
Add the new GPG key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8EC0731023C1F15B
Add a source entry for your Ubuntu OS. For now, supported distributions are supported:
Ubuntu Trusty 14.04 (LTS)
echo "deb http://repo.sonata-nfv.eu ubuntu-trusty main" | sudo tee -a /etc/apt/sources.list
Ubuntu Xenial 16.04 (LTS)
echo "deb http://repo.sonata-nfv.eu ubuntu-xenial main" | sudo tee -a /etc/apt/sources.list
- Update and install
sudo apt-get update sudo apt-get install sonata-cli
To install the SONATA CLI toolset in CentOS 7 follow these steps:
- Install EPEL
yum install epel-release
- Create a repository entry file in
/etc/yum.repos.d/sonata.repowith the following content:Note: currently the repository is not GPG signed (future work)
[sonata-repo] name=SONATA Repository baseurl=http://rpmrepo.sonata-nfv.eu/repo/ enabled=1 gpgcheck=0
- Install CLI
yum install sonata-cli
All dists (using setuptools)
The SONATA CLI toolset can also be installed via the Python setup script:
cd son-cli python3 setup.py install
Test if its working by invoking:
$ son-workspace -h $ son-package -h $ son-publish -h $ son-push -h $ son-monitor -h
For usage and detailed description of each tool, please refer to the wiki documentation.
The son-cli is published under Apache 2.0 license. Please see the LICENSE file for more details.
The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.
- Tiago Batista (https://github.com/tsbatista)
- Wouter Tavernier (https://github.com/wtaverni)
- Luís Conceição (https://github.com/lconceicao)