Ticket #293 (new enhancement)

Opened 22 months ago

Last modified 8 months ago

AMF webstatus

Reported by: thijs Owned by:
Priority: major Milestone: 0.8.+
Version: 0.7.7 Keywords:
Cc:

Description

The Adobe Flash Player is the main application that uses the  Action Message Format for communication between the client/server. AMF implementations are available for PHP, Java, .NET, Ruby and also Python with the  PyAMF project. It would be nice to query the buildbot status from a Flash Player clients through AMF RPC calls and I created a new webstatus page Download, based on the existing xmlrpc version. The only dependency this webstatus page has is PyAMF, and PyAMF can be used without additional dependencies on Python 2.5 (older versions require some extra packages, see the  install page for more info.

To enable this page, put the amf.py module in your buildmaster root folder (or make it available on the PYTHONPATH) and add the following lines to your master.cfg:

from buildbot.status import html
from amf import AMFServer
	
public = html.WebStatus(http_port="tcp:12344:interface=127.0.0.1", allowForce=False)
public.putChild('amf', AMFServer())

Attachments

amf.py Download (9.7 KB) - added by thijs 8 months ago.
buildbot.status.web.amf

Change History

Changed 22 months ago by thijs

I'm also working on a sample application, I'll update the ticket when it's completed, see  this page for progress.

Changed 22 months ago by thijs

  • type changed from defect to enhancement

Changed 13 months ago by dustin

  • milestone changed from undecided to 0.7.+

Please do post the app here when it's completed -- I think this would be a neat status plugin. I don't really know what flash source looks like -- how maintainable do you expect this to be?

Changed 8 months ago by thijs

Here's a Python client for this AMF webstatus to demonstrate it's working:

import logging


logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s %(levelname)-5.5s %(message)s'
)


def amf_client(url):
    from pyamf.remoting.client import RemotingService
    
    client = RemotingService(url, logger=logging)
    service = client.getService('buildbot')
    
    return service


if __name__ == "__main__":
    import sys
    import os.path
    import optparse

    usage = """usage: %s [options]""" % os.path.basename(sys.argv[0])
    parser = optparse.OptionParser(usage=usage)
    parser.add_option("-p", "--port", default=8010,
        dest="port", help="port number [default: %default]")
    parser.add_option("--host", default="localhost",
        dest="host", help="host address [default: %default]")
    (options, args) = parser.parse_args()

    url = "http://%s:%s/amf" % (options.host, int(options.port))
    client = amf_client(url)
    
    # get list of builder names
    builders = client.getAllBuilders()

    logging.info("Total builders: %d" % len(builders))

    if len(builders) > 0:
        logging.info("Builder status:")
        for builder in builders:
            # get builder status
            status = client.getStatus(builder)
            logging.info("\t%-20s%s" % (builder, status))

For our buildbot farm that reports:

2009-07-18 20:04:16,578 INFO  Connecting to http://localhost:8010/amf
2009-07-18 20:04:16,669 INFO  Total builders: 14
2009-07-18 20:04:16,670 INFO  Builder status:
2009-07-18 20:04:16,772 INFO  	ubuntu-py23         success
2009-07-18 20:04:16,885 INFO  	ubuntu-py24         success
2009-07-18 20:04:16,979 INFO  	ubuntu-py25         success
2009-07-18 20:04:17,078 INFO  	ubuntu-py26         success
2009-07-18 20:04:17,182 INFO  	x86-macosx-py25     failure
2009-07-18 20:04:17,286 INFO  	winxp32-py24        failure
2009-07-18 20:04:17,397 INFO  	winxp32-py25        failure
2009-07-18 20:04:17,496 INFO  	winxp32-py26        failure
2009-07-18 20:04:17,587 INFO  	google-appengine    success
2009-07-18 20:04:17,693 INFO  	debian64-py23       success
2009-07-18 20:04:17,795 INFO  	debian64-py24       success
2009-07-18 20:04:17,894 INFO  	debian64-py25       success
2009-07-18 20:04:17,994 INFO  	debian64-py26       success
2009-07-18 20:04:18,090 INFO  	jython25            failure

You'll need  PyAMF 0.5 (in trunk atm) for this and call a buildbot that has the AMF webstatus enabled as described above.

Changed 8 months ago by thijs

I also created a ticket for a JSON webstatus, and it seems to me that they will look very similar to this AMF webstatus and XML-RPC webstatus module. So it would be good write some base code to make it easier to add RPC-based web statuses?

Changed 8 months ago by dustin

Yes, that would be good :)

Changed 8 months ago by thijs

If this amf.py Download is included in buildbot/status/web then enabling it is as simple as:

# default config is:
# from buildbot.status import html
# c['status'].append(html.WebStatus(http_port=8010,allowForce=True))

from buildbot.status import html
from buildbot.status.web.amf import AMFServer

public = html.WebStatus(http_port=8010, allowForce=True)
public.putChild('amf', AMFServer())
c['status'].append(public)

I initially wanted to recreate a waterfall view in Flash using this AMF webstatus but I think I'll keep it simple like the Python client above and simple show a datagrid containing the status of each builder. Once that is done I'll post a link here and hopefully you guys can add this new webstatus to buildbot. PyAMF started in october 2007 and the API this webstatus is using hasn't changed since early 2008 so it should be maintainable imo.

Changed 8 months ago by thijs

buildbot.status.web.amf

Note: See TracTickets for help on using tickets.