summaryrefslogtreecommitdiff
path: root/morphlib
Commit message (Collapse)AuthorAgeFilesLines
* Fix confusing messagebaserock/ps/message-fixPaul Sherwood2014-10-271-1/+1
|
* build: Resolve the ref being built in the user's local definitions.gitSam Thursfield2014-10-243-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Most usefully, this patch means that Morph no longer updates its cached copy of definitions.git every time you run `morph build`. Also, it prevents confusion in the following situation. Imagine I have run: morph checkout baserock:baserock/definitions master I then wait a while, during which time someone pushes to 'master' in the definitions.git repo that I cloned from. Now I run: cd master morph build systems/whatever.morph Which commit does it build, the local head of 'master' or the remote head of 'master'? The answer, both before and after this patch, is that it builds the local version of master. But previously, this only happened because of the magic that we have to detect local changes. With this patch, the local change detection could be disabled and `morph build` would still build what the user had checked out as 'master' locally, not whatever 'master' pointed to in the remote repo.
* build: Allow passing in the name of the original ref to create_source_pool()Sam Thursfield2014-10-242-7/+15
| | | | | This means that we can force the building of a specific commit without losing the original branch name in the metadata of the resulting system.
* build: Restructure how BuildCommand.build() is calledSam Thursfield2014-10-242-15/+19
| | | | | | | | | Rather than take a list of triplets to build, the BuildCommand.build() function now takes a single repo/ref/morph triplet. Iterating through multiple sets of triplets is now done in the build plugin. There are a couple of cosmetic changes to the status output at the start and end of a build as a result.
* Merge branch 'baserock/richardmaw/parallelism-improvements'Richard Maw2014-10-243-11/+23
|\ | | | | | | | | | | | | | | This stripped out the commit from the patch series on the mailing list to remove /dev/shm. Reviewed-by: Sam Thursfield Reviewed-by: Daniel Silverstone
| * stagingarea: Mount proc and ccache inside the namespaceRichard Maw2014-10-242-10/+18
| | | | | | | | | | | | | | | | | | | | | | This works towards allowing multiple concurrent builds in the same system, which has the same problem as deployments. This is the easy bit, since linux-user-chroot has support for bind mounts and /proc mounts. We also need to get rid of the /dev/shm mount to be able to build in parallel though.
| * deploy extensions: Don't crash if someone builds at the same timeRichard Maw2014-10-241-1/+3
|/ | | | | | | | | | | | | | If a build happens, it creates a new network namespace, and if this happens while you have a disk image mounted, then you can't remove the mount-point, because the other namespace is using it. We can avoid the other namespace keeping this mount-point open by creating the disk image in a private mount namespace, so it never sees it. The nicest way to do this is to have every extension run in a private mount namespace, since you'd have to have extensions re-exec themselves, since the appropriate system calls aren't exposed very well.
* Run system-integrations in a namespaceRichard Maw2014-10-241-23/+53
| | | | | | | | | | | | | | | All temporary mounts should be done inside a namespace, so that they don't interfere with other namespaces. system-integrations may need capabilities that regular builds don't have, so they're chrooted, rather than linux-user-chrooted, which means it's more complicated to do namespaces. In the absence of a better command for it, we can do this with an in-lined shell script. This also stops us using the run-parts inside the system, and executes the integrations directly.
* Fix synopsis of `morph edit` commandSam Thursfield2014-10-221-1/+1
| | | | | Previously it was incorrect in the `morph help` output and in Morph's man page.
* Give clearer error when the same 'name' is used by two strataSam Thursfield2014-10-161-5/+4
|
* Don't print the ref of each stratum in the buildSam Thursfield2014-10-161-3/+0
| | | | | | | There's no need because all strata live in the same Git repository now. This message was added back when there could be multiple versions of strata coming from different repos or different refs in the same repo and life was very confusing.
* Merge branch 'baserock/richardipsum/arfix'Richard Maw2014-10-131-74/+51
|\ | | | | | | | | | | Reviewed-by: Richard Maw Reviewed-by: Richard Ipsum Reviewed-by: Sam Thursfield
| * Simplify _resolve_system_artifactsRichard Ipsum2014-10-101-12/+4
| |
| * Replace resolver queue with loopRichard Ipsum2014-10-101-62/+57
| | | | | | | | | | | | Since we're no longer adding anything to the queue we can replace it with a loop. This patch also splits the code up a little bit.
| * Remove queueingRichard Maw2014-10-101-16/+6
| | | | | | | | | | | | | | Artifact resolution is no longer recursive, so there's no need to requeue sources, removing this queue provides a significant speed up. Fixing an issue where artifact resoltuion was taking too long on some systems (several minutes in some cases).
* | Remove out of date commentRichard Ipsum2014-10-101-3/+0
| |
* | Merge branch 'sam/fix-list-artifacts'Sam Thursfield2014-10-101-6/+7
|\ \ | | | | | | | | | | | | | | | Reviewed-By: Adam Coldrick <adam.coldrick@codethink.co.uk> Reviewed-By: Richard Ipsum <richard.ipsum@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
| * | Fix the `morph list-artifacts` commandSam Thursfield2014-10-101-6/+7
| |/ | | | | | | It was broken by the per-source building changes.
* | Merge branch 'baserock/richardmaw/fix-ssh-rsync-destroying-versions'Richard Maw2014-10-101-77/+105
|\ \ | |/ |/| | | | | | | Reviewed-by: Sam Thursfield Reviewed-by: Jim MacArthur Reviewed-by: Richard Ipsum
| * ssh-rsync: Don't delete version if it existsRichard Maw2014-10-101-77/+105
|/ | | | | | | | | | | | | | | | A quirk in the resource cleanup code meant that if you gave the same version label when deploying a new version, then it would fail, then remove the old version, as it had assumed that it was the one to create those directories. This patch fixes this issue by making short context managers for all the resource allocation, so cleanup is done by walking up the context managers, so only the mount and the temporary directory need to be cleaned up if the `mkdir "$VERSION_ROOT"` fails. I've tested this with a deploy of a version that doesn't already exist, and the version I'm currently running, so I can conclusively say it's fixed that problem.
* Merge remote-tracking branch 'origin/baserock/ps/log-chunk-build-times'Richard Maw2014-10-091-0/+8
|\ | | | | | | | | Reviewed-by: Pedro Alvarez Reviewed-by: Richard Maw
| * Log elapsed time for each chunk buildbaserock/ps/log-chunk-build-timesPaul Sherwood2014-09-271-0/+7
| |
* | Update artifact resolver and ckc testsRichard Ipsum2014-10-092-9/+9
| | | | | | | | | | | | The original resolve_artifacts method is essentially unchanged, it's just private now. This means that aside from this name change the tests remain the same.
* | Tidy up artifact resolvingRichard Ipsum2014-10-092-34/+24
| | | | | | | | | | | | | | | | This patch started off as an attempt to address the comment in find_root_artifacts, though this patch doesn't impose an ordering on the list of artifacts as the comment suggested. The artifact resolver now returns a list of root artifacts which may make it easier to add multi-system builds to morph.
* | Merge branch 'sam/handle-missing-version-label'Sam Thursfield2014-10-082-2/+7
|\ \ | | | | | | | | | | | | Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk> Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
| * | deploy: Make ssh-rsync upgrade extension handle unset VERSION_LABELSam Thursfield2014-10-082-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It now gives an error message. Previously it would fail with a backtrace like this: 2014-10-08 09:51:37 [systems/genivi-baseline-system-armv7lhf-jetson.morph][self]Removing temporary mounts Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cliapp/app.py", line 190, in _run self.process_args(args) File "/src/morph/morphlib/exts/ssh-rsync.write", line 54, in process_args self.upgrade_remote_system(location, temp_root) File "/src/morph/morphlib/exts/ssh-rsync.write", line 107, in upgrade_remote_system location, ['btrfs', 'subvolume', 'delete', orig_dir]) UnboundLocalError: local variable 'orig_dir' referenced before assignment
* | | Merge branch 'baserock/richardmaw/fix-distbuild-v3'Richard Maw2014-10-085-107/+38
|\ \ \ | |/ / |/| | | | | | | | | | | Reviewed-by: Sam Thursfield Reviewed-by: Richard Ipsum Reviewed-by: Pedro Alvarez
| * | Allow distbuilds to choose where to put logsRichard Maw2014-10-081-0/+5
| | |
| * | Fix issues with distbuild caused by moving to building per-sourceRichard Maw2014-10-082-3/+5
| | |
| * | Allow ephemeral ports for distbuild servicesRichard Maw2014-10-021-1/+1
| | |
| * | distbuild: allow daemons to bind to ephemeral portsRichard Maw2014-10-011-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can bind to an ephemeral port by passing 0 as the port number. To work out which port you actually got, you need to call getsockname(). To facilitate being able to spawn multiple copies of the daemons for testing environments, you can pass a -file option, which will make the daemon write which port it actually bound to. If this path is a fifo, reading from it in the spawner process will allow synchronisation of only spawning services that require that port to be ready after it is.
| * | Allow default split rules to be overridden in-codeRichard Maw2014-10-011-4/+4
| | | | | | | | | | | | | | | | | | This is needed for distbuild to deserialise based on the split rules on the node that did the graph calculation, rather than the node that does the building.
| * | Remove overlap detection logicRichard Maw2014-10-012-96/+0
| | | | | | | | | | | | | | | | | | | | | I've rarely needed to use it, and on those rare occasions, it would have been easy enough to calculate it. Let's get rid of this step, and save everyone some time in future.
| * | Remove run-in-artifact subcommandRichard Maw2014-10-011-1/+1
| | | | | | | | | | | | It's easy enough to deploy the image.
* | | Merge branch 'sam/gbo-read-access'Sam Thursfield2014-10-071-2/+13
|\ \ \ | | | | | | | | | | | | | | | | Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk> Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
| * | | Never require SSH access to the Trove where baserock: content is hostedSam Thursfield2014-10-071-2/+13
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if the user included 'baserock' in their list of trove-ids, the keyed URL expansions in the repo-alias field would change such that reading from git.baserock.org required SSH access. This isn't good and in particular breaks Mason, which by default isn't set up with a Gitano account on the Trove that it reads from, and therefore doesn't have SSH access to that Trove. With this change, the trove-id field will not cause the default 'baserock:' and 'upstream:' prefixes to be overridden, so setting 'trove-id = baserock' in morph.conf will not Morph's behaviour to change.
* | | xfer-hole: Fix bug in copy_slice_from_file.Lars Wirzenius2014-10-021-2/+8
| | | | | | | | | | | | | | | os.read is limited to an int in size. copy_slice_from_file was trying to os.read more than that causing an OverflowError.
* | | ssh-rsync: gett UUID of the disk before writing fstabPedro Alvarez2014-10-011-2/+5
| |/ |/| | | | | | | | | | | | | | | With this patch, the fstab of the system to be deployed as an upgrade will be conifgured using the UUID of the disk. Now when doing an upgrade is not needed to specify the ROOT_DEVICE.
* | Fix behaviour of `morph --version`Pedro Alvarez2014-09-301-2/+4
|/ | | | | | | | | | | | | | | | Currently, if morph is installed in the system, `morph --version` prints the sha1 of the version installed. $ morph --version e8adedb8f3f27d9212caf277b8e8f7c6792a20c2 If you run morph from git, the output will be something similar to the following. $ morph --version baserock-14.26-124-g7b73af4 This patch changes the behaviour of the latter to match the former.
* Safely interpolate in environment variable reportingRichard Maw2014-09-241-2/+2
| | | | | | | | | The msg parameter to status is a format string. If we pass a string directly to it, then we have to be careful to escape any formatting characters. However, we can just do the interpolation directly in the status call instead, which is less code.
* Add no cover to morphology hash functionRichard Ipsum2014-09-231-1/+1
|
* Merge branch 'baserock/richardmaw-os/tidy-build-logic-v7'Richard Maw2014-09-2227-938/+686
|\ | | | | | | | | | | Reviewed-by: Lars Wirzenius (+2 to misc fixups) Reviewed-by: Sam Thursfield (+1 to per-source building) Reviewed-by: Paul Sherwood (+1 to per-source building)
| * Remove Artifact compatibility methodsRichard Maw2014-09-193-40/+7
| |
| * Remove get_dependency_prefix_setRichard Maw2014-09-191-14/+0
| | | | | | | | | | | | | | | | This was used by artifacts to tell what they should put in their path, based on what prefixes were used earlier. This implementation didn't handle recursive deps, and it was trivial to open-code it at the call-site, so it is no longer useful.
| * Fix show-dependencies plugin to use source deps.Richard Maw2014-09-191-2/+2
| |
| * FIXUP: Fix unit tests after changing to per-source buildsRichard Maw2014-09-195-90/+28
| |
| * Build per-source rather than per-artifactRichard Maw2014-09-196-297/+314
| |
| * FIXUP: Add compatibility methods to Artifact for fields that moved to SourceRichard Maw2014-09-192-2/+36
| | | | | | | | | | This means we can avoid having to rewrite everything immediately after the fields moved.
| * Move dependencies and cache keys to SourcesRichard Maw2014-09-192-22/+23
| |
| * FIXUP: Fix up unit tests from change allowing multiple sourcesRichard Maw2014-09-199-276/+114
| | | | | | | | | | This is logically part of the previous patch, but has been split out to ease reviewing.