Author: wade
Date: 2005-05-03 18:30:35 -0400 (Tue, 03 May 2005)
New Revision: 43989

Added:
   trunk/release/monobuild/
   trunk/release/monobuild/HOWTO
   trunk/release/monobuild/Mono/
   trunk/release/monobuild/Mono/Build.pm
   trunk/release/monobuild/Mono/Build/
   trunk/release/monobuild/Mono/Build/Config.pm
   trunk/release/monobuild/design.txt
   trunk/release/monobuild/www/
   trunk/release/monobuild/www/build.css
   trunk/release/monobuild/www/cgi-perl/
   trunk/release/monobuild/www/cgi-perl/buildstatus.pl
   trunk/release/monobuild/www/cgi-perl/schedulebuild.pl
   trunk/release/monobuild/www/index.html
   trunk/release/monobuild/www/package_status_example.html
Log:
Initial commit for the build status/scheduler and it's structure


Added: trunk/release/monobuild/HOWTO
===================================================================
--- trunk/release/monobuild/HOWTO       2005-05-03 22:28:11 UTC (rev 43988)
+++ trunk/release/monobuild/HOWTO       2005-05-03 22:30:35 UTC (rev 43989)
@@ -0,0 +1,60 @@
+
+Configuration: Path to release Work Area
+----------------------------------------
+Modify the Build/Config.pm and point $releaseRepo to the working copy of the 
following Subversion repository: mono-cvs.ximian.com/source/trunk/release
+
+
+Configuring Apache for MonoBuild
+--------------------------------
+
+Add the following to /etc/apache2/mod_perl-startup.pl:
+
+use lib qw(/home/wberrier/wa/mono/msvn/release/monobuild);
+
+The above will point to your working copy.
+
+Make sure that your mod_perl configuration includes the startup file.
+
+Also, include the following Perl Directives:
+PerlInitHandler Apache::Reload
+
+
+Here's a working example of /etc/apache2/conf.d/mod_perl.conf:
+----------------------------------------------------------------
+<Directory "/srv/www/perl-lib">
+    AllowOverride None
+    Options None
+    Order allow,deny
+    Deny from all
+</Directory>
+
+<IfModule mod_perl.c>
+    PerlRequire "/etc/apache2/mod_perl-startup.pl"
+
+    ScriptAlias /perl/ "/srv/www/cgi-bin/"
+    <Location /perl/>
+        # mod_perl mode
+        SetHandler perl-script
+        PerlResponseHandler ModPerl::Registry
+        PerlOptions +ParseHeaders
+        Options +ExecCGI
+    </Location>
+
+    # Important stuff
+    ##############################################################
+    PerlInitHandler Apache::Reload
+    #ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
+    ScriptAlias /cgi-perl/ 
"/home/wberrier/wa/mono/msvn/release/monobuild/www/cgi-perl/"
+    <Location /cgi-perl>
+        # perl cgi mode
+        SetHandler  perl-script
+        PerlResponseHandler ModPerl::PerlRun
+        PerlOptions +ParseHeaders
+        Options +ExecCGI
+    </Location>
+    ##############################################################
+
+    # The /cgi-bin/ ScriptAlias is already set up in httpd.conf
+
+</IfModule>
+

Added: trunk/release/monobuild/Mono/Build/Config.pm
===================================================================
--- trunk/release/monobuild/Mono/Build/Config.pm        2005-05-03 22:28:11 UTC 
(rev 43988)
+++ trunk/release/monobuild/Mono/Build/Config.pm        2005-05-03 22:30:35 UTC 
(rev 43989)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+package Mono::Build::Config;
+
+our $releaseRepo = "/home/wberrier/wa/mono/msvn/release";
+
+our $distroDir = "$releaseRepo/packaging/conf";
+our $componentDir = "$releaseRepo/packaging/defs";
+
+
+1;


Property changes on: trunk/release/monobuild/Mono/Build/Config.pm
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/release/monobuild/Mono/Build.pm
===================================================================
--- trunk/release/monobuild/Mono/Build.pm       2005-05-03 22:28:11 UTC (rev 
43988)
+++ trunk/release/monobuild/Mono/Build.pm       2005-05-03 22:30:35 UTC (rev 
43989)
@@ -0,0 +1,109 @@
+#!/usr/bin/perl
+
+package Mono::Build;
+
+use Mono::Build::Config;
+
+sub getDistros
+{
+       my $dir = $Mono::Build::Config::distroDir;
+       my @distros;
+
+       opendir(DIR, $dir) or die "Can't open dir: $dir\n";
+
+
+       while($dir = readdir(DIR))
+       {
+               # For some reason... .svn fails the -d perl test...???
+               #if(!-d $dir)
+               if($dir ne "." && $dir ne ".." && $dir ne ".svn" && $dir ne 
"hosts")
+               {
+                       push @distros, $dir;
+               }
+
+       }
+
+       closedir(DIR);
+
+       return sort @distros;
+
+
+}
+
+sub getComponents
+{
+       my $dir = $Mono::Build::Config::componentDir;
+       my @components;
+
+       opendir(DIR, $dir) or die "Can't open dir: $dir\n";
+
+
+       while($dir = readdir(DIR))
+       {
+               # For some reason... .svn fails the -d perl test...???
+               if(!-d $dir && $dir ne ".svn")
+               {
+                       push @components, $dir;
+               }
+
+       }
+
+       closedir(DIR);
+
+       return sort @components;
+
+
+}
+
+
+sub getState
+{
+       my $index = shift;
+       # This info will eventually come out of a file or something...
+       my @states = (
+                       'notused',
+                       'success', 
+                       'success', 
+                       'success', 
+                       'success', 
+                       'failure', 
+                       'building', 
+                       'building', 
+                    );
+
+       return $states[$index % @states];
+
+}
+
+
+# Read in distro->component map
+sub getValidDistroComponents
+{
+
+
+}
+
+sub arrayContains
+{
+       my $needle = shift;
+       my @haystack = @_;
+
+       foreach my $item (@haystack)
+       {
+               if ($item eq $needle)
+               {
+                       return 1;
+
+               }
+
+
+       }
+       return 0;
+
+
+}
+
+
+1;
+
+


Property changes on: trunk/release/monobuild/Mono/Build.pm
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/release/monobuild/design.txt
===================================================================
--- trunk/release/monobuild/design.txt  2005-05-03 22:28:11 UTC (rev 43988)
+++ trunk/release/monobuild/design.txt  2005-05-03 22:30:35 UTC (rev 43989)
@@ -0,0 +1,50 @@
+28 Apr 2005
+Wade / Ben
+
+------
+Design
+------
+
+Each of the build hosts contact the web server for specific jobs
+The web server is responsible for assigning jobs to each client
+the build client will pop the job (text file) out of it's directory (hostname) 
+When the build client is done, it sends the success/fail message back to the 
web server (puts it in a directory), and also puts the log file in a directory
+
+
+Need to automatically generate some pages (or combine the following 
information into a page):
+
+Status page: Shows success/fail and links to log files (which get posted after 
the build)
+Control Center Page: build components on specific platforms
+
+Need to have archives of the builds (rpms) as well as the logs... very 
important
+
+How to know that the builds are in progress? (Without using a database... flat 
state file I guess)
+
+
+Questions:
+-Will we only want to be able to build HEAD from the webpage, or be able to 
pick a revision?
+-Do we need web accessible archives (builds and logs)...? How will these 
archives get cleaned up?
+
+
+One the log and download page that Ben sent me, we can have all the logs and 
builds available from there
+
+
+-------
+Phase 2
+-------
+-Later...  a cron job will set up mandatory job requests, so that the builds 
get run every night
+-to utilize the hardware better, we need to find the best build box to assign 
the job to
+-We need to track and calculate dependencies so we know which components to 
build when we need a new build
+       (this gets somewhat complicated... always rebuild dep, what if parent 
project doesn't change??, etc...)
+
+
+-------
+Phase 3
+-------
+-Test suites, not only build, but do unit tests on the builds
+-Ben mentioned something that we need to get our test cases running against an 
installed Mono instead of a compiled source tree
+
+
+----
+try setting this up on monobuild2 for now
+

Added: trunk/release/monobuild/www/build.css
===================================================================
--- trunk/release/monobuild/www/build.css       2005-05-03 22:28:11 UTC (rev 
43988)
+++ trunk/release/monobuild/www/build.css       2005-05-03 22:30:35 UTC (rev 
43989)
@@ -0,0 +1,111 @@
+h1 {
+       color: #efefef;
+       font-size: 14pt;
+       font-family: "Trebuchet MS";
+       border: 0;
+       margin: 0;
+       padding: 1em;
+       background: #666666;
+}
+
+h2, h3, h4, h5, h6 {
+       font-family: Verdana,sans-serif;
+       font-weight: bold;
+       margin: 9pt;
+}
+
+h2 {
+       font-size: 18px;
+}
+
+h3 {
+       font-size: 13px;
+       border-bottom: 2px solid #dddddd;
+}
+
+h3 a {
+       color: black;
+       text-decoration: none;
+}
+
+body, table {
+       background-color: #ffffff;
+       font-family: Verdana, sans-serif; font-size: 12px;
+       color: black;
+       margin: 0;
+       padding: 0;
+       border: 0;
+}
+
+p {
+       margin-left: 2em;
+       margin-right: 2em;
+}
+
+.code, .xml , .script
+{
+       margin:15px;
+       padding:15px;
+       font-size: small;
+       font-family: "Courier New", Courier;
+       background:whitesmoke;
+       border: solid 1px silver;
+       line-height:110%;
+}
+
+
+.code-xml, .code-csharp, .code-mdb, .code-gaim
+{
+       margin:15px;
+       padding:15px;
+       font-size: small;
+       font-family: "Courier New", Courier;
+       background:whitesmoke;
+       border: solid 1px silver;
+       line-height:110%;
+}
+
+table.buildstatus {
+       border-collapse: collapse;
+}
+table.buildstatus td {
+       padding:.5em;
+}
+
+table.buildstatus tbody td{
+       border: solid 1px whitesmoke;
+       text-align: center;
+}
+
+table.buildstatus th {
+       font-weight:normal;
+       text-align:right;
+       padding: .5em;
+}
+
+td.success {
+       background:PaleGreen;
+}
+
+
+td.failure {
+       background:red;
+}
+
+td.building {
+       background:yellow
+}
+
+td.notused {
+       background:white;
+}
+
+table.legend th {
+       font-weight:normal;
+       text-align:right;
+       padding: .5em;
+}
+
+table.legend td {
+       width: 10em;
+}

Added: trunk/release/monobuild/www/cgi-perl/buildstatus.pl
===================================================================
--- trunk/release/monobuild/www/cgi-perl/buildstatus.pl 2005-05-03 22:28:11 UTC 
(rev 43988)
+++ trunk/release/monobuild/www/cgi-perl/buildstatus.pl 2005-05-03 22:30:35 UTC 
(rev 43989)
@@ -0,0 +1,200 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::RealBin/../..";
+
+use Mono::Build;
+
+# Read these in from a file later...
+my @linux_distros = Mono::Build::getDistros();
+
+               #'nld-9-x86_64',
+#              'rhel-3-i386',
+#              'sles-9-i586',
+#              'suse-92-i586',
+#              'suse-93-x86_64',
+#              'fedora-3-i386',
+#              'nld-9-i586',
+#              'redhat-9-i386',
+#              'rhel-4-i386',
+#              'sles-9-x86_64',
+#              'suse-93-i586',
+#              );
+
+my @linux_components = Mono::Build::getComponents();
+#my @linux_components = (
+#              'gtk-sharp-2.0',
+#              'mod_mono',
+#              'monodoc',
+#              'gecko-sharp-2.0',
+#              'gtksourceview-sharp-2.0',
+#              'mono-1.1',
+#              'xsp',
+#              'gtk-sharp',
+#              'libgdiplus-1.1',
+#              'monodevelop'
+#              );
+
+my @other_platforms = (
+               'sparc',
+               'windows',
+               'mac'
+               );
+
+my @other_components = ('mono-1.1');
+
+my $rev;
+
+print<<END;
+Content-type: text/html
+
+<HTML>
+<HEAD>
+<TITLE>Mono Build Status</TITLE>
+<link rel="stylesheet" href="/build.css" type="text/css">
+</HEAD>
+<BODY>
+
+<H1>Mono Build Status</H1>
+
+END
+
+print<<END;
+<h3>Linux Distros</h3>
+
+<p>
+<table class="buildstatus">
+       <thead><td></td>
+END
+
+foreach my $distro (sort @linux_distros)
+{
+       print "<td>$distro</td>\n";
+}
+
+print "</thead><tbody>";
+
+foreach my $component (sort @linux_components)
+{
+       print "<tr><td>$component</td>\n";
+
+       foreach my $distro (sort @linux_distros)
+       {
+               print "<td ";
+               my $rand = randomResult();      
+               my $state = Mono::Build::getState($rand);
+
+               print "class=$state>";
+
+               $rev = "r454";
+
+               if($state ne 'notused')
+               {
+                       #print "<a 
href=logs/$component-$distro-$rev$rand.log>$rev$rand</a>";
+                       print "<a 
href=/package_status_example.html>$rev$rand</a>";
+               }
+               
+               print "</td>\n";
+
+       }
+       print "</tr>";
+       
+
+}
+
+
+print "</tbody>
+</table>
+</p>";
+
+
+# Other Systems
+print<<END;
+<h3>Other Platforms</h3>
+
+<p>
+<table class="buildstatus">
+       <thead><td></td>
+END
+
+foreach my $distro (sort @other_platforms)
+{
+       print "<td>$distro</td>\n";
+}
+
+print "</thead><tbody>";
+
+foreach my $component (sort @other_components)
+{
+       print "<tr><td>$component</td>\n";
+
+       foreach my $distro (sort @other_platforms)
+       {
+               print "<td ";
+               my $rand;       
+               my $state;
+
+               # Make sure you don't get unused
+               do 
+               {
+                       $rand = randomResult(); 
+                       $state = Mono::Build::getState($rand);
+               } while($state eq 'notused');
+
+               print "class=$state>";
+
+               $rev = "r454";
+
+               #print "<a 
href=logs/$component-$distro-$rev$rand.log>$rev$rand</a>";
+               print "<a href=/package_status_example.html>$rev$rand</a>";
+
+               print "</td>\n";
+
+       }
+       print "</tr>";
+       
+
+}
+
+
+print "</tbody>
+</table>
+</p>";
+
+
+# Legend
+print<<END;
+
+<h3>Legend</h3>
+<p>
+<table class=legend>
+
+<tbody>
+<tr><th>In Progress</th><td class=building></td></tr>
+<tr><th>Success</td><td class=success></td></tr>
+<tr><th>Failed</td><td class=failure></td></tr>
+
+</tbody>
+</table>
+</p>
+
+END
+
+# Footer
+print<<END;
+<br>
+
+</BODY>
+</HTML>
+
+END
+
+sub randomResult
+{
+       return int(rand(10));
+}
+
+


Property changes on: trunk/release/monobuild/www/cgi-perl/buildstatus.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/release/monobuild/www/cgi-perl/schedulebuild.pl
===================================================================
--- trunk/release/monobuild/www/cgi-perl/schedulebuild.pl       2005-05-03 
22:28:11 UTC (rev 43988)
+++ trunk/release/monobuild/www/cgi-perl/schedulebuild.pl       2005-05-03 
22:30:35 UTC (rev 43989)
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+# Read these in from a file later...
+my @distros = 
('nld-9-x86_64','rhel-3-i386','sles-9-i586','suse-92-i586','suse-93-x86_64',
+               
'fedora-3-i386','nld-9-i586','redhat-9-i386','rhel-4-i386','sles-9-x86_64','suse-93-i586',
 'sparc','windows','mac');
+
+my @components = ('gtk-sharp-2.0','mod_mono','monodoc',
+               'gecko-sharp-2.0','gtksourceview-sharp-2.0','mono-1.1','xsp',
+               'gtk-sharp','libgdiplus-1.1','monodevelop');
+
+
+my $success_color = "#72ff75";
+my $failed_color= "red";
+my $inprogress_color = "yellow";
+
+my $disabled;
+my $rev;
+
+
+print<<END;
+Content-type: text/html
+
+<HEAD>
+<TITLE>Mono Build Control</TITLE>
+<link rel="stylesheet" href="/build.css" type="text/css">
+</HEAD>
+<BODY>
+
+<H2>Mono Build Control</H2>
+
+
+<FORM ACTION=startbuild.html>
+
+<table Border=2 cellpadding=3>
+       <th><td></td>
+END
+
+foreach my $distro (sort @distros)
+{
+       print "<td>$distro</td>\n";
+}
+
+print "</th>";
+
+foreach my $component (sort @components)
+{
+       print "<tr><td>$component</td>\n";
+
+       foreach my $distro (sort @distros)
+       {
+               $disabled = "";
+               print "<td ";
+               my $rand = randomResult();      
+
+               # Random status...
+               if($rand > 8)
+               {
+                       print "bgcolor=$inprogress_color";
+                       $disabled = "DISABLED"
+
+               }
+               elsif($rand > 7)
+               {
+                       print "bgcolor=$failed_color";
+
+               }
+               else
+               {
+                       print "bgcolor=$success_color";
+
+               }
+
+               $rev = "r4546";
+
+               print ">";
+               print "<INPUT type=checkbox $disabled NAME=$component-$distro 
>";
+               #print "<BR><a href=logs/$component-$distro-$rev.log>$rev</a>";
+               
+               print "</td>\n";
+
+       }
+       print "</tr>";
+       
+
+}
+
+sub randomResult
+{
+       return int(rand(10));
+}
+
+
+print<<END
+</table>
+
+<BR>
+<INPUT TYPE=Submit VALUE=Build!>
+
+</FORM>
+
+Legend
+<table border=1>
+
+<tr><td>In Progress</td><td cellpadding=10 bgcolor=yellow></td></tr>
+<tr><td>Success</td><td bgcolor=green></td></tr>
+<tr><td>Failed</td><td bgcolor=red></td></tr>
+
+</table>
+
+<br>
+
+</BODY>
+
+END
+
+
+


Property changes on: trunk/release/monobuild/www/cgi-perl/schedulebuild.pl
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/release/monobuild/www/index.html
===================================================================
--- trunk/release/monobuild/www/index.html      2005-05-03 22:28:11 UTC (rev 
43988)
+++ trunk/release/monobuild/www/index.html      2005-05-03 22:30:35 UTC (rev 
43989)
@@ -0,0 +1,2 @@
+<meta http-equiv=refresh content="0; URL=/cgi-perl/buildstatus.pl">
+

Added: trunk/release/monobuild/www/package_status_example.html
===================================================================
--- trunk/release/monobuild/www/package_status_example.html     2005-05-03 
22:28:11 UTC (rev 43988)
+++ trunk/release/monobuild/www/package_status_example.html     2005-05-03 
22:30:35 UTC (rev 43989)
@@ -0,0 +1,50 @@
+<html><head>
+
+
+<title>Mono Build Status</title><link rel="stylesheet" href="build.css" 
type="text/css"></head><body>
+
+<h1>mono-1.1 -- redhat-9-i386 -- r1234</h1>
+
+<h3>Build status</h3>
+
+<p>
+<table>
+       <tbody><tr>
+               <th>Build started:</th>
+               <td>Fri Apr 29 14:20:47</td>
+               
+               <th>Build completed:</th>
+               <td>Fri Apr 29 15:20:47</td>
+               
+       </tr>
+       
+       <tr>
+               <th>Build host</th>
+               <td>monobuild1</td>
+       </tr>
+</tbody></table>
+</p>
+
+
+<h3>Build Steps</h3>
+<p>
+       <table>
+       <tbody><tr>
+               <th>Make tarballs</th>
+               <td><a 
href="http://primates.ximian.com/%7Ebmaurer/bstatus/tarball-log";>Success</a></td>
+               <td><a 
href="http://primates.ximian.com/%7Ebmaurer/bstatus/mono-1.1.6.1234.tar.gz";>mono-1.1.6.1234.tar.gz</a></td>
+       </tr>
+       
+       <tr>
+               <th>Build</th>
+               <td><a 
href="http://primates.ximian.com/%7Ebmaurer/bstatus/build-log";>Success</a></td>
+       </tr>
+       
+       <tr>
+               <th>Make RPMS</th>
+               <td><a 
href="http://primates.ximian.com/%7Ebmaurer/bstatus/build-log";>Success</a></td>
+               <td><a 
href="http://primates.ximian.com/%7Ebmaurer/bstatus/rpmlist.html";>RPMS</a></td>
+       </tr>
+
+
+</tbody></table></p></body></html>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to