gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r209265 - in /gump/branches/Gump3: gumpdb/src/sql/gump3-database-definition.sql gumpdb/src/sql/gump3-old-sampledata.sql gumpdb/src/sql/gump3-sampledata.sql pygump/python/gump/plugins/dynagumper.py
Date Tue, 05 Jul 2005 12:06:29 GMT
Author: leosimons
Date: Tue Jul  5 05:06:27 2005
New Revision: 209265

URL: http://svn.apache.org/viewcvs?rev=209265&view=rev
Log:
Make dynagumper (the gump3 plugin that pushes data into the dynagump database) push out most of the data (a few TODOs left), update the database definition to be a little simpler and a little more consistent, document the database schema, split out the sample data dump from the definitions, and add some gump-generated sample data.

 * pygump/python/gump/plugins/dynagumper.py: write a whole bunch of store-the-model-inside-the-database. This plugin now contains most of the logic/intelligence that was so far implicit in the database schema (I hope).

 * gumpdb/src/sql/gump3-database-definition.sql,
   gumpdb/src/sql/gump3-sampledata.sql,
   gumpdb/src/sql/gump3-old-sampledata.sql: splitting off the sample data into seperate files, and adding new gump-generated sample data.

 * gumpdb/src/sql/gump3-database-definition.sql: so far gump doesn't actually have any 'runtime environment package management' so I'm removing that from the schema for now even if its a good idea. Added a bunch of documentation on what things are. Gave some variables (like all the ids) more space. Got rid of the 'descriptor' term all-round and just use 'id' everywhere. Added some useful keys. Added a 'causes' table which identifies why a project is stalled (still some work to do here, for example when the module is a cause). And other small tweaks.

Added:
    gump/branches/Gump3/gumpdb/src/sql/gump3-old-sampledata.sql
      - copied, changed from r209092, gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql
    gump/branches/Gump3/gumpdb/src/sql/gump3-sampledata.sql
Modified:
    gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql
    gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py

Modified: gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql?rev=209265&r1=209264&r2=209265&view=diff
==============================================================================
--- gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql (original)
+++ gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql Tue Jul  5 05:06:27 2005
@@ -1,228 +1,199 @@
-# CocoaMySQL dump
-# Version 0.5
-# http://cocoamysql.sourceforge.net
-#
-# Host: localhost (MySQL 4.1.7-standard)
-# Database: gump
-# Generation Time: 2004-11-30 22:22:01 -0800
-# ************************************************************
+# Copyright 2004-2005 The Apache Software Foundation
+#
+# 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.
+
+#
+# GUMP3 Database model for Dynagump
+#
+#
+# This model provides for versioned storage of the key bits of the gump
+# metadata model and the key information of its build results. Information
+# can be stored from multiple workspaces on multiple hosts across multiple
+# runs.
+#
+# Because of the versioning characteristics, some relationships may be
+# a little different from what you expect: certain aspects of the gump
+# metadata change over time, and hence where the rest of the gump codebase
+# may assume, for example, that a particular "dependency" is constant, here
+# we take into account that dependencies between projects change over time,
+# hence we model dependencies between "project_version" rows and not
+# between "projects".
+#
+# This database model has a diagram (probably somewhat outdated) living at
+#
+#  https://svn.apache.org/repos/asf/gump/trunk/src/xdocs/gump.pdf
+#
+# (page 6) that shows the relationships between the different tables.
+#
+#
+# What is a little different in this database scheme is that we are not
+# using simple integers as ids, but rather we have
+#
+#  `id` varchar(255) NOT NULL default '',
+#
+# in most of the tables. An id is (supposed to be) a sort-of URI (see the
+# relevant RFC) that is essentially globally (not per-database,
+# per-entire-universe) unique and human readable. For example,
+#
+#    gump:vmgump.apache.org:public:200507042114:xml-xerces
+#
+# can be understood to mean "the build of xml-xerces om vmgump.apache.org
+# as part of the 'public' workspace that started on 2005-07-04 21:14".
+#
+# This URI scheme is currently not fully defined, nor do we put the "gump:"
+# prefix in the database. For now, simply ensuring that all "id" fields
+# across the entire database (so not just within a table) are unique will
+# suffice.
 
-# Dump of table builds
-# ------------------------------------------------------------
+# NOTE: For now I have taken out the Packages table because that concept is not
+# yet supported anywhere else within Gump3.
 
-DROP TABLE IF EXISTS `builds`;
 
+# A "build" is the activity of "building" a project defined in the gump
+# metadata at some point in time on some machine as part of some gump run
+DROP TABLE IF EXISTS `builds`;
 CREATE TABLE `builds` (
-  `id` varchar(96) NOT NULL default '',
-  `run` varchar(64) NOT NULL default '',
-  `project_version` varchar(64) NOT NULL default '',
+  `id` varchar(255) NOT NULL default '',
+  `run_id` varchar(255) NOT NULL default '',
+  `project_version_id` varchar(255) NOT NULL default '',
   `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
   `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `result` int(1) NOT NULL default '0',
+  `result` int(2) NOT NULL default '0',
   `log` text,
   PRIMARY KEY  (`id`),
-  KEY `run` (`run`)
-) ENGINE=MyISAM;
-
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:0","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:0","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:1","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:1","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:0","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:0","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:1","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:1","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:2","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:32","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:2","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project3","2004-11-08 01:15:30","2004-11-08 01:15:37","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:2","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:33","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:2","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project3","2004-11-08 01:15:39","2004-11-08 01:15:43","0",NULL);
-
-
-# Dump of table hosts
-# ------------------------------------------------------------
+  KEY `run_id` (`run_id`),
+  KEY `project_version_id` (`project_version_id`),
+  KEY `result` (`result`)
+);
+
+
+# A "cause" is a pointer to the object (project_version, module, ...) that
+# made a "build" end up with a particular "result".
+DROP TABLE IF EXISTS `causes`;
+CREATE TABLE `causes` (
+  `build_id` varchar(255) NOT NULL default '',
+  `cause_id` varchar(255) NOT NULL default '',
+  `cause_table` varchar(32) NOT NULL default 'project_versions',
+  KEY `build_id` (`build_id`),
+  KEY `cause_id` (`cause_id`)
+);
 
+# A "host" is a physical machine on which gump runs
 DROP TABLE IF EXISTS `hosts`;
-
 CREATE TABLE `hosts` (
-  `address` varchar(32) NOT NULL default '',
+  `address` varchar(255) NOT NULL default '',
   `description` text,
   `cpu_arch` varchar(8) NOT NULL default 'x86',
   `cpu_number` int(2) unsigned NOT NULL default '1',
   `cpu_speed_Mhz` int(8) unsigned default NULL,
   `memory_Mb` int(8) unsigned default NULL,
   `disk_Gb` int(8) unsigned default NULL,
-  `name` varchar(16) NOT NULL default '',
+  `name` varchar(32) NOT NULL default '',
   PRIMARY KEY  (`address`)
-) ENGINE=MyISAM;
-
-INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test1.blah.com","debug host 1","x86","1",NULL,NULL,NULL,"Test 1");
-INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test2.blah.com","debug host 2","x86","1",NULL,NULL,NULL,"Test 2");
-
+);
 
-# Dump of table modules
-# ------------------------------------------------------------
 
+# A "module" corresponds directly to the concept of
+# the "module" in gump metadata. We do not version
+# modules (even though perhaps we could), primarily
+# because they are kind-of boring.
 DROP TABLE IF EXISTS `modules`;
-
 CREATE TABLE `modules` (
+  `id` varchar(255) NOT NULL default '',
   `name` varchar(32) NOT NULL default '',
   `description` tinytext,
-  `descriptor` varchar(128) NOT NULL default '',
-  PRIMARY KEY  (`name`)
-) ENGINE=MyISAM;
-
-INSERT INTO `modules` (`name`,`description`,`descriptor`) VALUES ("module1",NULL,"http://blah.com/module1/gump.xml");
-INSERT INTO `modules` (`name`,`description`,`descriptor`) VALUES ("module2",NULL,"http://blah.com/module2/gump.xml");
-
-
-# Dump of table packages
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `packages`;
-
-CREATE TABLE `packages` (
-  `uri` varchar(64) NOT NULL default '',
-  `version` varchar(16) NOT NULL default '1.0',
-  `location` varchar(64) NOT NULL default ':',
-  `name` varchar(16) NOT NULL default ''
-) ENGINE=MyISAM;
-
-
+  PRIMARY KEY  (`id`)
+);
 
-# Dump of table project_dependencies
-# ------------------------------------------------------------
 
+# A "project_dependency" is a link between a project_version
+# and one of it prerequisite project_versions.
 DROP TABLE IF EXISTS `project_dependencies`;
-
 CREATE TABLE `project_dependencies` (
-  `dependee` varchar(64) NOT NULL default '',
-  `dependant` varchar(64) NOT NULL default '',
+  `dependee` varchar(255) NOT NULL default '',
+  `dependant` varchar(255) NOT NULL default '',
   KEY `dependee` (`dependee`),
   KEY `dependant` (`dependant`)
-) ENGINE=MyISAM;
-
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080000:project1","test1.blah.com:main:200411080000:project2");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080000:project3","test1.blah.com:main:200411080000:project2");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080000:project3","test1.blah.com:main:200411080000:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080000:project2","test2.blah.com:main:200411080000:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080000:project3","test2.blah.com:main:200411080000:project2");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080000:project3","test2.blah.com:main:200411080000:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080100:project2","test1.blah.com:main:200411080100:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080100:project3","test1.blah.com:main:200411080100:project2");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080100:project3","test1.blah.com:main:200411080100:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080100:project2","test2.blah.com:main:200411080100:project1");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080100:project3","test2.blah.com:main:200411080100:project2");
-INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080100:project3","test2.blah.com:main:200411080100:project1");
+);
 
 
-# Dump of table project_versions
-# ------------------------------------------------------------
-
+# A "project_version" is a project at a particular point
+# in time as part of a particular gump run on a particular
+# machine. Its related to exactly one "project".
 DROP TABLE IF EXISTS `project_versions`;
-
 CREATE TABLE `project_versions` (
-  `id` varchar(64) NOT NULL default '',
-  `project` varchar(64) NOT NULL default ''
-) ENGINE=MyISAM;
-
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project3","project3");
+  `id` varchar(255) NOT NULL default '',
+  `project_id` varchar(255) NOT NULL default '',
+  PRIMARY KEY (`id`)
+);
 
 
-# Dump of table projects
-# ------------------------------------------------------------
-
+# A "project" corresponds directly to the concept of
+# the "project" in gump metadata, except that some of
+# the characteristics of a project (eg its dependencies)
+# are versioned and hence pushed into the project_versions
+# table
 DROP TABLE IF EXISTS `projects`;
-
 CREATE TABLE `projects` (
-  `name` varchar(32) NOT NULL default '',
+  `id` varchar(255) default NULL,
+  `name` varchar(255) NOT NULL default '',
   `description` tinytext,
-  `module` varchar(32) NOT NULL default '',
-  `descriptor` varchar(128) default NULL,
-  PRIMARY KEY  (`name`),
-  KEY `module` (`module`)
-) ENGINE=MyISAM;
-
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project1","The first project","module1",NULL);
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project2","The second project","module1",NULL);
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project3","The third project","module2",NULL);
-
+  `module_id` varchar(255) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `name` (`name`),
+  KEY `module_id` (`module_id`)
+);
 
-# Dump of table results
-# ------------------------------------------------------------
 
+# A "result" is basically a label to put on a certain
+# kind of build result. This table connects a name and
+# description to the "result" field of the "builds"
+# table
 DROP TABLE IF EXISTS `results`;
-
 CREATE TABLE `results` (
-  `id` int(1) NOT NULL default '0',
-  `name` varchar(16) NOT NULL default '',
+  `id` int(2) NOT NULL default '0',
+  `name` varchar(32) NOT NULL default '',
   `description` text,
   PRIMARY KEY  (`id`)
-) ENGINE=MyISAM;
-
+);
 INSERT INTO `results` (`id`,`name`,`description`) VALUES ("0","success","This is the status of a successful project build");
 INSERT INTO `results` (`id`,`name`,`description`) VALUES ("1","failure","This is the status of a failed project build");
 INSERT INTO `results` (`id`,`name`,`description`) VALUES ("2","stalled","This is the status of a project that cannot build due to unsatisfied dependencies");
 
 
-# Dump of table runs
-# ------------------------------------------------------------
-
+# A run is the execution of gump on a particular machine
+# at a particular point in time.
 DROP TABLE IF EXISTS `runs`;
-
 CREATE TABLE `runs` (
-  `id` varchar(64) NOT NULL default '',
+  `id` varchar(255) NOT NULL default '',
   `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
   `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `workspace` varchar(48) NOT NULL default '',
+  `workspace_id` varchar(255) NOT NULL default '',
   `name` varchar(12) NOT NULL default '',
   PRIMARY KEY  (`id`),
-  KEY `workspace` (`workspace`)
-) ENGINE=MyISAM;
-
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test1.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test1.blah.com:main","200411080000");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test1.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test1.blah.com:main","200411080100");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test2.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test2.blah.com:main","200411080000");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test2.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test2.blah.com:main","200411080100");
-
-
-# Dump of table runtime_dependencies
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `runtime_dependencies`;
-
-CREATE TABLE `runtime_dependencies` (
-  `run` varchar(64) NOT NULL default '',
-  `package` varchar(64) NOT NULL default ''
-) ENGINE=MyISAM;
-
+  KEY `workspace_id` (`workspace_id`)
+);
 
 
-# Dump of table workspaces
-# ------------------------------------------------------------
-
+# A workspace is a setup of gump on a particular machine.
+# It corresponds directly to the "workspace" concept in
+# gump metadata.
 DROP TABLE IF EXISTS `workspaces`;
-
 CREATE TABLE `workspaces` (
-  `id` varchar(48) NOT NULL default '0',
-  `name` varchar(16) NOT NULL default '',
-  `host` varchar(32) NOT NULL default '',
+  `id` varchar(255) NOT NULL default '0',
+  `name` varchar(32) NOT NULL default '',
+  `host` varchar(255) NOT NULL default '',
   `description` tinytext,
   PRIMARY KEY  (`id`),
   KEY `host` (`host`)
 ) ENGINE=MyISAM;
-
-INSERT INTO `workspaces` (`id`,`name`,`host`,`description`) VALUES ("test1.blah.com:main","main","test1.blah.com","The Main Run");
-INSERT INTO `workspaces` (`id`,`name`,`host`,`description`) VALUES ("test2.blah.com:main","main","test2.blah.com","The Main Run");
-
-

Copied: gump/branches/Gump3/gumpdb/src/sql/gump3-old-sampledata.sql (from r209092, gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql)
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/gumpdb/src/sql/gump3-old-sampledata.sql?p2=gump/branches/Gump3/gumpdb/src/sql/gump3-old-sampledata.sql&p1=gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql&r1=209092&r2=209265&rev=209265&view=diff
==============================================================================
--- gump/branches/Gump3/gumpdb/src/sql/gump3-database-definition.sql (original)
+++ gump/branches/Gump3/gumpdb/src/sql/gump3-old-sampledata.sql Tue Jul  5 05:06:27 2005
@@ -1,105 +1,43 @@
-# CocoaMySQL dump
-# Version 0.5
-# http://cocoamysql.sourceforge.net
+# Copyright 2004-2005 The Apache Software Foundation
 #
-# Host: localhost (MySQL 4.1.7-standard)
-# Database: gump
-# Generation Time: 2004-11-30 22:22:01 -0800
-# ************************************************************
-
-# Dump of table builds
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `builds`;
-
-CREATE TABLE `builds` (
-  `id` varchar(96) NOT NULL default '',
-  `run` varchar(64) NOT NULL default '',
-  `project_version` varchar(64) NOT NULL default '',
-  `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `result` int(1) NOT NULL default '0',
-  `log` text,
-  PRIMARY KEY  (`id`),
-  KEY `run` (`run`)
-) ENGINE=MyISAM;
-
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:0","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:0","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:1","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:1","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:0","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:0","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:1","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:1","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:2","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:32","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:2","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project3","2004-11-08 01:15:30","2004-11-08 01:15:37","1",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:2","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:33","2",NULL);
-INSERT INTO `builds` (`id`,`run`,`project_version`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:2","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project3","2004-11-08 01:15:39","2004-11-08 01:15:43","0",NULL);
-
-
-# Dump of table hosts
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `hosts`;
-
-CREATE TABLE `hosts` (
-  `address` varchar(32) NOT NULL default '',
-  `description` text,
-  `cpu_arch` varchar(8) NOT NULL default 'x86',
-  `cpu_number` int(2) unsigned NOT NULL default '1',
-  `cpu_speed_Mhz` int(8) unsigned default NULL,
-  `memory_Mb` int(8) unsigned default NULL,
-  `disk_Gb` int(8) unsigned default NULL,
-  `name` varchar(16) NOT NULL default '',
-  PRIMARY KEY  (`address`)
-) ENGINE=MyISAM;
-
-INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test1.blah.com","debug host 1","x86","1",NULL,NULL,NULL,"Test 1");
-INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test2.blah.com","debug host 2","x86","1",NULL,NULL,NULL,"Test 2");
-
-
-# Dump of table modules
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `modules`;
-
-CREATE TABLE `modules` (
-  `name` varchar(32) NOT NULL default '',
-  `description` tinytext,
-  `descriptor` varchar(128) NOT NULL default '',
-  PRIMARY KEY  (`name`)
-) ENGINE=MyISAM;
-
-INSERT INTO `modules` (`name`,`description`,`descriptor`) VALUES ("module1",NULL,"http://blah.com/module1/gump.xml");
-INSERT INTO `modules` (`name`,`description`,`descriptor`) VALUES ("module2",NULL,"http://blah.com/module2/gump.xml");
-
-
-# Dump of table packages
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `packages`;
-
-CREATE TABLE `packages` (
-  `uri` varchar(64) NOT NULL default '',
-  `version` varchar(16) NOT NULL default '1.0',
-  `location` varchar(64) NOT NULL default ':',
-  `name` varchar(16) NOT NULL default ''
-) ENGINE=MyISAM;
+# 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.
 
+#
+# GUMP3 Database model for Dynagump -- sample data
+#
+# Less useful now Gump3 can actually populate the database...
 
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:0","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","0",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:0","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:1","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","1",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:1","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:0","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project1","2004-11-08 00:01:03","2004-11-08 00:08:32","1",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:0","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project1","2004-11-08 01:01:03","2004-11-08 01:08:32","0",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:1","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project2","2004-11-08 00:10:09","2004-11-08 00:14:22","2",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:1","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project2","2004-11-08 01:10:09","2004-11-08 01:14:22","0",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080000:2","test1.blah.com:main:200411080000","test1.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:32","2",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test1.blah.com:main:200411080100:2","test1.blah.com:main:200411080100","test1.blah.com:main:200411080100:project3","2004-11-08 01:15:30","2004-11-08 01:15:37","1",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080000:2","test2.blah.com:main:200411080000","test2.blah.com:main:200411080000:project3","2004-11-08 00:15:29","2004-11-08 00:15:33","2",NULL);
+INSERT INTO `builds` (`id`,`run_id`,`project_version_id`,`start_time`,`end_time`,`result`,`log`) VALUES ("test2.blah.com:main:200411080100:2","test2.blah.com:main:200411080100","test2.blah.com:main:200411080100:project3","2004-11-08 01:15:39","2004-11-08 01:15:43","0",NULL);
 
-# Dump of table project_dependencies
-# ------------------------------------------------------------
+INSERT INTO `causes` (`build_id`,`cause_id`,`cause_table`) VALUES ("test2.blah.com:main:200411080000:1","test2.blah.com:main:200411080000:project1","project_versions");
+INSERT INTO `causes` (`build_id`,`cause_id`,`cause_table`) VALUES ("test1.blah.com:main:200411080000:2","test1.blah.com:main:200411080000:project1","project_versions");
 
-DROP TABLE IF EXISTS `project_dependencies`;
+INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test1.blah.com","debug host 1","x86","1",NULL,NULL,NULL,"Test 1");
+INSERT INTO `hosts` (`address`,`description`,`cpu_arch`,`cpu_number`,`cpu_speed_Mhz`,`memory_Mb`,`disk_Gb`,`name`) VALUES ("test2.blah.com","debug host 2","x86","1",NULL,NULL,NULL,"Test 2");
 
-CREATE TABLE `project_dependencies` (
-  `dependee` varchar(64) NOT NULL default '',
-  `dependant` varchar(64) NOT NULL default '',
-  KEY `dependee` (`dependee`),
-  KEY `dependant` (`dependant`)
-) ENGINE=MyISAM;
+INSERT INTO `modules` (`name`,`description`,`id`) VALUES ("module1",NULL,"module1");
+INSERT INTO `modules` (`name`,`description`,`id`) VALUES ("module2",NULL,"module2");
 
 INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080000:project1","test1.blah.com:main:200411080000:project2");
 INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test1.blah.com:main:200411080000:project3","test1.blah.com:main:200411080000:project2");
@@ -114,115 +52,27 @@
 INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080100:project3","test2.blah.com:main:200411080100:project2");
 INSERT INTO `project_dependencies` (`dependee`,`dependant`) VALUES ("test2.blah.com:main:200411080100:project3","test2.blah.com:main:200411080100:project1");
 
-
-# Dump of table project_versions
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `project_versions`;
-
-CREATE TABLE `project_versions` (
-  `id` varchar(64) NOT NULL default '',
-  `project` varchar(64) NOT NULL default ''
-) ENGINE=MyISAM;
-
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080000:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test1.blah.com:main:200411080100:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080000:project3","project3");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project1","project1");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project2","project2");
-INSERT INTO `project_versions` (`id`,`project`) VALUES ("test2.blah.com:main:200411080100:project3","project3");
-
-
-# Dump of table projects
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `projects`;
-
-CREATE TABLE `projects` (
-  `name` varchar(32) NOT NULL default '',
-  `description` tinytext,
-  `module` varchar(32) NOT NULL default '',
-  `descriptor` varchar(128) default NULL,
-  PRIMARY KEY  (`name`),
-  KEY `module` (`module`)
-) ENGINE=MyISAM;
-
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project1","The first project","module1",NULL);
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project2","The second project","module1",NULL);
-INSERT INTO `projects` (`name`,`description`,`module`,`descriptor`) VALUES ("project3","The third project","module2",NULL);
-
-
-# Dump of table results
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `results`;
-
-CREATE TABLE `results` (
-  `id` int(1) NOT NULL default '0',
-  `name` varchar(16) NOT NULL default '',
-  `description` text,
-  PRIMARY KEY  (`id`)
-) ENGINE=MyISAM;
-
-INSERT INTO `results` (`id`,`name`,`description`) VALUES ("0","success","This is the status of a successful project build");
-INSERT INTO `results` (`id`,`name`,`description`) VALUES ("1","failure","This is the status of a failed project build");
-INSERT INTO `results` (`id`,`name`,`description`) VALUES ("2","stalled","This is the status of a project that cannot build due to unsatisfied dependencies");
-
-
-# Dump of table runs
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `runs`;
-
-CREATE TABLE `runs` (
-  `id` varchar(64) NOT NULL default '',
-  `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `workspace` varchar(48) NOT NULL default '',
-  `name` varchar(12) NOT NULL default '',
-  PRIMARY KEY  (`id`),
-  KEY `workspace` (`workspace`)
-) ENGINE=MyISAM;
-
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test1.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test1.blah.com:main","200411080000");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test1.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test1.blah.com:main","200411080100");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test2.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test2.blah.com:main","200411080000");
-INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace`,`name`) VALUES ("test2.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test2.blah.com:main","200411080100");
-
-
-# Dump of table runtime_dependencies
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `runtime_dependencies`;
-
-CREATE TABLE `runtime_dependencies` (
-  `run` varchar(64) NOT NULL default '',
-  `package` varchar(64) NOT NULL default ''
-) ENGINE=MyISAM;
-
-
-
-# Dump of table workspaces
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `workspaces`;
-
-CREATE TABLE `workspaces` (
-  `id` varchar(48) NOT NULL default '0',
-  `name` varchar(16) NOT NULL default '',
-  `host` varchar(32) NOT NULL default '',
-  `description` tinytext,
-  PRIMARY KEY  (`id`),
-  KEY `host` (`host`)
-) ENGINE=MyISAM;
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080000:project1","module1:project1");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080000:project2","module1:project2");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080000:project3","module2:project3");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080100:project1","module1:project1");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080100:project3","module2:project3");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test1.blah.com:main:200411080100:project2","module1:project2");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080000:project1","module1:project1");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080000:project2","module1:project2");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080000:project3","module2:project3");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080100:project1","module1:project1");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080100:project2","module1:project2");
+INSERT INTO `project_versions` (`id`,`project_id`) VALUES ("test2.blah.com:main:200411080100:project3","module2:project3");
+
+INSERT INTO `projects` (`name`,`description`,`module_id`,`id`) VALUES ("project1","The first project","module1","module1:project1");
+INSERT INTO `projects` (`name`,`description`,`module_id`,`id`) VALUES ("project2","The second project","module1","module1:project2");
+INSERT INTO `projects` (`name`,`description`,`module_id`,`id`) VALUES ("project3","The third project","module2","module2:project3");
+
+INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace_id`,`name`) VALUES ("test1.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test1.blah.com:main","200411080000");
+INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace_id`,`name`) VALUES ("test1.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test1.blah.com:main","200411080100");
+INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace_id`,`name`) VALUES ("test2.blah.com:main:200411080000","2004-11-08 00:00:00","2004-11-08 00:22:00","test2.blah.com:main","200411080000");
+INSERT INTO `runs` (`id`,`start_time`,`end_time`,`workspace_id`,`name`) VALUES ("test2.blah.com:main:200411080100","2004-11-08 01:00:00","2004-11-08 01:33:00","test2.blah.com:main","200411080100");
 
 INSERT INTO `workspaces` (`id`,`name`,`host`,`description`) VALUES ("test1.blah.com:main","main","test1.blah.com","The Main Run");
 INSERT INTO `workspaces` (`id`,`name`,`host`,`description`) VALUES ("test2.blah.com:main","main","test2.blah.com","The Main Run");
-
-

Added: gump/branches/Gump3/gumpdb/src/sql/gump3-sampledata.sql
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/gumpdb/src/sql/gump3-sampledata.sql?rev=209265&view=auto
==============================================================================
--- gump/branches/Gump3/gumpdb/src/sql/gump3-sampledata.sql (added)
+++ gump/branches/Gump3/gumpdb/src/sql/gump3-sampledata.sql Tue Jul  5 05:06:27 2005
@@ -0,0 +1,298 @@
+-- MySQL dump 9.11
+--
+-- Host: localhost    Database: gump
+-- ------------------------------------------------------
+-- Server version	4.0.23_Debian-3ubuntu2-log
+
+--
+-- Table structure for table `builds`
+--
+
+CREATE TABLE `builds` (
+  `id` varchar(255) NOT NULL default '',
+  `run_id` varchar(255) NOT NULL default '',
+  `project_version_id` varchar(255) NOT NULL default '',
+  `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `result` int(2) NOT NULL default '0',
+  `log` text,
+  PRIMARY KEY  (`id`),
+  KEY `run_id` (`run_id`),
+  KEY `project_version_id` (`project_version_id`),
+  KEY `result` (`result`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `builds`
+--
+
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:0','giraffe/generic@200507051351','giraffe/generic@200507051351/xjavac','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:1','giraffe/generic@200507051351','giraffe/generic@200507051351/jaxp','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:2','giraffe/generic@200507051351','giraffe/generic@200507051351/bootstrap-ant','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:3','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-apis','2005-07-05 13:51:54','2005-07-05 13:51:54',1,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:4','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-resolver','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:5','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-commons-resolver','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:6','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-xerces','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:7','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-commons-which','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:8','giraffe/generic@200507051351','giraffe/generic@200507051351/ant','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:9','giraffe/generic@200507051351','giraffe/generic@200507051351/dist-xerces','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:10','giraffe/generic@200507051351','giraffe/generic@200507051351/xml-xercesImpl','2005-07-05 13:51:54','2005-07-05 13:51:54',2,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:11','giraffe/generic@200507051351','giraffe/generic@200507051351/jaxr','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:12','giraffe/generic@200507051351','giraffe/generic@200507051351/jaxm','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/generic@200507051351:13','giraffe/generic@200507051351','giraffe/generic@200507051351/jaxrpc','2005-07-05 13:51:54','2005-07-05 13:51:54',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:0','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-1','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:1','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-2','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:2','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:3','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-dir-management-1','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:4','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-ant-based-1','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:5','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-failure-1','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+INSERT INTO `builds` VALUES ('giraffe/gump3-test-fixture@200507051352:6','giraffe/gump3-test-fixture@200507051352','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','2005-07-05 13:52:11','2005-07-05 13:52:11',0,'Log saving still a TODO!');
+
+--
+-- Table structure for table `causes`
+--
+
+CREATE TABLE `causes` (
+  `build_id` varchar(255) NOT NULL default '',
+  `cause_id` varchar(255) NOT NULL default '',
+  `cause_table` varchar(32) NOT NULL default 'project_versions',
+  KEY `build_id` (`build_id`),
+  KEY `cause_id` (`cause_id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `causes`
+--
+
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:4','giraffe/generic@200507051351/xml-apis','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:5','giraffe/generic@200507051351/xml-resolver','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:6','giraffe/generic@200507051351/xml-commons-resolver','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:7','giraffe/generic@200507051351/xml-xerces','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:8','giraffe/generic@200507051351/xml-xerces','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:9','giraffe/generic@200507051351/ant','project_versions');
+INSERT INTO `causes` VALUES ('giraffe/generic@200507051351:10','giraffe/generic@200507051351/xml-xerces','project_versions');
+
+--
+-- Table structure for table `hosts`
+--
+
+CREATE TABLE `hosts` (
+  `address` varchar(255) NOT NULL default '',
+  `description` text,
+  `cpu_arch` varchar(8) NOT NULL default 'x86',
+  `cpu_number` int(2) unsigned NOT NULL default '1',
+  `cpu_speed_Mhz` int(8) unsigned default NULL,
+  `memory_Mb` int(8) unsigned default NULL,
+  `disk_Gb` int(8) unsigned default NULL,
+  `name` varchar(32) NOT NULL default '',
+  PRIMARY KEY  (`address`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `hosts`
+--
+
+INSERT INTO `hosts` VALUES ('giraffe','giraffe (Linux,2.6.10-5-386,#1 Fri May 20 13:52:48 UTC 2005,i686,)','',0,0,0,NULL,'giraffe');
+
+--
+-- Table structure for table `modules`
+--
+
+CREATE TABLE `modules` (
+  `id` varchar(255) NOT NULL default '',
+  `name` varchar(32) NOT NULL default '',
+  `description` tinytext,
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `modules`
+--
+
+INSERT INTO `modules` VALUES ('giraffe/generic/xml-xerces2','xml-xerces2','\n    Java XML Parser - the sequel with no equal\n  ');
+INSERT INTO `modules` VALUES ('giraffe/generic/java-xml-pack','java-xml-pack','\n    Java XML Pack\n  ');
+INSERT INTO `modules` VALUES ('giraffe/generic/ant','ant','\n    Java based build tool\n  ');
+INSERT INTO `modules` VALUES ('giraffe/generic/xml-commons','xml-commons','\n    XML commons($Revision: 1.24 $) externally defined standards - DOM,SAX,JAXP; plus xml utilities\n  ');
+INSERT INTO `modules` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn','gump-fixture-svn','None');
+
+--
+-- Table structure for table `project_dependencies`
+--
+
+CREATE TABLE `project_dependencies` (
+  `dependee` varchar(255) NOT NULL default '',
+  `dependant` varchar(255) NOT NULL default '',
+  KEY `dependee` (`dependee`),
+  KEY `dependant` (`dependant`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `project_dependencies`
+--
+
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/bootstrap-ant','giraffe/generic@200507051351/jaxp');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-apis','giraffe/generic@200507051351/bootstrap-ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-apis','giraffe/generic@200507051351/jaxp');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-resolver','giraffe/generic@200507051351/jaxp');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-resolver','giraffe/generic@200507051351/xml-apis');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-resolver','giraffe/generic@200507051351/bootstrap-ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-commons-resolver','giraffe/generic@200507051351/xml-resolver');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-xerces','giraffe/generic@200507051351/bootstrap-ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-xerces','giraffe/generic@200507051351/xjavac');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-xerces','giraffe/generic@200507051351/xml-commons-resolver');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-xerces','giraffe/generic@200507051351/jaxp');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-commons-which','giraffe/generic@200507051351/xml-xerces');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-commons-which','giraffe/generic@200507051351/bootstrap-ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/ant','giraffe/generic@200507051351/bootstrap-ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/ant','giraffe/generic@200507051351/xml-xerces');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/ant','giraffe/generic@200507051351/xml-apis');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/dist-xerces','giraffe/generic@200507051351/ant');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/dist-xerces','giraffe/generic@200507051351/xjavac');
+INSERT INTO `project_dependencies` VALUES ('giraffe/generic@200507051351/xml-xercesImpl','giraffe/generic@200507051351/xml-xerces');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-2','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-1');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-1');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-2');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-dir-management-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-2');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-ant-based-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-ant-based-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-dir-management-1');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-1');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-ant-based-1');
+INSERT INTO `project_dependencies` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-failure-1');
+
+--
+-- Table structure for table `project_versions`
+--
+
+CREATE TABLE `project_versions` (
+  `id` varchar(255) NOT NULL default '',
+  `project_id` varchar(255) NOT NULL default '',
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `project_versions`
+--
+
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xjavac','giraffe/generic/xml-xerces2/xjavac');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/jaxp','giraffe/generic/java-xml-pack/jaxp');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/bootstrap-ant','giraffe/generic/ant/bootstrap-ant');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-apis','giraffe/generic/xml-commons/xml-apis');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-resolver','giraffe/generic/xml-commons/xml-resolver');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-commons-resolver','giraffe/generic/xml-commons/xml-commons-resolver');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-xerces','giraffe/generic/xml-xerces2/xml-xerces');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-commons-which','giraffe/generic/xml-commons/xml-commons-which');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/ant','giraffe/generic/ant/ant');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/dist-xerces','giraffe/generic/xml-xerces2/dist-xerces');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/xml-xercesImpl','giraffe/generic/xml-xerces2/xml-xercesImpl');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/jaxr','giraffe/generic/java-xml-pack/jaxr');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/jaxm','giraffe/generic/java-xml-pack/jaxm');
+INSERT INTO `project_versions` VALUES ('giraffe/generic@200507051351/jaxrpc','giraffe/generic/java-xml-pack/jaxrpc');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-1','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-1');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-2','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-2');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-3','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-3');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-dir-management-1','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-dir-management-1');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-ant-based-1','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-ant-based-1');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-failure-1','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-failure-1');
+INSERT INTO `project_versions` VALUES ('giraffe/gump3-test-fixture@200507051352/gump-fixture-svn-project-prereq-failure-1','giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-prereq-failure-1');
+
+--
+-- Table structure for table `projects`
+--
+
+CREATE TABLE `projects` (
+  `id` varchar(255) NOT NULL default '',
+  `name` varchar(255) NOT NULL default '',
+  `description` tinytext,
+  `module_id` varchar(255) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `name` (`name`),
+  KEY `module_id` (`module_id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `projects`
+--
+
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-xerces2/xjavac','xjavac','None','giraffe/generic/xml-xerces2');
+INSERT INTO `projects` VALUES ('giraffe/generic/java-xml-pack/jaxp','jaxp','None','giraffe/generic/java-xml-pack');
+INSERT INTO `projects` VALUES ('giraffe/generic/ant/bootstrap-ant','bootstrap-ant','None','giraffe/generic/ant');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-commons/xml-apis','xml-apis','None','giraffe/generic/xml-commons');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-commons/xml-resolver','xml-resolver','None','giraffe/generic/xml-commons');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-commons/xml-commons-resolver','xml-commons-resolver','None','giraffe/generic/xml-commons');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-xerces2/xml-xerces','xml-xerces','None','giraffe/generic/xml-xerces2');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-commons/xml-commons-which','xml-commons-which','None','giraffe/generic/xml-commons');
+INSERT INTO `projects` VALUES ('giraffe/generic/ant/ant','ant','None','giraffe/generic/ant');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-xerces2/dist-xerces','dist-xerces','None','giraffe/generic/xml-xerces2');
+INSERT INTO `projects` VALUES ('giraffe/generic/xml-xerces2/xml-xercesImpl','xml-xercesImpl','None','giraffe/generic/xml-xerces2');
+INSERT INTO `projects` VALUES ('giraffe/generic/java-xml-pack/jaxr','jaxr','None','giraffe/generic/java-xml-pack');
+INSERT INTO `projects` VALUES ('giraffe/generic/java-xml-pack/jaxm','jaxm','None','giraffe/generic/java-xml-pack');
+INSERT INTO `projects` VALUES ('giraffe/generic/java-xml-pack/jaxrpc','jaxrpc','None','giraffe/generic/java-xml-pack');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-1','gump-fixture-svn-project-1','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-2','gump-fixture-svn-project-2','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-3','gump-fixture-svn-project-3','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-dir-management-1','gump-fixture-svn-project-dir-management-1','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-ant-based-1','gump-fixture-svn-project-ant-based-1','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-failure-1','gump-fixture-svn-project-failure-1','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+INSERT INTO `projects` VALUES ('giraffe/gump3-test-fixture/gump-fixture-svn/gump-fixture-svn-project-prereq-failure-1','gump-fixture-svn-project-prereq-failure-1','None','giraffe/gump3-test-fixture/gump-fixture-svn');
+
+--
+-- Table structure for table `results`
+--
+
+CREATE TABLE `results` (
+  `id` int(2) NOT NULL default '0',
+  `name` varchar(32) NOT NULL default '',
+  `description` text,
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `results`
+--
+
+#INSERT INTO `results` VALUES (0,'success','This is the status of a successful project build');
+#INSERT INTO `results` VALUES (1,'failure','This is the status of a failed project build');
+#INSERT INTO `results` VALUES (2,'stalled','This is the status of a project that cannot build due to unsatisfied dependencies');
+
+--
+-- Table structure for table `runs`
+--
+
+CREATE TABLE `runs` (
+  `id` varchar(255) NOT NULL default '',
+  `start_time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `end_time` datetime NOT NULL default '0000-00-00 00:00:00',
+  `workspace_id` varchar(255) NOT NULL default '',
+  `name` varchar(12) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  KEY `workspace_id` (`workspace_id`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `runs`
+--
+
+INSERT INTO `runs` VALUES ('giraffe/generic@200507051351','2005-07-05 13:51:54','2005-07-05 13:51:54','giraffe/generic','200507051351');
+INSERT INTO `runs` VALUES ('giraffe/gump3-test-fixture@200507051352','2005-07-05 13:52:11','2005-07-05 13:52:11','giraffe/gump3-test-fixture','200507051352');
+
+--
+-- Table structure for table `workspaces`
+--
+
+CREATE TABLE `workspaces` (
+  `id` varchar(255) NOT NULL default '0',
+  `name` varchar(32) NOT NULL default '',
+  `host` varchar(255) NOT NULL default '',
+  `description` tinytext,
+  PRIMARY KEY  (`id`),
+  KEY `host` (`host`)
+) TYPE=MyISAM;
+
+--
+-- Dumping data for table `workspaces`
+--
+
+INSERT INTO `workspaces` VALUES ('giraffe/generic','generic','giraffe','None');
+INSERT INTO `workspaces` VALUES ('giraffe/gump3-test-fixture','gump3-test-fixture','giraffe','None');
+

Modified: gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py?rev=209265&r1=209264&r2=209265&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py Tue Jul  5 05:06:27 2005
@@ -14,39 +14,113 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+"""This module provides a single plugin, the Dynagumper, which
+   is responsible for pushing data to the Dynagump database."""
+
 __copyright__ = "Copyright (c) 2004-2005 The Apache Software Foundation"
 __license__   = "http://www.apache.org/licenses/LICENSE-2.0"
 
 import platform
 import os
+import time
+from urllib import quote
 
+from gump.model import Dependency
+from gump.model.util import check_failure, check_skip
+from gump.model.util import get_failure_causes
 from gump.plugins import AbstractPlugin
+from gump.plugins.instrumentation import DEFAULT_TIME_FORMAT
 from gump.util.sysinfo import amount_of_memory
 from gump.util.sysinfo import amount_of_cpu_mhz
 from gump.util.sysinfo import number_of_cpus
 
+BASE_DESCRIPTOR_URI = ""
+
+def get_host():
+    (system, host, release, version, machine, processor) = platform.uname()
+    return host
+
+_build_id = 0
+def set_build_id(project,timeformat):
+    global _build_id
+    (run_start, run_end, run_name) = get_run_data(project.module.repository.workspace,timeformat)
+    run_uri = get_run_uri(project.module.repository.workspace, run_name)
+    project.build_id = "%s:%s" % (run_uri, _build_id)
+    _build_id = _build_id + 1
+
+def get_build_id(project):
+    return project.build_id
+
+# TODO: maybe cache these calculations on the model?? This is going to be
+# *a lot* of string operations
+
+def get_workspace_uri(workspace):
+    url = "%s%s/%s" % (BASE_DESCRIPTOR_URI, get_host(), workspace.name)
+    return url
+
+def get_run_data(workspace, timeformat):
+    (year,mon,day,hour,min,sec,wday,yday,isdst) = time.strptime(workspace.run_start, timeformat)
+    run_start = time.mktime((year,mon,day,hour,min,sec,wday,yday,isdst))
+    run_name = "%04d%02d%02d%02d%02d" % (year,mon,day,hour,min)
+    (year,mon,day,hour,min,sec,wday,yday,isdst) = time.strptime(workspace.run_end, timeformat)
+    run_end = time.mktime((year,mon,day,hour,min,sec,wday,yday,isdst))
+    return (run_start, run_end, run_name)
+
+def get_run_uri(workspace, name):
+    url = "%s@%s" % (get_workspace_uri(workspace), name)
+    return url
+
+def get_module_uri(module):
+    url = "%s/%s" % (get_workspace_uri(module.repository.workspace), module.name)
+    return url
+
+def get_project_uri(project):
+    url = "%s/%s" % (get_module_uri(project.module), project.name)
+    return url
+
+def get_project_version_uri(project,timeformat):
+    (run_start, run_end, run_name) = get_run_data(project.module.repository.workspace,timeformat)
+    url = "%s/%s" % (get_run_uri(project.module.repository.workspace, run_name), project.name)
+    return url
+
 class Dynagumper(AbstractPlugin):
     """
-    Populate the DynaGump run metadata database.    
+    Plugin to populate the DynaGump run metadata database. It should run
+    in the post-processing stage only, after the object model has been fully
+    decorated.
+    
+    In order to understand what this plugin does (or should do), it is important
+    to look at both the complete gump object model as implemented in python code
+    and at the SQL-based database model defined for Dynagump. The Dynagumper is
+    "nothing more" than a mapping between those two.
+    
+    Further dependencies:
+      - TimerPlugin that sets run_start on the workspace
+      - TimerPlugin that sets work_start and work_end on the projects
+        (can recover)
     """    
-    def __init__(self, db, log):
+    def __init__(self, db, log, timeformat=DEFAULT_TIME_FORMAT):
         AbstractPlugin.__init__(self,log)
         """Set up the Dynagumper.
 
         Arguments:
-            - db is an instance of a gump.util.Database.
-            - log is an instance of logging.Logger.
+            - db is the instance of gump.util.Database that we will be
+              using for all our database calls.
+            - log is an instance of logging.Logger that we barely use
+              (as the db can be responsible for logging all executed
+              statements).
         """
         self.db = db
         self.log = log
+        self.timeformat = timeformat
         
         (system, host, release, version, machine, processor) = platform.uname()
         self.host = host
         
     def initialize(self):
-        self.storeHost()
+        self.add_host_to_db()
     
-    def storeHost(self):
+    def add_host_to_db(self):
         """Adds information about this server to the hosts table."""
         (system, host, release, version, machine, processor) = platform.uname()
         tablename = "hosts"
@@ -72,17 +146,14 @@
                      WHERE address = '%s' AND name = '%s';""" \
                 % (tablename, processor, cpus, mhz, memory, description, host, host)
         self.db.execute(cmd)
-    
-    def visit_workspace(self, workspace):
-        """Add information about the workspace to the database."""
+
+    def _add_workspace_to_db(self, workspace):
         tablename = "workspaces"
+        id = get_workspace_uri(workspace)
         
-        cmd = "SELECT * FROM %s WHERE name = '%s' AND host = '%s';" % (tablename, workspace.name, self.host)
+        cmd = "SELECT * FROM %s WHERE id = '%s';" % (tablename, id)
         (rows, result) = self.db.execute(cmd)
         
-        #TODO For want of any other ID...
-        id = 'gump://%s@%s' % (workspace.name, self.host)
-        
         description = None
         if hasattr(workspace,'description'): description = workspace.description
         
@@ -99,51 +170,135 @@
                 % (tablename, id, description, workspace.name, self.host)
         self.db.execute(cmd)
     
-    def visit_module(self, module):    
-        """Add information about a module to the database."""
+    def _add_run_to_db(self, workspace):
+        tablename = "runs"
+        (run_start, run_end, run_name) = get_run_data(workspace,self.timeformat)
+        workspace_id = get_workspace_uri(workspace)
+        run_id = get_run_uri(workspace, run_name)
+
+        cmd = """INSERT INTO %s (id, start_time, end_time, workspace_id, name)
+                     VALUES ('%s', FROM_UNIXTIME(%s), FROM_UNIXTIME(%s), '%s', '%s')""" \
+                % (tablename, run_id, run_start, run_end, workspace_id, run_name)
+        self.db.execute(cmd)
+    
+    def _add_module_to_db(self, module):
         tablename = "modules"
         
-        cmd = "SELECT * FROM %s WHERE name = '%s';" % (tablename, module.name)
+        id = get_module_uri(module)
+
+        cmd = "SELECT * FROM %s WHERE id = '%s';" % (tablename, id)
         (rows, result) = self.db.execute(cmd)
                 
         # Store into database...
         if rows == 0:
             # Insert
-            cmd = """INSERT INTO %s (name, description, descriptor)
+            cmd = """INSERT INTO %s (name, description, id)
                      VALUES ('%s', '%s', '%s')""" \
-                % (tablename, module.name, module.description, module.url)
+                % (tablename, module.name, module.description, id)
         else:
             # Update
-            cmd = """UPDATE %s SET description='%s',descriptor='%s'
-                     WHERE name = '%s';""" \
-                % (tablename, module.description, module.url, module.name)
-        self.db.execute(cmd)
+            cmd = """UPDATE %s SET description='%s',name='%s'
+                     WHERE id = '%s';""" \
+                % (tablename, module.description, module.name, id)
+        self.db.execute(cmd)        
     
-    def visit_project(self, project):    
-        """Add information about a project to the database."""
+    def _add_project_to_db(self, project):
         tablename = "projects"
-        startdate = project.run_start
-        enddate = project.run_end
-        name = project.name
         
-        cmd = "SELECT * FROM %s WHERE name = '%s';" % (tablename, project.name)
+        id = get_project_uri(project)
+        module_id = get_module_uri(project.module)
+
+        cmd = "SELECT * FROM %s WHERE id = '%s';" % (tablename, id)
         (rows, result) = self.db.execute(cmd)
                 
         # Gather data
         description = None
         if hasattr(project,'description'): description = project.description
-        descriptor=None
-        if hasattr(project,'url'): descriptor = project.url
         
         # Store into database...
         if rows == 0:
             # Insert
-            cmd = """INSERT INTO %s (name, description, module, descriptor)
+            cmd = """INSERT INTO %s (name, description, module_id, id)
                      VALUES ('%s', '%s', '%s', '%s')""" \
-                % (tablename, project.name, description, project.module.name, descriptor)
+                % (tablename, project.name, description, module_id, id)
         else:
             # Update
-            cmd = """UPDATE %s SET description='%s',module='%s',descriptor='%s'
+            cmd = """UPDATE %s SET description='%s',module_id='%s',id='%s'
                      WHERE name = '%s';""" \
-                % (tablename, description, project.module.name, descriptor, project.name)
+                % (tablename, description, module_id, id, project.name)
+        self.db.execute(cmd)
+    
+    def _add_project_version_to_db(self, project):
+        tablename = "project_versions"
+        
+        id = get_project_version_uri(project,self.timeformat)
+        project_id = get_project_uri(project)
+
+        cmd = """INSERT INTO %s (id, project_id)
+                VALUES ('%s', '%s')""" \
+            % (tablename, id, project_id)
+        self.db.execute(cmd)
+
+    def _add_project_dependencies_to_db(self, project):
+        tablename = "project_dependencies"
+        cmd = """INSERT INTO """ + tablename + """ (dependee, dependant)
+                VALUES ('%s', '%s')"""
+        for relationship in project.dependencies:
+            dependee = get_project_version_uri(project,self.timeformat)
+            dependency = get_project_version_uri(relationship.dependency,self.timeformat)
+            self.db.execute( cmd % (dependee, dependency))
+
+    def _add_cause_to_db(self, project, problematic_dependency):
+        tablename = "causes"
+        build_id = get_build_id(project)
+        cause_id = get_project_version_uri(problematic_dependency.dependency, self.timeformat)
+        
+        cmd = """INSERT INTO %s (build_id, cause_id)
+                VALUES ('%s', '%s')""" \
+            % (tablename, build_id, cause_id)
         self.db.execute(cmd)
+        
+    def _add_result_to_db(self, project):
+        tablename = "builds"
+        state = 0
+        if check_skip(project):
+            state = 2
+
+        if check_failure(project):
+            state = 1
+            first_problem = get_failure_causes(project)[0]
+            if isinstance(first_problem, Dependency):
+                state = 2
+                self._add_cause_to_db(project, first_problem)
+        
+        id = get_project_version_uri(project,self.timeformat)
+        (run_start, run_end, run_name) = get_run_data(project.module.repository.workspace,self.timeformat)
+        run_id = get_run_uri(project.module.repository.workspace,run_name)
+        build_id = get_build_id(project)
+
+        work_start = getattr(project, "work_start", project.module.repository.workspace.run_start)
+        work_start = time.strptime(work_start, self.timeformat)
+        work_start = time.mktime(work_start)
+        
+        work_end = getattr(project, "work_end", project.module.repository.workspace.run_end)
+        work_end = time.strptime(work_end, self.timeformat)
+        work_end = time.mktime(work_end)
+
+        cmd = """INSERT INTO %s (id, run_id, project_version_id, start_time, end_time, result, log)
+                     VALUES ('%s', '%s', '%s', FROM_UNIXTIME(%s), FROM_UNIXTIME(%s), '%s', '%s')""" \
+                % (tablename, build_id, run_id, id, work_start, work_end, state, "Log saving still a TODO!") # TODO
+        self.db.execute(cmd)
+
+    def visit_workspace(self, workspace):
+        self._add_workspace_to_db(workspace)
+        self._add_run_to_db(workspace)
+    
+    def visit_module(self, module):    
+        self._add_module_to_db(module)
+    
+    def visit_project(self, project):
+        set_build_id(project,self.timeformat)
+        self._add_project_to_db(project)
+        self._add_project_version_to_db(project)
+        self._add_project_dependencies_to_db(project)
+        self._add_result_to_db(project)



Mime
View raw message