-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
271 lines (204 loc) · 13.3 KB
/
Copy pathbuild.xml
File metadata and controls
271 lines (204 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?xml version="1.0" encoding="UTF-8"?>
<project name="CS290B-HW3" basedir=".">
<description>
Builds, tests, and runs the project CS-290B-HW2.
</description>
<property name="src" location="source"/>
<property name="build" location="build/classes"/>
<property name="dist" location="dist"/>
<!-- codebase properties -->
<property name="client_file_codebase" location="/cs/student/kowshik/public_html/CS290B/HW3/"/>
<property name="client_web_codebase" value="http://www.cs.ucsb.edu/~kowshik/CS290B/HW3/"/>
<property name="client_codebase_server" value="csil.cs.ucsb.edu"/>
<!-- host names -->
<property name="host1" value="dudley.cs.ucsb.edu"/>
<property name="host2" value="scooby.cs.ucsb.edu"/>
<property name="host3" value="calvin.cs.ucsb.edu"/>
<property name="host4" value="linus.cs.ucsb.edu"/>
<property name="host5" value="lisa.cs.ucsb.edu"/>
<property name="host6" value="yogi.cs.ucsb.edu"/>
<property name="host7" value="megatron.cs.ucsb.edu"/>
<property name="host8" value="snarf.cs.ucsb.edu"/>
<property name="host9" value="dizzy.cs.ucsb.edu"/>
<property name="host10" value="cartman.cs.ucsb.edu"/>
<property name="host11" value="thundarr.cs.ucsb.edu"/>
<property name="host12" value="whiley.cs.ucsb.edu"/>
<property name="host13" value="optimus.cs.ucsb.edu"/>
<property name="host14" value="brain.cs.ucsb.edu"/>
<property name="host15" value="tick.cs.ucsb.edu"/>
<property name="host16" value="bugs.cs.ucsb.edu"/>
<property name="host_computespace" value="snoopy.cs.ucsb.edu"/>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<sshexec host="${client_codebase_server}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="rm -fr ${client_file_codebase}/tasks/" passphrase=""/>
<sshexec host="${client_codebase_server}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="mkdir -p ${client_file_codebase}/tasks/" passphrase=""/>
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="compile" description="compiles the source">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="javadoc" description="create javadocs" depends="compile">
<javadoc packagenames="tasks.*,api.*,client.*,system.*" sourcepath="${src}" destdir="documents/javadoc"/>
</target>
<target name="build_client" description="builds client" depends="compile">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Make client.jar file -->
<jar jarfile="${dist}/client.jar" basedir="${build}" includes="api/** client/** tasks/** system/**"/>
</target>
<target name="build_computer" description="builds computer" depends="compile">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Make computer.jar file -->
<jar jarfile="${dist}/computer.jar" basedir="${build}" includes="api/** system/** client/** tasks/**"/>
</target>
<target name="build_space" depends="compile" description="build space">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Make space.jar file -->
<jar jarfile="${dist}/space.jar" basedir="${build}" includes="api/** system/** tasks/**"/>
</target>
<target name="runLocalComputer" depends="build_computer" description="run a computer locally">
<!-- run computer -->
<java classname="system.ComputerImpl" fork="true">
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="localhost:2672"/>
<classpath>
<pathelement location="${dist}/computer.jar"/>
</classpath>
</java>
</target>
<target name="runComputer" description="runs computer on the remote host">
<!-- run remote computer -->
<java classname="system.ComputerImpl" fork="true">
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="snoopy.cs.ucsb.edu:2672"/>
<classpath>
<pathelement location="${dist}/computer.jar"/>
</classpath>
</java>
</target>
<target name="runRemoteComputers" depends="build_computer" description="starts remote computers through ssh">
<!-- run computer in remote hosts -->
<parallel>
<sshexec host="${host1}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="cd /cs/student/${username}/hw3/; ant runComputer" passphrase=""/>
<sshexec host="${host2}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="cd /cs/student/${username}/hw3/; ant runComputer" passphrase=""/>
<sshexec host="${host3}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="cd /cs/student/${username}/hw3/; ant runComputer" passphrase=""/>
<sshexec host="${host4}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="cd /cs/student/${username}/hw3/; ant runComputer" passphrase=""/>
</parallel>
</target>
<target name="kill" description="kills java processes in all remote machines started through ssh">
<!-- run computer in remote hosts -->
<parallel>
<sshexec host="${host1}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host2}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host3}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host4}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host5}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host6}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host7}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host8}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host9}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host10}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host11}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host12}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host13}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host14}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host15}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host16}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
<sshexec host="${host_computespace}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="killall java" passphrase=""/>
</parallel>
</target>
<target name="runLocalSpace" depends="build_space" description="run compute space locally">
<!-- run space -->
<java classname="system.SpaceImpl" fork="true">
<jvmarg value="-Djava.security.policy=policy/policy"/>
<classpath>
<pathelement location="${dist}/space.jar"/>
</classpath>
</java>
</target>
<target name="runRemoteSpace" depends="build_space" description="starts a remote compute space through ssh">
<!-- run compute space in remote hosts -->
<sshexec host="${host_computespace}" username="${username}" keyfile="/cs/student/${username}/.ssh/headless_rsa" trust="true" command="cd /cs/student/${username}/hw3/; ant runSpace" passphrase=""/>
</target>
<target name="runSpace" description="runs space on the remote host">
<!-- run remote space -->
<java classname="system.SpaceImpl" fork="true">
<jvmarg value="-Djava.security.policy=policy/policy"/>
<classpath>
<pathelement location="${dist}/space.jar"/>
</classpath>
</java>
</target>
<target name="runMandelbrotSetClient" description="run mandelbrot set client" depends="build_client">
<!-- rsun client -->
<java classname="client.MandelbrotSetClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="snoopy.cs.ucsb.edu:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
<target name="runTspClient" description="run travelling salesman problem client" depends="build_client">
<!-- run client -->
<java classname="client.TspClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="snoopy.cs.ucsb.edu:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
<target name="runFibClient" description="run fibonacci series generation" depends="build_client">
<!-- run client -->
<java classname="client.FibonacciClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="snoopy.cs.ucsb.edu:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
<target name="runLocalMandelbrotSetClient" description="run mandelbrot set client locally" depends="build_client">
<!-- run client -->
<java classname="client.MandelbrotSetClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="localhost:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
<target name="runLocalTspClient" description="run travelling salesman problem client locally" depends="build_client">
<!-- run client -->
<java classname="client.TspClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="localhost:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
<target name="runLocalFibClient" description="run fibonacci series generation locally" depends="build_client">
<!-- run client -->
<java classname="client.FibonacciClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${client_web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy/policy"/>
<arg value="localhost:2672"/>
<classpath>
<pathelement location="${dist}/client.jar"/>
</classpath>
</java>
</target>
</project>