@@ -12,8 +12,8 @@ def log(s):
12
12
print s
13
13
sys .stdout .flush ()
14
14
15
- def calls (s ):
16
- return call (s .split ())
15
+ def calls (s , cwd = None ):
16
+ return call (s .split (), cwd = None )
17
17
18
18
if exists ("instance-setup-warner.stamp" ):
19
19
log ("instance-setup-warner.stamp exists, exiting" )
@@ -48,6 +48,7 @@ def get_metadata(name, type="instance"):
48
48
from rewrite_config import reconfig
49
49
50
50
introducer_furl = get_metadata ("introducer-furl" , "project" )
51
+ perf_rootcap = get_metadata ("perf-rootcap" , "project" )
51
52
52
53
for nodename in get_metadata ("tahoeperf-nodes" ).split ("," ):
53
54
if nodename .startswith ("storage" ):
@@ -61,13 +62,25 @@ def get_metadata(name, type="instance"):
61
62
log ("started %s" % nodedir )
62
63
63
64
if nodename == "client" :
64
- pass
65
- ## TAHOE = expanduser("~/bin/tahoe")
66
- ## if not exists(expanduser("~/.tahoe")):
67
- ## log("creating %s" % nodename)
68
- ## call([TAHOE, "create-client", "-n", nodename, "-i", introducer_furl])
69
- ## call([TAHOE, "start"])
70
- ## log("started %s" % nodename)
65
+ # fetch tahoe tarball, unpack, setup.py build
66
+ if not exists ("allmydata-tahoe-1.10.0" ):
67
+ calls ("wget https://tahoe-lafs.org/source/tahoe-lafs/releases/allmydata-tahoe-1.10.0.zip" )
68
+ calls ("unzip allmydata-tahoe-1.10.0.zip" )
69
+ calls ("python setup.py build" ,
70
+ cwd = expanduser ("allmydata-tahoe-1.10.0" ))
71
+ if not exists (expanduser ("~/bin/tahoe" )):
72
+ os .symlink (expanduser ("~/allmydata-tahoe-1.10.0/bin/tahoe" ),
73
+ expanduser ("~/bin/tahoe" ))
74
+ TAHOE = expanduser ("~/bin/tahoe" )
75
+ if not exists (expanduser ("~/.tahoe" )):
76
+ # create client
77
+ log ("creating/starting %s" % nodename )
78
+ call ([TAHOE , "create-client" , "-n" , nodename , "-i" ,introducer_furl ])
79
+ # start node
80
+ call ([TAHOE , "start" ])
81
+ # configure perf: alias
82
+ call ([TAHOE , "add-alias" , "perf" , perf_rootcap ])
83
+ log ("started %s" % nodename )
71
84
## log("running start-client.py")
72
85
## call([sys.executable, expanduser("~/perf-tests/./start-client.py")])
73
86
0 commit comments