Navigation Menu

Skip to content

sonata-nfv/son-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

son-cli

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-workspace creates, configures and manages development workspaces and projects.
  • son-package packages 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-validate can 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-access enables 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-monitor provides tools to easily monitor/generate metrics for debugging and analyzing service performance.
  • son-profile supports network service developers to automatically profile their network services and network functions.

Building

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.

Prerequisites:

  • python 3 (3.4 used for most of the development)
  • virtualenv
  • docker (used by son-monitor)
  • docker-compose (used by son-monitor)

Creating a virtualenv:

  1. Install virtualenvwrapper using your distribution repositories or the pip package. https://virtualenvwrapper.readthedocs.org/en/latest/
  2. 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 git@github.com:sonata-nfv/son-cli.git 
cd son-cli
python bootstrap.py
bin/buildout

If you are using pycharm, the IDE has support both for buildout and for virtualenvs, please read their fine documentation on the subject before proceeding.

Generated binaries

The buildout generates the binaries for the tools son-workspace, son-package, son-validate, son-validate-api, son-access, son-profile and son-monitor. Information on how to use the tools is detailed in the wiki documentation.

Dependencies

The son-cli tools have the following dependencies:

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

Contributing

To contribute to son-cli the following sequence of steps should be followed:

  1. Fork this repository;
  2. Work on your proposed changes, preferably through submiting issues;
  3. Submit a Pull Request to the master branch;
  4. Follow/answer related issues (see Feedback-Chanel, below).

Installation

Ubuntu Trusty (14.04) and Xenial (16.04)

To install the SONATA CLI toolset in Ubuntu follow these steps:

  1. Add the new GPG key

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8EC0731023C1F15B
  2. 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
  1. Update and install
    sudo apt-get update
    sudo apt-get install sonata-cli

CentOS 7

To install the SONATA CLI toolset in CentOS 7 follow these steps:

  1. Install EPEL
    yum install epel-release
  2. Create a repository entry file in /etc/yum.repos.d/sonata.repo with the following content:
    [sonata-repo]
    name=SONATA Repository
    baseurl=http://rpmrepo.sonata-nfv.eu/repo/
    enabled=1
    gpgcheck=0
    Note: currently the repository is not GPG signed (future work)
  3. 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.

License

The son-cli is published under Apache 2.0 license. Please see the LICENSE file for more details.

Lead Developers

The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.

Feedback-Chanel