gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r123453 - /gump/trunk/gump /gump/trunk/python/gump/actor/mysql/dynagumper.py /gump/trunk/python/gump/actor/stats/mysql /gump/trunk/python/gump/core/runner/runner.py /gump/trunk/src/xdocs/HowToRunYourOwnGump.html
Date Mon, 27 Dec 2004 23:06:11 GMT
Author: leosimons
Date: Mon Dec 27 15:06:10 2004
New Revision: 123453

URL: http://svn.apache.org/viewcvs?view=rev&rev=123453
Log:
Start work on having Gumpy talk to DynaGump, and add checks and instructions on getting the
gump+(python+mysql) combo properly set up
Added:
   gump/trunk/python/gump/actor/mysql/dynagumper.py
Modified:
   gump/trunk/gump
   gump/trunk/python/gump/actor/stats/mysql/   (props changed)
   gump/trunk/python/gump/core/runner/runner.py
   gump/trunk/src/xdocs/HowToRunYourOwnGump.html

Modified: gump/trunk/gump
Url: http://svn.apache.org/viewcvs/gump/trunk/gump?view=diff&rev=123453&p1=gump/trunk/gump&r1=123452&p2=gump/trunk/gump&r2=123453
==============================================================================
--- gump/trunk/gump	(original)
+++ gump/trunk/gump	Mon Dec 27 15:06:10 2004
@@ -286,6 +286,7 @@
   check_env_var "JAVA_HOME" "the location of the java jdk"
   
   check_env_pylib "rdflib" "http://rdflib.net/"
+  check_env_pylib "MySQLdb" "http://sourceforge.net/projects/mysql-python"
 
   cd cron
   ./gump.sh $@

Added: gump/trunk/python/gump/actor/mysql/dynagumper.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/actor/mysql/dynagumper.py?view=auto&rev=123453
==============================================================================
--- (empty file)
+++ gump/trunk/python/gump/actor/mysql/dynagumper.py	Mon Dec 27 15:06:10 2004
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+# Copyright 2003-2004 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.
+
+__copyright__ = "Copyright (c) 2004 The Apache Software Foundation"
+__license__   = "http://www.apache.org/licenses/LICENSE-2.0"
+
+import MySQLdb
+import MySQLdb.cursors
+
+from gump import log
+from gump.core.run.gumprun import *
+import gump.core.run.actor
+
+class Dynagumper(gump.core.run.actor.AbstractRunActor):
+    """
+    Populate the DynaGump run metadata database.
+    """
+    
+    def __init__(self,run):              
+        gump.core.run.actor.AbstractRunActor.__init__(self,run)    
+        self.dbInfo=self.workspace.getDatabaseInformation()
+        
+    def processOtherEvent(self,event):   
+        conn=None
+        helper=None
+        try:
+            conn=self.getConnected()
+            # do the actual work right here...
+            log.warning('dynagumper.py line 42: need to implement event processing')
+        finally:
+            if conn: conn.close()
+                      
+    def processWorkspace(self):
+        """
+        Add information about the workspace to the database.
+        """
+        conn=None
+        helper=None
+        try:
+            conn=self.getConnected()
+            # do the actual work right here...
+            log.warning('dynagumper.py line 56: need to implement workspace event processing')
+        finally:
+            if conn: conn.close()
+    
+    def processModule(self,module):    
+        """
+        Add information about the module to the database.
+        """
+        conn=None
+        helper=None
+        try:
+            conn=self.getConnected()
+            # do the actual work
+            log.warning('dynagumper.py line 68: need to implement module event processing')
+        finally:
+            if conn: conn.close()
+    
+    def processProject(self,project):    
+        """
+        Add information about the project to the database.
+        """
+        conn=None
+        helper=None
+        try:
+            conn=self.getConnected()
+            # do the actual work right here...
+            log.warning('dynagumper.py line 82: need to implement project event processing')
+        finally:
+            if conn: conn.close()
+        
+        
+    def getConnected(self):
+        """
+        Get a database connection.
+        """
+                
+        return MySQLdb.Connect(
+                    host=self.dbInfo.getHost(), 
+                    user=self.dbInfo.getUser(),
+                    passwd=self.dbInfo.getPasswd(), 
+                    db=self.dbInfo.getDatabase(),
+                    compress=1,
+                    cursorclass=MySQLdb.cursors.DictCursor)

Modified: gump/trunk/python/gump/core/runner/runner.py
Url: http://svn.apache.org/viewcvs/gump/trunk/python/gump/core/runner/runner.py?view=diff&rev=123453&p1=gump/trunk/python/gump/core/runner/runner.py&r1=123452&p2=gump/trunk/python/gump/core/runner/runner.py&r2=123453
==============================================================================
--- gump/trunk/python/gump/core/runner/runner.py	(original)
+++ gump/trunk/python/gump/core/runner/runner.py	Mon Dec 27 15:06:10 2004
@@ -144,7 +144,7 @@
                 log.warning('Unable to register Database Actor :  %s ' % details,
                             exc_info=1)
         
-        # Add Historical Database storer
+        # Add Historical Database storer -- ??? no such thing...
         if self.run.getOptions().isOfficial() and \
             self.run.getWorkspace().hasDatabaseInformation() and \
             self.run.getOptions().isHistorical():       
@@ -153,6 +153,15 @@
                 self.run.registerActor(gump.actor.history.historical.Historical(self.run))
             except Exception, details:
                 log.warning('Unable to register Historical Database Actor :  %s ' % details,
+                            exc_info=1)
+
+        # Add DynaGump database populator
+        if self.run.getWorkspace().hasDatabaseInformation():
+            try:
+                import gump.actor.mysql.dynagumper
+                self.run.registerActor(gump.actor.mysql.dynagumper.Dynagumper(self.run))
+            except Exception, details:
+                log.warning('Unable to register Dynagump Database Actor :  %s ' % details,
                             exc_info=1)
         
         # Document..

Modified: gump/trunk/src/xdocs/HowToRunYourOwnGump.html
Url: http://svn.apache.org/viewcvs/gump/trunk/src/xdocs/HowToRunYourOwnGump.html?view=diff&rev=123453&p1=gump/trunk/src/xdocs/HowToRunYourOwnGump.html&r1=123452&p2=gump/trunk/src/xdocs/HowToRunYourOwnGump.html&r2=123453
==============================================================================
--- gump/trunk/src/xdocs/HowToRunYourOwnGump.html	(original)
+++ gump/trunk/src/xdocs/HowToRunYourOwnGump.html	Mon Dec 27 15:06:10 2004
@@ -35,6 +35,8 @@
   <li>the Bash shell;<br>
   </li>
   <li>Python 2.3 or later;</li>
+  <li>MySQL 4.0 or later (client and server);</li>
+  <li>the MySQLdb python library for interfacing the above two;</li>
   <li>the pkill program;</li>
   <li>the hostname program;</li>
   <li>the cvs program;</li>
@@ -100,6 +102,16 @@
 <code>~/bin</code> is on your path):<br>
 </p>
 <pre>#!/bin/sh<br>#<br># Simple wrapper script which fires off gump<br>olddir=`pwd`<br>cd
~/local/gump<br>./gump $@<br>cd $olddir<br></pre>
+<h2>Setting up the mysql database</h2>
+<p>Gump uses a mysql database for storing lots of interesting data about
+the build results. Create a new database named "gump", then populate it
+with lots of tables by importing the <code>mysql/gump.sql</code> dump into
+your new database:</p>
+<pre>
+cd ~/gump/local
+mysqladmin -u root create gump
+mysql -u root gump < mysql/gump.sql
+</pre>
 <h2>Running the unit tests</h2>
 <p>Next, we'll run the gump unit tests using the command line
 interface. It would be nice if these tests would all always work, but
@@ -120,6 +132,10 @@
 gump will build. The file referenced is <code>profile/minimal-profile.xml</code>,
 which builds Apache Ant, and nothing else.<br>
 </p>
+
+<p>Unless you're connecting to a database named "gump" as the root user
+without using a password, you'll need to customize the &lt;database&gt;
+field inside that profile to reflect your actual settings.</p>
 <h2>Running gump</h2>
 <p>Pfew. You're still here? Good. Let's do an actual "gump run":</p>
 <pre>cd ~/local/gump<br>./gump run<br></pre>

Mime
View raw message