This repository was archived by the owner on Apr 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDart.tex
4282 lines (3637 loc) · 203 KB
/
Dart.tex
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{InsightBook}
% \usepackage{graphicx}
\usepackage{cite}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage[sf]{caption}
\usepackage{enumerate}
\usepackage{fancyhdr}
% \usepackage{fncychap}
% \usepackage{float}
\usepackage{floatflt}
\usepackage{amsmath}
\usepackage[tight]{units}
\usepackage{url}
\usepackage{xspace}
\usepackage[pdftex,bookmarksopen=true,bookmarksopenlevel=10,pdfstartview=Fit,bookmarks=true,colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue,pdfauthor={Daniel J. Blezek and James V. Miller},pdftitle={Dart Manual}]{hyperref}
\newcommand{\answermark}{$\triangleright$ }
\newcommand{\xmltag}[1]{\texttt{<#1>}}
% Use to markup file and directory names
\newcommand{\filename}[1]{\texttt{#1}}
% This declares a set of common abbreviations (e.g., i.e.,
% etc.). These commands should be used instead of explicitly doing it
% yourself to get better typeset results. For example, ``\emph{e.g.}
% something'' would yield a sentence ending space between the ``.''
% and ``s'', which is not correct. The correct way is ``\emph{e.g.}\
% something''; this inserts a normal interword space. The macro
% ``\eg'' will take care of this automatically. The macros below will
% also make sure that at the end of a sentence, there won't be two
% periods. \Ie, ``apples, bananas, \etc.'' will not have two periods
% at the end, but ``(apples, bananas, \etc)'' will have a period
% before the closing paranthesis.
%
% (The code below taken from cvpr.sty, by [email protected]
% and [email protected].)
%
\makeatletter
\DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot}
\def\@onedot{\ifx\@let@token.\else.\xspace\fi}
\def\eg{\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot}
\def\ie{\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot}
\def\cf{\emph{c.f}\onedot} \def\Cf{\emph{C.f}\onedot}
\def\etc{\emph{etc}\onedot}
\def\vs{\emph{vs}\onedot}
\def\wrt{w.r.t\onedot}
\def\dof{d.o.f\onedot}
\def\etal{\emph{et al}\onedot}
\makeatother
\begin{document}
\title{Dart: Testing, Reports and Dashboards}
\author{Daniel J. Blezek \\
James V. Miller}
\maketitle
%----------------------------------------------------------------------
\chapter*{Acknowledgments}
\thispagestyle{empty}
This product includes software developed by the Apache Software Foundation (\url{http://www.apache.org/}).
This product includes software developed by the Visigoth Software Society (\url{http://www.visigoths.org/}).
This work funded in part by the National Library of Medicine of the National Institutes of Health as a component of the Insight Segmentation and Registration Toolkit (\url{http://www.itk.org/}), contract number N01-LM-9-3531.
This work is part of the National Alliance for Medical Image
Computing (NA-MIC), funded by the National Institutes of Health
through the NIH Roadmap for Medical Research, Grant U54 EB005149.
Information on the National Centers for Biomedical Computing
can be obtained from \url{http://nihroadmap.nih.gov/bioinformatics}.
%----------------------------------------------------------------------
\chapter*{License}
\thispagestyle{empty}
\begin{verbatim}
Copyright (c) 2004-2007, The Insight Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Insight Consortium nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\end{verbatim}
% Put the table on contents after the license
%
%
%
\tableofcontents
\setcounter{tocdepth}{10}
%----------------------------------------------------------------------
\chapter{Introduction}
\section{Dart Statement of Purpose}
\begin{quote}
\emph{Dart shall aggregate data across many independent distributed
build and test hosts, summarizing the software quality aspects of the project
in a concise and informative fashion cross-sectionally and longitudinally.}
\end{quote}
\section{History of Dart}
In 1997, General Electric added a new quality initiative, called \emph{Six Sigma}. As part of Six Sigma training, each employee had to complete a number of quality projects. At GE Research, we focused a collection of our quality projects on the development of one of our software toolkits, the Visualization Toolkit or VTK (\url{http://www.vtk.org/}). At the end of the first round of training, we had 14 different quality assurance processes applied to dynamic memory analysis, test code coverage, coding style, etc. In a second round of training, we integrated these original 14 projects into an automated system that collected their outputs and integrated them into an online dashboard. This system was a collection of \texttt{tcsh}, \texttt{awk}, \texttt{sed} and \texttt{cron} scripts, cobbled together into a quality assurance system.
In 1999, the National Library of Medicine commissioned the development of an open source, cross platform project called the Insight Segmentation and Registration Toolkit, ITK (\url{http://www.itk.org/}). As part of GE Research's contribution to the ITK effort, GE Research developed the first version of Dart. Dart's goals were
\begin{enumerate}
\item Remove the dependence on \texttt{tcsh}, \texttt{awk}, \texttt{sed} and \texttt{cron} scripts to perform a build and test sequence
\item Allow testing machines from around the world to submit test results to a Dart server
\item Separate the data from its presentation
\item Apply the Dart testing system to a variety of project (ITK, VTK, VXL)
\item Make the testing system itself open source
\end{enumerate}
The original Dart used \texttt{TCL} to orchestrate a build/test sequence on a client machine and construct an XML representation of the build/test results. The XML files were sent to a staging area on a Dart server using \texttt{ftp} and a \texttt{cgi-bin} script moved the XML data to the Dart server web page. A \texttt{cron} job periodically rolled up a Dashboard, using XSLT to convert the XML files to static HTML. Later, Kitware Inc. developed a second Dart client called CTest. CTest simplified the build/test process for the client machines and removed the client's dependency on \texttt{TCL}.
Dart met its original design goals and was successfully applied to many software projects. Dart clients were easy to use and allowed for testing machines to be distributed around the world. The Dart server allowed anyone to view the results of a test sequence and monitor the software development process. Dart allowed a cross-platform system to be tested in multiple configurations.
The server side of Dart, however, was still difficult to maintain. The Dart server needed a web server, cgi-bin, \texttt{Perl}, an \texttt{ftp} server, \texttt{TCL}, \texttt{cron}, and \texttt{java} (for XSLT). Dart required considerable storage and computational resources. The XML files needed considerable storage and it could take 20 minutes to convert XML files into static web pages.
In 2004, NIH sponsored the National Alliance of Medical Image Computing, NA-MIC (\url{http://www.na-mic.org/}) as part of NIH Roadmap for Medical Research, Grant U54 EB005149. GE Research is developing the next generation of Dart as part of NA-MIC. The goals remain broadly the same, however, two new goals have been identified
\begin{enumerate}
\item Simplify the Dart server setup and maintenance
\item Allow for longitudinal or temporal analysis of test results
\end{enumerate}
To this end, we introduce the new version of Dart. We affectionately refer to the previous version of Dart as \emph{Dart Classic}. The new Dart still accepts build/test results in the \emph{Dart Classic} format. Dart has been completely rewritten in Java. It uses an embedded web server and servlet engine (Jetty) and an embedded database (Derby). XML-RPC is used to transmit build/test results to the Dart server. Dart is distributed as two jar files. The first jar file, DartServer.jar, contains everything to create and run a Dart server managing several Dart projects. The second jar file, DartClient.jar, is a small utility to shutdown a server, refresh its resources, query its status, and can be used as an XML-RPC messenger.
\section{To Do}
\begin{itemize}
\item Better coverage formatting, to get up to par with Dart 1
\item Calendar for easy day navigation
\item Use Javascript column sorting, rather than server side sorting
\item HTAccess support
\begin{verbatim}
<Directory "/">
<limit GET POST>
Order deny,allow
deny from all
allow from 127.0.0.1
</Limit>
</Directory>
\end{verbatim}
\item SSL support
\end{itemize}
%----------------------------------------------------------------------
\chapter{Tutorial}
\section{Quick Start}
\label{Section:QuickStart}
If you are building Dart from source, please refer to
Section~\ref{Section:Development} to build the jar files, then return
to this Section. If you've downloaded the jar files, you may begin
here. The distributions are built using JDK 1.4. For users upgrading
from an earlier version of Dart, please see Sections~\ref{Section:UpgradeServer}-\ref{Section:UpgradePre0.4}.
Dart contains two jar files:
\begin{description}
\item[DartServer.jar] Complete Dart server with http server, servlet engine, and back end database.
\item[DartClient.jar] Small client to communicate with the Dart server. DartClient.jar can be used to shutdown the server, instruct the server to refresh/restore its resources (icons, templates, styles) from the DartServer.jar file, query the status of the Dart server, and transmit XML files to the Dart server.
\end{description}
Here are the steps to create a new Dart server, create a project on the Dart server, and start and stop the Dart server:
\begin{enumerate}
\item Create the Server directory and configuration\\
\begin{verbatim}
java -jar DartServer.jar --createserver TestServer
\end{verbatim}
The \texttt{--createserver} flag creates a new Server directory and an default configuration file Server.xml.
\item Initialize the server\\
\begin{verbatim}
java -jar DartServer.jar --initializeserver TestServer
\end{verbatim}
Initializes the Server database.
\item Create the project\\
\begin{verbatim}
java -jar DartServer.jar --create TestProject
\end{verbatim}
The \texttt{--create} flag requires a directory name argument.
Dart will create this directory for the Project
(\texttt{TestProject} in this example).
\item Configure the Project
By default, a reasonable settings file is found in
\texttt{TestProject/Project.xml}. If desired, this file may be
edited to change the projects settings (see
Section~\ref{Section:Settings}). Now is a good time to do this.
\item \label{quickstart:startprojectfirsttime} Start the project for the first time\\
\begin{verbatim}
java -jar DartServer.jar \
--initialize --refresh --refreshServer TestServer TestProject
\end{verbatim}
The \texttt{--initialize} flag instructs the server to create the
database tables that Dart requires for the project, while \texttt{--refresh}
copies the project resources into the TestProject directory.
TestServer is the name of the Dart Server, while any projects to
be started can be configured in TestServer/Server.xml and are
overridden by the commandline arguments. Note that \textbackslash\
indicates line continuation; that is, the code above should be
typed on one line. The \texttt{--refreshServer} puts some server
specific files in the correct locations in the Server directory.
\item View the dashboard. Point your browser to
\texttt{http://localhost:8081/TestProject/Dashboard/} to
view the (empty) Dashboard.
\item Shutting down the server
\begin{verbatim}
java -jar DartClient.jar -q TestProject
\end{verbatim}
To shutdown down the server, you need to send a message to the running server. The DartClient.jar file is a small Dart client that can be used to shutdown the server (or query its status or refresh its resources).
\item Restarting the server
\begin{verbatim}
java -jar DartServer.jar TestServer TestProject
\end{verbatim}
Once the project has been initialized in step \ref{quickstart:startprojectfirsttime}, the \texttt{--initialize} option is no longer needed when starting the project. The \texttt{--refresh} and \texttt{--refreshServer} could still be used if project or server resources (icons, template, styles) needed to be updated from the DartServer.jar.
\end{enumerate}
The project \texttt{TestProject} is now up and running accepting
XML-RPC submissions and serving HTML pages on
port \texttt{8081}.
You can also start Dart with multiple projects (that you previously created with the --create flag) by appending them to the command line:
\begin{verbatim}
java -jar DartServer.jar TestServer TestProject1 TestProject2 TestProject3
\end{verbatim}
Point your browser to \texttt{http://localhost:8081/} to view the project index.
The ports and other configurations are covered in
Section~\ref{Section:ServerSetup}.
\section{Web configuration}
\label{Section:WebConfiguration}
Once the Project is configured and the server is running, you should log into
the Dart web application and configure the \texttt{admin} User. Point a browser at
\url{http://localhost:8081/TestProject/Dashboard/} (Figure \ref{fig:FirstDartPage}) and click on the \texttt{login or create account} link at the top of the page. Log in as the default Dart administrator (Figure \ref{fig:DartAdminLogin}) using
\begin{description}
\item[Email:] admin
\item[Password:] password
\end{description}
Once you are logged into the Dart web application, you can modify the default password for the \texttt{admin} user (Figure \ref{fig:AdminUserPage}).
\begin{figure}[htb]
\centering
\includegraphics[width=4in]{FirstDartPage}
\caption{Dart Dashboard}
\label{fig:FirstDartPage}
\end{figure}
\begin{figure}[htb]
\centering
\includegraphics[width=4in]{DartAdminLogin}
\caption{Logging in as the administrator}
\label{fig:DartAdminLogin}
\end{figure}
\begin{figure}[htb]
\centering
\includegraphics[width=4in]{AdminUserPage}
\caption{Administrators User page}
\label{fig:AdminUserPage}
\end{figure}
* Please note that the weekly section seen in the figure \ref{fig:FirstDartPage} has been removed from the main page due to date issues. The commented code still remain in the XML default template (DefaultProject.xml) if you still need it. Please refer to Sun's Java \texttt{Date} class format for input.
\section{Submission}
Dart ships with a utility called DartClient to submit results to the
server. The basic use is:
\begin{verbatim}
java -jar DartClient.jar TestProject Results.xml
\end{verbatim}
This submits Results.xml to the \texttt{TestProject} Project on the
Server running on \texttt{localhost}. Submission is only a copy, and
does not provide feedback on the XML validity.
DartClient also provides other options:
\begin{verbatim}
# java -jar DartClient.jar --help
0 [main] INFO dart.DartClient - Starting DartClient
usage: DartClient [options] Project <foox.xml> <foo2.xml> ... <fooN.xml>
-p,--port XML-RPC Port to connect to, 8081 is default
-R,--refreshServer Refresh Server resources
-d,--date Print the current date and exit
-g,--getstatus Get Server status
-h,--help Print help message
-l,--sql SQL Commands to run on server
-q,--shutdown Shutdown the Server
-r,--refresh Refresh Project resources
-s,--server Server to connect to, localhost is default
-u,--username ProjectAdministrator username
-w,--password ProjectAdministrator password
-z,--schedulerstatus Get Scheduler status
\end{verbatim}
To connect through a proxy or firewall use:
\begin{verbatim}
java -Dhttp.proxyPort=8080 -Dhttp.proxyHost=proxyhost.mydomain.org \
-jar DartClient.jar --help
\end{verbatim}
with \texttt{http.proxyPort} and \texttt{http.proxyHost} replaced by
your proxy port and server.
\section{Software Installation}
To be completed.
\chapter{User Guide}
\label{Section:Users}
\section{Dart Users}
The Dart web application supports users and roles. At the top of each Dart page is a link that allows one to \emph{login or create account} (Figure \ref{fig:FirstDartPage}). Dart User accounts are shared amongst all projects on the Dart server. Currently, Dart User accounts are used by the Dart system to notify users of events. Future versions of Dart will allow Users more customization options: setting plot durations, storing queries, etc.
One event in the Dart system that may notify Users is a submission to the server that contains build errors. The authors of the new code in that submission can be notified via email that their contribution or modification of the source code produces errors on a particular platform. The Dart server uses Dart User accounts to map from source code repository userids to email addresses for notifications.
\begin{figure}
\centering
\includegraphics[width=4in]{DartUserPage}
\caption{User page}
\label{fig:DartUserPage}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=4in]{DartPageWithUserLoggedIn}
\caption{You can return to your Dart User page by clicking on your name at the top a Dart page.}
\label{fig:DartPageWithUserLoggedIn}
\end{figure}
When you log into the Dart web application, you are taken to a page with your User properties (Figure \ref{fig:DartUserPage}). If you have already browsed off this page, you can return to this page at anytime by clicking on your name shown at the top of each Dart page (Figure \ref{fig:DartPageWithUserLoggedIn}. The User property page has a table called \texttt{Repository Userids}. The text entry controls at the bottom of this table allow the user to specify their source code repository userids for each Project hosted on the Dart server. Figure \ref{fig:DartUserEnteringRepositoryId} shows how to associate the source code repository userid of \texttt{someone} to this User on the Project \texttt{TestProject}. Figure \ref{fig:DartUserWithRepositoryId} shows the results of this association. Multiple source code repository userids can be associated with a Dart User for one Project or for multiple Projects.
\begin{figure}
\centering
\includegraphics[width=4in]{DartUserEnteringRepositoryId}
\caption{Enter source code repository userid associations for each Dart Project.}
\label{fig:DartUserEnteringRepositoryId}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=4in]{DartUserWithRepositoryId}
\caption{Dart User with a source code repository userid association.}
\label{fig:DartUserWithRepositoryId}
\end{figure}
\section{Dart Navigation}
\section{Dashboard customization}
It is possible for the user to customize the information display on the Dashboard. Currently, url parameters can be used to control what tracks are displayed. Adding url parameters like \texttt{showtrack=Nightly} will restrict the Dashboard display to just the Nightly track. Using url parameters \texttt{showtrack=Nightly\&showtrack=Coverage} will display just the Nightly track and the Coverage track.
Future versions of Dart will allow these customizations to be stored as User specific queries.
\section{RSS Feeds}
\begin{floatingfigure}[l]{16pt}
\includegraphics[width=16pt]{feed-icon32x32.png}
\end{floatingfigure}
The Dashboard for any given Project can be monitored for new submissions by watching the provided RSS feed. In the title block on the Dashboard page, the RSS icon displayed is a hyper-link to the Project's RSS page. You can copy the link associated with this image and paste the link into your RSS reader.
If use the FireFox browser, the RSS icon will appear in the address bar, indicating a RSS feed is available. You can add the RSS feed to your \emph{Live Bookmarks} by clicking on the icon.
\chapter{Dart Server and Project Administration Guide}
\section{Database Administration}
Though not generally recommended, there may arise the need to examine and modify the Dart database directly. This section provides a short guide to using Derby, for other database systems, please consult your DB administration guide. To connect to the Dart Derby database, be sure Dart is not currently running and start up the Derby interactive interface:
\begin{verbatim}
{practical:Dart}1021:java -classpath DartServer.jar org.apache.derby.tools.ij
ij version 10.2
ij> driver 'org.apache.derby.jdbc.EmbeddedDriver';
ij> connect 'jdbc:derby:/local/Dart/TestProject/Database/TestProject';
ij> -- Note: the connect string is from the Project.xml file, but does not include 'create=true' option
ij> -- Can execute any SQL queries or commands required
\end{verbatim}
\section{Client Configuration}
\label{Section:ClientConfiguration}
\begin{figure}
\centering
\includegraphics[width=4in]{ClientEnteringExpected}
\caption{Designating a client as an expected submission requires a client property of \texttt{Expected.<TrackName>} with a value of \texttt{true}.}
\label{fig:ClientEnteringExpected}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=4in]{ClientEnteringNotifyUserId}
\caption{To assign an owner to a client, assign a client property called \texttt{Expected.<TrackName>.Notify.UserId} a value of a Dart Username (email address).}
\label{fig:ClientEnteringNotifyUserId}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=4in]{ClientWithNotifyUserId}
\caption{Client configured with a Dart User to notify if a submission on the Nightly track is not available.}
\label{fig:ClientWithNotifyUserId}
\end{figure}
\chapter{Server Setup}
\label{Section:ServerSetup}
\section{Command Line}
The Server has several command line options.
\begin{verbatim}
# java -jar DartServer.jar
usage: DartServer [options] Server.xml <Project0.xml> <Project1.xml> ...
<ProjectN.xml>
-R,--refreshServer Refresh server resources
-a,--archive Archive the project
-c,--create Create a new project in the directory specified
-d,--database At project creation time, configure the
Schema.sql file for generic, Postgres, Derby
or MySQL
-h,--help Print help message
-i,--initialize Initialize the database from the Schema.sql file
in the project directory
-j,--initializeserver Initialize the database from the
ServerSchema.sql file in the dart server directory
-k,--createserver Create a new server in the directory specified
-l,--logconfiguration File to configure log4j from, defaults are used
if not present
-r,--refresh Refresh project resources
-t,--projecttemplate Create a new Project using the specified default
template: dart/Resources/Server/DartDefault.xml in the jar file is the
default
-u,--upgradeprojectdb Update all Project's databases to the lastest
version
\end{verbatim}
The \texttt{--archive} flag dumps all the Submissions in each project
in Dart XML format into the \texttt{Project/Archive} directory. This
is the best way to archive a Project all at once.
The \texttt{--projecttemplate} flag is used in conjunction with the
\texttt{--create} argument at project creation time. If not
specified, the file \filename{dart/Resources/Server/DartDefault.xml} is
used as the Project template. To extract this file, use the command:
\begin{verbatim}
jar fxv DartServer.jar dart/Resources/Server/DartDefault.xml
\end{verbatim}
The \filename{DartDefault.xml} file may be edited to suit the site
specific needs. Take care to preserve the FreeMarker tags in the
original file, as they are specific to some parts of the Project creation process.
\section{Server Directory Layout}
When is Server is created, several directories and files are created.
These are shown below:
\begin{verbatim}
practical:Dart}1016:ls DartServer/
Database/ HTML/ realm.properties Templates/
DefaultServer.xml LocalTemplates/ ServerSchema.sql Temporary/
DefaultTemplates/ Plugins/ Server.xml
\end{verbatim}
The sub-directories are
\begin{description}
\item[Server.xml] This file contains the settings for the server.
The details of this file are found in Section~\ref{Section:Settings}.
\item[ServerSchema.sql] This file contains the database specific
SQL code used to create the Server database. This file is copied from
the \filename{DartServer.jar} file when the Server is created.
\item[realm.properties] This file is used for authentication from
the Jetty embedded web server. The Server Administrator should not
modify this file.
\item[Database] This directory contains the Derby database used by
the Server to manage Users and Server-wide settings. The Dart
administrator should have no reason to modify anything in this
directory.
\item[Templates,LocalTemplates,DefaultTemplates] These three
directories contain the templates used by the Server. Generally the
Dart Administrator will only modify the files in LocalTemplates and
move them to the Templates directory.
Section~\ref{Section:TemplateDirectories} gives more detail on these
directories.
\item[HTML] This directory contains Server resources such as the
standard Project.xml used to configure a project and the dart style
sheets (\filename{Style.css}). More detail is found in
Section~\ref{Section:TemplateDirectories}.
\item[Plugins] This directory contains Server specific plugins as
detailed in Section~\ref{Section:Plugins}.
\item[Temporary] This directory is used to store temporary files for
the Server.
\end{description}
\section{Server Configuration}
\label{Section:Settings}
In the \texttt{TestServer} directory, there is a file named
\filename{Server.xml}. This contains the default settings for a dart
server. The sections of the Server configuration are as follows.
\subsection{Server Info}
\begin{verbatim}
<?xml version="1.0" encoding="utf-8"?>
<Server>
<Title>TestServer</Title>
<BaseDirectory>f:\Source\Dart\TestServer</BaseDirectory>
\end{verbatim}
This is the XML preamble followed by the Server information: Title and
BaseDirectory.
\subsection{Server Name}
\begin{verbatim}
<ServerName></ServerName>
\end{verbatim}
Dart defaults to using the canonical hostname and the \texttt{HTTPPort} specified in the next section for constructing self referring urls. These urls are included in email messages to notify users of various events. The canonical hostname is not always appropriate for inclusion in these notifications. For instance,
if the Dart server is behind a firewall or accessed via a proxy server, a server name other than the canonical hostname may need to used. The \xmltag{ServerName} tag can be used specify an alternative to the canonical hostname. ServerName should be in the
format of a servername and port \texttt{www.somewhere.com:8081}.
\subsection{Ports}
\begin{verbatim}
<HTTPPort>8081</HTTPPort>
\end{verbatim}
The HTTPPort is used for both serving content and accepting XML-RPC connections.
\subsection{Scheduler}
\begin{verbatim}
<Scheduler>
<ThreadPoolSize>10</ThreadPoolSize>
</Scheduler>
\end{verbatim}
The Scheduler has a default ThreadPoolSize of 10, indicating that 10
jobs may be executed concurrent by all the Projects managed by this
Server instance.
\subsection{Database}
\begin{verbatim}
<!-- Configure the database parameters derby-->
<Database>
<!-- Derby database -->
<Driver>org.apache.derby.jdbc.EmbeddedDriver</Driver>
<URL>jdbc:derby:f:\Source\Dart\TestServer/Database/TestServer;create=true</URL>
<ShutdownURL>jdbc:derby:f:\Source\Dart\TestServer/Database/TestServer;shutdown=true
</ShutdownURL>
<Username/>
<Password/>
<!-- Maximum active / idle connections, -1 is infinite -->
<MaxActive>10</MaxActive>
<MaxIdle>3</MaxIdle>
<!-- Time (in milliseconds) between pool eviction runs, -1 is never run -->
<TimeBetweenEvictionRunsMillis>-1</TimeBetweenEvictionRunsMillis>
<!-- Age (in milliseconds) of a Connection in the pool before being considered for eviction -1 is never -->
<MinEvictableIdleTimeMillis>-1</MinEvictableIdleTimeMillis>
</Database>
\end{verbatim}
This section specifies the connection to the Server's database. In
this example, the database is Derby. The Driver tag specifies the
class implementing the JDBC connection. URL is the connection string,
ShutdownURL is used to shutdown the Derby database cleanly, it may be
safely left blank for other JDBC packages. The Username and Password
tags specify the connection parameters. Dart uses a connection
pooling mechanism for the database with two parameters: MaxActive
specifies the maximum number of active connections, and MaxIdle
specifies the maximum number of idle threads. If a connection is
needed when MaxActive threads are already active, the connection
request will block until a connection is return to the pool.
TimeBetweenEvictionRunsMillis and MinEvictableIdleTimeMillis control
the reaping of invalid Connections in the pool. Apache DBCP maintains
a thread that will move Connections out of the pool if they fail a
validation test. TimeBetweenEvictionRunsMillis controls how often the
thread validates all Connections in the pools, any value less than 0
will prohibit the thread from reaping the pools.
MinEvictableIdleTimeMillis is the age in milliseconds of a Connection
before it is considered for reaping. This setting gives Dart a chance
to use the Connection without immediately reaping it. The default
values are -1 for both, effectively prohibiting reaping. This setting
may be used if the Connections become ``stale'' and cause the pool to
fill up.
\subsubsection{MySQL and PostgreSQL}
Though Derby is the perfered database for small dashboards, larger
dashboard installations may wish to use a stand alone database for
Dart's data store. Both MySQL(\url{http://www.mysql.com}) and
PostgreSQL(\url{http://www.postgresql.org}) database Schema scripts may be
configured automatically from the DartServer command line. For these
databases, the Dart administrator must create the database in the
server instance before having Dart initialize the tables. By default,
the DartServer jar file ships with JDBC drivers for MySQL and
PostgreSQL.
\subsection{Servlet Manager}
\begin{verbatim}
<!-- Servlet configuration -->
<ServletManager>
<Servlet>
<Class>dart.server.servlet.Server</Class>
<Context>/Dart/*</Context>
<Properties/>
</Servlet>
</ServletManager>
\end{verbatim}
The Servlet manager is responsible for configuring Jetty. Different
Servlets can respond to different URLs. In this case, the
dart.server.servlet.Server class is configured to respond to requests
starting with /Dart/*.
\section{Project Configuration}
\subsection{Project Directory Layout}
After following the directions in Section~\ref{Section:QuickStart},
the \texttt{TestProject} directory will contain several files and
directories.
\begin{verbatim}
{practical:Dart}1014:dir TestProject/
Archive/ DefaultProject.xml LocalTemplates/ Result/ Templates/
Data/ DefaultTemplates/ Plugins/ Schema.sql Temporary/
Database/ HTML/ Project.xml Statistics.txt
\end{verbatim}
\begin{description}
\item[Project.xml] The Project's configuration information. The
format and available options are described in
Section~\ref{Section:ProjectConfiguration}.
\item[DefaultProject.xml] This file is generated each time the
Project's resources are refreshed. It contains the stock Dart
configuration and is useful for merging new Dart features into
existing Project.xml files.
\item[Schema.sql] This file contains the SQL statements used to
create the database. This is mainly for reference as this file is not
used after the initial creation of the database.
\item[Statistics.txt] This file is created by the
\texttt{SaveStatistics} task (see
Section~\ref{Section:TaskConfiguration} for details).
\item[Archive] This is the default directory for the ArchiveTask.
It contains sub-directories where Archived Submissions are written.
Section~\ref{Section:TaskConfiguration} details the structure and use
of this directory.
\item[Data] A Dart Project stores large Test Results in the Data
directory. Each file is stored based on it's MD5 hash value, and
duplicate files are stored only once. The Dart Administrator should
have no reason to change the contents of this directory. The
ArchiveTask may be configured to remove these files during the
archiving process.
\item[Database] Database is the default directory for the Derby
embedded database. This directory should not be disturbed.
\item[DefaultTemplates,LocalTemplates,Templates] These directories
contain the Freemarker templates used to generate the Dart Project
pages. See Section~\ref{Section:TemplateDirectories} for details of
how these directories are used.
\item[HTML] This directory contains Project resources. More detail is found in
Section~\ref{Section:TemplateDirectories}.
\item[Plugins] Project specific Java Plugins are stored in this
directory. Section~\ref{Section:Plugins} gives details of Plugin
creation and configuration.
\item[Temporary] The Temporary directory is a temporary cache for
Submission to the Dart Server. The Submit Command
(Section~\ref{Section:CommandManager}) may optionally delete processed
Submissions from this directory. By default, submissions containing
errors are not deleted and remain in the Temporary directory.
\end{description}
\subsection{Project.xml Configuration}
\label{Section:ProjectConfiguration}
Project.xml is a preconfigured Project configuration
file containing the settings necessary to run a basic Dart
Project. The settings can be modified to control tasks, notifications, and archiving.
The contents of Project.xml are discussed section by section in the following sections.
Accompanying Project.xml is a file called DefaultProject.xml. DefaultProject.xml always shows the stock project configuration. DefaultProject.xml can serve as a reference to the original settings as Project.xml is modified. DefaultProject.xml is regenerated whenever the Dart server is started. When the Dart server is started with a new version of Dart, the DefaultProject.xml file will be representative of the stock project configuration for the new version of Dart. Therefore, DefaultProject.xml can serve as a means to migrate new Dart capabilities into an existing project.
\subsubsection{Project Info}
\begin{verbatim}
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Title>TestProject</Title>
<BaseDirectory>/projects/Dart/TestProject</BaseDirectory>
\end{verbatim}
The first line is the \texttt{xml} preamble, and is required for all
\texttt{xml} files. The \xmltag{Project} tag indicates the start of
the Project configuration. \xmltag{Title} is the project title, and
\xmltag{BaseDirectory} is the absolute path name to the Project
directory. If the Project is moved to a new location on the file
system, \xmltag{BaseDirectory} must be changed to reflect the new
location.
\subsubsection{Administrator Username and Password}
\begin{verbatim}
<!-- Administrator Username/Password. If blank, no administrator access -->
<AdministratorUsername></AdministratorUsername>
<AdministratorPassword></AdministratorPassword>
\end{verbatim}
These tags specify the Project Administrator username and password.
If blank, the Project denys all access to Administrator functions.
\subsubsection{Project Properties}
Certain aspects of a Dart project can be customized by properties
assigned to the project.
\begin{verbatim}
<Properties>
<Property name="MaxTestsPerSubmission">1500</Property>
<Property name="RepositoryURL">http://www.itk.org/cgi-bin/viewcvs.cgi/</Property>
<Property name="RepositoryURL.Type">viewcvs</Property>
<Property name="RepositoryURL.Repository">Insight</Property>
<Property name="Menu">
<![CDATA[
<ul>
<li><a href="#">Repository ></a>
<ul>
<li><a href="http://www.itk.org/cgi-bin/viewcvs.cgi?cvsroot=Insight">
Insight</a>
</li>
<li>
<a href="http://www.itk.org/cgi-bin/viewcvs.cgi?cvsroot=InsightApplications">
Insight Applications
</a>
</li>
</ul>
<li>
<li><a href="http://www.itk.org/Bug">Bugs</a></li>
<li><a href="#">Documentation ></a>
<ul>
<li><a href="http://www.itk.org/Insight/Doxygen/html/">Doxygen (API)</a></li>
<li><a href="http://www.itk.org/">www.itk.org</a></li>
<li><a href="http://www.itk.org/Wiki/ITK">ITK Wiki</a></li>
<li><a href="http://www.insightsoftwareconsortium.org/">
Insight Software Consortium</a>
</li>
</ul>
</li>
<li><a href="http://www.itk.org/">Home</a></li>
</ul>
]]>
</Property>
</Properties>
\end{verbatim}
\begin{description}
\item[MaxTestsPerSubmission]{Defines a throttle for the number of tests that can be included in a submission.}
\item[RepositoryURL]{URL for accessing a project's software repository via the web.}
\item[RepositoryURL.Type]{Identifies the type of the web portal for the repository (viewcvs, cvsweb, websvn, viewcvswithsvn,cvstrac,svntrac).}
\item[RepositoryURL.Repository]{Identifies the repository to reference at the specified \texttt{RepositoryURL}}.
\item[Menu]{Definition of a menu to display on web pages. This menu can include links to navigate within Dart or to navigate to external sites such as documentation, bug trackers, \etc. \texttt{Menu} is defined as an HTML list (encapsulated in a \texttt{CData} section), with sub-menus being sublists. Each menu item is modelled with an \texttt{HREF} within an \texttt{LI}. If a menu item is the title of a sub-menu, then the \texttt{HREF} should link to ''\#'' and the item label should indicate a drop down menu is available (for instance, suffixing the name with a \texttt{>} sign. }
\end{description}
\subsubsection{Database Configuration}
\begin{verbatim}
<!-- Derby database -->
<Database>
<Driver>org.apache.derby.jdbc.EmbeddedDriver</Driver>
<URL>jdbc:derby:/projects/Dart/TestProject/Database/TestProject;create=true</URL>
<ShutdownURL>jdbc:derby:/projects/Dart/TestProject/Database/TestProject
;shutdown=true</ShutdownURL>
<Username/>
<Password/>
</Database>
\end{verbatim}
This section configures the Database connection that the Project will
use. The \xmltag{Driver} tag indicates the JDBC Java class for the
particular type of relational database management system (RDBMS). In
the example, \texttt{org.apache.derby.jdbc.EmbeddedDriver} is the
driver for the Derby Open Source embedded RDBMS system. Note: the
\xmltag{ShutdownURL} was broken across two lines for display
purposes, and should not be broken in an actual configuration file.
The \xmltag{URL} tag specifies the connection URL for the RDBMS.
This is a RDBMS specific string. In the above example, the
\texttt{create=true} property indicates that the driver should create
the database if it does not exist. Please consult your RDBMS
documentation for the proper setting for the \xmltag{URL} tag.
Because Derby is an embedded RDBMS, it must be properly shutdown to
leave the database in a consistent state. This is specified in the
\xmltag{ShutdownURL} tag. If the RDBMS does not require special
shutdown processing, leave this tag empty and it will be ignored.
\xmltag{Username/} and \xmltag{Password} tags specify the
authentication settings for the RDBMS. In the case of Derby, no
Username/Password is required.
\paragraph{CommandManager Configuration}
\label{Section:CommandManager}
\begin{verbatim}
<CommandManager>
<Command>
<Name>Submit</Name>
<Class>dart.server.command.Submit</Class>
<Properties>
<Property name="DeleteWhenDigested">true</Property>
</Properties>
</Command>
<Command>
<Name>ProjectAdministration</Name>
<Class>dart.server.command.ProjectAdministration</Class>
<Properties/>
</Command>
</CommandManager>
\end{verbatim}
The Dart Server provides an XML-RPC server for results to be
submitted to a Project. This server operates through a Servlet
configured in the ServletManager (see
Section~\ref{Sec:ServletManager} below). For the CommandManager to
operate, a dart.server.servlet.CommandServlet object must be added to
the ServletManager. In addition, the \texttt{CommandServer} can
be configured to respond to any query using specialized
\texttt{Command}s. The \xmltag{CommandServer} section specifies
the settings for the Project specific settings.
In the instance above, the \xmltag{Command} tag specifies an object
that the Project will use to respond to XML-RPC calls. Commands must
implement the dart.server.command.Command interface. \xmltag{Name}
is the object name, \xmltag{Class} is the name of the class that the
CommandManager instantiates and any Properties for the object are
specified using the \xmltag{Properties} tags. Any public methods of
the object are exposed to XML-RPC calls.
The ProjectAdministration Command allows a remote Administrator to
perform a variety of tasks.
\subsubsection{ServletManager Configuration}
\label{Sec:ServletManager}
\begin{verbatim}
<!-- Servlet configuration -->
<ServletManager>
<Servlet>
<Class>dart.server.servlet.Dashboard</Class>
<Context>/Dashboard/*</Context>
<Properties>
</Properties>
</Servlet>
<Servlet>
<Class>dart.server.servlet.Admin</Class>
<Context>/Admin/*</Context>
<Properties/>
</Servlet>
<Servlet>
<Class>dart.server.servlet.User</Class>
<Context>/User/*</Context>
<Properties/>
</Servlet>
<Servlet>
<Class>dart.server.servlet.ZipServlet</Class>
<Context>/Zip/*</Context>
<Properties>
<!-- Properties for the ZipServlet are encodings for the files
in the zip archive. The name of the property is used to match the
suffix of the file (lowercased...).
.html == text/html, .png == image/png
-->
<Property name=".html">text/html</Property>
<Property name=".htm">text/html</Property>
<Property name=".xml">text/xml</Property>
<Property name=".xsl">text/xml</Property>
<Property name=".png">image/png</Property>
<Property name=".jpg">image/jpg</Property>
<Property name=".jpeg">image/jpg</Property>
<Property name=".css">text/css</Property>
<Property name=".js">application/x-javascript</Property>
<Property name=".txt">text/plain</Property>
</Properties>
</Servlet>
<Servlet>
<Class>dart.server.servlet.CommandServlet</Class>
<Context>/Command/</Context>
<Properties/>
</Servlet>
<Servlet>
<Class>dart.server.servlet.SubmitServlet</Class>
<Context>/Submit/</Context>
<Properties/>
</Servlet>
<Servlet>
<Class>dart.server.servlet.ChartServlet</Class>
<Context>/Chart</Context>
<Properties/>
</Servlet>
</ServletManager>
\end{verbatim}
To generate Dashboard pages, the Server uses the Jetty Servlet
engine in conjunction with the FreeMarker template engine. Stock
Project Servlets are automatically configured at project creation
time. User defined Servlets may be added if desired. The
\xmltag{Class} tag indicates the class of the Servlet,
\xmltag{Context} tag indicates how the Servlet is found by Jetty.
By default, the Project title is stored in the Servlet's initial
parameters as \texttt{"project"} and may be accessed as
\texttt{getInitParameter ( "project" ) } within the Servlet.
Parameters in the \xmltag{Properties} section are also put in the
initial parameters map.
The second servlet in the stock configuration web access to administer
a project. Users in the roles of \texttt{Dart.Administrator}
and \emph{ProjectName}.\texttt{Administrator} will have access to the
administration tools from their \emph{User} page.
The third servlet in the stock configuration provides \emph{User}
logins and \emph{User} configuration.
The forth servlet in the stock configuration provides capabilities to serve
content from within zip archives. Some third party software analysis tools
output web-based reports. These web-based reports can be place in a zip
archive and placed on the Dart server. The Dart server can serve pages
from the web-based report as if the pages were unarchived on the Dart server.
The fifth Servlet in the stock configuration is
dart.server.servlet.CommandServlet. CommandServlet accepts XML-RPC
calls and delegates them to the appropriate handler object as
configured in the CommandManager. The last Servlet is the
ChartServlet used to generate charts for the dashboard.
To call an XML-RPC method, the URL needed is determined by the root
project URL, \ie
\texttt{http://localhost:8081/\emph{ProjectName}/Command/\emph{Command}.\emph{Method}}.
For example, the URL to submit some results to the Dart project
TestProject running on the local system is:
\url{http://localhost:8081/TestProject/Command/} and the method is \texttt{Submit.put}.
SubmitServlet allows Submissions to be transfered through \texttt{HTTP
PUT} methods, essentially a simplified XMLRPC. A Client needs only to
PUT a file to the URL:
\texttt{http://localhost:8081/\emph{ProjectName}/\emph{SUBMIT}}. The
expected response is ``true''. Submission through this mechanism
follows the same path as the previous Servlet.
The last servlet in the stock configuration provides Dart with charting and plotting
capabilities. The \emph{ChartServlet} uses JFreeChart to generate plots of test timings and status.
\paragraph{Adding a new servlet to Dart}
\label{Sec:UserServlet}
If you are building Dart from source, you can add additional servlets
to the DartServer.jar by adding the servlet's source code to
\filename{Dart/Source/dart/server/servlet} directory and rebuilding. The
servlet can be activated for a project as in the above example.
If you are running from a pre-built DartServer.jar, you can still add
additional servlets to Dart. This is done by adding the \texttt{classpath}
property to the servlet definition in the Project.xml file.
\begin{verbatim}
<Servlet>
<Class>user.servlet.MyDashboard</Class>
<Context>/MyDashboard/*</Context>
<Properties>
<Property name="Foo">10</Property>
<Property name="classpath">foo.jar</Property>
</Properties>
</Servlet>
\end{verbatim}
This example adds the class \texttt{user.servlet.MyDashboard} from the \filename{foo.jar}
archive to the project and assigns it the url space of \texttt{/MyDashboard/*}.
\subsubsection{MessengerManager Configuration}
\label{Section:MessengerManager}
\begin{verbatim}
<MessengerManager>
<Messenger>
<Name>SMTP</Name>
<Type>dart.server.messenger.SMTPMessenger</Type>
<!-- The properties specified on the SMTPMessenger are passed directly
to JavaMail to configure the mail host, port, protocols,
authentication, encryption, etc. -->
<Properties>
<Property name="mail.host">localhost</Property>
<Property name="mail.port">25</Property>
<Property name="mail.from">dart@localhost</Property>
<Property name="mail.transport.protocol">smtp</Property>
</Properties>