Updating README and script to the new setup.py install
[osm/vim-emu.git] / README.md
1 # Distributed Cloud Emulator
2
3 Contributors:
4
5 * Manuel Peuster <manuel.peuster@upb.de>
6
7
8 ### Requirements
9 * needs the latest [Dockernet](https://github.com/mpeuster/dockernet) to be installed on the system
10  * the emulator is implemented against Dockernet's APIs
11 * The emulator uses ZeroMQ based RPC to for communication between demo CLI client and cloud-like APIs
12  * `pip install zerorpc`
13  * (This will be replaced / extended by a REST API later)
14
15 ### Project structure
16 * **src/emuvim/** all emulator code 
17  * **api/** Data center API endpoint implementations (zerorpc, OpenStack REST, ...)
18  * **cli/** CLI client to interact with a running emulator
19  * **dcemulator/** Dockernet wrapper that introduces the notion of data centers and API endpoints
20  * **test/** Unit tests
21  * **example_topology.py** An example topology script to show how topologies can be specified
22
23 ### Installation
24 Automatic installation is provide through Ansible playbooks.
25 * Requires: Ubuntu 14.04 LTS
26 * `sudo apt-get install ansible git`
27 * `sudo vim /etc/ansible/hosts`
28 * Add: `localhost ansible_connection=local`
29
30 #### 1. Dockernet
31 * `cd`
32 * `git clone -b dockernet-sonata https://github.com/mpeuster/dockernet.git`
33 * `cd ~/dockernet/ansible`
34 * `sudo ansible-playbook install.yml`
35 * Wait (and have a coffee) ...
36
37 #### 2. Emulator
38 * Fork the repository.
39 * `cd`
40 * `git clone https://github.com/<user>/son-emu.git`
41 * `cd ~/son-emu/ansible`
42 * `sudo ansible-playbook install.yml`
43
44
45 ### Run
46
47 In the `~/son-emu` directory:
48
49 * During development:
50  * `python setup.py develop`
51 * Otherwise, for a classic installation:
52  * `python setup.py install`
53 * First terminal:
54  * `sudo python src/emuvim/example_topology.py`
55 * Second terminal:
56  * `son-emu-cli compute start -d datacenter1 -n vnf1`
57  * `son-emu-cli compute start -d datacenter1 -n vnf2`
58  * `son-emu-cli compute list`
59 * First terminal:
60  * `dockernet> vnf1 ping -c 2 vnf2`
61 * Second terminal:
62  *  `son-emu-cli monitor get_rate -vnf vnf1`
63
64 #### Example scripts:
65  * `./start_dcnetwork` starts an example datacenter network with monitoring api endpoint
66  * `./start_example_chain` sets up an example service chain, using the example docker container from `package_samples` https://github.com/sonata-nfv/packaging_samples/tree/master/VNFs
67
68 ### Run Unit Tests
69 * `cd ~/son-emu`
70 * `sudo py.test -v src/emuvim` (equivalent to `python setup.py test -v --addopts 'src/emuvim'` but with direct access to the commandline arguments)
71
72 ### CLI
73 * [Full CLI command documentation](https://github.com/sonata-nfv/son-emu/wiki/CLI-Command-Overview)
74