~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/buildd/buildd-slave.tac

  • Committer: mbp at canonical
  • Date: 2011-11-20 23:37:23 UTC
  • mto: This revision was merged to the branch mainline in revision 14344.
  • Revision ID: mbp@canonical.com-20111120233723-370p96db2crru5tm
Delete canonical.buildd again

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
 
# GNU Affero General Public License version 3 (see the file LICENSE).
3
 
 
4
 
# CAUTION: The only modules in the Launchpad tree that this is permitted to
5
 
# depend on are canonical.buildd, since buildds are deployed by copying that
6
 
# directory only. (See also bug=800295.)
7
 
 
8
 
# Buildd Slave implementation
9
 
# XXX: dsilvers: 2005/01/21: Currently everything logged in the slave gets
10
 
# passed through to the twistd log too. this could get dangerous/big
11
 
 
12
 
from twisted.application import service, strports
13
 
from canonical.buildd import XMLRPCBuildDSlave
14
 
from canonical.buildd.binarypackage import BinaryPackageBuildManager
15
 
from canonical.buildd.sourcepackagerecipe import (
16
 
    SourcePackageRecipeBuildManager)
17
 
from canonical.buildd.translationtemplates import (
18
 
    TranslationTemplatesBuildManager)
19
 
 
20
 
from twisted.web import server, resource, static
21
 
from ConfigParser import SafeConfigParser
22
 
 
23
 
import os
24
 
 
25
 
conffile = os.environ.get('BUILDD_SLAVE_CONFIG', 'buildd-slave-example.conf')
26
 
 
27
 
conf = SafeConfigParser()
28
 
conf.read(conffile)
29
 
slave = XMLRPCBuildDSlave(conf)
30
 
 
31
 
# 'debian' is the old name. It remains here for compatibility.
32
 
slave.registerBuilder(BinaryPackageBuildManager, "debian")
33
 
slave.registerBuilder(BinaryPackageBuildManager, "binarypackage")
34
 
slave.registerBuilder(SourcePackageRecipeBuildManager, "sourcepackagerecipe")
35
 
slave.registerBuilder(
36
 
    TranslationTemplatesBuildManager, 'translation-templates')
37
 
 
38
 
application = service.Application('BuildDSlave')
39
 
builddslaveService = service.IServiceCollection(application)
40
 
 
41
 
root = resource.Resource()
42
 
root.putChild('rpc', slave)
43
 
root.putChild('filecache', static.File(conf.get('slave', 'filecache')))
44
 
slavesite = server.Site(root)
45
 
 
46
 
strports.service(slave.slave._config.get("slave","bindport"),
47
 
                 slavesite).setServiceParent(builddslaveService)
48
 
 
49
 
# You can interact with a running slave like this:
50
 
# (assuming the slave is on localhost:8221)
51
 
#
52
 
# python
53
 
# import xmlrpclib
54
 
# s = xmlrpclib.ServerProxy("http://localhost:8221/rpc")
55
 
# s.echo("Hello World")