Skip to content

Commit 2af7aef

Browse files
authored
Merge pull request #221 from mpeuster/master
Cleanups and fixes for upcoming v2.1
2 parents ed5966d + 78001a9 commit 2af7aef

File tree

4 files changed

+38
-96
lines changed

4 files changed

+38
-96
lines changed

README.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
# son-emu
44
This is the repository of [SONATA's](http://sonata-nfv.eu) emulation platform.
55

6-
This emulation platform was created to support network service developers to locally prototype and test complete network service chains in realistic end-to-end multi-PoP scenarios. It allows the direct execution of real network functions, packaged as Docker containers, in emulated network topologies running locally on the network service developer's machine.
6+
This emulation platform was created to support network service developers to locally prototype and test complete network service chains in realistic end-to-end multi-PoP scenarios. It allows the execution of real network functions, packaged as Docker containers, in emulated network topologies running locally on the network service developer's machine.
77

88
### Cite this work
99

1010
If you use son-emu for your research and/or other publications, please cite the following paper to reference our work:
1111

12-
* Manuel Peuster, Holger Karl, and Steven van Rossem. "**MeDICINE: Rapid Prototyping of Production-Ready Network Services in Multi-PoP Environments.**" to appear in IEEE Conference on Network Function Virtualization and Software Defined Network (NFV-SDN), 2016.
13-
* Pre-print online: http://arxiv.org/abs/1606.05995
12+
* M. Peuster, H. Karl and S. van Rossem, **"MeDICINE: Rapid prototyping of production-ready network services in multi-PoP environments,"** 2016 IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Palo Alto, CA, USA, 2016, pp. 148-153.
13+
doi: 10.1109/NFV-SDN.2016.7919490
14+
* Link: http://ieeexplore.ieee.org/document/7919490/
15+
* Pre-print: http://arxiv.org/abs/1606.05995
1416

1517
A short demo that showcases son-emu together with its dummy gatekeeper is available [here](https://www.youtube.com/watch?v=ZANz97pV9ao).
1618

@@ -25,15 +27,17 @@ To install the emulator package in development mode, do:
2527
* `ansible` Install scripts
2628
* `misc` Example packages and VNFs
2729
* `src`
28-
* `emuvim` Emulator components
29-
* `api` API endpoint implementations
30-
* `rest` REST API for son-emu-cli
31-
* `sonata` Dummy gatekeeper API
32-
* `cli` Command line client to control the emulator
33-
* `dcemulator` Emulator core
34-
* `resourcemodel` Resource limitation models
35-
* `examples` Example topology scripts
36-
* `test` Test scripts
30+
* `emuvim` Emulator components
31+
* `api` API endpoint implementations
32+
* `rest` REST API for son-emu-cli
33+
* `sonata` Dummy gatekeeper API
34+
* `openstack` OpenStack-like APIs for MANO integration
35+
* `cli` Command line client to control the emulator
36+
* `dashboard` A web-based dashboard to display the emulator's state
37+
* `dcemulator` Emulator core
38+
* `resourcemodel` Resource limitation models
39+
* `examples` Example topology scripts
40+
* `test` Test scripts
3741
* `utils` Helper scripts for SONATA's CI/CD setup
3842

3943

@@ -78,7 +82,7 @@ Contributing to the son-emu is really easy. You must:
7882
4. Follow/answer related [issues](https://github.com/sonata-nfv/son-emu/issues) (see Feedback-Chanel, below).
7983

8084
## Installation
81-
There are two ways to install and use son-emu. The simple one is to use Vagrant to create a VirtualBox-based VM on you machine that contains the pre-installed and configured emulator. The more complicated installation requires a freshly installed Ubuntu 14.04 LTS and is done by a ansible playbook.
85+
There are two ways to install and use son-emu. The simple one is to use Vagrant to create a VirtualBox-based VM on your machine that contains the pre-installed and configured emulator. The more complicated installation requires a freshly installed Ubuntu 16.04 LTS and is done by a ansible playbook.
8286

8387
### Vagrant Installation
8488

@@ -92,7 +96,7 @@ Follow the MOTD in the VM to run the example topology and the dummy-gatekeeper.
9296

9397
### Ansible Installation
9498

95-
* Requires: Ubuntu 14.04 LTS
99+
* Requires: Ubuntu 16.04 LTS
96100
* `sudo apt-get install ansible git aptitude`
97101
* `sudo vim /etc/ansible/hosts`
98102
* Add: `localhost ansible_connection=local`
@@ -115,7 +119,6 @@ Follow the MOTD in the VM to run the example topology and the dummy-gatekeeper.
115119
## Usage
116120

117121
### Examples
118-
#### Manual Usage Example:
119122

120123
This simple example shows how to start the emulator with a simple topology (terminal 1) and how to start (terminal 2) some empty VNF containers in the emulated datacenters (PoPs) by using the son-emu-cli.
121124

@@ -129,23 +132,11 @@ This simple example shows how to start the emulator with a simple topology (term
129132
* `containernet> vnf1 ifconfig`
130133
* `containernet> vnf1 ping -c 2 vnf2`
131134

132-
#### Dummy Gatekeeper Example:
133-
134-
This example shows how to deploy a SONATA example package in the emulator using the dummy gatekeeper.
135-
136-
* First terminal (start the emulation platform):
137-
* `sudo python src/emuvim/examples/sonata_y1_demo_topology_1.py`
138-
* Second terminal (deploy the example package):
139-
* Upload: `curl -i -X POST -F [email protected] http://127.0.0.1:5000/packages`
140-
* Instantiate: `curl -X POST http://127.0.0.1:5000/instantiations -d "{}"`
141-
* Verify that service runs: `son-emu-cli compute list`
142-
143-
Note: The [son-push](https://github.com/mpeuster/son-cli) tool can be used instead of CURL.
144-
145135

146136
### Further Documentation
147137
* [Full CLI command documentation](https://github.com/sonata-nfv/son-emu/wiki/CLI-Command-Overview)
148138
* [Requirements for Docker containers executed by the emulator](https://github.com/sonata-nfv/son-emu/wiki/Container-Requirements)
139+
* [REST API](https://github.com/sonata-nfv/son-emu/wiki/REST-API-command-overview)
149140

150141
## License
151142

@@ -168,6 +159,7 @@ The following lead developers are responsible for this repository and have admin
168159
* Hadi Razzaghi Kouchaksaraei (https://github.com/hadik3r)
169160
* Wouter Tavernier (https://github.com/wtaverni)
170161
* Geoffroy Chollon (https://github.com/cgeoffroy)
162+
* Eduard Maas (https://github.com/edmaas)
171163

172164
#### Feedback-Chanel
173165

src/emuvim/api/rest/rest_api_endpoint.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ def start(self):
130130
logging.info("Started API endpoint @ http://%s:%d" % (self.ip, self.port))
131131

132132
def _start_flask(self):
133-
#self.app.run(self.ip, self.port, debug=True, use_reloader=False)
133+
#self.app.run(self.ip, self.port, debug=False, use_reloader=False)
134134
#this should be a more production-fit http-server
135-
http_server = WSGIServer((self.ip, self.port), self.app)
135+
#self.app.logger.setLevel(logging.ERROR)
136+
http_server = WSGIServer((self.ip, self.port),
137+
self.app,
138+
log=open("/dev/null", "w") # This disables HTTP request logs to not mess up the CLI when e.g. the auto-updated dashboard is used
139+
)
136140
http_server.serve_forever()

src/emuvim/dashboard/index_upb.html

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
2626
<![endif]-->
2727

28-
<script src="js/main.js" type="text/javascript"></script>
28+
<script src="js/main_upb.js" type="text/javascript"></script>
2929

3030

3131
</head>
@@ -48,36 +48,6 @@
4848
<div class="col-sm-4" id="logo"><a href="http://sonata-nfv.eu" target="_blank"><img src="img/SONATA_new.png" alt="SONATA Logo" width="252" height="70"></a></div>
4949
</div>
5050

51-
<nav class="navbar navbar-default">
52-
<div class="container-fluid">
53-
<!-- Brand and toggle get grouped for better mobile display -->
54-
<div class="navbar-header">
55-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
56-
<span class="sr-only">Toggle navigation</span>
57-
<span class="icon-bar"></span>
58-
<span class="icon-bar"></span>
59-
<span class="icon-bar"></span>
60-
</button>
61-
</div>
62-
63-
<!-- Collect the nav links, forms, and other content for toggling -->
64-
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
65-
<div class="navbar-form navbar- navbar-btn btn-group" role="group" aria-label="category">
66-
<!--<button type="button" class="btn btn-default active" id="btn_tab_pop">Datacenter List</button>-->
67-
<!--<button type="button" class="btn btn-default" id="btn_tab_container">Container List</button>-->
68-
<!--<button type="button" class="btn btn-default" id="btn_tab_other">Other</button> -->
69-
</div>
70-
<form class="navbar-form navbar-right">
71-
<div class="input-group">
72-
<span class="input-group-addon">http://</span>
73-
<input type="text" class="form-control" placeholder="api-url.or.ip" value="localhost:5001" id="text_api_host" data-provide="typeahead" size="30">
74-
</div>
75-
<button type="button" class="btn btn-success" id="btn_connect">Connect &nbsp;<span class="glyphicon glyphicon-play-circle"></span></button>
76-
<button type="button" class="btn btn-danger disabled" id="btn_disconnect">Disconnect &nbsp;<span class="glyphicon glyphicon-off"></span></button>
77-
</form>
78-
</div><!-- /.navbar-collapse -->
79-
</div><!-- /.container-fluid -->
80-
</nav>
8151
</div>
8252
<div id="content">
8353

@@ -103,7 +73,7 @@
10373

10474
</div>
10575

106-
<footer class="footer text-center small">(c) 2017 by SONATA Consortium and Paderborn University and IMEC</footer>
76+
<footer class="footer text-center small">(c) 2017 by SONATA Consortium, Paderborn University and IMEC</footer>
10777

10878

10979
</body>

src/emuvim/dashboard/js/main_upb.js

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
var API_HOST = "http://127.0.0.1:5001";
1+
var API_HOST = ""; // set to a remote url if dashboard is not served by REST API server
22
var ERROR_ALERT = false;
33
var TIMESTAMP = 0;
44
var CONNECTED = false;
55
var LATENESS_UPDATE_INTERVAL = 50;
6-
var DATA_UPDATE_INTERVAL = 1000 * 10;
6+
var DATA_UPDATE_INTERVAL = 1000 * 2;
77
var LAST_UPDATE_TIMESTAMP_CONTAINER = 0;
88
var LAST_UPDATE_TIMESTAMP_DATACENTER = 0;
99

1010

1111
function update_lateness_loop() {
1212
lateness_datacenter= (Date.now() - LAST_UPDATE_TIMESTAMP_DATACENTER) / 1000;
13-
$("#lbl_lateness_datacenter").text("Lateness: " + Number(lateness_datacenter).toPrecision(3) + "s");
13+
$("#lbl_lateness_datacenter").text("Lateness: " + Number(lateness_datacenter).toPrecision(2) + "s");
1414
lateness_container= (Date.now() - LAST_UPDATE_TIMESTAMP_CONTAINER) / 1000;
15-
$("#lbl_lateness_container").text("Lateness: " + Number(lateness_container).toPrecision(3) + "s");
15+
$("#lbl_lateness_container").text("Lateness: " + Number(lateness_container).toPrecision(2) + "s");
1616
// loop while connected
1717
if(CONNECTED)
1818
setTimeout(update_lateness_loop, LATENESS_UPDATE_INTERVAL)
@@ -26,11 +26,12 @@ function errorAjaxConnection()
2626
{
2727
ERROR_ALERT = true;
2828
// show message
29-
alert("ERROR!\nAPI request failed.\n\n Please check the backend connection.", function() {
29+
alert("API request failed. Is the emulator running?", function() {
3030
// callback
3131
ERROR_ALERT = false;
3232
});
3333
}
34+
CONNECTED = false;
3435
}
3536

3637

@@ -106,14 +107,6 @@ function fetch_container()
106107
}
107108

108109

109-
function fetch_d3graph()
110-
{
111-
// do HTTP request and trigger gui update on success
112-
var request_url = API_HOST + "/restapi/network/d3jsgraph";
113-
console.debug("fetching from: " + request_url);
114-
//$.getJSON(request_url, update_graph);
115-
}
116-
117110
function fetch_loop()
118111
{
119112
// only fetch if we are connected
@@ -134,7 +127,7 @@ function connect()
134127
{
135128
console.info("connect()");
136129
// get host address
137-
API_HOST = "http://" + $("#text_api_host").val();
130+
//API_HOST = "http://" + $("#text_api_host").val();
138131
console.debug("API address: " + API_HOST);
139132
// reset data
140133
LAST_UPDATE_TIMESTAMP_DATACENTER = Date.now();
@@ -144,36 +137,19 @@ function connect()
144137
update_lateness_loop();
145138
// restart data fetch loop
146139
fetch_loop();
147-
// gui updates
148-
$("#btn_disconnect").removeClass("disabled");
149-
$("#btn_connect").addClass("disabled");
150-
}
151-
152-
function disconnect()
153-
{
154-
console.info("disconnect()");
155-
CONNECTED = false;
156-
// gui updates
157-
$("#btn_connect").removeClass("disabled");
158-
$("#btn_disconnect").addClass("disabled");
159140
}
160141

161142

162143
$(document).ready(function(){
163144
console.info("document ready");
164145
// setup global connection error handling
165-
/*
146+
166147
$.ajaxSetup({
167148
"error": errorAjaxConnection
168149
});
169150

170-
// add listeners
171-
$("#btn_connect").click(connect);
172-
$("#btn_disconnect").click(disconnect);
173-
*/
174-
setTimeout(fetch_datacenter, 1000);//fetch_datacenter();
175-
setTimeout(fetch_container, 2000);//fetch_container();
176-
151+
// connect
152+
connect();
177153

178154
// additional refresh on window focus
179155
$(window).focus(function () {

0 commit comments

Comments
 (0)