forked from swift-lang/swift-k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
511 lines (429 loc) · 18.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
<!--
Swift Parallel Scripting Language (http://swift-lang.org)
Code from Java CoG Kit Project (see notice below) with modifications.
Copyright 2005-2014 University of Chicago
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- ===================================================================
This code is developed as part of the Java CoG Kit project
The terms of the license can be found at http://www.cogkit.org/license
This message may not be removed or altered.
==================================================================== -->
<project name="Java CoG Kit" default="redist" basedir=".">
<property name="swift.root" value="${basedir}"/>
<property name="cog.dir" value="${basedir}/cogkit"/>
<property name="main.buildfile" value="${cog.dir}/mbuild.xml"/>
<!-- set module name and dir here to override values in mbuild.xml -->
<property name="module.name" value="swift"/>
<property name="module.dir" value="${swift.root}"/>
<!-- Need to get version from properties -->
<property file="${module.dir}/project.properties"/>
<property name="dist.dir" value="${module.dir}/dist/${module.name}-${version}"/>
<property name="build.dir" value="${module.dir}/build"/>
<!-- ================================================ -->
<!-- Help -->
<!-- ================================================ -->
<target name="help">
<echo>
Available targets:
help:
prints out this help message
dist:
creates a distribution directory of the
${project} ${long.name}
redist:
does a distclean and then a dist. This is the safest
way of building Swift.
jar:
creates a jar file for the ${project} ${long.name}
named ${jar.filename}
javadoc:
creates the documentation
clean:
removes the compiled classes
distclean:
deletes the distribution directory
all:
dist and javadoc
deploy.webstart:
deploys the module as a webstart application
dist.joint:
builds everything into one jar file. Should only
be used globally (from all)
fixeol:
change newlines to the unix standard.
</echo>
</target>
<!-- ================================================ -->
<!-- Dist -->
<!-- ================================================ -->
<target name="etc">
<copy todir="${dist.dir}/etc">
<fileset dir="${module.dir}/etc" excludes="launcher-template*"/>
</copy>
</target>
<target name="dist" depends="generateVersion, antlr, compileParams, processScriptTemplates">
<ant antfile="${main.buildfile}" target="dist"/>
<mkdir dir="${dist.dir}/libexec"/>
<copy todir="${dist.dir}/libexec">
<fileset dir="${module.dir}/libexec" excludes="_swiftwrap*.in _swiftwrap*.lib"/>
</copy>
<mkdir dir="${dist.dir}/libexec/ec2-cloud-provider"/>
<copy todir="${dist.dir}/libexec/ec2-cloud-provider">
<fileset dir="${cog.dir}/modules/provider-localscheduler/libexec/ec2-cloud-provider"/>
</copy>
<mkdir dir="${dist.dir}/libexec/gce-cloud-provider"/>
<copy todir="${dist.dir}/libexec/gce-cloud-provider">
<fileset dir="${cog.dir}/modules/provider-localscheduler/libexec/gce-cloud-provider"/>
</copy>
<mkdir dir="${dist.dir}/libexec/radical-pilot-provider"/>
<copy todir="${dist.dir}/libexec/radical-pilot-provider">
<fileset dir="${cog.dir}/modules/provider-localscheduler/libexec/radical-pilot-provider"/>
</copy>
<copy todir="${dist.dir}/bin">
<fileset dir="${module.dir}/bin"/>
</copy>
<copy todir="${dist.dir}/lib/perl">
<fileset dir="${module.dir}/lib/perl"/>
</copy>
<chmod perm="+x">
<fileset dir="${dist.dir}/bin">
<include name="apptimes"/>
<include name="foreachworker"/>
<include name="gensites"/>
<include name="moab-qdel"/>
<include name="moab-qstat"/>
<include name="moab-qsub"/>
<include name="prop2scs.pl"/>
<include name="start-coaster-service"/>
<include name="stop-coaster-service"/>
<include name="swiftlog"/>
<include name="swiftrun"/>
<include name="swift-plot-log"/>
<include name="swift-service"/>
<include name="VDL2Karajan"/>
<include name="vdlc"/>
</fileset>
</chmod>
<chmod perm="+x">
<fileset dir="${dist.dir}/libexec/log-processing">
<include name="active-state-transitions"/>
<include name="add-runid-as-prefix"/>
<include name="affine-transform"/>
<include name="all-kickstarts-to-event"/>
<include name="all-logs-active-jobsubmissions-count-graph"/>
<include name="annotate-karatasks-with-execute2-id"/>
<include name="autospace-data"/>
<include name="cli-finished"/>
<include name="cli-version"/>
<include name="cluster-report"/>
<include name="cluster-stats"/>
<include name="colour-execute2"/>
<include name="colour-execute2-by-falkon"/>
<include name="colour-karatasks"/>
<include name="coloured-event-plot"/>
<include name="combine-execute-start-last-times"/>
<include name="combine-karajan-tasks-and-load-average"/>
<include name="combine-start-last-times"/>
<include name="combine-start-last-times-to-event"/>
<include name="compute-t-inf"/>
<include name="create-everylog-vs-versions-data"/>
<include name="duration-of-workflow"/>
<include name="error-summary"/>
<include name="event-duration-stats"/>
<include name="events-in-progress"/>
<include name="events-in-progress-*.pl"/>
<include name="everylog-durations-of-workflows"/>
<include name="everylog-to-event"/>
<include name="everylog-vs-versions"/>
<include name="execstages-plot"/>
<include name="execute2-status-from-log"/>
<include name="execute2-summary-from-log"/>
<include name="execution-summaries"/>
<include name="extract-activity-for-subthreads-of"/>
<include name="extract-activity-for-task"/>
<include name="extract-activity-for-thread"/>
<include name="extract-completed-time-for-run-id"/>
<include name="extract-end-time"/>
<include name="extract-execute-start-times"/>
<include name="extract-failed-time-for-run-id"/>
<include name="extract-jobid-karajanid-bindings"/>
<include name="extract-last-time-for-execute"/>
<include name="extract-start-time"/>
<include name="extract-start-times"/>
<include name="falkon-to-event"/>
<include name="generate-karatasks-event"/>
<include name="get-jobid-for-karajanid"/>
<include name="get-replicationid-for-execute2id"/>
<include name="get-site-for-run-id"/>
<include name="get-thread-for-run-id"/>
<include name="info-and-karajan-actives"/>
<include name="info-to-md5"/>
<include name="info-to-transitions"/>
<include name="info-to-zeroed-transitions"/>
<include name="iso-to-secs"/>
<include name="karatasks-only"/>
<include name="kickstarts-to-event"/>
<include name="kickstarts-to-plot"/>
<include name="last-times"/>
<include name="last-transition-line"/>
<include name="list-known-tasks"/>
<include name="list-known-threads"/>
<include name="log-to-*-transitions"/>
<include name="logs-for-all"/>
<include name="lookup-colour"/>
<include name="max-duration"/>
<include name="normalise-event-start-time"/>
<include name="normalise-event-start-time-to-any"/>
<include name="number-events"/>
<include name="number-sites-list"/>
<include name="overview-reports.sh"/>
<include name="per-site-execute2-durations"/>
<include name="plot-duration-histogram"/>
<include name="plot-everylogs"/>
<include name="queue-state-transitions"/>
<include name="retrycounts"/>
<include name="sec-to-utc"/>
<include name="sec-to-utc-day"/>
<include name="simple-event-plot"/>
<include name="sort-preserve"/>
<include name="split-start-times-shifted"/>
<include name="start-last-times-and-kickstart"/>
<include name="sum-tt1.pl"/>
<include name="swap-and-sort"/>
<include name="swap-and-sort-and-swap"/>
<include name="swift-standard-log-to-transition"/>
<include name="table-jobs-sites"/>
<include name="task-status-to-transitions"/>
<include name="tasks-in-cluster"/>
<include name="temporal-join"/>
<include name="tie-url-filenames"/>
<include name="times-for-all-tasks"/>
<include name="total-event-plot"/>
<include name="trail"/>
<include name="trail-freex"/>
<include name="transitions-to-cedps"/>
<include name="transitions-to-event"/>
<include name="tscore.sh"/>
<include name="weights.sh"/>
<include name="whole-workflow-event"/>
<include name="whole-workflow-time"/>
</fileset>
</chmod>
<!--<delete file="${dist.dir}/lib/jaxrpc.jar" quiet="true"/>-->
<delete includeEmptyDirs="true">
<fileset dir="${dist.dir}/bin/examples"/>
</delete>
<delete>
<fileset dir="${dist.dir}/bin"
includes="examples, cog-checkpoint*, cog-file-operation*, cog-register*"/>
<fileset dir="${dist.dir}/bin"
includes="cog-task2xml*, globus-gass-server*, globus-personal-gatekeeper*"/>
<fileset dir="${dist.dir}/bin"
includes="globus2jks*, grid-info-search*, cogrun*, globus-gass-server-shutdown*"/>
</delete>
<antcall target="remove-supporting" />
<copy todir="${dist.dir}/etc"
file="${module.dir}/etc/karajan.properties"
overwrite="true"/>
<copy todir="${dist.dir}/etc"
file="${module.dir}/etc/log4j.properties.swift"
overwrite="true"/>
<copy todir="${dist.dir}/etc/templates">
<fileset dir="${module.dir}/etc/templates"/>
</copy>
<copy todir="${dist.dir}/etc/sites">
<fileset dir="${module.dir}/etc/sites"/>
</copy>
<chmod perm="+x" file="${dist.dir}/bin/swift"/>
<chmod perm="+x" file="${dist.dir}/bin/swift-osg-ress-site-catalog"/>
<chmod perm="+x" file="${dist.dir}/libexec/cdm_broadcast.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/ec2-cloud-provider/stsubmit.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/ec2-cloud-provider/ststat.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/ec2-cloud-provider/stcancel.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/gce-cloud-provider/stsubmit.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/gce-cloud-provider/ststat.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/gce-cloud-provider/stcancel.sh"/>
<chmod perm="+x" file="${dist.dir}/libexec/radical-pilot-provider/stsubmit"/>
<chmod perm="+x" file="${dist.dir}/libexec/radical-pilot-provider/ststat"/>
<chmod perm="+x" file="${dist.dir}/libexec/radical-pilot-provider/stcancel"/>
</target>
<target name="antlr">
<java classname="antlr.Tool" fork="true" failonerror="true">
<arg value="-o"/>
<arg value="${module.dir}/src/org/globus/swift/parser"/>
<arg value="${module.dir}/resources/swiftscript.g"/>
<classpath>
<pathelement location="${module.dir}/lib/antlr-2.7.5.jar"/>
<pathelement location="${module.dir}/lib/stringtemplate.jar"/>
</classpath>
</java>
</target>
<target name="compileParams">
<!-- Mapper parameters are java classes that are (mostly) -->
<!-- generated from parameter files. This is done to avoid -->
<!-- costly hashtables attached to every single piece of -->
<!-- swift root data. They could be written by hand (and -->
<!-- some are), but it's a tedious process -->
<!-- first compile the params compiler -->
<mkdir dir="${build.dir}"/>
<echo message="[swift] Compiling mapper params compiler"/>
<javac srcdir="${module.dir}/src"
destdir="${build.dir}"
includes="**/MappingParamFileGenerator.java"
includeAntRuntime="false"/>
<!-- then compile the files themselves -->
<echo message="[swift] Generating mapping parameter classes"/>
<java classname="org.griphyn.vdl.mapping.file.MappingParamFileGenerator" fork="true" failonerror="true">
<arg value="${module.dir}/src"/>
<classpath>
<pathelement location="${build.dir}"/>
</classpath>
</java>
</target>
<target name="processScriptTemplates">
<mkdir dir="${build.dir}"/>
<echo message="[swift] Compiling script generator"/>
<javac srcdir="${module.dir}/src"
destdir="${build.dir}"
includes="**/ScriptTemplateProcessor.java"
includeAntRuntime="false"/>
<!-- then compile the files themselves -->
<echo message="[swift] Generating scripts"/>
<java classname="org.griphyn.vdl.util.ScriptTemplateProcessor" fork="true" failonerror="true">
<arg value="${module.dir}/libexec"/>
<classpath>
<pathelement location="${build.dir}"/>
</classpath>
</java>
</target>
<target name="swift.launcher">
<condition property="launcher.exists">
<and>
<available file="${dist.dir}/bin/${launcher-name}"/>
<available file="${dist.dir}/bin/${launcher-name}.bat"/>
</and>
</condition>
<antcall target="create.swift.launcher">
<param name="class-name" value="${class-name}"/>
<param name="launcher-name" value="${launcher-name}"/>
</antcall>
</target>
<target name="create.swift.launcher" unless="launcher.exists">
<echo message="[${module.name}]: LAUNCHER ${launcher-name}"/>
<property name="umask" value=""/>
<filter token="class" value="${class-name}"/>
<filter token="jar" value="${jar.name}"/>
<filter token="umask" value="${umask}"/>
<copy file="${module.dir}/etc/launcher-template"
tofile="${dist.dir}/bin/${launcher-name}"
filtering="true"/>
<copy file="${module.dir}/etc/launcher-template.bat"
tofile="${dist.dir}/bin/${launcher-name}.bat"
filtering="true"/>
<chmod file="${dist.dir}/bin/${launcher-name}" perm="+x"/>
<!-- Just in case... -->
<fixcrlf srcdir="${dist.dir}/bin"
eol="lf"
includes="${launcher-name}" />
<fixcrlf srcdir="${dist.dir}/bin"
eol="crlf"
includes="${launcher-name}.bat" />
</target>
<!-- ================================================ -->
<!-- Compile -->
<!-- ================================================ -->
<target name="compile">
<ant antfile="${main.buildfile}" target="compile"/>
</target>
<!-- ================================================ -->
<!-- Clean -->
<!-- ================================================ -->
<target name="clean" depends="cleanGenerated">
<ant antfile="${main.buildfile}" target="clean"/>
</target>
<!-- ================================================ -->
<!-- Distclean -->
<!-- ================================================ -->
<target name="distclean" depends="cleanGenerated">
<ant antfile="${main.buildfile}" target="distclean"/>
</target>
<target name="cleanGenerated">
<delete includeEmptyDirs="true">
<fileset dir="${module.dir}/src/org/griphyn/vdl/model/" includes="**/*.java" erroronmissingdir="false" />
</delete>
<delete file="lib/vdldefinitions.jar"/>
</target>
<!-- ================================================ -->
<!-- Jar -->
<!-- ================================================ -->
<target name="jar">
<ant antfile="${main.buildfile}" target="jar"/>
</target>
<!-- ================================================ -->
<!-- Javadoc -->
<!-- ================================================ -->
<target name="javadoc">
<ant antfile="${main.buildfile}" target="javadoc"/>
</target>
<!-- ================================================ -->
<!-- PMD -->
<!-- ================================================ -->
<target name="pmd">
<ant antfile="${main.buildfile}" target="pmd"/>
</target>
<!-- ================================================ -->
<!-- deploy.webstart -->
<!-- ================================================ -->
<target name="deploy.webstart">
<ant antfile="${main.buildfile}" target="deploy.webstart"/>
</target>
<!-- ================================================ -->
<!-- replacelibs -->
<!-- ================================================ -->
<target name="replacelibs">
<ant antfile="${main.buildfile}" target="replacelibs"/>
</target>
<!-- ================================================ -->
<!-- webstart.launchers -->
<!-- ================================================ -->
<target name="webstart.launchers">
<ant antfile="${main.buildfile}" target="webstart.launchers"/>
</target>
<!-- ================================================ -->
<!-- dist.joint -->
<!-- ================================================ -->
<target name="dist.joint">
<ant antfile="${main.buildfile}" target="dist.all"/>
</target>
<!-- ================================================ -->
<!-- fixeol -->
<!-- ================================================ -->
<target name="fixeol">
<ant antfile="${main.buildfile}" target="fixeol"/>
</target>
<target name="module.package">
<ant antfile="${main.buildfile}" target="module.package"/>
</target>
<target name="generateVersion">
<echo file="${module.dir}/libexec/version.txt">Swift </echo>
<exec os="Linux, Mac OS X" executable="${module.dir}/libexec/svn-revision" append="true" output="${module.dir}/libexec/version.txt"/>
<exec os="Linux, Mac OS X" executable="${module.dir}/libexec/generate-buildid" append="false" output="${module.dir}/libexec/buildid.txt"/>
</target>
<target name="redist" depends="distclean, dist">
</target>
<target name="remove-supporting" if="no-supporting">
<delete>
<fileset dir="${dist.dir}/bin"
includes="cog*, globus*, grid*"/>
</delete>
</target>
</project>