summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* yarns: Test building and deployment of a system with a chunk in definitionsbaserock/adamcoldrick/load-chunks-from-definitionsAdam Coldrick2014-07-043-0/+67
|
* unittests: Test that paths in the morph field of chunks workAdam Coldrick2014-07-046-32/+96
| | | | | | | This commit adds a test to check that having a filepath in the morph field of a chunk spec works as expected. It also fixes the tests to work with a separate morphology repository and source repository in Source objects.
* Adapt traverse_morphs to be able to load chunk morphologies from definitionsAdam Coldrick2014-07-031-22/+54
| | | | | | | | | This commit adapts the traverse_morphs code to handle keeping track of both the morphology location and the source location for chunks by loading morphologies from a given "morphology_repo" and "morphology_ref" rather than the source repo and ref. The repo and ref of the source is still passed and used as the reference for the chunk and given to the Source object in the source pool.
* Add information about the whereabouts of the morphology to SourcesAdam Coldrick2014-07-033-6/+10
| | | | | | | In order to maintain the ability to keep chunk morphologies in the source repository as well as in the definitions repository the Source object for a chunk needs to be able to know about two different repositories, one for the morphology and one for the chunk source.
* tests: Fix the branch-from-image test to get the right SHAAdam Coldrick2014-07-031-1/+1
| | | | | | Due to the changes to the way cache keys are computed for chunks, the sed expression in this script was matching two SHAs in the metadata file. This commit tweaks the expression to pick the right one.
* unittests: Test that the description field is ignored for chunksAdam Coldrick2014-07-031-3/+6
|
* Use the whole chunk morphology to compute cache keysAdam Coldrick2014-07-031-5/+10
| | | | | | | | Change the cache key computer to use all (useful) fields in the chunk morphology to compute the cache key for a chunk. Previously, changing a chunk morphology meant the chunk ref would need to change, but now this is not the case, so the cache key needs to change when the morphology does.
* yarns: Don't use filepaths for chunk morphologiesAdam Coldrick2014-07-033-8/+8
| | | | | | | | The following commits will make morph attempt to load a chunk morphology from the definitions repository if its morph field is a filepath rather than a name. In preparation for this, this commit stops the yarn tests from using a filepath in this field when the morphology is not in the definitions repository.
* yarns: Adapt to put morphologies in subdirsbaserock/richardmaw/S11284/morphologies-by-pathRichard Maw2014-06-198-202/+198
| | | | | | | | | | | | | We want to move our morphologies in our definitions repository into subdirectories, so they're more organised. We'd prefer to only refer to morphologies by file path, rather than a name that loosely corresponds to the file path, but we need to support that for backwards compatibility until we can move all of our morphologies into the definitions repository. However, since we want to eventually remove this, and we want to ensure that file paths work, we change the yarn tests to use file paths.
* Don't check if a file exists before trying to read itRichard Maw2014-06-191-16/+16
| | | | | | | | | | | | | | | | | We used to check whether a file existed before trying to read it. We used to be able to get away with only looking at the top-level directory, which made using ls-files before trying to cat-file it better. Unfortunately, we need to look at the files in subdirectories now, so this no longer works. We could make it include files in subdirectories, but for repositories with many files, you would end up reading a file listing longer than the morphology, so even in the slow case of needing to read the entire morphology file, it would be faster to attempt to read the file first. So now we beg forgiveness rather than asking permission.
* Use exact filenames to refer to morphology filesRichard Maw2014-06-1914-1747/+1754
| | | | | | | | | | | | | | | | | | | Rather than repeatedly stripping and appending an optional .morph extension morphology names, instead always use the file path of the morphology relative to the definitions repository. This is an inversion of the previous logic, which would strip the .morph extension and use the "name" internally. The exception to this rule of always using the filename, is that `morph edit CHUNK` uses the name of the morphology as-defined in the stratum. This is based off Adam Coldrick's inital patch, but this version will allow the old style of providing the "name" by converting it into a path if it does not have either a / or a . in it. An unfortunate consequence of this change is that the show-dependencies command's output changed, so the test needed updating.
* Don't assume morphologies end in .morphRichard Maw2014-06-195-193/+13
| | | | | | | | | | | | | | | We occasionally need to load every morphology in the repository, e.g. morph edit needs to change every morphology that references that chunk. We used to do this by loading everything that ended in `.morph`, but if we're moving to allowing morphologies to have arbitrary filenames, there's no suitable metric other than "this file will successfully validate as a morphology". So, the morphologyfinder module is no longer appropriate, and the responsibility for working out what is a valid morphology has been shifted to the SystemBranchDirectory class, which is used to having to load all the morphologies.
* Add class hierarchies for Morphology load errorsRichard Maw2014-06-191-27/+35
| | | | | There's a lot of them, it's too much of a pain to enumerate them all, so it's convenient to provide a hierachy and catch the base exceptions.
* Exorcise some old and unused commandsRichard Maw2014-06-1934-2772/+0
| | | | | | | | | | | | | `morph merge` only worked for a small subset of cases, and has been left to bit-rot, since we don't use it. `morph tag` is just a `git tag` when we have petrified definitions repository. We don't use it, nor do we need it, so it can go away rather than take up valuable development time fixing it when requirements change. `old-foo` have all been superceded by newer versions and are no-longer used.
* Remove check on checkout/branch that there are systemsRichard Maw2014-06-192-31/+0
| | | | | | | This was the wrong response to the problem of accidentally checking-out morph when trying to check out morphs. Now that it's called definitions, this is irrelevent, and aborting a checkout when this check fails is the wrong thing to do.
* Remove code made vestigial from the `morph edit` rewriteRichard Maw2014-06-193-119/+1
| | | | | | This was originally used by `morph edit`, but since we removed the need to run `morph edit system stratum` and could shorten it to `morph edit chunk`, this function is no longer used.
* Merge branch 'baserock/adamcoldrick/deploy-specific-systems-v5'Adam Coldrick2014-06-186-11/+203
|\ | | | | | | | | Reviewed by: Richard Maw <richard.maw@codethink.co.uk> Lars Wirzenius <lars.wirzenius@codethink.co.uk>
| * Add yarn tests for new deployment functionalitybaserock/adamcoldrick/deploy-specific-systems-v5Adam Coldrick2014-06-183-1/+111
| |
| * Update the help text for morph deployAdam Coldrick2014-06-181-1/+5
| |
| * Allow the user to specify deployments in a clusterAdam Coldrick2014-06-181-8/+43
| | | | | | | | | | | | | | | | Instead of taking the name of a cluster morphology and zero or more parameters for overriding the cluster morphology, morph deploy should take the name of a cluster morphology and the names of zero or more system deployments that are defined in the cluster morphology. If no deployment names are given then all deployments are deployed.
| * Add unit test to test the validation of cluster morphsAdam Coldrick2014-06-181-0/+18
| |
| * Validate cluster morphologiesAdam Coldrick2014-06-181-1/+26
|/ | | | | The names of deployments in cluster morphologies will need to be unique in order for the deployment of selected systems to work.
* Fix: use end of options option with run-partsRichard Ipsum2014-06-181-1/+6
| | | | | | We want to supply the end of options option before the SYSTEM_INTEGRATION_PATH so that the system integration path doesn't get interpreted as an option if it happens to begin with a -
* Merge remote-tracking branch 'origin/sam/morph-version-no-tags'Sam Thursfield2014-06-181-2/+3
|\ | | | | | | | | | | | | | | | | Several reviews; all were happy with the code but not all were sure that this is the correct approach to take. I have merged, because we need this change to make Baserock releases easier. We can revisit it in the future if we want to provide semantic versioning for Morph, instead of our current "report the version of the containing OS image instead" approach.
| * Use abbreviated commit SHA as version number, rather than the tagSam Thursfield2014-06-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This still (ab)uses 'git describe', in order to get an '-unreproducible' postfix when the tree has uncommitted changes. Previously we tagged morph.git with the name of the corresponding Baserock release that it was to be part of. This made the Baserock release process awkward. We needed to first create and test the release images, then (once we knew the version of Morph we were releasing was good) tag morph.git, and then build all the release images again so that the new tag would be picked up and the output of `morph --version` would be correct.
* | Merge remote-tracking branch 'origin/sam/distbuild-gc-fix'Sam Thursfield2014-06-161-0/+3
|\ \ | | | | | | | | | Reviewed-By: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
| * | Don't delete subdirectories of tempdir in gc pluginSam Thursfield2014-06-131-0/+3
| | | | | | | | | | | | | | | | | | There is code that assumes these exist in at least one place: StagingArea.abort(). That code should be fixed, but we should also stop deleting them every time we run 'morph gc'.
* | | Update NEWS for releasebaserock-14.24Richard Maw2014-06-121-0/+14
| |/ |/|
* | Check for presence of btrfs before trying to use itSam Thursfield2014-06-115-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If btrfs is not present in the kernel we end up with strange output like this: Error creating disk image2014-06-10 16:00:40 [devel-system-x86_64-generic][my-raw-disk-image][rawdisk.write]Failure to create disk image at /src/tmp/testdev.img ERROR: Command failed: mount -o loop /src/tmp/testdev.img /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE mount: mounting /dev/loop0 on /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE failed: Device or resource busy To avoid this confusing error, Morph should explicitly check first.
* | Merge branch 'baserock/richardipsum/distbuild_err_when_no_controller2'Richard Ipsum2014-06-113-12/+62
|\ \ | | | | | | | | | | | | | | | Reviewed by: Lars Wirzenius Richard Maw
| * | Make buildcommand use InitiatorConnectionMachineRichard Ipsum2014-06-111-2/+11
| | | | | | | | | | | | | | | | | | After a failed attempt to connect to the controller node the initiator will wait 30 seconds before attempting a reconnect, if this reconnect fails the initiator gives up.
| * | Import InitiatorConnectionMachineRichard Ipsum2014-06-111-1/+2
| | |
| * | Use superRichard Ipsum2014-06-111-1/+1
| | | | | | | | | | | | This change is made just for consistency.
| * | Add InitiatorConnectionMachineRichard Ipsum2014-06-111-5/+36
| | | | | | | | | | | | | | | | | | The InitiatorConnectionMachine wraps the ConnectionMachine, so we can continue to use ConnectionMachine without providing it with an app.
| * | Add max_retries optionRichard Ipsum2014-06-111-5/+14
|/ / | | | | | | | | | | | | By default there is no limit on the number of reconnection attempts. We make the reconnect_interval a parameter, but the default interval remains 1 second.
* | Fix: force select to wait on timeoutRichard Ipsum2014-06-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently the mainloop unintentionally busy-waits if we can't connect to the controller. We want the mainloop's select call to wait for the timeout not for this socket's descriptors (which are always ready). We could just call stop_reading() and stop_writing() but since we won't be needing this socket again we may as well close the entire event source, which calls stop_reading(), stop_writing() and then closes the socket.
* | Note future improvement for fetching artifacts from remote cacheSam Thursfield2014-06-102-0/+7
| |
* | Merge branch 'sam/remote-artifact-cache-failure'Sam Thursfield2014-06-103-50/+60
|\ \ | | | | | | | | | | | | Reviewed-By: Richard Ipsum <richard.ipsum@codethink.co.uk> Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
| * | Fix up sam/remote-artifact-cache-failure branch after reviewSam Thursfield2014-06-101-3/+10
| | |
| * | Ensure that transferring an artifact from the remote cache is atomicSam Thursfield2014-06-031-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Artifacts can have multiple parts; while this may not be an ideal design, changing the format of artifacts has implications for backwards compatibility. We should transfer all parts at once and delete them all if we encounter any errors, to reduce the change of getting the local artifact cache into an inconsistent state.
| * | Improve robustness when fetching artifacts from remote artifact cacheSam Thursfield2014-06-032-30/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously Morph would check if an artifact is present in the remote artifact cache, then fetch the necessary files. If an error occured during fetching, it would raise an error and abort. Instead, we should just try and fetch the files and if anything fails, move on to building locally. This avoids the situation where an error in the remote cache makes local building impossible, which we experienced recently.
| * | Tweak exception message of remote artifact cache GetErrorSam Thursfield2014-06-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ERROR: Failed to get metadata meta for the artifact file:///src/ws-baserock-hawk/baserock/ps/build-system/baserock/baserock/definitions|refs/heads/baserock/builds/778b1a370a1f43c497c1354a2a949de1/56c9ec89d09240fd80faa7d2226b7eda|core|core-devel from the artifact cache http://git.baserock.org:8080/ After: ERROR: Failed to get metadata meta for the artifact f896a081beacd4a99ded38d28b44fbf02970038fb53349265f85f8f3298ead9d.stratum.core-devel from the artifact cache http://git.baserock.org:8080/ When debugging artifact cache issues, the information that's most useful is the filename of the artfact.
| * | Make all remote artifact cache get errors inherit from GetErrorSam Thursfield2014-06-031-3/+3
| | | | | | | | | | | | This saves from having to catch three separate exceptions.
* | | Merge branch 'baserock/pedroalvarez/deploy-dont-update-gits'Pedro Alvarez2014-06-101-0/+1
|\ \ \ | | | | | | | | | | | | | | | | Reviewed-by: Adam Coldrick Reviewed-by: Pedro Alvarez
| * | | Morph deploy should never update git reposPaul Sherwood2014-06-101-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | The deploy plugin is relying on existing code which respects the 'no-git-update' setting and updates gits if it is not set. Since deploy can only work for built systems anyway, we can force this True for deployments, to avoid wasting the user/caller's time.
* | | Merge branch 'baserock/richardmaw/S11226/yarns-v2'Richard Maw2014-06-093-2/+128
|\ \ \ | |_|/ |/| | | | | Reviewed-by: Sam Thursfield and Richard Ipsum
| * | Add yarn to test initramfs deploymentsRichard Maw2014-06-062-0/+126
| | |
| * | initramfs.write: create parent directories of locationRichard Maw2014-06-061-2/+2
| | |
* | | Merge branch 'baserock/ps/simple-edit-syntax'Sam Thursfield2014-06-0925-179/+82
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 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> Reviewed-By: Sam Thursfield <sam.thursfield@codethink.co.uk>
| * | | Fix up before mergeSam Thursfield2014-06-092-37/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - All tests now pass - The odd case of chunks with the same name but different repo URLs now correctly informs the user of the multiple checkouts that were done. - Tidyups