-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.xml
307 lines (249 loc) · 11.3 KB
/
build.xml
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<project name="CloudWorkflowSimulator" default="dist" basedir=".">
<description>
Build ile for cloud-workflow-simulator. For some of the targets user must have required executor in PATH environment variable.
</description>
<!-- Set properties and paths
============================================================-->
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="lib" location="lib"/>
<property name="test.dir" location="test"/>
<property name="testbuild" location="test_bin"/>
<property name="script.dir" location="scripts"/>
<property name="dist" location="dist"/>
<property name="test.data.dir" location="test_results"/>
<property name="test.reports.dir" location="${test.data.dir}/reports"/>
<manifest file="MANIFEST.MF">
<!--default class of the jar to be loaded-->
<attribute name="Main-Class"
value="cws.core.simulation.Simulation"/>
</manifest>
<path id="build.classpath">
<fileset dir="lib" includes="*.jar"/>
</path>
<path id="testbuild.classpath">
<fileset dir="lib" includes="*.jar"/>
<pathelement path="${build}"/>
</path>
<!-- Classpath needs to include the libs, the cws classes and the
tests classes -->
<path id="test.classpath">
<fileset dir="lib" includes="*.jar"/>
<pathelement path="${build}"/>
<pathelement path="${java.class.path}"/>
<pathelement path="${testbuild}"/>
</path>
<!-- Build commands
============================================================-->
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${testbuild}"/>
<!-- Create directories for test output -->
<mkdir dir="${test.data.dir}"/>
<mkdir dir="${test.reports.dir}"/>
<!-- Dir for output from SimulationTest -->
<mkdir dir="${test.data.dir}/SimulationTest"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" classpathref="build.classpath"
includeantruntime="false" source="6" target="6"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything in ${build} into the jar file -->
<jar jarfile="${dist}/cloudworkflowsimulator.jar" basedir="${build}"/>
</target>
<target name="dist-fat-jar" depends="compile"
description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything in ${build} into the jar file and include every library from ${lib} as well -->
<jar jarfile="${dist}/cloudworkflowsimulator-fat.jar" basedir="${build}" manifest="MANIFEST.MF">
<zipgroupfileset dir="${lib}" includes="**/*.jar"/>
</jar>
</target>
<target name="test-build" depends="compile"
description="build the java unit and integration tests" >
<javac srcdir="${test.dir}"
destdir="${testbuild}"
classpathref="testbuild.classpath"
includeantruntime="false" />
<javac srcdir="integration_test"
destdir="${testbuild}"
classpathref="testbuild.classpath"
includeantruntime="false" />
</target>
<target name="test-java" depends="compile,test-build"
description="run the java unit and integration tests" >
<junit printsummary="yes"
haltonfailure="no"
errorProperty="test.failed"
failureProperty="test.failed"
fork="true"
forkMode="once">
<!-- Forking once allows ant to automatically set the classpath so
that it can find the required junit and ant files. -->
<classpath refid="test.classpath" />
<!-- Find and run tests in 'test' and 'integration_test' dirs -->
<batchtest todir="${test.data.dir}">
<!-- Exclude abstract classes -->
<fileset dir="${test.dir}" includes="**/*Test.java"
excludes="**/StorageManagerTest.java,
**/VMCacheManagerTest.java,
**/DAGDynamicSchedulerStorageAwareTest.java"/>
<fileset dir="integration_test" includes="**/*Test.java"/>
</batchtest>
<!-- Dump xml output to file -->
<formatter type="xml"/>
</junit>
<!-- Make pretty html output from the xml files -->
<junitreport todir="${test.data.dir}">
<fileset dir="${test.data.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports.dir}"/>
</junitreport>
<!-- Report failures -->
<fail if="test.failed">
Unit tests failed. Check ${test.reports.dir}/index.html for details.
</fail>
</target>
<target name="test-python" description="run python tests">
<exec executable="/usr/bin/python" dir="${script.dir}">
<arg line="-m"/>
<arg line="validation.single_task_validator_test"/>
</exec>
<exec executable="/usr/bin/python" dir="${script.dir}">
<arg line="-m"/>
<arg line="validation.order_validator_test"/>
</exec>
<exec executable="/usr/bin/python" dir="${script.dir}">
<arg line="-m"/>
<arg line="validation.simulation_validator_test"/>
</exec>
<exec executable="/usr/bin/python" dir="${script.dir}">
<arg line="-m"/>
<arg line="validation.constraints_validator_test"/>
</exec>
<exec executable="/usr/bin/python" dir="${script.dir}">
<arg line="-m"/>
<arg line="log_parser.parse_experiment_log_test "/>
</exec>
</target>
<!-- Run all tests -->
<target name="test" depends="test-java,test-python" description="build and run all tests" />
<!-- Run a single test -->
<target name="runtest" description="Runs the test you specify on the command line with -Dtest="
depends="compile, test-build, ensure-test-name">
<junit printsummary="withOutAndErr" fork="yes">
<classpath refid="test.classpath" />
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/${ttr}.java"/>
</fileset>
<fileset dir="integration_test">
<include name="**/${ttr}.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- For single test make sure we have passed the argument -->
<target name="ensure-test-name" unless="ttr">
<fail message="You must run this target with -Dttr=TestName"/>
</target>
<!-- Simulator related targets to make it easier for user -->
<target name="run-sim-locally-defaults"
depends="compile, ensure-input-dir"
description="runs simulation locally on GENOME workflows with default params">
<exec executable="sh">
<arg value="-c"/>
<arg value="${script.dir}/runners/run_simulation_locally.sh "--application GENOME --input-dir ${indir} --output-file ${out} --distribution pareto_unsorted --algorithm SPSS --storage-manager void --ensemble-size 20""/>
</exec>
</target>
<target name="run-sim-locally"
depends="compile, ensure-input-dir, ensure-application-type, ensure-distribution-type, ensure-algo, ensure-ensemble-size, ensure-storage-manager-type"
description="runs simulation locally">
<exec executable="sh">
<arg value="-c"/>
<arg value="${script.dir}/runners/run_simulation_locally.sh "--application ${app} --input-dir ${indir} --output-file ${out} --distribution ${distr} --algorithm ${algo} --storage-manager ${storagemng} --ensemble-size ${ensemblesize} --scaling-factor ${scalingfactor} --seed ${seed} --storage-cache ${storagecache} --enable-logging ${enablelog} --log-to-stdout ${stdoutlog} --n-budgets ${budgets} --n-deadlines ${deadlines} --vm-type-selection ${vmtypeselection}""/>
</exec>
</target>
<target name="preprocess-test-results"
depends="ensure-raw-log-file, ensure-preprocessed-log-file"
description="preprocesses test results">
<exec executable="python" dir="${script.dir}">
<arg line="-m"/>
<arg line="log_parser.parse_experiment_log ../${rawlog} ../${preprocessedlog}"/>
</exec>
</target>
<target name="validate-test-result"
depends="ensure-preprocessed-log-file"
description="validates preprocessed test results">
<exec executable="python" dir="${script.dir}">
<arg line="-m"/>
<arg line="validation.experiment_validator ../${preprocessedlog}"/>
</exec>
</target>
<target name="visualize-scheduling-process-defaults"
depends="ensure-preprocessed-log-file, ensure-graph-file"
description="visualizes scheduling process of simulation">
<exec executable="ruby" dir="${script.dir}/visualisation">
<arg line="plot_gantt.rb results ../../${preprocessedlog} ../../${graph}"/>
</exec>
</target>
<target name="visualize-storage-demand-defaults"
depends="ensure-preprocessed-log-file, ensure-graph-file"
description="visualizes storage demand of simulation">
<exec executable="ruby" dir="${script.dir}/visualisation">
<arg line="plot_storage.rb number ../../${preprocessedlog} ../../${graph}"/>
</exec>
</target>
<target name="preprocess-validate-visualize-scheduling-process-and-storage-demand"
depends="preprocess-test-results, validate-test-result, visualize-scheduling-process-defaults, visualize-storage-demand-defaults"
description="runs preprocessing, validating and visualizing.">
</target>
<!-- Make sure some tasks are passed proper arguments. -->
<target name="ensure-raw-log-file" unless="rawlog">
<fail message="You must run this target with -Drawlog=name-of-log-file-to-preprocess"/>
</target>
<target name="ensure-preprocessed-log-file" unless="preprocessedlog">
<fail message="You must run this target with -Dpreprocessedlog=name-of-preprocessed-log-file"/>
</target>
<target name="ensure-input-dir" unless="indir">
<fail message="You must run this target with -Dindir=input-directory-of-dags"/>
</target>
<target name="ensure-graph-file" unless="graph">
<fail message="You must run this target with -Dgraph=output-graph-file"/>
</target>
<target name="ensure-application-type" unless="app">
<fail message="You must run this target with -Dapp=[GENOME/CYBERSHAKE/LIGO/MONTAGE/SIPHT]"/>
</target>
<target name="ensure-distribution-type" unless="distr">
<fail message="You must run this target with -Ddistr=[pareto_unsorted/..?]"/>
</target>
<target name="ensure-algo" unless="algo">
<fail message="You must run this target with -Dalgo=[SPSS/DPDS/WADPDS]"/>
</target>
<target name="ensure-ensemble-size" unless="ensemblesize">
<fail message="You must run this target with -Densemblesize=number-in-range-of-0-to-30"/>
</target>
<target name="ensure-storage-manager-type" unless="storagemng">
<fail message="You must run this target with -Dstoragemng=[void/fifo]"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${testbuild}"/>
</target>
</project>