.releng

automation, application, assembly, and angst

Web-Based PDE Builds

As a release engineer, one of my daily challenges is usability - making painful processes easier to use. Of course invariably the simpler a process is to the user, the more complex it is to set up.

Here’s a quick rundown of the 6 pieces involved in setting up a build:

  1. website (php)
  2. .htaccess
  3. shell script (bash)
  4. lockfile (txt)
  5. lockfile watcher (bash)
  6. crontab entry

Modeling builds are run using a shell script, starting with the aptly named start.sh.

But as you can see from the command syntax (see the usage() function), it requires a lot of flags and options to run properly.

So, to make things simpler, we wrap this command up in a php script and serve a simpler web UI:

Depending on your webserver configuration / security level, you may be able to set up the web user (eg., www-data or apache) to run builds. Assuming your builds only need read access to CVS, your script can extract sources via pserver anonymously and the web user can create files/folders within the web root in order to run a build. It is recommended that in this case you secure scripts that write to the filesystem via at least .htaccess files.

In order for the web user to run a php script which in turn executes a shell script, you will have to have php configured to allow exec(). If your build server is secured to not allow this, you will need another level of abstraction — creation of queue or lock files.

Instead of just executing a shell command, the build webpage must queue up the command to be run. However, for added safety, the created file itself should not be executable; instead, it’s just the command flags to be passed to the script:

$ cat mdt-ocl_1.1.0.lock.txt
-proj mdt -sub ocl -version 1.1.0 -branch HEAD -URL http://download.eclipse.org/eclipse/downloads/drops/S-3.3M6-200703231616/eclipse-SDK-3.3M6-linux-gtk.tar.gz -URL http://download.eclipse.org/modeling/emf/emf/downloads/drops/2.3.0/S200703291501/emf-sdo-xsd-SDK-2.3.0M6.zip -URL http://download.eclipse.org/modeling/mdt/uml2/downloads/drops/2.1.0/I200703221526/uml2-SDK-I200703221526.zip -URL http://download.eclipse.org/tools/orbit/downloads/drops/S200703161546/orbit-S200703161546.zip -antTarget run -mapfileRule use-false -buildType N -javaHome /opt/ibm-java2-ppc-50 -downloadsDir /home/build/downloads -buildDir /home/build/modeling/mdt/ocl/downloads/drops/1.1.0/N200707110048 -writableBuildRoot /tmp -buildTimestamp 200707110048 -basebuilderBranch RC3_33

Then we need a crontab entry to check the folder where the lockfiles are stored:

$ crontab -l
# check every minute
* * * * * /home/build/modeling/scripts/lockfileWatcher.sh -all 2>/dev/null 1>/dev/null

And finally, we need the script, lockfileWatcher.sh, to check for lockfiles and respond accordingly.

When put together, you have an .htaccess secured build, initiated anonymously by the webserver but run by an authorized user on the build server. For more information & screenshots, see Modeling Build Server Setup.

Posted July 11th, 2007 by in category: pde, usability, workflow
You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply

You must be logged in using your Eclipse Bugzilla account to post a comment.

Recent Posts

Archives

Categories

Meta