summaryrefslogtreecommitdiff
path: root/distbuild/initiator_connection.py
Commit message (Collapse)AuthorAgeFilesLines
* distbuild: When a build finishes, say which worker it was built onSam Thursfield2015-10-071-1/+2
| | | | Change-Id: I493fced8cf2664283923f6f41097ca991d3fc3de
* Use protocol to validate incoming requestsRichard Ipsum2015-05-191-19/+27
| | | | Change-Id: I16680439b131e63d30eeff91814a1af643af6246
* Disable logging of build output by defaultRichard Ipsum2015-05-181-3/+6
| | | | | | Logging build output makes the controller logs difficult to read. Change-Id: I5b81ff9359ada969e964328eb1c2624ab6b9375a
* distbuild: Handle errors from socketSam Thursfield2015-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | We found a distbuild controller stuck in a busy loop, with the logs full of the same error message repeated: ... _flush(): Exception 'IOError: [Errno 32] Broken pipe' from sock.write() We suspect this came about because the initiator disconnected without sending an EOF. The initiator was in a VM on a laptop so it seems possible that the host OS turned off the wireless adaptor without giving the VM a chance to close its connections gracefully. The busy loop is because nothing in the SocketBuffer class handles the SocketError events queued by the _flush() method. Unhandled events are ignored. So the SocketBuffer stays in 'w' state without ever shifting any data and never returns. Adding transitions to handle the SocketError event will fix the problem. If a socket error happens now in the same scenario, it will be handled as if the initiator disconnected. Change-Id: I0f6834f7186a01ca2bc74aef899a4cccbc891e51
* Protocol check fixRichard Ipsum2015-05-131-2/+2
| | | | | | | This patch fixes an error where we can end up calling int(None) when we try to send an error response for a malformed message. Change-Id: Id3ee3298cfb6a5cb32e35fdc5916dab1e4c87a03
* Remove % from debug statementRichard Ipsum2015-05-121-1/+1
| | | | Change-Id: I674c39149aad82c07c85d2db3207280b91dfa292
* Add a common func for handling build terminationRichard Ipsum2015-05-121-20/+11
| | | | Change-Id: I95fbfcb2ed6a8ffdd946d36eacc030b4ae1b9b21
* Add GraphProgress messagesRichard Ipsum2015-05-121-0/+34
| | | | | | | Adds distinct message types to give us more flexibility over message handling now that we have multiple initiator types with different requirements. Change-Id: Ib2af8736b83d66ef20a8e37591ca68c9441b6497
* distbuild: Fix initiator hanging when protocol errors occurSam Thursfield2015-05-071-19/+34
| | | | | | | | | | | | | | | | | | | | | If the initiator sends an invalid build-request message, it will now exit with the following sort of error: ERROR: Failed to build baserock:baserock/definitions f2d78e9b7221bca65cba53af3f3b50d50d90628f systems/build-system-x86_64.morph: Invalid build-request message. Check you are using a supported version of Morph. This distbuild network uses protocol version 2. Previously, the controller would log an error to its log file, but it would not send any response to the initiator so the initiator would hang forever. Behaviour is the same as before for the case where the initiator sends a build-request message with the wrong protocol version: the initiator will exit with an error message. Change-Id: I94fdee02bc701d4a679a0261b3c46dbdf14cfcaf
* distbuild: Add distbuild status commandLauren Perry2015-04-291-8/+26
| | | | | | | | | Adds a command to get the status of all recently ran distbuilds for a given server (e.g. Running, Finished, Failed, Cancelled), so as to tell if a build running via distbuild-start has finished or otherwise exited without going through the server's log files Change-Id: I5ce9fe54ae7b1bd8fe3e0d629f615042be8827ed
* distbuild: Add distbuild start and cancel functionalityLauren Perry2015-04-291-0/+48
| | | | | | | | | | | Add command for distbuild-start to build_plugin in morphlib, and create a boolean parameter to inform the initiator whether to disconnect the controller and leave the build running remotely. Add distbuild-cancel command to parse currently-running distbuild build-request IDs and cancel the one matching the given argument Change-Id: I458a5767bb768ceb2b4d8876adf1c86075d452bd
* distbuild: Add protocol version checking for list-jobs commandLauren Perry2015-04-291-12/+16
| | | | | | | | | | | | | | | Currently, the distbuild-list-jobs command will fail if morph is outdated (i.e. protocol version for client and distbuild network don't match); a protocol_version field has been added to the list-jobs request message to fix this. Moved version check outside build-request message to reduce duplication in new functions. Generalised the list-request output to reduce duplication for any further additions that may require a message output. Change-Id: I28e733cbfe8c89e8c11427df5d40ab275abd313c
* distbuild: Add distbuild-list-jobs functionLauren Perry2015-04-171-20/+44
| | | | | | | | | | Add InitiatorListJobs class and list-jobs message template, add distbuild-list-jobs to morph commandlist, send running job information back to initiator, split out handling of build request and list-jobs messages to separate functions and change generating a random integer to UUID for message identification Change-Id: Id02604f2c1201dbc10f6bbd7f501b8ce1ce0deae
* Use the modern way of the GPL copyright header: URL instead real addressJavier Jardón2015-03-161-2/+1
| | | | Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
* Fix how the morph protocol version error message is displayedLauren Perry2015-03-111-2/+2
|
* Merge branch 'sam/distbuild-build-logs'Sam Thursfield2015-03-111-23/+1
|\ | | | | | | | | Reviewed-By: Adam Coldrick <adam.coldrick@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
| * distbuild: Remove the build-steps messageSam Thursfield2015-02-181-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This message was hundreds of kilobytes in size, as it contained a recursive list of dependencies for each artifact in the build graph. It was used in the initiator only to print this message: Build steps in total: 592 This message is now gone. The 'Need to build %d artifacts' build-progress message now indicates the total build steps instead: Need to build 300 artifacts, of 592 total This is a compatible change to the distbuild protocol: old initiators will continue to work as normal with new controllers that don't send the build-steps message.
| * Update copyright yearsSam Thursfield2015-02-181-1/+1
| |
* | Add protocol versioning for distbuild systemsLauren Perry2015-02-251-0/+12
| |
* | Update copyright yearsLauren Perry2015-02-091-1/+1
| |
* | Fix distbuild controller crashing on some invalid inputsLauren Perry2015-02-091-9/+13
|/
* Fix issues with distbuild caused by moving to building per-sourceRichard Maw2014-10-081-1/+1
|
* Fix copyright years of distbuild code.Sam Thursfield2014-09-111-1/+1
|
* Fix all distbuild code to be GPLv2 licensed.Sam Thursfield2014-09-101-1/+1
|
* InitiatorConnection: Handle _step_already_startedRichard Ipsum2014-04-231-1/+21
|
* Fix lines longer than 80 characters (my fault)Sam Thursfield2014-04-141-1/+2
|
* distbuild: Make some transitions more specificSam Thursfield2014-04-141-1/+1
| | | | | | There is always one BuildController object per InitiatorConnection. By coupling the objects slightly closer we can simplify some transitions in BuildController.
* distbuild: Clarify InitiatorConnection docstringSam Thursfield2014-04-141-3/+6
|
* distbuild: Label state machine transition tablesSam Thursfield2014-04-141-0/+1
| | | | Makes it easier to see what they mean at a glance.
* distbuild: Log IPs of initiators and workers in more placesSam Thursfield2014-04-101-26/+23
| | | | This makes tracking multiple builds through one log file a bit easier.
* distbuild: Improve logging of connections and objectsSam Thursfield2014-04-101-0/+4
| | | | | | | | | | New DistbuildSocket class that wraps socket.socket(), providing a descriptive repr() handler showing where the socket is connected, and providing a couple of helper methods for fetching local and remote endpoint names. This commit also adds a descriptive repr() handler to a few other objects (mostly giving socket connection details).
* Add the distbuild libsRichard Ipsum2014-03-211-0/+216