~launchpad-pqm/launchpad/devel

10134.1.21 by Aaron Bentley
Cleanup, add test script.
1
# Copyright 2009, 2010 Canonical Ltd.  This software is licensed under the
8687.15.8 by Karl Fogel
Add the copyright header block to more files.
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
4
# Buildd Slave implementation
1264 by Canonical.com Patch Queue Manager
Bob the builder! (initial buildd slave implementation)
5
# XXX: dsilvers: 2005/01/21: Currently everything logged in the slave gets
6
# passed through to the twistd log too. this could get dangerous/big
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
7
8
from twisted.application import service, strports
10134.2.1 by William Grant
Factor the binary package building stuff out of DebianBuildManager.
9
from canonical.buildd import XMLRPCBuildDSlave
10
from canonical.buildd.binarypackage import BinaryPackageBuildManager
10134.3.1 by William Grant
Add and register skeleton SourcePackageRecipeBuildManager.
11
from canonical.buildd.sourcepackagerecipe import (
12
    SourcePackageRecipeBuildManager)
12126.5.4 by Curtis Hovey
Hush lint. Removed test for bad data...the was fixed.
13
from canonical.buildd.translationtemplates import (
14
    TranslationTemplatesBuildManager)
11765.1.1 by Robert Collins
Split out the launchpad-buildd needed component from tachandler.py.
15
from canonical.launchpad.daemons import readyservice
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
16
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
17
from twisted.web import server, resource, static
18
from ConfigParser import SafeConfigParser
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
19
20
import os
21
1311 by Canonical.com Patch Queue Manager
Move buildd master to new scripts dir, and buildd slave to new daemons dir
22
conffile = os.environ.get('BUILDD_SLAVE_CONFIG', 'buildd-slave-example.conf')
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
23
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
24
conf = SafeConfigParser()
25
conf.read(conffile)
26
slave = XMLRPCBuildDSlave(conf)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
27
10134.2.2 by William Grant
'debian' is now an alias for 'binarypackage', the new name for BinaryPackageBuildManager.
28
# 'debian' is the old name. It remains here for compatibility.
29
slave.registerBuilder(BinaryPackageBuildManager, "debian")
30
slave.registerBuilder(BinaryPackageBuildManager, "binarypackage")
10134.3.1 by William Grant
Add and register skeleton SourcePackageRecipeBuildManager.
31
slave.registerBuilder(SourcePackageRecipeBuildManager, "sourcepackagerecipe")
12126.5.4 by Curtis Hovey
Hush lint. Removed test for bad data...the was fixed.
32
slave.registerBuilder(
33
    TranslationTemplatesBuildManager, 'translation-templates')
1264 by Canonical.com Patch Queue Manager
Bob the builder! (initial buildd slave implementation)
34
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
35
application = service.Application('BuildDSlave')
36
builddslaveService = service.IServiceCollection(application)
37
2240 by Canonical.com Patch Queue Manager
My librarian-cleanups branch, held up by baz confusion. r=BjornT
38
# Service that announces when the daemon is ready
11765.1.1 by Robert Collins
Split out the launchpad-buildd needed component from tachandler.py.
39
readyservice.ReadyService().setServiceParent(builddslaveService)
2240 by Canonical.com Patch Queue Manager
My librarian-cleanups branch, held up by baz confusion. r=BjornT
40
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
41
root = resource.Resource()
2606 by Canonical.com Patch Queue Manager
Build Daemon protocol rework. r=spiv
42
root.putChild('rpc', slave)
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
43
root.putChild('filecache', static.File(conf.get('slave', 'filecache')))
44
slavesite = server.Site(root)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
45
12126.5.4 by Curtis Hovey
Hush lint. Removed test for bad data...the was fixed.
46
strports.service(slave.slave._config.get("slave","bindport"),
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
47
                 slavesite).setServiceParent(builddslaveService)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
48
49
# You can interact with a running slave like this:
1311 by Canonical.com Patch Queue Manager
Move buildd master to new scripts dir, and buildd slave to new daemons dir
50
# (assuming the slave is on localhost:8221)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
51
#
52
# python
53
# import xmlrpclib
10134.1.18 by Aaron Bentley
Get buildd able to start building
54
# s = xmlrpclib.ServerProxy("http://localhost:8221/rpc")
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
55
# s.echo("Hello World")