Skip to content
edmaas edited this page Aug 30, 2017 · 3 revisions

The following is a step by step walkthrough of how to create an environment in which son-profile works and how to generate and execute an example experiment.

Walkthrough

  1. Install the necessary software with sudo apt-get install git ansible docker virtualenvwrapper
  2. Clone the git repository containing the necessary files with git clone https://github.com/edmaas/son-cli.git (or later on git clone https://github.com/sonata-nfv/son-cli.git)

Installing son-cli

  1. Create a virtual environment in which the standard python version is 3.4 or higher with
    mkvirtualenv -p /usr/python34 sonata
  2. Activate this environment with workon sonata
  3. Navigate to the folder ~/son-cli/ansible and execute ansible-playbook install.yml (this may take a few minutes)
  4. Navigate to the folder ~/son-cli and execute python bootstrap.py. Afterwards execute bin/buildout
  5. Lastly, execute python setup.py develop

Starting a VM which works as a remote host

  1. Make sure you have a valid ssh key at ~/.ssh/id_rsa.pub. This key can not require a password, it is recommended to just use defaults when generating it
  2. Navigate to ~/son-cli/src/son/profile/misc/son-emu-vagrant
  3. Execute vagrant up
  4. This operation will take a few minutes and end with an error reporting it could not connect to the VM to check on the installation. This is normal.

Configuration of son-cli

To configure son-cli, the config file at ~/son-cli/src/son/profile/config.yml has to be modified.
An example configuration file which should work for this case could look like this:

Example configuration file

descriptor_version: "0.1"
target_platforms:
 - name: "vagrant_vm"
   address: "127.0.0.1"
   package_port: 5000
   ssh_port: 2222
   ssh_user: "vagrant"
   ssh_key_loc: "~/.ssh/id_rsa"

Generating and starting an experiment

To start the experiment, run
son-profile --mode active -p ~/son-cli/src/son/profile/tests/misc/active_test_ped.yml
This should generate the services and execute them. Gathered results can be found at ~/son-cli/results

Example Output

son-profile --mode active -p src/son/profile/tests/misc/active_test_ped.yml
2017-08-30 13:27:16 Lev-Lap son.profile.profile[3611] INFO SONATA profiling tool initialized
2017-08-30 13:27:16 Lev-Lap son.profile.profile[3611] INFO Loaded PED file '/root/son-cli/src/son/profile/tests/misc/active_test_ped.yml'.
2017-08-30 13:27:16 Lev-Lap son.profile.experiment[3611] INFO Populated experiment specification: service_throughput with 1 configurations to be executed.
2017-08-30 13:27:17 Lev-Lap root[3611] INFO Generating grammar tables from /usr/lib/python3.4/lib2to3/Grammar.txt
2017-08-30 13:27:17 Lev-Lap root[3611] INFO Generating grammar tables from /usr/lib/python3.4/lib2to3/PatternGrammar.txt
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] INFO SONATA service configuration generator initialized
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] INFO Extracted SONATA service package: /root/son-cli/src/son/profile/tests/misc/./sonata-proxy-lb-service.son
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] INFO Loaded SONATA service package contents: SonataService(eu.sonata-nfv.package.sonata-proxy-lb-service-emu.0.4) (3 VNFDs).
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] INFO Generated service experiment 'service_throughput': 'SonataService(eu.sonata-nfv.package.sonata-proxy-lb-service-emu.0.4)' with run ID: 0
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] INFO Starting to pack 1 service configurations ...
2017-08-30 13:27:17 Lev-Lap son.profile.generator.sonata[3611] WARNING /tmp/tmpbwsmg1uz/service_throughput_00000.son
2017-08-30 13:27:17 Lev-Lap son.workspace.project[3611] INFO Loading Project configuration '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/project.yml'
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Create Package Content Section
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating service '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/sources/nsd/sonata-active-profiling-service.yml'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO ... syntax: True, integrity: False, topology: False
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of service 'eu.sonata-nfv.sonata-active-profiling-service.0.1'
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Packaging VNF descriptors from project source...
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating function '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/sources/vnf/nginx-lb-vnf/nginx-lb-vnf.yml'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO ... syntax: True, integrity: False, topology: False
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of function 'eu.sonata-nfv.nginx-lb-vnf.0.1'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating function '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/sources/vnf/mp.input/mp.input.yml'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO ... syntax: True, integrity: False, topology: False
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of function 'son-profile.mp.input.1.0'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating function '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/sources/vnf/squid-vnf/squid-vnf.yml'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO ... syntax: True, integrity: False, topology: False
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of function 'eu.sonata-nfv.squid-vnf.0.1'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating function '/tmp/tmpbwsmg1uz/.tmp_gen_services/service_throughput_00000/sources/vnf/apache-server-vnf/apache-server-vnf.yml'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO ... syntax: True, integrity: False, topology: False
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of function 'eu.sonata-nfv.apache-server-vnf.0.1'
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO package_pcs executed in 0.302 sec
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Create Package Resolver Section
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO package_prs executed in 0.000 sec
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Create Package Dependencies Section
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO package_pds executed in 0.000 sec
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Create Artifact Dependencies Section
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO package_ads executed in 0.000 sec
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Create General Description section
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO package_gds executed in 0.000 sec
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating package '/tmp/tmpbwsmg1uz/service_throughput_00000.son'
2017-08-30 13:27:18 Lev-Lap son.validate.validate[3611] INFO Validating syntax of package descriptor 'eu.sonata-nfv.package.sonata-proxy-lb-service-emu.0.4'
2017-08-30 13:27:18 Lev-Lap son.package.package[3611] INFO Package generated successfully.
File: /tmp/tmpbwsmg1uz/service_throughput_00000.son
MD5: 049266fdcc98d5b1e686628cd0bb264a

--------------------------------------------------------------------------------
SONATA Profiler: Experiment Package Generation Report (sonata-pkg-gen)
--------------------------------------------------------------------------------

| Experiment         |   Num. Pkg. |   Pkg. Time (s) |   Pkg. Sizes (kB) |
|--------------------+-------------+-----------------+-------------------|
| service_throughput |           1 |        0.816753 |           8.48926 |
| Total              |           1 |        0.816753 |           8.48926 |

Generated service packages path: /tmp/tmpbwsmg1uz
Total time: 0.8774

2017-08-30 13:27:18 Lev-Lap SON-Profile Emulator[3611] INFO 1 nodes found.
2017-08-30 13:27:18 Lev-Lap SON-Profile Emulator[3611] INFO Remote logs will not be shown.
2017-08-30 13:27:18 Lev-Lap SON-Profile Emulator[3611] INFO 1 experiments will be run.
2017-08-30 13:27:18 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: PED data found. Updating data.
2017-08-30 13:27:18 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:19 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:19 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Connected to remote host.
2017-08-30 13:27:19 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Starting remote topology.
2017-08-30 13:27:19 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:19 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Path to package is '/tmp/tmpbwsmg1uz/service_throughput_00000.son'
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Uploading package to 'http://127.0.0.1:5000'.
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Stopping remote topology.
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Closing ssh connection.
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: SSH connection closed.
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Connected to remote host.
2017-08-30 13:27:24 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Starting remote topology.
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:24 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Path to package is '/tmp/tmpbwsmg1uz/service_throughput_00000.son'
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Uploading package to 'http://127.0.0.1:5000'.
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Stopping remote topology.
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Closing ssh connection.
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: SSH connection closed.
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Connected to remote host.
2017-08-30 13:27:29 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Starting remote topology.
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:29 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:27:34 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Path to package is '/tmp/tmpbwsmg1uz/service_throughput_00000.son'
2017-08-30 13:27:34 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Uploading package to 'http://127.0.0.1:5000'.
2017-08-30 13:27:43 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Sleep for 60 seconds.
2017-08-30 13:27:43 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:27:43 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:28:43 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Stopping service
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Stopping remote topology.
2017-08-30 13:28:55 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:28:55 Lev-Lap paramiko.transport.sftp[3611] INFO [chan 0] Opened sftp connection (server version 3)
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Copying results from remote hosts.
2017-08-30 13:28:55 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Removing results on remote host.
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Closing connections.
2017-08-30 13:28:55 Lev-Lap paramiko.transport.sftp[3611] INFO [chan 0] sftp session closed.
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: Closing ssh connection.
2017-08-30 13:28:55 Lev-Lap SON-Profile Emulator[3611] INFO Run 0: SSH connection closed.
2017-08-30 13:28:55 Lev-Lap paramiko.transport[3611] INFO Connected (version 2.0, client OpenSSH_6.6.1p1)
2017-08-30 13:28:55 Lev-Lap paramiko.transport[3611] INFO Authentication (publickey) successful!

Clone this wiki locally