[cig-commits] r17997 - in cs/buildbot: . templates templates/master templates/slave
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 1 12:42:00 PST 2011
Author: brad
Date: 2011-03-01 12:42:00 -0800 (Tue, 01 Mar 2011)
New Revision: 17997
Added:
cs/buildbot/templates/
cs/buildbot/templates/master/
cs/buildbot/templates/master/buildbot.tac
cs/buildbot/templates/master/makefile
cs/buildbot/templates/master/master.cfg
cs/buildbot/templates/master/packager.py
cs/buildbot/templates/master/windows.py
cs/buildbot/templates/slave/
cs/buildbot/templates/slave/buildbot.tac
cs/buildbot/templates/slave/crontab
Log:
Imported template files.
Added: cs/buildbot/templates/master/buildbot.tac
===================================================================
--- cs/buildbot/templates/master/buildbot.tac (rev 0)
+++ cs/buildbot/templates/master/buildbot.tac 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,10 @@
+
+from twisted.application import service
+from buildbot.master import BuildMaster
+
+basedir = r'/home/buildbot/master'
+configfile = r'master.cfg'
+
+application = service.Application('buildmaster')
+BuildMaster(basedir, configfile).setServiceParent(application)
+
Added: cs/buildbot/templates/master/makefile
===================================================================
--- cs/buildbot/templates/master/makefile (rev 0)
+++ cs/buildbot/templates/master/makefile 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,19 @@
+# -*- makefile -*-
+
+# This is a simple makefile which lives in a buildmaster/buildslave
+# directory (next to the buildbot.tac file). It allows you to start/stop the
+# master or slave by doing 'make start' or 'make stop'.
+
+# The 'reconfig' target will tell a buildmaster to reload its config file.
+
+start:
+ twistd --no_save -y buildbot.tac
+
+stop:
+ kill `cat twistd.pid`
+
+reconfig:
+ kill -HUP `cat twistd.pid`
+
+log:
+ tail -f twistd.log
Added: cs/buildbot/templates/master/master.cfg
===================================================================
--- cs/buildbot/templates/master/master.cfg (rev 0)
+++ cs/buildbot/templates/master/master.cfg 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,634 @@
+# -*- python -*-
+
+###############################################################################
+
+from buildbot.config import Config
+
+c = BuildmasterConfig = {}
+config = Config()
+
+depsURL = "http://www.geodynamics.org/~buildbot/deps/"
+buildbotURLRoot = "http://www.geodynamics.org/buildbot/"
+buildbotURL = "http://www.geodynamics.org:8009/"
+c['buildbotURL'] = buildbotURL
+
+debug = False
+
+###############################################################################
+
+####### REPOSITORIES & SOURCES
+
+from buildbot.repositories import SVNRepository, HGRepository
+
+class repos:
+ if debug:
+ cig = SVNRepository("file:///home/leif/sandbox/buildbot/repo/")
+ else:
+ cig = SVNRepository("http://www.geodynamics.org/svn/cig/")
+ petsc = HGRepository("http://petsc.cs.iit.edu/petsc/petsc-dev/")
+ petscBuildSystem = HGRepository("http://petsc.cs.iit.edu/petsc/BuildSystem/")
+
+config.repositories = [repos.cig, repos.petsc, repos.petscBuildSystem]
+
+from buildbot.changes.pb import PBChangeSource
+c['sources'] = [PBChangeSource()]
+
+###############################################################################
+
+####### USERS
+
+from buildbot.users import AddressBook
+from buildbot.users import User as u
+
+class users:
+
+ # main server
+ barmin = u("barmin at mathis.colorado.edu")
+ becker = u(None)
+ brad = u("baagaard at usgs.gov")
+ cassie = u("casferguson at yahoo.com")
+ cjoneill = u(None)
+ gurnis = u("gurnis at geodynamics.org")
+ knepley = u("knepley at mcs.anl.gov")
+ leif = u("leif at geodynamics.org")
+ luis = u("luis at geodynamics.org")
+ luke = u(None)
+ maweier = u(None)
+ mspieg = u(None)
+ polson = u(None)
+ sue = u("sue at geodynamics.org")
+ tan2 = u("tan2 at geodynamics.org")
+ walter = u("walter at geodynamics.org")
+ wei = u("wei at geodynamics.org")
+ weimi = u("wei at geodynamics.org")
+ willic3 = u("willic3 at rpi.edu")
+ wyjiang = u(None)
+
+ # s-wave
+ alessia = u("alessia at gps.caltech.edu")
+ anne = u(None)
+ bernhard = u("mail at bernhard-schuberth.de")
+ carltape = u("carltape at gps.caltech.edu")
+ cmerlet = u(None)
+ cmorency = u(None)
+ davidmichea = u("davidmichea at gmail.com")
+ dkomati1 = u("dimitri.komatitsch at univ-pau.fr")
+ emanuele = u("emanuele at gps.caltech.edu")
+ friberg = u("p.friberg at isti.com")
+ jtromp = u("jtromp at gps.caltech.edu")
+ kasper = u("kasper at cgiss.boisestate.edu")
+ komatits = dkomati1
+ lqy = u("lqy at gps.caltech.edu")
+ mchen = u("mchen at gps.caltech.edu")
+ nlegoff = u("nicolas.legoff at univ-pau.fr")
+ savage13 = u("savage at uri.edu")
+ slombey = u("slombey at cacr.caltech.edu")
+ tarje = u(None)
+ vala = u("vala at ldeo.columbia.edu")
+ yingz = u("yingz at vt.edu")
+ ykaneko = u(None)
+ ykim = u("ykim at gps.caltech.edu")
+
+ # misc.
+ petsc_maint = u("petsc-maint at mcs.anl.gov")
+
+ admin = leif
+
+class debug_users:
+ leif = u("leif at geodynamics.org")
+ admin = leif
+
+class groups:
+ # CitcomS = [users.tan2]
+ PyLith = [users.brad, users.willic3, users.knepley]
+
+config.addressBook = AddressBook(debug and debug_users or users)
+#config.addressBook = AddressBook(debug_users)
+
+###############################################################################
+
+####### PROJECTS & BRANCHES
+
+from buildbot.projects import Project
+from buildbot.bs import gnu, distutils, make, scons, ASEBuildSystem, ASEBuildSystemInstall, sf
+import buildbot.languages as languages
+
+projectTable = dict(
+ # name # url # branches # owners
+ # CitcomCU = ("mc/citcomcu/", ["inflow-bcs"], []),
+ # CitcomS = ("mc/citcoms/", ["v2.2"], groups.CitcomS),
+ # Ellipsis3D = ("mc/ellipsis3d/", [], []),
+ # Gale = ("long/gale/", [], [users.walter]),
+ # MAG = ("geodyn/mag/", [], []),
+ PyLith = ("short/pylith/", [], groups.PyLith),
+ # SPECFEM3D = ("seismo/specfem3d/", [], []),
+ # SPECFEM3D_GLOBE = ("seismo/specfem3d-globe/", [], []),
+ # cigma = ("cs/cigma/", [], []),
+ #merlin = (None, ["v1"], []),
+ #nemesis = (None, [], []),
+ #pythia = ("cs/pythia/", [], []),
+ spatialdata = (None, [], [users.brad]),
+ )
+
+class projects:
+ pass
+
+packages = "http://www.geodynamics.org/cig/software/packages/"
+for name, entry in projectTable.iteritems():
+ url, branches, owners = entry
+ if url is not None:
+ url = packages + url
+ project = Project(name = name,
+ url = url,
+ branches = branches,
+ owners = [], #owners,
+ )
+ setattr(projects, name, project)
+ config.projects.append(project)
+
+projects.PyLith.binaries = True
+# projects.cigma.binaries = True
+
+# non-GNU build systems
+#projects.merlin.defaultBuildSystem = distutils
+#projects.pythia.defaultBuildSystem = distutils
+# projects.Gale.defaultBuildSystem = scons
+# projects.MAG.defaultBuildSystem = make
+# projects.SPECFEM3D.defaultBuildSystem = sf
+# projects.SPECFEM3D_GLOBE.defaultBuildSystem = sf
+
+repos.cig.initLayout({
+ "cs": {
+ # "cigma": projects.cigma,
+ #"merlin": projects.merlin,
+ #"nemesis": projects.nemesis,
+ #"pythia": projects.pythia,
+ "spatialdata": projects.spatialdata,
+ },
+ "geodyn": {
+ "3D": {
+ # "MAG": projects.MAG,
+ },
+ },
+ "long": {
+ "3D": {
+ # "Gale": projects.Gale,
+ },
+ },
+ "mc": {
+ "3D": {
+ # "CitcomS": projects.CitcomS,
+ # "CitcomCU": projects.CitcomCU,
+ # "Ellipsis3D": projects.Ellipsis3D,
+ },
+ },
+ "seismo": {
+ "3D": {
+ # "SPECFEM3D": projects.SPECFEM3D,
+ # "SPECFEM3D_GLOBE": projects.SPECFEM3D_GLOBE,
+ },
+ },
+ "short": {
+ "3D": {
+ "PyLith": projects.PyLith,
+ },
+ },
+})
+
+# special project configurations
+
+# projects.CitcomS.trunk.configs = {'pyrized': [], 'binaries': [], 'traditional': ['--without-pyre']}
+# projects.CitcomS.branches["v2.2"].configs = {'pyrized': [], 'traditional': ['--without-pyre']}
+# projects.Gale.configureArgs[scons] = []
+projects.PyLith.trunk.configs['default'] = ["--enable-testing", "--enable-cubit", "--enable-swig"]
+# projects.cigma.trunk.configs['default'] = ["--with-hdf5=%(PREFIX)s", "--with-vtk=%(PREFIX)s"]
+#projects.cigma.trunk.schedulerKwds = dict(treeStableTimer=60)
+#projects.merlin.trunk = None # trunkless
+projects.spatialdata.configureArgs[gnu] = ["--enable-testing", "--enable-pythia", "--enable-swig"]
+
+# def isImportantSpecfemChange(change):
+# from os.path import splitext
+# for filename in change.files:
+# base, ext = splitext(filename)
+# if filename.startswith("version41_beta/"):
+# continue
+# if ext in [".f90", ".h"]:
+# return True
+# if filename.endswith(".h.in"):
+# return True
+# return False
+
+# for project in [projects.SPECFEM3D, projects.SPECFEM3D_GLOBE]:
+# project.trunk.languages = [languages.f90]
+# project.trunk.fileIsImportant = isImportantSpecfemChange
+# project.trunk.schedulerKwds = dict(
+# treeStableTimer = 60*60*36, # simulations are time consuming and expensive
+# )
+
+# debugging
+
+if debug:
+ import buildbot.bs as bs
+ for name in projectTable.iterkeys():
+ project = getattr(projects, name)
+ for line in project.lines():
+ line.setBuildSystem(bs.debug)
+
+###############################################################################
+
+####### DEPENDENCIES
+
+# external dependencies
+
+depsTable = dict(
+ # name # filename base # build system
+ #cppunit = ("cppunit-1.12.0", gnu),
+ #FIAT = ("FIAT-0.9.9", distutils),
+ #numpy = ("numpy-1.3.0", distutils), # numpy-1.2.1 on cygwin
+ #proj = ("proj-4.5.0", gnu),
+ #netcdf = ("netcdf-3.6.2", gnu), # for PyLith's --enable-cubit
+ # hdf5 = ("hdf5-1.6.5", gnu), # for cigma
+ #swig = ("swig-1.3.37", gnu),
+)
+
+class deps:
+ pass
+
+for name, entry in depsTable.iteritems():
+ basename, bs = entry
+ project = Project(name = name,
+ bs = bs,
+ )
+ project.addTarball(depsURL + basename + ".tar.gz")
+ setattr(deps, name, project)
+ config.projects.append(project)
+
+# PETSc
+
+class NewASEBuildSystem(ASEBuildSystem):
+ # *Sigh*
+
+ def generativeSteps(self, buildEnv, buildConfig, env, desc, workdir, configureArgs, line):
+ steps = []
+ if self.location:
+ steps = self.location.sourceSteps(
+ workdir = workdir + "/config/BuildSystem",
+ mode = 'clobber')
+ return steps
+
+
+ase = ASEBuildSystem("%(PREFIX)s/opt/petsc")
+ase_old = ASEBuildSystem("%(PREFIX)s/opt/petsc-old")
+ase_dev = NewASEBuildSystem("%(PREFIX)s/opt/petsc-dev", repos.petscBuildSystem.location())
+ase_install = ASEBuildSystemInstall(repos.petscBuildSystem.location())
+
+deps.PETSc = Project(name = "PETSc",
+ url = "http://www.mcs.anl.gov/petsc",
+ bs = ase,
+ owners = [users.admin, users.petsc_maint],
+ )
+
+# PETSc v2.3.2 -- for Gale
+# deps.PETSc.addTarball(depsURL + "petsc-2.3.2-p10.tar.gz")
+# now save 'release' as a branch -- it will be overwritten by v2.3.3 below
+# petsc_old = deps.PETSc.release
+# deps.PETSc.branches = dict(old = petsc_old)
+# petsc_old.setBuildSystem(ase_old)
+# petsc_old.env = {"PETSC_DIR": "%(WORKDIR)s"}
+# petsc_old.configs = {"default": ["--with-mpi=1", "--with-x=0"]}
+# petsc_old.dependentConfigureArgs = {gnu: ["PETSC_DIR=%(PREFIX)s/opt/petsc-old"],
+# scons: ["--with-petsc-dir=%(PREFIX)s/opt/petsc-old"]}
+# petsc_old.dependentEnv = {"PATH": "%(PREFIX)s/opt/petsc-old/bin/%(PETSC_ARCH)s"} # for Cygwin DLLs
+# petsc_old.buildNightly(0, 0)
+
+# PETSC v2.3.3
+# deps.PETSc.addTarball(depsURL + "petsc-2.3.3-p0.tar.gz")
+petscConfigureArgs = [
+ "--prefix=%(PREFIX)s",
+ "--download-f-blas-lapack=1",
+ "--with-sieve=1",
+ "--with-c2html=0",
+ "--CXXFLAGS=-DMPICH_IGNORE_CXX_SEEK",
+ "--with-clanguage=C++",
+ "--with-mpicompilers=1",
+ "--with-debugging=0",
+
+ # Use MPI compilers and have them in the path rather than
+ # specifying compilers explicitly or using --with-mpi-dir.
+ # Each MPI installation is configured with the
+ # corresponding compilers for that configuration, so using the
+ # "MPI compilers" should do the right thing.
+
+ # deps
+ "--download-scientificpython=1",
+ "--download-fiat=1",
+ "--download-chaco=1",
+ "--download-netcdf=1",
+ "--download-boost=1",
+ "--download-m1=1",
+ # other
+ "--with-x=0",
+ ]
+# deps.PETSc.release.env = {"PETSC_DIR": "%(WORKDIR)s"}
+# deps.PETSc.release.configs = {"default": (petscConfigureArgs +
+# ["--with-c-support"] # for Gale
+# )
+# }
+# deps.PETSc.release.dependentConfigureArgs = {gnu: ["PETSC_DIR=%(PREFIX)s/opt/petsc"],
+# scons: ["--with-petsc-dir=%(PREFIX)s/opt/petsc"]}
+# deps.PETSc.release.dependentEnv = {"PATH": "%(PREFIX)s/opt/petsc/bin/%(PETSC_ARCH)s"} # for Cygwin DLLs
+# deps.PETSc.release.buildNightly(3, 0)
+
+# PETSc-dev
+from buildbot.lines import Line
+deps.PETSc.trunk = Line(name = "dev",
+ location = repos.petsc.location(),
+ project = deps.PETSc)
+deps.PETSc.trunk.setBuildSystem(ase_install)
+deps.PETSc.trunk.env = {"PETSC_DIR": "%(WORKDIR)s"}
+deps.PETSc.trunk.configs = {"default": (petscConfigureArgs +
+ ["--with-shared-libraries=1"] # for PyLith
+ )
+ }
+deps.PETSc.trunk.dependentConfigureArgs = {gnu: ["PETSC_DIR=%(PREFIX)s"],
+ scons: ["--with-petsc-dir=%(PREFIX)s/opt/petsc-dev"]}
+deps.PETSc.trunk.dependentEnv = {"PATH": "%(PREFIX)s/bin"} # for Cygwin DLLs
+deps.PETSc.trunk.buildNightly(6, 0)
+
+
+config.projects.append(deps.PETSc)
+
+#deps.netcdf.release.configs = {"default": ["--disable-f90", "--enable-shared"]} # for Cygwin
+# deps.hdf5.release.configs = {"default": ["RUNPARALLEL=none"]} # for MPICH2
+
+# dependency graph
+
+# projects.Gale.trunk.dependencies = [
+# petsc_old,
+# ]
+
+projects.PyLith.trunk.dependencies = [
+ projects.spatialdata.trunk,
+ #projects.pythia.trunk,
+ #projects.nemesis.trunk,
+ deps.PETSc.trunk,
+ #deps.cppunit.release,
+ #deps.FIAT.release,
+ #deps.numpy.release,
+ #deps.proj.release,
+ #deps.netcdf.release,
+ #deps.swig.release,
+ ]
+
+# projects.cigma.trunk.dependencies = [
+# deps.hdf5.release,
+# ]
+
+###############################################################################
+
+####### SLAVES & ENVIRONMENTS
+
+from buildbot.config import BuildSlave as s
+from buildbot.config import BuildConfig as cfg
+from buildbot.config import LAMBuildConfig as lam
+from buildbot.config import BinaryBuildConfig as bin
+from buildbot.config import BuildEnvironment as env
+
+# active Linux slaves
+# id = s('system-name', 'password')
+# system-name is shown on buildbot webpage
+dynamo = s('bot-dynamo', 'boY1uoqu') ### NOTE: problem enabling g++-3.4 using dselect
+linux64 = s('bot-linux64', 'quah6Oci')
+#ubuntu64 = s('ubuntu-linux64', 'quah6Oci')
+ubuntu64 = s('io-ubuntu-linux64', 'quah6Oci')
+
+
+def aseConfigArgs(extraASE=[]):
+ args = {ase: extraASE,
+ ase_old: extraASE,
+ ase_dev: extraASE,
+ scons: extraASE,
+ }
+ return args
+
+
+config.buildEnvironments = [
+ ### Linux
+ env("x86 linux single nosched",
+ configs=[bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.3",
+ # "PATH": "%(HOME)s/opt/mpich2/bin",
+ "PETSC_ARCH": "linux-gnu-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ # "":"%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib", # for numpy to find petsc's blas
+ "LD_LIBRARY_PATH": "%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib", # for nemesis
+ },
+ slaves = [dynamo],
+ configureArgs = aseConfigArgs(),
+ ),
+ ]
+ ),
+ env("x86_64 linux single nosched",
+ configs=[
+ bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.6",
+ "PETSC_ARCH": "linux-gnu-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ "LD_LIBRARY_PATH": "%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib",
+ },
+ slaves = [linux64],
+ configureArgs = aseConfigArgs(),
+ ),
+ ]
+ ),
+ env("ubuntu_8.04",
+ configs=[
+ bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.5",
+ "PETSC_ARCH": "linux-gnu-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ "LD_LIBRARY_PATH": "%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib:/opt/pkg/proj-4.7.0/lib",
+ "LDFLAGS": "-L/opt/pkg/proj-4.7.0/lib"
+ },
+ slaves = [ubuntu64],
+ configureArgs = aseConfigArgs(extraASE=["--with-debugging=no",
+ "--with-ml=1",
+ "--with-cc=/home/buildbot/install/ubuntu_8.04_binbot/opt/gcc-4.5.2/bin/gcc",
+ "--with-cxx=/home/buildbot/install/ubuntu_8.04_binbot/opt/gcc-4.5.2/bin/g++",
+ "--with-fc=/home/buildbot/install/ubuntu_8.04_binbot/opt/gcc-4.5.2/bin/gfortran",
+ "--download-ml=1"]),
+ ),
+ ]
+ ),
+ env("pylith_linux_x86_64",
+ configs=[
+ bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.6",
+ "PETSC_ARCH": "pylith-linux-gnu-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ "LD_LIBRARY_PATH": "%(PREFIX)s/lib:%(HOME)s/pylith_deps/lib",
+ "LDFLAGS": "-L%(PREFIX)s/lib -L%(HOME)s/pylith_deps/lib",
+ "PYTHONPATH": "%(PREFIX)s/lib/python2.6/site-packages:%(HOME)s/pylith_deps/lib/python2.6/site-packages",
+ "PATH": "%(PREFIX)s/bin:%(HOME)s/pylith_deps/bin",
+ },
+ slaves = [ubuntu64],
+ configureArgs = aseConfigArgs(),
+ ),
+ ]
+ ),
+
+ ### Mac
+ env("darwin 10.4 single nosched",
+ defaultSlaves = [s('bot-magma', 'il6ogh4K')],
+ configs=[bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.3",
+ # "PATH": "%(HOME)s/opt/binbot/bin",
+ "PETSC_ARCH": "darwin8.11.1-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ "DYLD_LIBRARY_PATH": "%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib",
+ },
+
+ # [PETSC #16663] configure fails w/"Runaway process" on Intel Macs
+
+ # The "--useThreads=0" arg is a work-around for
+ # the above issue. Eventually 'configure.py'
+ # fails with "Runaway process exceeded time limit
+ # of 1800.0s". This always seems happen on the
+ # same preprocessing command (a <Mesh.hh> test).
+ # Matt writes: "I think the original problem has
+ # to be a Python bug with the handling of
+ # select(). I took that code directly from mpd."
+
+ # [PETSC #18387] (2008-10-08):
+ #
+ # * On the Mac, v2.3.2's configure.py leaves
+ # behind 'conftest' processes which
+ # eventually sink the machine;
+ # "--useThreads=0" is a work-around for this
+ # problem as well.
+ #
+ # * Removed "--useThreads=0" from 'dev' builds
+ # per Barry's request. But they're still in
+ # denial that PETSC #16663 is a bug in
+ # 'configure.py'.
+
+ configureArgs = aseConfigArgs(extraASE=["--with-debugging=no",
+ "--with-fortran=no",
+ "--useThreads=0"]),
+ ),
+ ]
+ ),
+ env("darwin 10.6 single nosched",
+ defaultSlaves = [s('bot-europa', 'Goo7quah')],
+ configs=[bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.f90, languages.python],
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "FC": "mpif90", "PYTHON": "python2.6",
+ # "PATH": "%(HOME)s/opt/binbot/bin",
+ "PETSC_ARCH": "darwin10.3.0-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ "DYLD_LIBRARY_PATH": "%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib",
+ },
+
+ # [PETSC #16663] configure fails w/"Runaway process" on Intel Macs
+
+ # The "--useThreads=0" arg is a work-around for
+ # the above issue. Eventually 'configure.py'
+ # fails with "Runaway process exceeded time limit
+ # of 1800.0s". This always seems happen on the
+ # same preprocessing command (a <Mesh.hh> test).
+ # Matt writes: "I think the original problem has
+ # to be a Python bug with the handling of
+ # select(). I took that code directly from mpd."
+
+ # [PETSC #18387] (2008-10-08):
+ #
+ # * On the Mac, v2.3.2's configure.py leaves
+ # behind 'conftest' processes which
+ # eventually sink the machine;
+ # "--useThreads=0" is a work-around for this
+ # problem as well.
+ #
+ # * Removed "--useThreads=0" from 'dev' builds
+ # per Barry's request. But they're still in
+ # denial that PETSC #16663 is a bug in
+ # 'configure.py'.
+
+ configureArgs = aseConfigArgs(extraASE=["--with-debugging=no",
+ "--with-ml=1",
+ "--download-ml=1",
+ "--useThreads=0"]),
+ ),
+ ]
+ ),
+ ### Windows
+ env("x86 cygwin single nosched",
+ defaultSlaves = [s('bot-tracer', 'thohNaf7')],
+ configs=[bin("binbot",
+ [languages.c, languages.cpp, languages.f77, languages.python],
+ # No 'mpif90' here, because 'gfortran' is a
+ # binary I downloaded (not a part of Cygwin), and
+ # MPICH2 rejects it because it's incompatible
+ # with the Cygwin 'g77'.
+ {"CC": "mpicc", "CXX": "mpicxx", "F77": "mpif77", "PYTHON": "python2.6",
+ "PATH": "%(HOME)s/opt/binbot/bin:%(PREFIX)s/lib:%(PREFIX)s/opt/petsc-dev/%(PETSC_ARCH)s/lib", # Windows overloads PATH and LD_LIBRARY_PATH
+ "PETSC_ARCH": "cygwin-cxx-opt", # required by petsc-dev
+ "HDF5_HOME": "%(PREFIX)s", # for cigma
+ },
+ configureArgs = aseConfigArgs(extraASE=["--with-valgrind=no"]),
+ ),
+ ]
+ ),
+ ]
+
+###############################################################################
+
+####### BOTS, STATUS, BUILDERS, SCHEDULERS
+
+from buildbot.status import html, mail
+from buildbot.categories import CategorySet
+
+config.schedulerKwds = dict(treeStableTimer = 60*60,
+ nice = range(8, 12 + 6), # no builds during office hours
+ )
+
+# this is the waterfall for all projects
+waterfall = html.Waterfall(http_port=8009, css="buildbot.css")
+config.status.append(waterfall)
+
+# project-specific waterfalls
+waterfalls = (
+ # port # project
+ # (8010, projects.CitcomS),
+ # (8011, projects.CitcomCU),
+ # (8012, projects.Ellipsis3D),
+ (8013, projects.PyLith),
+ # (8014, projects.Gale),
+ # (8015, projects.MAG),
+ # (8016, projects.cigma),
+ )
+
+for http_port, project in waterfalls:
+ project.buildbotURL = buildbotURLRoot + project.name.replace(' ', '_') + "/"
+ waterfall = html.Waterfall(http_port=http_port,
+ css="buildbot.css",
+ categories=CategorySet({'project': [project.name]}),
+ buildbotURL=project.buildbotURL,
+ projectName=project.name,
+ projectURL=project.url,
+ )
+ config.status.append(waterfall)
+
+
+config.generate()
+
+c['slavePortnum'] = 9996
+
+config.getBuildmasterConfig(c)
+
+
+# vim: syntax=python
Added: cs/buildbot/templates/master/packager.py
===================================================================
--- cs/buildbot/templates/master/packager.py (rev 0)
+++ cs/buildbot/templates/master/packager.py 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,732 @@
+
+import os, sys, platform
+from popen2 import Popen4
+from glob import glob
+from os.path import basename, dirname, isabs, isdir, isfile, join
+from buildbot.meta import Config, getNamePackageAndVersion
+
+
+class PackingList(object):
+ def __init__(self, config, opSys, python):
+ self.stripList = []
+ stripList = self.stripList
+
+ exe = ""
+ if opSys == "win":
+ exe = ".exe"
+ libglob = "bin/*%s*.dll"
+ elif opSys == "linux":
+ libglob = "lib/lib%s*.so*"
+ elif opSys == "darwin":
+ libglob = "lib/lib%s*.dylib"
+ else:
+ sys.exit("unknown OS: " + opSys)
+ self.exe = exe
+
+ self.directories = []
+ for d in config.packaging.directories:
+ self.directories.append(d)
+
+ self.programs = []
+ for p in config.packaging.programs:
+ p = "bin/" + p + exe
+ stripList.append(p)
+ self.programs.append(p)
+
+ self.scripts = []
+ for s in config.packaging.scripts:
+ s = "bin/" + s
+ self.scripts.append(s)
+
+ self.libraries = []
+ petsc = None
+ libraries = config.packaging.libraries[:]
+ if opSys == "linux":
+ libraries.extend(["stdc++", "gcc_s", "g2c",
+ "gfortran", "f77blas", "cblas", "atlas" # x86_64
+ ])
+ for l in libraries:
+ if l == "mpi":
+ l = "*mpich"
+ for p in ["mpirun", "mpiexec"]: # mpirun is evil symlink
+ p = "bin/" + p + exe
+ self.programs.append(p)
+ elif l == "petsc" or l == "petsc-dev":
+ petsc = l
+ continue
+ if opSys == "win" and l == "*mpich":
+ l = "lib/*mpich*.dll"
+ else:
+ l = libglob % l
+ libs = glob(l)
+ stripList.extend(libs)
+ self.libraries.extend(libs)
+ if petsc:
+ petsc_arch = os.environ['PETSC_ARCH']
+ petsc_arch_dir = "opt/" + petsc + "/" + petsc_arch
+ if isdir(petsc_arch_dir):
+ petsc_libglob = petsc_arch_dir + "/" + libglob
+ else:
+ # PETSc v2.3.3 and earlier
+ petsc_libglob = ("opt/" + petsc + "/" +
+ libglob.replace("/", "/" + petsc_arch + "/"))
+ l = petsc_libglob % ""
+ libs = glob(l)
+ stripList.extend(libs)
+ if opSys == "win":
+ # Install DLLs under 'bin'.
+ libs = [(dll, "bin") for dll in libs]
+ self.libraries.extend(libs)
+
+ self.misc = []
+ for f in config.packaging.files:
+ self.misc.append(f)
+ if opSys == "darwin":
+ # I couldn't get @executable_path working for Python
+ # extension modules; hence, this hack.
+ self.misc.append("setup.sh")
+ elif opSys == "linux":
+ # Brad wants this. Plus, RPATH doesn't seem to work on some systems.
+ self.misc.append("setup.sh")
+
+ self.python = []
+
+ if config.packaging.python:
+ # Unfortunately, this will include all site-packages... oh well.
+ # Note that Windows has its own logic for including Python.
+ self.directories.append("lib/" + python)
+ if opSys == "linux":
+ self.directories.append("include/" + python) # for distutils
+ l = libglob % "python"
+ libs = glob(l)
+ self.libraries.extend(libs)
+
+ else:
+ # A better way to do site-packages.
+ for p in config.packaging.python:
+ p = "lib/" + python + "/site-packages/" + p
+ # Here we use glob expansion b/c eggs make the actual
+ # directory names hard to determine.
+ entries = glob(p)
+ for e in entries:
+ if isfile(e):
+ self.misc.append(e)
+ else:
+ self.directories.append(e)
+
+ cig = [("CIG", "cig", "http://www.geodynamics.org/")]
+ self.urls = cig + tupleUp(config.packaging.urls, 3)
+
+ return
+
+
+ def addFile(self, f):
+ self.misc.append(f)
+
+ def addDirectory(self, d):
+ self.directories.append(d)
+
+
+ def files(self):
+ for f in self.programs:
+ yield f
+ for f in self.scripts:
+ yield f
+ for f in self.libraries:
+ yield f
+ for f in self.misc:
+ yield f
+ return
+
+
+ def all(self):
+ for d in self.directories:
+ yield d
+ for f in self.files():
+ yield f
+ return
+
+
+def tupleUp(l, n):
+ tuples = []
+ i = iter(l)
+ try:
+ while True:
+ t = []
+ for count in xrange(n):
+ t.append(i.next())
+ tuples.append(tuple(t))
+ except StopIteration:
+ pass
+ return tuples
+
+
+def spawn(*argv):
+ print ' '.join(argv)
+ status = os.spawnvp(os.P_WAIT, argv[0], argv)
+ if status != 0:
+ statusMsg = "%s: %s: exit %d" % (sys.argv[0], argv[0], status)
+ sys.exit(statusMsg)
+ return
+
+
+def ospawn(*argv):
+ print ' '.join(argv)
+ child = Popen4(argv)
+
+ child.tochild.close()
+
+ output = child.fromchild.readlines()
+ status = child.wait()
+
+ exitStatus = None
+ if (os.WIFSIGNALED(status)):
+ statusStr = "signal %d" % os.WTERMSIG(status)
+ elif (os.WIFEXITED(status)):
+ exitStatus = os.WEXITSTATUS(status)
+ statusStr = "exit %d" % exitStatus
+ else:
+ statusStr = "status %d" % status
+ if exitStatus != 0:
+ sys.exit("%s: %s: %s" % (sys.argv[0], argv[0], statusStr))
+
+ return output
+
+
+def cygpath(*args):
+ output = ospawn("cygpath", *args)
+ return output[0].rstrip()
+
+
+def getSVNInfo():
+ url, revision = None, "unknown"
+ output = ospawn("svn", "info")
+ for line in output:
+ values = line.split()
+ if len(values) == 2:
+ k, v = values
+ if k == "Revision:":
+ revision = "r" + v
+ elif k == "URL:":
+ url = v
+ return url, revision
+
+
+def itwindirs(l, sourceDir):
+ for src in l:
+ if isinstance(src, tuple):
+ src, dest = src
+ elif isabs(src):
+ dest = src[1:]
+ else:
+ dest = src
+ src = cygpath("-w", src)
+ if src.startswith(sourceDir):
+ src = src[len(sourceDir)+1:]
+ dest = "{app}\\" + dest.replace("/", "\\")
+ yield src, dest
+ return
+
+
+def itwinfiles(l, sourceDir):
+ for src in l:
+ if isinstance(src, tuple):
+ src, dest = src
+ elif isabs(src):
+ dest = dirname(src)[1:]
+ else:
+ dest = dirname(src)
+ src = cygpath("-w", src)
+ if src.startswith(sourceDir):
+ src = src[len(sourceDir)+1:]
+ dest = "{app}\\" + dest.replace("/", "\\")
+ yield src, dest
+ return
+
+
+def copyAll(srcList, prefix):
+ for src in srcList:
+ if isinstance(src, tuple):
+ src, dest = src
+ elif isabs(src):
+ dest = dirname(src)[1:]
+ else:
+ dest = dirname(src)
+ if not isabs(src):
+ src = join(prefix, src)
+ if not isdir(dest):
+ os.makedirs(dest)
+ os.system("cp -r %s %s" % (src, dest))
+ return
+
+
+def installCigIcon(prefix):
+ import buildbot
+ cigIco = dirname(buildbot.__file__) + "/cig.ico"
+ os.system("cp %s %s" % (cigIco, prefix))
+ return
+
+
+def generateBashrc(prefix, package, info):
+ bashrc = "." + package.lower() + "rc"
+ s = open(prefix + "/" + bashrc, "w")
+
+ stuff = {
+ "line": "-" * len(info["AppVerName"]),
+ }
+ stuff.update(info)
+
+ s.write(
+r"""
+
+export PATH=/usr/bin:/bin:/lib:$PATH
+
+echo %(line)s
+echo %(AppVerName)s
+echo %(line)s
+
+PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
+""" % stuff
+ )
+
+ return bashrc
+
+
+def minCygwin(python):
+ # Minimal set of Cygwin binaries, as determined while preparing for CFEM 2006.
+ l = [
+ "[.exe",
+ "bash.exe",
+ "cat.exe",
+ "cp.exe",
+ "cygattr-1.dll",
+ "cygiconv-2.dll",
+ "cygintl-8.dll",
+ "cygncurses-9.dll",
+ "cygpath.exe",
+ "cygreadline7.dll",
+ "cyggfortran-3.dll",
+ "cyggcc_s-1.dll",
+ "cygstdc++-6.dll",
+ # This is given special treatment.
+ "cygwin1.dll",
+ #"cygz.dll", # for HDF5 (used by Cigma)
+ "echo.exe",
+ "gunzip",
+ "gzip.exe",
+ "lib" + python + ".dll",
+ "ln.exe",
+ "ls.exe",
+ "pwd.exe",
+ "python",
+ python + ".exe",
+ "rm.exe",
+ "sed.exe",
+ "sh.exe",
+ "tar.exe",
+ "vi",
+ "vim-nox.exe",
+ "which.exe",
+ ]
+ l = ["/bin/" + b for b in l]
+ l.extend([
+ ("/lib/lapack/cygblas-0.dll", "bin"),
+ ("/lib/lapack/cyglapack-0.dll", "bin"),
+ ])
+ # Additional Python stuff.
+ l.extend([
+ "/lib/" + python,
+ "/usr/include/" + python,
+ ])
+ return l
+
+def installMungedCygwinDLL(munged):
+ # We don't require that the user has Cygwin installed. At the
+ # same time, we need to avoid conflicts if they *do* have it
+ # installed.
+
+ # Therefore, we install a munged copy of "cygwin1.dll", performing
+ # the following transformations:
+ # Cygnus Solutions -> Cigwin Solutions
+ # cygwin1S4 -> cigwin1S4
+ # These are the registry key name and the shared memory object
+ # name, respectively.
+
+ # N.B.: It is significant that the replacement string is the same
+ # length as the original string. Otherwise, the DLL would become
+ # corrupted.
+
+ # This gives us the freedom to create our own chrooted environment
+ # using Cygwin's mounts, without messing-up the Cygwin registry on
+ # systems that do have Cygwin installed. Registry clean-up at
+ # uninstall is also made easy.
+
+ # Ugly, yes; but so much easier than building a custom Cygwin from
+ # source...
+ status = os.system("""sed -b """
+ """-e "s/Cygnus Solutions/Cigwin Solutions/g" """
+ """-e s/cygwin1S4/cigwin1S4/g """
+ """/bin/cygwin1.dll > %s""" % munged)
+ if status != 0:
+ sys.exit("sed: exit %d" % status)
+ return
+
+
+def installMinimalCygwin(python, prefix):
+ cygwin = minCygwin(python)
+ copyAll(cygwin, prefix)
+ installMungedCygwinDLL("bin/cygwin1.dll")
+ return
+
+
+def rebaseDLLs(stage):
+ # Work-around "unable to remap xyz.dll to same address as parent".
+ # The base and offset were determined through trial-and-error.
+
+ print "Rebasing DLLs."
+
+ dlls = []
+
+ for dirpath, dirnames, filenames in os.walk(stage):
+ for filename in filenames:
+ if filename.endswith(".dll"):
+ dll = join(dirpath, filename)
+ print dll
+ dlls.append(dll)
+
+ if not dlls:
+ sys.exit("no DLLs found!")
+ dlls = ' '.join(dlls)
+
+ status = os.system("""rebase -b 0x50000000 -o 0x100000 %s""" % dlls)
+ if status != 0:
+ sys.exit("rebase: exit %d" % status)
+ return
+
+
+def stageWindowsInstallation(prefix, workdir, python, pl):
+
+ stage = join(workdir, "buildbot-win-stage")
+ spawn("rm", "-rf", stage)
+ os.mkdir(stage)
+ os.chdir(stage)
+
+ copyAll(pl.all(), prefix)
+
+ installMinimalCygwin(python, prefix)
+
+ rebaseDLLs(stage)
+
+ return stage
+
+
+def generateISS(workdir, sourceDir, info, pl, bashrc, python, stage=None):
+ s = open(workdir + "/buildbot.iss", "w")
+
+
+ # [Setup]
+ s.write(
+"""; Inno Setup Script generated by BuildBot
+
+[Setup]
+AppName=%(AppName)s
+AppVerName=%(AppVerName)s
+AppPublisher=Computational Infrastructure for Geodynamics
+AppPublisherURL=http://www.geodynamics.org/
+AppSupportURL=http://www.geodynamics.org/
+AppUpdatesURL=http://www.geodynamics.org/
+DefaultDirName={pf}\\%(AppName)s
+DefaultGroupName=%(AppName)s
+SourceDir=%(SourceDir)s
+
+""" % info
+ )
+
+
+ # [Tasks]
+ s.write(
+"""
+[Tasks]
+Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
+
+""")
+
+
+ # [Files]
+ # NOTE: Don't use "Flags: ignoreversion" on any shared system files
+ s.write(
+"""
+[Files]
+"""
+ )
+ if stage:
+ for pathname in os.listdir(stage):
+ if isfile(pathname):
+ s.write("""Source: "%s"; DestDir: "{app}"; Flags: ignoreversion\n""" % pathname)
+ else:
+ s.write("""Source: "%s\\*"; DestDir: "{app}\\%s"; Flags: ignoreversion recursesubdirs\n""" % (pathname, pathname))
+ else:
+ for src, dest in itwindirs(pl.directories, sourceDir):
+ s.write("""Source: "%s\\*"; DestDir: "%s"; Flags: ignoreversion recursesubdirs\n""" % (src, dest))
+ for src, dest in itwinfiles(pl.files(), sourceDir):
+ s.write("""Source: "%s"; DestDir: "%s"; Flags: ignoreversion\n""" % (src, dest))
+ for f in [bashrc, "cig.ico"]:
+ s.write("""Source: "%s"; DestDir: "{app}"; Flags: ignoreversion\n""" % f)
+
+
+ # [Dirs]
+ s.write(
+"""
+[Dirs]
+; Cygwin demands a /tmp directory
+Name: "{app}\\tmp"
+; for our /usr mounts
+Name: "{app}\\usr"
+Name: "{app}\\usr\\bin"
+Name: "{app}\\usr\\lib"
+
+"""
+ )
+
+
+ # [Registry]
+ s.write(
+"""
+[Registry]
+Root: HKLM; Subkey: "Software\\Cigwin Solutions"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; Flags: noerror; ValueType: string; ValueName: "native"; ValueData: "{app}"
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; Flags: noerror; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; Flags: noerror; ValueType: string; ValueName: "native"; ValueData: "{app}\\bin"
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; Flags: noerror; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; Flags: uninsdeletekey noerror
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; Flags: noerror; ValueType: string; ValueName: "native"; ValueData: "{app}\\lib"
+Root: HKLM; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; Flags: noerror; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+; for non-admin install
+Root: HKCU; Subkey: "Software\\Cigwin Solutions"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; ValueType: string; ValueName: "native"; ValueData: "{app}"
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/"; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; ValueType: string; ValueName: "native"; ValueData: "{app}\\bin"
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/bin"; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; Flags: uninsdeletekey
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; ValueType: string; ValueName: "native"; ValueData: "{app}\\lib"
+Root: HKCU; Subkey: "Software\\Cigwin Solutions\\Cygwin\\mounts v2\\/usr/lib"; ValueType: dword; ValueName: "flags"; ValueData: "00000002"
+
+"""
+ )
+
+
+ # [INI]
+ s.write("""[INI]\n""")
+ for name, filename, url in pl.urls:
+ s.write("""Filename: "{app}\\%(filename)s.url"; Section: "InternetShortcut"; Key: "URL"; String: "%(url)s"\n""" %
+ {'filename': filename, 'url': url})
+
+
+ # [Icons]
+ s.write(
+"""
+[Icons]
+Name: "{group}\\%(AppName)s"; Filename: "{app}\\bin\\bash.exe"; Parameters: "--init-file %(bashrc)s -i"; WorkingDir: "{app}"; IconFilename: "{app}\\cig.ico"
+Name: "{userdesktop}\\%(AppName)s"; Filename: "{app}\\bin\\bash.exe"; Tasks: desktopicon; Parameters: "--init-file %(bashrc)s -i"; WorkingDir: "{app}"; IconFilename: "{app}\\cig.ico"
+""" % {'AppName': info['AppName'], 'bashrc': bashrc}
+ )
+ for name, filename, url in pl.urls:
+ s.write("""Name: "{group}\\%s"; Filename: "{app}\\%s.url"\n""" % (name, filename))
+ s.write("""Name: "{group}\Uninstall %(AppName)s"; Filename: "{uninstallexe}"\n""" % info)
+
+
+ # [Run]
+ s.write(
+"""
+[Run]
+Filename: "{app}\\bin\\bash.exe"; Description: "Launch %(AppName)s"; Parameters: "--init-file %(bashrc)s -i"; WorkingDir: "{app}"; Flags: nowait postinstall skipifsilent
+
+""" % {'AppName': info['AppName'], 'bashrc': bashrc}
+ )
+
+
+ # [UninstallDelete]
+ s.write("""[UninstallDelete]\n""")
+ for name, filename, url in pl.urls:
+ s.write("""Type: files; Name: "{app}\%s.url"\n""" % filename)
+ for filename in [".bash_history"]:
+ s.write("""Type: files; Name: "{app}\%s"\n""" % filename)
+
+ s.write("\n; end of file\n")
+
+ return
+
+
+def createWindowsInstaller(python, stage, workdir, name, package, version, pl,
+ installer):
+
+ sourceDir = cygpath("-w", stage)
+
+ info = {
+ "AppName": name,
+ "AppVerName": name + " v" + version,
+ "SourceDir": sourceDir,
+ }
+
+ installCigIcon(stage)
+ bashrc = generateBashrc(stage, package, info)
+
+ generateISS(workdir, sourceDir, info, pl, bashrc, python, stage)
+
+ os.chdir(workdir)
+
+ os.system("unix2dos buildbot.iss")
+
+ status = os.system("iscc buildbot.iss")
+ if status != 0:
+ sys.exit("iscc: exit %d" % status)
+
+ status = os.system("mv %s/Output/setup.exe %s.exe" % (stage, installer))
+ if status != 0:
+ sys.exit("mv: exit %d" % status)
+
+ return
+
+
+def stripBinaries(pl, opSys):
+ strip = "strip"
+ if opSys == "darwin":
+ # Just plain "strip" renders our Python interpreter unusable
+ # by extension modules.
+ strip = "strip -S"
+ status = os.system(strip + " " + " ".join(pl.stripList))
+ if status != 0:
+ sys.exit("strip: exit %d" % status)
+ return
+
+
+def rewriteScripts(pl, prefix, opSys):
+ # Tweak the shebang line of scripts so they are relative instead
+ # of absolute.
+
+ if opSys == "win":
+ # chrooted environment
+ relative = "#!/bin/%s"
+ else:
+ relative = "#!/usr/bin/env %s"
+ absolute = "#!" + prefix + "/bin/"
+
+ for script in pl.scripts:
+ s = open(script, "r")
+ lines = s.readlines()
+ s.close()
+ shebang = lines[0]
+ if shebang.startswith(absolute):
+ interpreter = shebang[len(absolute):]
+ shebang = relative % interpreter
+ s = open(script, "w")
+ s.write(shebang)
+ for line in lines[1:]:
+ s.write(line)
+ s.close()
+
+ return
+
+
+def installSource(pl, package, revision, url, workdir):
+ src = "src/" + package
+ spawn("rm", "-rf", src)
+ if not isdir("src"):
+ os.makedirs("src")
+ if False:
+ # This takes too long over a slow connection (the very reason
+ # we use 'copy' mode for the SourceStep).
+ spawn("svn", "export", "-" + revision, url, src)
+ elif False:
+ # This includes junk in .svn directories.
+ spawn("cp", "-r", workdir + "/../source", src)
+ else:
+ # This is just right.
+ spawn("svn", "export", workdir + "/../source", src)
+ pl.addDirectory(src)
+ return
+
+
+def mkpkg():
+ buildnumber = int(sys.argv[1])
+
+ # WithProperties simply doesn't work in this case.
+ if False:
+ revision = sys.argv[2]
+ if revision:
+ revision = "r" + revision
+ else:
+ revision = "forced"
+
+ url, revision = getSVNInfo()
+ opSys = platform.system().lower()
+ if opSys.startswith("cygwin"):
+ opSys = "win"
+ arch = opSys + "-" + (platform.processor() or platform.machine()) # Why does every last detail have to be painful?
+ tag = "%s-b%04d" % (revision, buildnumber)
+ python = os.environ['PYTHON']
+ prefix = os.environ['PREFIX']
+ name, package, version = getNamePackageAndVersion()
+ distdir = package + "-" + version
+ print "tag:", tag
+ print "python:", python
+ print "prefix:", prefix
+ print "distdir:", distdir
+
+ config = Config.readConfigFromSubversionProp()
+ if config.packaging is None:
+ sys.exit('no packaging configuation; try "svn propedit buildbot:config ."')
+
+ if opSys == "linux":
+ # We only need one of these; do it on Linux only.
+ archive = distdir + ".tar.gz"
+ taggedArchive = tag + "-" + archive
+ status = os.system("make dist")
+ if status != 0:
+ sys.exit("make: exit %d" % status)
+ os.system("mv " + archive + " " + taggedArchive)
+
+ workdir = os.getcwd()
+ os.chdir(prefix)
+
+ pl = PackingList(config, opSys, python)
+
+ stripBinaries(pl, opSys)
+ rewriteScripts(pl, prefix, opSys)
+ if url:
+ installSource(pl, package, revision, url, workdir)
+
+ distdir_arch = distdir + "-" + arch
+ if opSys == "darwin" or opSys == "linux":
+ # No .dmg on Mac for now.
+ os.chdir(workdir)
+ os.system("rm " + distdir_arch)
+ os.system("ln -s " + prefix + " " + distdir_arch)
+ packingList = [distdir_arch + "/" + m for m in pl.all()]
+ archive = distdir_arch + ".tar.gz"
+ taggedArchive = tag + "-" + archive
+ status = os.system("tar cvzf " + archive + " " + " ".join(packingList))
+ if status != 0:
+ sys.exit("tar: exit %d" % status)
+
+ os.system("mv " + archive + " " + taggedArchive)
+ elif opSys == "win":
+ stage = stageWindowsInstallation(prefix, workdir, python, pl)
+ createWindowsInstaller(python, stage, workdir, name, package, version, pl,
+ tag + "-" + distdir_arch)
+ else:
+ sys.exit("unknown OS: " + opSys)
+
+ return
+
+
+if __name__ == "__main__":
+ mkpkg()
Added: cs/buildbot/templates/master/windows.py
===================================================================
--- cs/buildbot/templates/master/windows.py (rev 0)
+++ cs/buildbot/templates/master/windows.py 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+
+
+import os, sys
+from popen2 import Popen4
+
+
+def spawn(*argv):
+ print ' '.join(argv)
+ status = os.spawnvp(os.P_WAIT, argv[0], argv)
+ if status != 0:
+ statusMsg = "%s: %s: exit %d" % (sys.argv[0], argv[0], status)
+ sys.exit(statusMsg)
+ return
+
+
+def ospawn(*argv):
+ print ' '.join(argv)
+ child = Popen4(argv)
+
+ child.tochild.close()
+
+ output = child.fromchild.readlines()
+ status = child.wait()
+
+ exitStatus = None
+ if (os.WIFSIGNALED(status)):
+ statusStr = "signal %d" % os.WTERMSIG(status)
+ elif (os.WIFEXITED(status)):
+ exitStatus = os.WEXITSTATUS(status)
+ statusStr = "exit %d" % exitStatus
+ else:
+ statusStr = "status %d" % status
+ if exitStatus != 0:
+ sys.exit("%s: %s: %s" % (sys.argv[0], argv[0], statusStr))
+
+ return output
+
+
+def mkpetscdlls():
+ cxx = os.environ['CXX']
+ petsc_dir = os.getcwd()
+ petsc_arch = os.environ['PETSC_ARCH']
+ petsc_lib = petsc_dir + "/" + petsc_arch + "/lib"
+ petsc_bin = petsc_dir + "/" + petsc_arch + "/bin"
+
+ chaco = "chaco"
+ ml = "ml"
+
+ if os.path.isdir(petsc_lib):
+ os.chdir(petsc_lib)
+ else:
+ # PETSc v2.3.3 and earlier
+
+ petsc_lib = petsc_dir + "/lib/" + petsc_arch
+ os.chdir(petsc_lib)
+ chaco = ("../../externalpackages/Chaco-2.2/" + petsc_arch + "/lib/", chaco)
+ if not os.path.isdir(chaco[0]):
+ # Configured w/o Chaco.
+ chaco = None
+
+ # This doesn't exist -- I'm making it up, for consistency.
+ petsc_bin = petsc_dir + "/bin/" + petsc_arch
+ if not os.path.isdir(petsc_bin):
+ os.makedirs(petsc_bin)
+
+ # from PETSC_LIBS:
+ # -lpetscts -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc
+ # -lchaco -llapack -lblas -ldl
+ # -lmpich -lfrtbegin -lg2c
+ # -lcygwin -luser32 -ladvapi32 -lshell32 -lmpichcxx -lstdc++ -lgdi32 -luser32 -ladvapi32 -lkernel32 -ldl
+
+ # libs, in order
+ libs = ["petsc"]
+ if chaco:
+ libs.append(chaco)
+ if ml:
+ libs.append(ml)
+ deps = ["-llapack", "-lblas", "-lgdi32", "-lgfortran"]
+
+ while libs:
+ directory = ""
+ l = libs.pop()
+ if isinstance(l, tuple):
+ directory, l = l
+ archive = directory + "lib" + l + ".a"
+ dll = petsc_bin + "/" + l + ".dll"
+ implib = "lib" + l + ".dll.a"
+
+ output = ospawn("ar", "xv", archive)
+ objs = [line.split()[2] for line in output]
+
+ # NYI: assumes GCC
+ link = [cxx, "-shared", "-o", dll, "-Wl,--out-implib," + implib, "-L."] + objs + deps
+ spawn(*link)
+
+ spawn("rm", *objs)
+
+ deps.insert(0, "-l" + l)
+
+ return
+
+
+if __name__ == "__main__":
+ mkpetscdlls()
Added: cs/buildbot/templates/slave/buildbot.tac
===================================================================
--- cs/buildbot/templates/slave/buildbot.tac (rev 0)
+++ cs/buildbot/templates/slave/buildbot.tac 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1,18 @@
+
+from twisted.application import service
+from buildbot.slave.bot import BuildSlave
+
+basedir = r'/home/buildbot/slave'
+host = 'www.geodynamics.org'
+port = 9996
+slavename = 'io-ubuntu-linux64'
+passwd = 'quah6Oci'
+keepalive = 600
+usepty = 1
+umask = None
+
+application = service.Application('buildslave')
+s = BuildSlave(host, port, slavename, passwd, basedir, keepalive, usepty,
+ umask=umask)
+s.setServiceParent(application)
+
Added: cs/buildbot/templates/slave/crontab
===================================================================
--- cs/buildbot/templates/slave/crontab (rev 0)
+++ cs/buildbot/templates/slave/crontab 2011-03-01 20:42:00 UTC (rev 17997)
@@ -0,0 +1 @@
+ at reboot export PYTHONPATH=/home/buildbot/buildbot/lib/python:/home/buildbot/buildbot/lib/python2.6/site-packages; cd ~/slave; /home/buildbot/bin/buildbot start ~/slave
More information about the CIG-COMMITS
mailing list