diff --git a/README.md b/README.md index d3f556f..ecc973b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ The CacheTorrent system extends the [BitTorrent protocol](https://en.wikipedia.o ### Quick Start -- Prerequisites: [Golang](https://golang.org/) >= 1.6 - [Installation](docs/install.md) guide - [Usage](docs/usage.md) instructions - [Testing](docs/testing.md) @@ -19,7 +18,7 @@ The general documentation is provided in Markdown, while the code uses [GoDoc](h #### Protocols - **[BitTorrent](docs/torrent.md)** - a simplified implementation of the BitTorrent protocol - - **[CacheTorrent](docs/cache.md)** - a BitTorrent extension aimed to make the protocol mode network friendly by reducing the inter-ISP traffic + - **[CacheTorrent](docs/cache.md)** - a BitTorrent extension aimed to reduce the inter-ISP traffic - **[Extensions](docs/extension.md)** - extensions on top of CacheTorrent based on emperical results #### Tools diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..18f1651 --- /dev/null +++ b/docs/install.md @@ -0,0 +1,34 @@ +## Install + +#### Prerequisites +- [Golang](https://golang.org/) >= 1.6 +- Python >= 3.5 + +#### Install + +To install the basic packages: +``` +go get github.com/danalex97/Speer +go get github.com/danalex97/nfsTorrent +``` + +To install the visualization tools: +``` +apt install python3-pip +pip install Flask +pip install flask-cors +pip install requests +``` + +To install the remote run tools: +``` +apt install python3-pip +pip install Flask +pip install requests +``` + +#### Setting up remote runs + +To be able to run simulations remotely you need: +- a network file system +- ability to log in using SSH diff --git a/remote/pool.py b/remote/pool.py index 6261669..f7d2473 100644 --- a/remote/pool.py +++ b/remote/pool.py @@ -4,7 +4,7 @@ import random class Pool: - def __init__(self): + def __init__(self, pool=None): def app(id, idx): if idx < 10: id = id + "0" @@ -18,7 +18,12 @@ def app(id, idx): [app("point", i) for i in range(1, 61)] + \ [app("voxel", i) for i in range(1, 27)] + \ [app("graphic", i) for i in range(1, 13)] - self.pool = POOL[:] + try: + with open(pool, 'r') as f: + self.pool = f.read().splitlines() + except Exception: + # Use the default Pool configuration. + self.pool = POOL[:] random.shuffle(self.pool) def next(self): diff --git a/remote/remote.py b/remote/remote.py index 60c7be0..9a13d2e 100755 --- a/remote/remote.py +++ b/remote/remote.py @@ -10,6 +10,8 @@ from coordinator import Coordinator +from pool import Pool + import os import threading import string @@ -59,6 +61,8 @@ def onDone(coordinator): help="The PID of process to be notified when all jobs were dispached.") parser.add_argument("-k", "--kill", nargs='?', action="store", dest="kill", default=[], help="Use this flag to kill all remote jobs.") + parser.add_argument("-pool", type=str, default="", + help="Path to a .txt file containing IPs(or names) for the machine pool.") parser.add_argument('command', nargs='*') parser.set_defaults(kill=False) @@ -68,6 +72,7 @@ def onDone(coordinator): runs = args.runs name = args.name kill = args.kill + pool = args.pool if kill != False: if kill == None: @@ -85,7 +90,8 @@ def onDone(coordinator): command = command, times = runs, name = name, - notify = notify) \ + notify = notify, + pool = Pool(pool)) coordinator.onDone(lambda: onDone(coordinator)) coordinator.run()