~launchpad-pqm/launchpad/devel

8687.15.8 by Karl Fogel
Add the copyright header block to more files.
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
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
# Author: Daniel Silverstone <daniel.silverstone@canonical.com>
5
6
# Buildd Slave implementation
1264 by Canonical.com Patch Queue Manager
Bob the builder! (initial buildd slave implementation)
7
# XXX: dsilvers: 2005/01/21: Currently everything logged in the slave gets
8
# 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
9
10
from twisted.application import service, strports
1264 by Canonical.com Patch Queue Manager
Bob the builder! (initial buildd slave implementation)
11
from canonical.buildd import XMLRPCBuildDSlave, DebianBuildManager
2240 by Canonical.com Patch Queue Manager
My librarian-cleanups branch, held up by baz confusion. r=BjornT
12
from canonical.launchpad.daemons import tachandler
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
13
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
14
from twisted.web import server, resource, static
15
from ConfigParser import SafeConfigParser
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
16
17
import os
18
1311 by Canonical.com Patch Queue Manager
Move buildd master to new scripts dir, and buildd slave to new daemons dir
19
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
20
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
21
conf = SafeConfigParser()
22
conf.read(conffile)
23
slave = XMLRPCBuildDSlave(conf)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
24
1264 by Canonical.com Patch Queue Manager
Bob the builder! (initial buildd slave implementation)
25
slave.registerBuilder(DebianBuildManager,"debian")
26
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
27
application = service.Application('BuildDSlave')
28
builddslaveService = service.IServiceCollection(application)
29
2240 by Canonical.com Patch Queue Manager
My librarian-cleanups branch, held up by baz confusion. r=BjornT
30
# Service that announces when the daemon is ready
31
tachandler.ReadyService().setServiceParent(builddslaveService)
32
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
33
root = resource.Resource()
2606 by Canonical.com Patch Queue Manager
Build Daemon protocol rework. r=spiv
34
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
35
root.putChild('filecache', static.File(conf.get('slave', 'filecache')))
36
slavesite = server.Site(root)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
37
2556 by Canonical.com Patch Queue Manager
Add /filecache/ to build slave, rev protocol to 2, rev package to v9. r=stevea
38
strports.service(slave.slave._config.get("slave","bindport"), 
39
                 slavesite).setServiceParent(builddslaveService)
1193 by Canonical.com Patch Queue Manager
Merge in the buildd stuff so I can start a 2005 archive
40
41
# 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
42
# (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
43
#
44
# python
45
# import xmlrpclib
46
# s = xmlrpclib.Server("http://localhost:8221/")
47
# s.echo("Hello World")