Changes between Version 2 and Version 3 of MasterSlaveCommunication


Ignore:
Timestamp:
05/31/12 09:47:39 (12 months ago)
Author:
sa1
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MasterSlaveCommunication

    v2 v3  
    1 There is a new message-based protocol under development. This will replace the Twisted Perspective-Broker based protocol. 
     1There is a new message-based protocol under development. This will replace the Twisted Perspective-Broker based RPC protocol. 
     2= Current Protocol = 
    23For the current API, 
    34See: [http://buildbot.net/buildbot/docs/latest/developer/master-slave.html Master-Slave API] 
    45 
    5 The developed protocol will be similar to the current API, but with incremental improvements. 
    6 The current sequence diagram, if represented as messages, looks similar to this:  
     6The current protocol sequence diagram, if represented as messages, looks similar to this:  
    77 
    88[[Image(SequenceDiagram.png)]] 
    99 
     10Most remote calls are asynchronous. 
     11 
     12'''Initial Interaction''': 
     13 
     14Authentication: Currently the slave authenticates with the Twisted Cred (newcred) mechanism, using the username and password supplied to buildslave create-slave. 
     15 
     16After that the master requests information about the slave, via the remote methods {{{ remote_getSlaveInfo}}}, {{{ remote_getVersion}}}, and {{{ remote_getCommands}}}.  
     17 
     18The SlaveInfo currently consists of the contents of the slave's info/ directory.[[BR}} 
     19This also contains the keys[[BR]] 
     20{{{environ}}}: copy of the slaves environment[[BR]] 
     21{{{system}}}: OS the slave is running (extracted from pythons os.name)[[BR]] 
     22{{{basedir}}}:base directory where slave is running[[BR]] 
     23 
     24 
     25{{{remote_getVersion}}} returns the version of slave. 
     26{{{remote_getCommands}}} returns the list of (name, version) for all commands the slave recognizes. 
     27These methods do not take any arguments. 
     28 
     29Next the master sets the builder list via {{{remote_setBuilderList}}}. This method, given a list of builders and their build directories, ensures that those builders, and only those builders, are running. It returns a set of {{{SlaveBuilder}}} objects. 
     30This method can be called later as well.  
     31 
     32Then the master sets itself as master for each {{{SlaveBuilder}}} via remote_setMaster. This returns a reference to the master-side {{{SlaveBuilder}}}. 
     33 
     34'''Reactor Loop''':  
     35 
     36The twisted event loop, or reactor, then waits for external triggers, such as Build.  
     37 
     38On receiving the Build trigger, the master then runs commands on the {{{SlaveBuilder}}}. 
     39For documentation on commands see : [http://buildbot.net/buildbot/docs/latest/developer/cls-remotecommands.html#remotecommands Remote Commands][[BR]] 
     40For each of the commands, [[BR]] 
     41The command is started with {{{remote_startCommand}}}. This takes {{{stepref}}}, {{{stepId}}}, {{{command}}}, {{{args}}} as arguments.[[BR]] 
     42The command can be interrupted via an external trigger, which calls {{{remote_interruptCommand}}}. This method takes {{{stepID}}} and a reason {{{why}}} as arguments. 
     43 
     44The running command provides [http://buildbot.net/buildbot/docs/latest/developer/master-slave.html#updates Updates], sent as arguments to {{{remote_update}}} from the {{{SlaveBuilder}}} to the master, during execution. 
     45 
     46At the end of a command, the completion of the command is indicated by calling {{{remote_complete}}}, with failures as optional arguments. 
     47 
     48The master and slave(in versions greater than 0.8.3) can initiate the shutdown of a slave. The master can call {{{remote_shutdown}}} to shut down the slave, while the slave can also request for a graceful shutdown. 
     49 
     50= Proposed Protocol = 
     51 
     52The proposed protocol is message-based rather than RPC based. 
     53The protocol would be versioned. The initially planned changes are shown below. [[Image(ProposedSequenceDiagram.png)]] 
     54 
    1055Changes will include reducing the number of roundtrips, support for several masters, a busy-signal from the slave, protocol versioning and other improvements.