summaryrefslogtreecommitdiff
path: root/morph
Commit message (Collapse)AuthorAgeFilesLines
* Refactor SystemBuilder and add helper classLars Wirzenius2012-03-021-6/+8
| | | | | | | | The helper class, Factory, has unit tests, which is why it's currently separate. It may later get integrated with BlobBuilder, or the other way around. Classes that don't have unit tests are marked out of coverage.
* Remove further remnants of cmd_build* returning valuesLars Wirzenius2012-02-281-5/+3
|
* Simplify iterating over build triplets from the command lineLars Wirzenius2012-02-281-24/+15
|
* Remove unused return values from cmd_build*Lars Wirzenius2012-02-281-6/+0
|
* Clarify --keep-path help: it's not just for tests anymoreLars Wirzenius2012-02-281-2/+1
|
* Clarify --tempdir help to explain why it's different from setting $TMPDIRLars Wirzenius2012-02-281-1/+6
|
* Use Tempdir.remove instead of rm, and drop unused Tempdir.clearLars Wirzenius2012-02-281-9/+3
| | | | | | | | If the remove method is insufficient (because it gets run as non-root, but some of the stuff needs root to remove them), then we need to fix the method, not replace it with other things. The Tempdir.clear method was not used anywhere, so YAGNI and removed it.
* Remove version numberLars Wirzenius2012-02-281-1/+1
| | | | | | We don't do releases, so having the version number in the source is misleading. If and when we start doing numbered releases, it's easy to add back. However, YAGNI and all that.
* Set sensible defaults for git-base-url, bundle-server, cachedir, max-jobsLars Wirzenius2012-02-281-6/+21
| | | | | | | | | | | | | | Also, change builder.py to always obey the --max-jobs setting, unless a morphology has a max-jobs field. The defaults have been chosen so that they work for everyone equally well. It may be useful to have a local mirror and then set the options to point there, but it's not reasonable to try to guess such things, so the defaults can be adapated to that. Collect the defaults into one place so they're easier to overview. The cliapp interface for adding settings is verbose enough that the defaults were getting buried.
* Add version number to morphLars Wirzenius2012-02-271-1/+1
|
* Add docstring to the update-gits subcommandLars Wirzenius2012-02-271-0/+8
|
* Clarify that --ignore-submodules applies to git submodulesLars Wirzenius2012-02-271-2/+2
|
* Remove outdated warningLars Wirzenius2012-02-271-3/+0
|
* Remove the system testing subcommands and related codeLars Wirzenius2012-02-271-61/+0
| | | | | | | | This we a proof-of-concept, and we want to explore various options of how to do this, so let's not keep the code in morph. The code also has no tests, so it is already likely to have bit-rotted. If we decide we want to, we can always resurrect it from git history.
* Add --no-git-update setting to morphLars Wirzenius2012-02-171-3/+11
|
* Build non-bootstrap chunks inside a staging chrootLars Wirzenius2012-02-161-8/+26
| | | | | | This adds options --staging-filler and --staging-chroot. The wisdom of these options needs to be re-considered at some point, but for now they're OK.
* Revert "Add --prefix option, adjust autotools system and env variables."Jannis Pohlmann2012-02-141-4/+0
| | | | This reverts commit 63cab3e0e2f550a0bfe470d018063a8b91a759bd.
* Add --prefix option, adjust autotools system and env variables.Jannis Pohlmann2012-02-111-0/+4
|
* Use $TMPDIR for --tempdir by default, rather than hard-coding /tmp.Jannis Pohlmann2012-02-101-2/+2
|
* Add --tempdir option, allow to set the tempdir for building.Jannis Pohlmann2012-02-101-3/+6
| | | | | | This will not affect or overwrite TMPDIR, so all other parts of morph and Python (like the multiprocessing library) will still use TMPDIR (e.g. /tmp) for temporary files and directories.
* Don't enable --ignore-submodules by default, cannot disable it this way.Jannis Pohlmann2012-02-091-2/+1
|
* Add --ignore-submodules flag to avoid updating/unpacking submodules.Jannis Pohlmann2012-02-091-0/+4
|
* Extract chunk submodule repos into the build directory directly.Jannis Pohlmann2012-02-081-0/+21
| | | | | | | | | | | | | This change requires the latest version of cliapp to be installed. Rather than creating an archive from the cached git repositories, moving this tarball archive into the cache and then extracting it from there into the build directory, we now directly extract the sources into the build directory. We also recursively extract all submodules into the corresponding paths inside the build directory. (Recursing has not been tested yet, however.)
* Document all morph sub-commands.Jannis Pohlmann2012-02-011-1/+41
|
* Properly unpack dependencies into the staging area in build-single.Jannis Pohlmann2012-01-311-6/+39
| | | | | | | | | | | | 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.
* Fix "morph update-gits" to update all dependency repos properly.Jannis Pohlmann2012-01-301-10/+4
| | | | | | Computing the cache ID will not update all dependencies, just some of them (e.g. the chunk repos a stratum morph needs). Resolving the dependency graph, however, will update everything.
* Add a "build-single" command to build a blob without its dependencies.Jannis Pohlmann2012-01-261-0/+36
| | | | | ...while at the same time making sure that all dependencies are marked for staging prior to building the blob itself.
* Share functionality in BuildWorker, implement SSH, add name/ident concept.Jannis Pohlmann2012-01-241-6/+10
| | | | | | | | | | | | | 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-8/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Bump copyright years, get rid of long lines and unused imports.Jannis Pohlmann2012-01-231-1/+0
|
* Port everything to using Treeish objects instead of (repo, ref).Jannis Pohlmann2012-01-201-27/+34
| | | | | | | | | | | This affects pretty much every part of morph, so this might not be fully working and stable yet. This commit also introduces the "update-gits" command that can be used to update all cached repositories from the list of base URLs. The tree walk when resolving the Treeish objects in Builder.get_cache_id() is a bit similar to what we do in BuildDependencyGraph, maybe we can merge that one day.
* Convert git-base-url setting to a list. Add bundle-server setting.Rob Taylor2012-01-191-1/+4
|
* Apply code review changes and fix a bug when clearing dependencies.Jannis Pohlmann2012-01-191-1/+0
|
* Initial work on integrate the build order work into builder.Jannis Pohlmann2012-01-191-17/+33
|
* Introduce the "show-dependencies" command and BuildDependencyGraph.Jannis Pohlmann2012-01-161-0/+41
| | | | | | | | The "show-dependencies" command takes a series of build tuples and dumps the resulting dependency graph (including strata and chunks at the moment) to the standard output. It also dumps the resulting build order which is a list of groups. These groups indicate which chunks and strata can be built in parallel and are not dependent on each other.
* stop morph from using fakeroot and sudoLars Wirzenius2012-01-111-2/+2
| | | | | | | | | | | | | Instead, assume the whole build will be run, by the user, under fakeroot or sudo (the latter for system image builds). This allows us to run all non-system-image-build tests without root access at all. We now always create the cache directory, if missing, even if we're running as root. We no longer run ldconfig if ld.so.conf is missing. It is missing during our tests, but is (now) created by fhs-dirs for real builds.
* implement test subcommand properlyLars Wirzenius2011-12-121-2/+12
|
* make a test subcommand that builds and gets the morph, image filenameLars Wirzenius2011-12-121-1/+14
|
* Merge branch 'richardmaw/login'Richard Maw2011-12-121-1/+3
|\
| * Make the install parts of morphs run as sudoRichard Maw2011-12-081-1/+3
| | | | | | | | | | | | | | | | Then fix all the places where this broke things because they didn't have the required permissions. This is a potential security risk of course, it would be preferable if the install commands were run in a fakeroot session and only the final image building was run as root, but it needs to work first
* | add a "morph test" commandLars Wirzenius2011-12-091-0/+50
|/
* Merge remote-tracking branch 'quarry/liw/distcc-support'Lars Wirzenius2011-12-061-0/+1
|\
| * add --no-distcc option to disable distccLars Wirzenius2011-12-061-0/+1
| |
* | give Builder class the cliapp.Application as argumentLars Wirzenius2011-12-061-1/+1
|/ | | | | This is simpler than giving each separate little thing we need from there.
* create cachedir at startup if it does not existLars Wirzenius2011-12-011-0/+3
| | | | | | | We don't create it if running as root, since that would mean a typo creates a directory in a place that may be awkward. Anyone running builds as root can go create the directory themselves.
* Add morph --bootstrap optionLars Wirzenius2011-11-171-0/+4
|
* Flush stdout after progress messagesLars Wirzenius2011-11-151-0/+1
|
* Clean up the environmentLars Wirzenius2011-11-031-0/+3
|
* Always get all morphologies from gitLars Wirzenius2011-11-021-7/+12
| | | | | Previously, we've been able to get morphs for strata and systems directly from files, with uncommitted changes. No more.
* Refactor builder.py for correctness and clarityLars Wirzenius2011-11-021-5/+1
| | | | | It now uses a systematic approach for building needed components, and for decided when something has already been built.