Merge pull request #66 from mpeuster/master
[osm/vim-emu.git] / README.md
1 [![Build Status](http://jenkins.sonata-nfv.eu/buildStatus/icon?job=son-emu)](http://jenkins.sonata-nfv.eu/job/son-emu)
2
3 # Distributed Cloud Emulator
4
5 ## Lead Developers
6 The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.
7
8
9 * Manuel Peuster (mpeuster)
10 * Steven Van Rossem (stevenvanrossem)
11
12
13 ### Dependencies
14 * needs the latest [Dockernet](https://github.com/mpeuster/dockernet) to be installed on the system
15 * pyaml
16 * zerorpc
17 * tabulate
18 * argparse
19 * networkx
20 * six>=1.9
21 * ryu
22 * oslo.config
23 * pytest
24 * pytest-runner
25 * Flask
26 * flask_restful
27 * requests 
28 * docker-py
29
30
31 ### Project structure
32
33 * **src/emuvim/** all emulator code 
34  * **api/** Data center API endpoint implementations (zerorpc, OpenStack REST, ...)
35  * **cli/** CLI client to interact with a running emulator
36  * **dcemulator/** Dockernet wrapper that introduces the notion of data centers and API endpoints
37  * **examples/** Example topology scripts
38  * **test/** Unit tests
39 * **ansible/** Ansible install scripts
40 * **util/** helper scripts
41
42 ### Installation
43 Automatic installation is provide through Ansible playbooks.
44
45 * Requires: Ubuntu 14.04 LTS
46 * `sudo apt-get install ansible git`
47 * `sudo vim /etc/ansible/hosts`
48 * Add: `localhost ansible_connection=local`
49
50 #### 1. Dockernet
51 * `cd`
52 * `git clone -b dockernet-sonata https://github.com/mpeuster/dockernet.git`
53 * `cd ~/dockernet/ansible`
54 * `sudo ansible-playbook install.yml`
55 * Wait (and have a coffee) ...
56
57 #### 2. Emulator
58 * Fork the repository.
59 * `cd`
60 * `git clone https://github.com/<user>/son-emu.git`
61 * `cd ~/son-emu/ansible`
62 * `sudo ansible-playbook install.yml`
63
64
65 ### Run
66
67 In the `~/son-emu` directory:
68
69 * During development:
70  * `python setup.py develop`
71 * Otherwise, for a classic installation:
72  * `python setup.py install`
73 * First terminal:
74  * `sudo python src/emuvim/examples/simple_topology.py 
75 `
76 * Second terminal:
77  * `son-emu-cli compute start -d datacenter1 -n vnf1`
78  * `son-emu-cli compute start -d datacenter1 -n vnf2`
79  * `son-emu-cli compute list`
80 * First terminal:
81  * `dockernet> vnf1 ping -c 2 vnf2`
82 * Second terminal:
83  *  `son-emu-cli monitor get_rate -vnf vnf1`
84
85 ### Run Unit Tests
86 * `cd ~/son-emu`
87 * `sudo py.test -v src/emuvim` (equivalent to `python setup.py test -v --addopts 'src/emuvim'` but with direct access to the commandline arguments)
88
89 ### CLI
90 * [Full CLI command documentation](https://github.com/sonata-nfv/son-emu/wiki/CLI-Command-Overview)
91