Developing lightweight computation at the DSG edge

README.md 3.16 KB
Newer Older
Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
1
2
# uc-monitor-go-test
A proof-of-concept application that leverages [AntidoteDB](https://syncfree.github.io/antidote/) to orchestrate the Guifi.net network nodes monitoring system for the [LightKone](https://www.lightkone.eu/) project.
felix's avatar
felix committed
3

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
4
5
6
7
8
## Description
The monitoring application is distributed in three main blocks:
 - Network description fetching and feeding (functional)
 - Nodes assignment among the different monitoring servers [WiP]
 - Actual nodes monitorisation [WiP]
felix's avatar
felix committed
9

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
10
This proof of concept is built on top of the [AntidoteDB Java tutorial](https://github.com/SyncFree/antidote-java-tutorial) by [Deepthi Akkoorath (@deepthidevaki)](https://github.com/deepthidevaki) and uses [João Neto (@joaomlneto)](https://github.com/joaomlneto)'s [HTTP/HTTPS REST API for AntidoteDB](https://github.com/LightKone/antidote-rest-server).
felix's avatar
felix committed
11

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
12
## Installation
felix's avatar
felix committed
13

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
14
15
### Docker
Install `docker-ce` using your
felix's avatar
felix committed
16

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
17
18
### Go and required libraries
Install Go using your operating system's package manager or follow the [instructions here](https://golang.org/doc/install).
felix's avatar
felix committed
19

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
20
21
After installing Go, download and install the folowing external libraries needed:
 - golang/glog:
felix's avatar
felix committed
22

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
23
 `go get github.com/golang/glog`
felix's avatar
felix committed
24

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
25
 - sparrc/go-ping:
felix's avatar
felix committed
26

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
27
 `go get github.com/sparrc/go-ping`
felix's avatar
felix committed
28

Roger Pueyo Centelles's avatar
Roger Pueyo Centelles committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
### AntidoteDB Java tutorial
Get the tutorial's source code [here](https://github.com/SyncFree/antidote-java-tutorial) to download the code and [start the two AntidoteDB nodes](https://github.com/SyncFree/antidote-java-tutorial#starting-antidote-nodes).

### HTTP/HTTPS REST API

Install the AntidoteDB REST API server following the [instructions here](https://github.com/LightKone/antidote-rest-server). Once everything is installed, start the server with the `antidote-rest-server` command. The server connects to one of the AntidoteDB instances (the one running on port 8087) from the Java tutorial.

## Building and running the application

### Fetch the network description and feed it to AntidoteDB
The whole Guifi.net network description is included in the `cnml.xml` file, which can be downloaded from the Guifi.net website, and is used by default:
```
$ cd src/monitor/fetch/
$ go run monitor-fetch.go
57642 nodes read from cnml.xml
53461 devices read from cnml.xml
39988 devices exported to /tmp/gmonitor2/devs.json
0 devices removed from AntidoteDB (0 success, 0 fail)
0 IPv4 addresses removed from AntidoteDB (0 success, 0 fail)
10634 devices added to AntidoteDB (10634 success, 0 fail) ...
```
etc.

Smaller subnetworks can be used instead, like the Guifi-UPC subnetwork, for testing purposes:
```
$ go run monitor-fetch.go -cnml_file upc.xml
19 nodes read from upc.xml
0 devices removed from AntidoteDB (0 success, 0 fail)
0 IPv4 addresses removed from AntidoteDB (0 success, 0 fail)
49 devices added to AntidoteDB (49 success, 0 fail)
67 IPv4 addresses added or updated to AntidoteDB (67 success, 0 fail)
```

### Assign network nodes to monitoring servers [WiP]
```
go run monitor-assign.go
```

### Monitor the nodes [WiP]
```
go run monitor-ping.go  <host>
```
### Note
Previously as of this note on Linux support: _this library attempts to send an "unprivileged" ping via UDP. On Linux, this must be enabled by setting_:

```sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"```