[Ros-commits] r16603 - in stacks/ros_release/branches/fuerte…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: wim@code.ros.org
Date:  
To: ros-commits
Subject: [Ros-commits] r16603 - in stacks/ros_release/branches/fuerte/job_generation: . website website/cgi-bin website/html
Author: wim
Date: 2012-04-02 10:33:55 -0700 (Mon, 02 Apr 2012)
New Revision: 16603

Added:
stacks/ros_release/branches/fuerte/job_generation/website/
stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/
stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/gen_rosinstall.py
stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/prerelease_kickoff.py
stacks/ros_release/branches/fuerte/job_generation/website/html/
stacks/ros_release/branches/fuerte/job_generation/website/html/index.html
stacks/ros_release/branches/fuerte/job_generation/website/html/search.png
Log:
add website changes to fuerte branch


Added: stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/gen_rosinstall.py
===================================================================
--- stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/gen_rosinstall.py                            (rev 0)
+++ stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/gen_rosinstall.py    2012-04-02 17:33:55 UTC (rev 16603)
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+import sys
+import cgi
+import urllib
+import os
+import subprocess
+import tempfile
+import re
+
+import cgitb
+cgitb.enable()
+
+
+def main():
+    legacy_distro = ['cturtle', 'diamondback', 'electric']
+
+    print "Content-Type: text/html"     # HTML is following
+    print                               # blank line, end of headers
+
+    form = cgi.FieldStorage()
+    keys = ['rosdistro', 'variant', 'overlay']
+    for k in keys:
+        if not k in form.keys():
+            return 'Missing parameters: %s'%k
+    if form['rosdistro'].value not in ['boxturtle', 'cturtle', 'diamondback', 'unstable', 'electric', 'fuerte']:
+         # needs to send httperror instead
+         return 'invalid rosdistro parameter'
+    if form['overlay'].value not in ['yes', 'no']:
+         # needs to send httperror instead
+         return 'invalid overlay parameter'
+    p = re.compile('\A[A-Za-z]+[\w\-]*\Z')
+    if not bool(p.match(form['variant'].value)):
+         # needs to send httperror instead
+         return 'invalid variant parameter'
+
+
+    # old legacy toolset in /home/willow/ros_release
+    if form['rosdistro'].value in legacy_distro:
+        command = 'export ROS_HOME=/tmp && export ROS_PACKAGE_PATH="/home/willow/ros_release:/opt/ros/cturtle/stacks" && export ROS_ROOT="/opt/ros/cturtle/ros" && export PATH="/opt/ros/cturtle/ros/bin:$PATH" && export PYTHONPATH="/opt/ros/cturtle/ros/core/roslib/src" && rosrun job_generation generate_rosinstall.py --rosdistro %s --variant %s --overlay %s --database /home/log/rosinstall.db'%(form['rosdistro'].value, form['variant'].value, form['overlay'].value)
+
+    # new pypi-based tools
+    else:
+        command = 'generate_rosinstall.py --rosdistro %s --variant %s --overlay %s --database /home/log/rosinstall.db'%(form['rosdistro'].value, form['variant'].value, form['overlay'].value)
+
+    helper = subprocess.Popen(['bash', '-c', command], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    res, err = helper.communicate()
+    if helper.returncode != 0:
+        return '%s'%str(err)
+    else:
+        print '%s'%str(res)
+        return 0
+    
+
+if __name__ == '__main__':
+    sys.exit(main())
+



Property changes on: stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/gen_rosinstall.py
___________________________________________________________________
Added: svn:executable
+ *

Added: stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/prerelease_kickoff.py
===================================================================
--- stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/prerelease_kickoff.py                            (rev 0)
+++ stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/prerelease_kickoff.py    2012-04-02 17:33:55 UTC (rev 16603)
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+import sys
+import cgi
+import urllib
+import os
+import subprocess
+import tempfile
+
+import cgitb
+cgitb.enable()
+
+
+# Assemble a dictionary of stacks.
+def find_stacks(form):
+    if 'email' not in form.keys():
+        print "<H1>Error</H1>"
+        print "Please fill in email address."
+        return None
+    email = form['email'].value
+
+    if 'distro' not in form.keys():
+        print "<H1>Error</H1>"
+        print "Please select a valid distribution."
+        return None
+    distro = form['distro'].value
+
+    import re
+    stack_form = re.compile('stack_([0-9]*)')
+    stacks = []
+    for k in form.keys():
+        match = stack_form.match(k)
+        if match:
+            stacks.append(form['stack_%d'%int(match.group(1))].value)
+    if len(stacks) == 0:
+        print "<H1>Error</H1>"
+        print "Please specify the stack(s) to test."
+        return None
+        
+    return distro, email, stacks
+      
+
+def main():
+    legacy_distro = ['cturtle', 'diamondback', 'electric']
+
+    print "Content-Type: text/html"     # HTML is following
+    print                               # blank line, end of headers
+    
+    form = cgi.FieldStorage()
+
+    ret = find_stacks(form)
+    if not ret:
+        print '<p><a href="/hudson-html/hudson_kick_off.html">Try again</a>'
+        return
+    distro, email, stacks = ret
+
+    f = open('/var/www/hds.xml')
+    info = f.read().split(',')
+
+    command = ""
+    # old legacy toolset in /home/willow/ros_release
+    if distro in legacy_distro:
+      command = 'export ROS_HOME=/tmp && export ROS_PACKAGE_PATH="/home/willow/ros_release:/opt/ros/cturtle/stacks" && export ROS_ROOT="/opt/ros/cturtle/ros" && export PATH="/opt/ros/cturtle/ros/bin:$PATH" && export PYTHONPATH="/opt/ros/cturtle/ros/core/roslib/src" && rosrun job_generation generate_prerelease.py %s %s --repeat 0 --email %s --rosdistro %s'%(info[0], info[1], email, distro)
+
+    # new pypi-based tools
+    else:
+      command = 'generate_prerelease.py %s %s --repeat 0 --email %s --rosdistro %s'%(info[0], info[1], email, distro)
+
+    for s in stacks:
+      command += ' --stack %s'%s
+
+    res, err = subprocess.Popen(['bash', '-c', command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+    res = res.replace('<', '<a href="')
+    res = res.replace('>', '">the Hudson server</a>')
+    res = res.replace('\n', '<br>')
+    print '<h1>Your request was sent to the Hudson server</h1> <p> %s %s'%(str(res), str(err))
+
+if __name__ == '__main__':
+    main()



Property changes on: stacks/ros_release/branches/fuerte/job_generation/website/cgi-bin/prerelease_kickoff.py
___________________________________________________________________
Added: svn:executable
+ *

Added: stacks/ros_release/branches/fuerte/job_generation/website/html/index.html
===================================================================
--- stacks/ros_release/branches/fuerte/job_generation/website/html/index.html                            (rev 0)
+++ stacks/ros_release/branches/fuerte/job_generation/website/html/index.html    2012-04-02 17:33:55 UTC (rev 16603)
@@ -0,0 +1,124 @@
+<html>
+<head>
+<title>Pre-Release tests</title>
+<script>
+/* This script and many more are available free online at
+The JavaScript Source!! http://javascript.internet.com
+Created by: Jeroen Haan | http://www.haan.net */
+
+function addStackInput(i) {
+  var div = document.createElement("div");
+  div.innerHTML='&rarr;Stack name ' + i + ': <input type="text" name="stack_' + i + '"/> (e.g., <tt>joystick_drivers</tt>)';
+
+  div.setAttribute("id", 'stack_' + i);
+  var stacks = document.getElementById('stacks');
+  stacks.appendChild(div);
+}
+
+function setupClickHandler() {
+  var x = document.getElementById('add_stack');
+  x.onclick = function() {
+    var i = parseFloat(g_stack_count)+1;
+    addStackInput(i);
+    g_stack_count = i;
+  }
+}
+
+// Multiple onload function created by: Simon Willison
+// http://simonwillison.net/2004/May/26/addLoadEvent/
+function addLoadEvent(func) {
+  var oldonload = window.onload;
+  if (typeof window.onload != 'function') {
+    window.onload = func;
+  } else {
+    window.onload = function() {
+      if (oldonload) {
+        oldonload();
+      }
+      func();
+    }
+  }
+}
+
+addLoadEvent(function() {
+  g_stack_count = 1;
+  addStackInput(g_stack_count);
+  setupClickHandler();
+});
+</script>
+</head>
+
+<body>
+<h1>Pre-Release stack tests on Hudson</h1>
+<p>Use this form to create Hudson jobs that verify if one or more
+  stacks are ready to be released.  To release multiple stacks that
+  depend on each others changes, you need to trigger one single
+  prerelease build for all stacks at once. 
+
+<p> <img src="search.png" alt="Search for bugs" />
+
+
+<h3>What gets tested:</h3>
+<p>Hudson will build your stack plus all released stacks that have a
+dependency on your stack. So you will find out if your own stack
+works, and if the release of your stack breaks any of the already
+released stacks. The build will happen on all the distributions and
+architectures that are supported by Willow Garage. 
+
+Hudson will download the branches of your stack that are specified in
+the rosdistro file.  In some cases this is trunk, in other cases this
+is another branch. Check the rosdistro file to see which branches will
+get
+tested. See <a href="http://www.ros.org/wiki/regression_tests">this
+page</a> for more details.
+
+<h3>Why run these tests:</h3>
+<p>You should see these Hudson tests as a powerful tool to help you to
+avoid the embarasment of releasing a broken stack, or worse, from
+releasing a stack that breaks other people's code.  While it is
+acceptable to release a stack that does not work on all distributions
+and architectures that are supported by Willow Garage, your stack will
+be much more useful to the community when it works on all supported
+platforms.
+
+
+<h3>Reproduce test results:</h3>
+<p>If you're trying to reproduce a failure that only happens on a
+distro/arch that is different from your machine, you can
+follow <a href="http://www.ros.org/wiki/regression_tests/reproducing">these instructions</a> to set up a chroot invironment.
+
+<h3>Problems:</h3>
+<p>If you have any problems with the pre-release tests, you can file a
+  ticket <a href="https://code.ros.org/trac/ros/newticket?component=ros_release&type=defect&owner=wim&keywords=prerelease"
+  target="_blank">here</a>.
+
+<form name="input" action="http://packages.ros.org/cgi-bin/prerelease_kickoff.py" method="get">
+
+<br><br>
+<h1>Run the tests</h1>
+
+<h3>ROS distribution:</h3>
+<select name="distro"> 
+    <option>cturtle</option> 
+    <option>diamondback</option> 
+    <option selected>electric</option>
+    <option>fuerte</option> 
+    <option>unstable</option> 
+</select> (which distribution you want to test against)
+<br><br>
+
+<h3>Stack(s) to test (simultaneously):</h3>
+<div id="stacks">
+</div>
+<a href="#" id="add_stack"><input type="button" value="Add another stack"/></a>
+
+<br><br>
+
+
+<h3>Email address:</h3> <input type="text" name="email" /> (e.g., <tt></tt>)
+<br>
+<br><hr>
+<input type="submit" value="Submit" />
+</form>
+</body>
+</html>


Added: stacks/ros_release/branches/fuerte/job_generation/website/html/search.png
===================================================================
(Binary files differ)


Property changes on: stacks/ros_release/branches/fuerte/job_generation/website/html/search.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream

_______________________________________________
Ros-commits mailing list

https://code.ros.org/mailman/listinfo/ros-commits