@@ -42,7 +42,7 @@ def dyn_server_role():
42
42
from collections import defaultdict
43
43
env .timings = defaultdict (list )
44
44
45
- NUM_MACHINES = 10
45
+ NUM_MACHINES = 8
46
46
47
47
@runs_once
48
48
def ec2start ():
@@ -74,7 +74,7 @@ def ec2stop():
74
74
75
75
@roles ("servers" )
76
76
def time ():
77
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
77
+ with cd ('/home/ubuntu/projects/rscoin' ):
78
78
x = run ('py.test-2.7 -s -k "full_client"' ) + "\n \n "
79
79
x += run ('py.test-2.7 -s -k "timing"' )
80
80
@@ -93,15 +93,13 @@ def null():
93
93
94
94
@roles ("servers" ,"clients" )
95
95
def gitpull ():
96
- with cd ('/home/ubuntu/projects/rscoin/src' ):
97
- # run('git commit -m "merge" -a')
96
+ with cd ('/home/ubuntu/projects/rscoin' ):
98
97
run ('git pull' )
99
98
100
99
@roles ("servers" , "clients" )
101
100
@parallel
102
101
def gitall ():
103
- with cd ('/home/ubuntu/projects/rscoin/src' ):
104
- # run('git commit -m "merge" -a')
102
+ with cd ('/home/ubuntu/projects/rscoin' ):
105
103
run ('git pull' )
106
104
107
105
@@ -112,20 +110,20 @@ def host_type():
112
110
@roles ("servers" )
113
111
@parallel
114
112
def start ():
115
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
113
+ with cd ('/home/ubuntu/projects/rscoin' ):
116
114
run ('twistd -y rscserver.tac.py' )
117
115
118
116
@roles ("servers" )
119
117
@parallel
120
118
def clean ():
121
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
119
+ with cd ('/home/ubuntu/projects/rscoin' ):
122
120
run ('rm log-*' )
123
121
run ('rm keys-*' )
124
122
125
123
@roles ("servers" , "clients" )
126
124
@parallel
127
125
def stop ():
128
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
126
+ with cd ('/home/ubuntu/projects/rscoin' ):
129
127
run ('kill `cat twistd.pid`' )
130
128
131
129
@roles ("servers" )
@@ -138,7 +136,7 @@ def keys():
138
136
env ["rsdir" ] = {"special" : pid , "directory" : []}
139
137
140
138
[_ , host ] = env .host_string .split ("@" )
141
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
139
+ with cd ('/home/ubuntu/projects/rscoin' ):
142
140
run ('touch secret.key' )
143
141
run ('rm secret.key' )
144
142
result = run ('python derivekey.py --store' )
@@ -154,37 +152,34 @@ def keys():
154
152
@roles ("servers" ,"clients" )
155
153
@parallel
156
154
def loaddir ():
157
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
155
+ with cd ('/home/ubuntu/projects/rscoin' ):
158
156
put ('directory.conf' , 'directory.conf' )
159
157
160
158
@roles ("clients" )
161
159
@parallel
162
160
def loadsecret ():
163
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
161
+ with cd ('/home/ubuntu/projects/rscoin' ):
164
162
put ('secret.key' , 'secret.key' )
165
163
166
164
167
165
@roles ("servers" ,"clients" )
168
166
@parallel
169
167
def passcache ():
170
- put ('known_hosts' , '~/.ssh/known_hosts' )
171
- with cd ('/home/ubuntu/projects/rscoin/.git' ):
172
- sudo ('touch ~/.ssh/id_rsa && rm ~/.ssh/id_rsa' )
173
- put ('~/.ssh/id_rsa' , '~/.ssh/id_rsa' )
174
- run ('chmod 600 ~/.ssh/id_rsa' )
175
- put ('../.git/config' , 'config' )
176
-
177
- with cd ('/home/ubuntu/projects/rscoin/src' ):
168
+ # Delete old folder and make a new one
169
+ sudo ( 'rm -rf /home/ubuntu/projects/rscoin' )
170
+
171
+ with cd ('/home/ubuntu/projects' ):
178
172
sudo ('pip install petlib --upgrade' )
179
- run ("git pull " )
173
+ run ("git clone https://github.com/gdanezis/rscoin.git " )
180
174
181
175
@runs_once
182
176
def init ():
183
177
local ("grep rsa ~/.ssh/known_hosts > known_hosts" )
178
+ local ("python derivekey.py --store" )
184
179
execute (passcache )
185
180
186
181
def runcollect ():
187
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
182
+ with cd ('/home/ubuntu/projects/rscoin' ):
188
183
run ("collectl -f LOGFILE -D" )
189
184
num = run ("ps -A | grep collect" )
190
185
print re .findall ("[0-9]+" , num )[0 ]
@@ -217,7 +212,7 @@ def experiment1run():
217
212
# local('sudo sysctl -w net.ipv4.ip_local_port_range="500 65535"')
218
213
# local("sudo echo 20000500 > /proc/sys/fs/nr_open")
219
214
# local('sudo sh -c "ulimit -n 1048576"')
220
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
215
+ with cd ('/home/ubuntu/projects/rscoin' ):
221
216
run ("python simscript.py %s payments.txt" % env .messages )
222
217
run ("rm -rf %s" % env .expname )
223
218
run ("mkdir %s" % env .expname )
@@ -227,33 +222,33 @@ def experiment1run():
227
222
@roles ("clients" )
228
223
@parallel
229
224
def experiment1pre ():
230
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
225
+ with cd ('/home/ubuntu/projects/rscoin' ):
231
226
run ("./rsc.py --play payments.txt-r1 > %s/r1-times.txt" % env .expname )
232
227
233
228
234
229
@roles ("clients" )
235
230
@parallel
236
231
def experiment1actual ():
237
- with cd ('/home/ubuntu/projects/rscoin/src ' ):
232
+ with cd ('/home/ubuntu/projects/rscoin' ):
238
233
run ("./rsc.py --play payments.txt-r2 --conn 20 > %s/r2-times.txt" % env .expname )
239
234
240
235
241
236
@roles ("clients" )
242
237
def experiment1collect ():
243
238
# run("ls experiment1/*")
244
- with cd ('/home/ubuntu/projects/rscoin/src/ %s' % env .expname ):
239
+ with cd ('/home/ubuntu/projects/rscoin/%s' % env .expname ):
245
240
get ('issue-times.txt' , '%s/%s-issue-times.txt' % (env .expname , env .host ))
246
241
247
242
with lcd (env .expname ):
248
243
local ("cat %s-issue-times.txt >> issue-times.txt" % env .host )
249
244
250
- with cd ('/home/ubuntu/projects/rscoin/src/ %s' % env .expname ):
245
+ with cd ('/home/ubuntu/projects/rscoin/%s' % env .expname ):
251
246
get ('r1-times.txt' , '%s/%s-r1-times.txt' % (env .expname , env .host ))
252
247
253
248
with lcd (env .expname ):
254
249
local ("cat %s-r1-times.txt >> r1-times.txt" % env .host )
255
250
256
- with cd ('/home/ubuntu/projects/rscoin/src/ %s' % env .expname ):
251
+ with cd ('/home/ubuntu/projects/rscoin/%s' % env .expname ):
257
252
get ('r2-times.txt' , '%s/%s-r2-times.txt' % (env .expname , env .host ))
258
253
259
254
with lcd (env .expname ):
0 commit comments