Skip to content

Commit 67591f5

Browse files
author
droodev
committed
Initial files copy
1 parent 3f421c7 commit 67591f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+50392
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyage
2+
=====

fabfile.py

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from fabric.api import *
2+
import os
3+
4+
hosts = ['localhost:' + str(port) for port in range(9000, 9005)]
5+
ns = '172.16.129.54'
6+
7+
def host_type():
8+
env.hosts = ['localhost:' + str(port) for port in range(9000, 9005)]
9+
run('uname -s')
10+
11+
def update():
12+
execute(run_update, hosts = hosts)
13+
14+
def run_update():
15+
sudo('apt-get -y --no-upgrade install python-setuptools')
16+
sudo('sudo easy_install -U pyage Pyro4==4.17')
17+
18+
def matplotlib():
19+
execute(run_matplotlib, hosts = hosts)
20+
21+
def run_matplotlib():
22+
sudo('apt-get update')
23+
sudo('apt-get install libfreetype6-dev libpng-dev python-numpy gcc g++ python2.7-dev -y')
24+
sudo('sudo easy_install matplotlib')
25+
26+
def send_conf():
27+
execute(send, hosts = hosts)
28+
29+
def send():
30+
put('pyage_conf', '~/')
31+
32+
33+
@parallel
34+
def evolution():
35+
agents_count = 180
36+
for i in range(6,0,-1):
37+
h = hosts[:i]
38+
execute(run_evolution, agents_count/i, ns, hosts=h)
39+
40+
@parallel
41+
def run_evolution(agents_count, ns_hostname):
42+
with shell_env(AGENTS=str(agents_count),NS_HOSTNAME=ns_hostname):
43+
run("export PYRO_HOST=$(ip addr show eth0 | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*); python -m pyage.core.bootstrap pyage.conf.fconf")
44+
45+
@parallel
46+
def aggregate():
47+
agents_count = 180
48+
for i in range(6,0,-1):
49+
h = hosts[:i]
50+
execute(run_aggregate, agents_count/i, ns, hosts=h)
51+
52+
@parallel
53+
def run_aggregate(agents_count, ns_hostname):
54+
with shell_env(AGENTS=str(agents_count),NS_HOSTNAME=ns_hostname):
55+
run("export PYRO_HOST=$(ip addr show eth0 | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*); python -m pyage.core.bootstrap pyage.conf.fagg_conf")
56+
57+
@parallel
58+
def emas():
59+
agents_count = 60
60+
for i in range(len(hosts),0,-1):
61+
h = hosts[:i]
62+
execute(run_emas, agents_count/i, ns, hosts=h)
63+
64+
@parallel
65+
def run_emas(agents_count, ns_hostname):
66+
with shell_env(AGENTS=str(agents_count),NS_HOSTNAME=ns_hostname):
67+
run("export PYRO_HOST=$(ip addr show eth0 | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*); python -m pyage.core.bootstrap pyage.conf.femas_conf")
68+

0 commit comments

Comments
 (0)