summaryrefslogtreecommitdiff
path: root/morphlib/buildworker.py
Commit message (Collapse)AuthorAgeFilesLines
* Do not pass cmdline options to workers if their value is None.Jannis Pohlmann2012-02-101-0/+2
|
* Properly unpack dependencies into the staging area in build-single.Jannis Pohlmann2012-01-311-9/+60
| | | | | | | | | | | | This requires build-single to take a dependency context tuple when building chunks of a stratum. This context tuple is the surrounding stratum which is used to construct the dependency graph in the worker and then do a breadth-first search to collect all dependencies that need to be added to the staging area. Implementing this required a few hash/eq changes in Blob, Morphology and Treeish as well as a few adjustments in the corresponding unit tests.
* Only force TTY when using sudo. It seems to corrupt the standard output.Jannis Pohlmann2012-01-261-2/+3
|
* Add a "build-single" command to build a blob without its dependencies.Jannis Pohlmann2012-01-261-3/+3
| | | | | ...while at the same time making sure that all dependencies are marked for staging prior to building the blob itself.
* Add sudo functionality to LocalBuildWorker. Doesn't work though.Jannis Pohlmann2012-01-261-2/+6
|
* Run remote sudo morph commands in a login shell.Jannis Pohlmann2012-01-261-5/+9
| | | | This allows worker machines to be configured via ~/.bash_profile.
* Add poor checks for the output and error properties.Jannis Pohlmann2012-01-251-2/+2
|
* Add poor man's unit tests for controller and workers.Jannis Pohlmann2012-01-251-11/+11
|
* Add temporary code to convert settings to cmdline options for workers.Jannis Pohlmann2012-01-241-2/+68
| | | | | | This functionality would ideally be implemented in cliapp.Settings, as it needs access to internals of that class. However, I'll drop it here for now.
* Report build errors in workers back to the controller.Jannis Pohlmann2012-01-241-15/+38
| | | | | | Also, distinguish between running "sudo" and "fakeroot" depending on whether or not a remote worker builds a system image. For some reason, sudo in SSH does not seem to work here, so we need to figure that out.
* Share functionality in BuildWorker, implement SSH, add name/ident concept.Jannis Pohlmann2012-01-241-30/+57
| | | | | | | | | | | | | All BuildWorker subclasses are likely to make use of the multiprocessing library anyway, so most of the functionality can be shared. All workers now have an ident (e.g. "user@hostname" or "local") which is used by the BuildController to generate enumerated names for them (e.g. "user@hostname-1", "user@hostname-2" or "local-1" and "local-2"), which makes it easier to identify who does what. The RemoteBuildWorker now runs "ssh HOSTNAME fakeroot morph" for building stuff remotely.
* Add controller, worker classes and a new "build-distributed" command.Jannis Pohlmann2012-01-231-0/+99
This commit introduces four new classes: BuildController: * takes an app instance and a tempdir * allows to add BuildWorker objects * provides a build() method that takes a set of blobs and a build order that is then built by assigning work to the build workers as needed * the build() method takes care of polling the workers for their state, moving them between busy and idle states reliably, collect and print their output in a non-confusing order, and makes sure to wait for all workers to finish before processing the next group in the build order. * at this point, when waiting for one or more workers to become idle to assign them another blob to build, the controller always picks the worker that has been idling for the longest period of time. this can be changed later. BuildWorker: * base class for all worker classes * takes a name and an app instance * has a idle_since datetime property * provides a build() method that takes a Blob object and builds it in whatever way the subclasses implement it * provides a check_complete(timeout) method that checks whether the worker has finished building the blob yet or not LocalBuildWorker: * worker class for local builds that don't go through SSH * it uses morphlib.execute.Execute to run morph in a child process in build() * at the moment, this class executes "./morph" instead of "morph" as it assumes the user to run morph from its source tree. obviously, this will have to be fixed later. RemoteBuildWorker: * doesn't implement anything yet, will be used for distributing work to other machines running morph via SSH Notes: * At the moment, there is a degree of undesired redundancy when building a stratum in a worker, as this will cause the worker to rebuild all its dependencies. This will have to be fixed as it is avoidable and wastes a lot of time and processing power.