New version of mock working (I think)
Michael_E_Brown at Dell.com
Michael_E_Brown at Dell.com
Mon Jun 26 19:20:42 UTC 2006
> -----Original Message-----
> From: fedora-buildsys-list-bounces at redhat.com
> [mailto:fedora-buildsys-list-bounces at redhat.com] On Behalf Of
> Clark Williams
> Sent: Monday, June 26, 2006 1:52 PM
> To: Discussion of Fedora build system
> Subject: Re: New version of mock working (I think)
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Michael_E_Brown at Dell.com wrote:
> >> Does it really have to be a server? Could it be a push
> rather than a
> >> poll? Mock could make xml-rpc calls to whatever wraps around it.
> > Just catching up on weekend traffic here. XMLRPC is a great idea. I
> > have implemented several xmlrpc servers in the past, and this is an
> > idea that could work out well. Given the nature of mock, it would
> > probably be best if it made calls into plague, rather than
> the other
> > way around, but it wouldn't be _too_ much overhead to have a server
> > that could be polled for status.
> > I have mock hacking on my todo list for this week, so after
> I finish
> > catching up with list traffic and get the latest prototype
> > and building, I'll take a look at this.
> Ugh. I get the feeling that this is a case of "Oooo shiny!".
> What benefit is it to mock to add either client or server RPC
> capabilities so that someone can determine mock's state? Are
> we talking about communicating something besides a string?
> XML-RPC works GREAT as a marshaling/unmarshaling mechanism to
> describe complex data structures. In this case however we're
> talking about telling someone that we're in the "prep" state,
> or in the "cache_unpack" state.
> If there is a wealth of information that we're not making
> available to the outside world (i.e. distributed build
> systems) then yeah, lets set up a series of remote procedure
> calls and publish them; I'll gladly work on client/server
> code in the mock codebase if it's justified. But if we're
> only changing state and not allowing the outside world to
> interact with us to change our behavior while building, then
> let's keep it simple.
It is simple, we can do an xmlrpc client in about 7 lines of code and
add it to the status() function. Here are all the lines that I can think
to add that would fully enable this:
config["status_server"] = None
parser.add_option("--statusserver", action="store", type="string",
default=None, help="server to contact for status info.")
if options.status_server is not None: config["status_server"] =
server = xmlrpclib.Server(config["status_server"])
A server would probably take another 10-20 lines of code.
An additional argument could probably be made for shared mem or a named
pipe, but I havent coded those, so I don't know. As for simplicity,
another file descriptor pre-opened by plague, or a named pipe passed via
command line would probably be "simpler", but probably not in terms of
lines of code.
More information about the buildsys