Bug 3575

Summary: Improve hob client communication with bitbake backend via xmlrpc
Product: [Build System, Metadata & Runtime] Toaster Reporter: Jessica <jessica.zhang>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: alexandru.damian, andreea.b.proca, belen.barros.pena, cristian.iorga, mihai.lindner, poky.bs.watcher, poky.watcher, richard.purdie, valentin.popa
Version: unspecified   
Target Milestone: 1.5 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 3211, 4648, 4649    

Description Jessica 2012-12-12 18:33:48 UTC

    
Comment 1 Bogdan Marinescu 2013-01-17 09:46:34 UTC
Do we want to have this feature for bitbake too or only for hob? In other words, should "bitbake" be usable like this:

$ bitbake --server server:port -t xmlrpc <target>

or is this feature applicable to Hob only ?
Comment 2 Richard Purdie 2013-01-18 12:56:40 UTC
There is no good reason knotty shouldn't work with a remote server over xmlrpc?
Comment 3 Bogdan Marinescu 2013-01-22 13:06:39 UTC
(In reply to comment #2)
> There is no good reason knotty shouldn't work with a remote server over
> xmlrpc?

There are a few that I've found. The main problem comes from the fact that the server is initialized like this:

    server = server.BitBakeServer()
    if configuration.bind:
        server.initServer((configuration.bind, 0))
    else:
        server.initServer()

    idle = server.getServerIdleCB()

    cooker = bb.cooker.BBCooker(configuration, idle, initialenv)
    cooker.parseCommandLine()

    server.addcooker(cooker)
    server.saveConnectionDetails()
    server.detach()

As you can see, parseCommandLine is called when the server is initialized. If we switch to client/server model, the command line on the client side won't be taken into account, since it's not ever parsed. Fortunately, this is fairly easy to fix (by moving the command line parsing on the client side).
The real problem, which is related to the one above, comes from dealing with conf/local.conf. This is parsed early in the cooker (loadConfigurationData) and again, the cooker is "linked" with the server and initialized at server creation time. Even if we add a "reparseConfigurationData" method to the cooker, if the client 'bitbake' is started from a different build directory, we need access to that build's directory conf/ files. Hob works differently in this respect, since the user sets the required configuration data in the interface and then Hob calls setVariable on the server, thus setting the proper configuration. Of course, this can be done with knotty or any other user interface too, but it definitely needs some work and should probably be the subject of another bug.
Comment 4 Bogdan Marinescu 2013-01-22 13:08:06 UTC
I've uploaded my changes for this bug to the contrib/bogdanm/b3575 branch. Please review them. I'd like to have a review before uploading the patches, as I expect some comments on the implementation.
Comment 5 Alexandru Damian 2013-06-13 16:32:26 UTC
Patches are posted on the mail list and waiting integration.
Comment 6 Mihai Lindner 2013-07-10 07:42:54 UTC
Upon resolving this bug, we would expect some references to changes that address this bug, or to some documentation that could shed some light on what we're actually looking for. Thanks.
Comment 7 Alexandru Damian 2013-07-10 08:29:00 UTC
please use

bitbake --server-only -t xmlrpc -B localhost:8200 

bitbake --remote-server localhost:8200 -t xmlrpc  [command]

to run commands on the remote server

the server can be on the same machine or on different machines
Comment 8 Andreea Brandusa Proca 2013-07-10 10:30:21 UTC
Verified.