| | 10 | Most remote calls are asynchronous. |
| | 11 | |
| | 12 | '''Initial Interaction''': |
| | 13 | |
| | 14 | Authentication: Currently the slave authenticates with the Twisted Cred (newcred) mechanism, using the username and password supplied to buildslave create-slave. |
| | 15 | |
| | 16 | After that the master requests information about the slave, via the remote methods {{{ remote_getSlaveInfo}}}, {{{ remote_getVersion}}}, and {{{ remote_getCommands}}}. |
| | 17 | |
| | 18 | The SlaveInfo currently consists of the contents of the slave's info/ directory.[[BR}} |
| | 19 | This 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. |
| | 27 | These methods do not take any arguments. |
| | 28 | |
| | 29 | Next 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. |
| | 30 | This method can be called later as well. |
| | 31 | |
| | 32 | Then 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 | |
| | 36 | The twisted event loop, or reactor, then waits for external triggers, such as Build. |
| | 37 | |
| | 38 | On receiving the Build trigger, the master then runs commands on the {{{SlaveBuilder}}}. |
| | 39 | For documentation on commands see : [http://buildbot.net/buildbot/docs/latest/developer/cls-remotecommands.html#remotecommands Remote Commands][[BR]] |
| | 40 | For each of the commands, [[BR]] |
| | 41 | The command is started with {{{remote_startCommand}}}. This takes {{{stepref}}}, {{{stepId}}}, {{{command}}}, {{{args}}} as arguments.[[BR]] |
| | 42 | The command can be interrupted via an external trigger, which calls {{{remote_interruptCommand}}}. This method takes {{{stepID}}} and a reason {{{why}}} as arguments. |
| | 43 | |
| | 44 | The 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 | |
| | 46 | At the end of a command, the completion of the command is indicated by calling {{{remote_complete}}}, with failures as optional arguments. |
| | 47 | |
| | 48 | The 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 | |
| | 52 | The proposed protocol is message-based rather than RPC based. |
| | 53 | The protocol would be versioned. The initially planned changes are shown below. [[Image(ProposedSequenceDiagram.png)]] |
| | 54 | |