summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix distbuild-morphologyAdam Coldrick2015-05-071-1/+1
| | | | | | This fixes an error caused by not enough parameters being given to the InitiatorBuildCommand constructor in distbuild-morphology. Change-Id: I133bd2f267fd06cfe88a1cbf4711cc79ad00d209
* 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
* Fix sysroot.write trying to overwrite existing filesSam Thursfield2015-05-072-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 807e6a90876c5469d242 changed the behaviour of sysroot.write to avoid deleting the contents of the sysroot. This was done so if you accidentally set 'sysroot=/' it wouldn't delete your whole system. It turns out that SDK deployments like clusters/sdk-example-cluster.morph depended on the contents of the directory being deleted. The system armv7lhf-cross-toolchain-system-x86_64.morph has a bunch of files installed by the cross-toolchain in /usr/armv7lhf-baserock-linux-gnueabi/sys-root. Previously sysroot.write would delete these, but since commit 807e6a90876c5469d242 it would fail with several errors like: mv: can't rename '/src/tmp/deployments/usr/armv7l.../sys-root/sbin' If we use 'cp -a' instead of 'mv' then it is slower to deploy, but there are no errors. I am still unsure why files from the cross-toolchain system are installed and then deleted. Although this patch fixes the immediate issue, I don't know if it's the right thing to do. It seems better to not install those files in the first place, if we do not need them. This commit also removes the check for the sysroot target location being empty. This doesn't work, because it runs /before/ the system being deployed is unpacked. Change-Id: I10671c2f3b2060cfb36f880675b83351c6cdd807
* distbuild: Allow WorkerConnection to track multiple in-flight jobsSam Thursfield2015-05-071-108/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although in theory a worker should only ever have one job at once, in practice this assumption doesn't hold, and can cause serious confusion. The worker (implemented in the JsonRouter class) will actually queue up exec-request messages and run the oldest one first. I saw a case where, due to a build not being correctly cancelled, the WorkerConnection.current_job attribute got out of sync with what the worker was actually building. This lead to an error when trying to fetch the built artifacts, as the controller tried to fetch artifacts for something that wasn't actually built yet, and everything got stuck. To prevent this from happening, we either need to remove the exec-request queue in the worker-daemon process, or make the WorkerConnection class cope with multiple jobs at once. The latter seems like the more robust approach, so I have done that. Another bug this fixes is the issue where, if the 'Computing build graph' (serialise-artifact) step of a build completes on the controller while one of its WorkerConnection objects is waiting for artifacts to be fetched by the shared cache from the worker, the build hangs. This would happen because the WorkerConnection assumed that any HelperResponse message it saw was the result of its request, so would send a _JobFinished before caching had actually finished if there was an unrelated HelperResponse received in the meantime. It now checks the request ID of the HelperResponse before calling the code that is now in the new _handle_helper_result_for_job() function. Change-Id: Ia961f333f9dae77405b58c82c99a56e4c43e1628
* distbuild: Track worker jobs using artifact basename onlySam Thursfield2015-05-071-34/+23
| | | | | | | Rather than generating IDs for each job, identify them by what artifact is going to be built. Artifact cache IDs need to be unique in any case. Change-Id: I37a0277931c45a8fb6e37ae7c2a6a942ae732fdd
* distbuild: Track state of a job in the Job classSam Thursfield2015-05-071-22/+31
| | | | | | | This is a bit more comprehensive than the previous approach of using public instance attributes, and I find it easier to reason about. Change-Id: I2942ecf53c95e29893dc0982d38aec689ebfa614
* distbuild: Make Jobs class into a more generic JobQueueSam Thursfield2015-05-071-11/+17
| | | | | | | The intention is to allow workers to use this class for job tracking, in addition to the controller. Change-Id: I355861086764476b383266bab7e850af5e05bc54
* Make str() of a GitDirectory return its location.Sam Thursfield2015-05-071-0/+3
| | | | | | Handy for log messages. Change-Id: I4336866c456a6225a6f3ecbfef10dfc7b864ac59
* Make listing contents of local tarball cache more robustSam Thursfield2015-05-071-1/+12
| | | | | | | | | | | Previously it would crash with a backtrace if there were unexpected filenames in the directory. It's still not amazingly robust, but I don't have time to rewrite the whole thing now. This code seems to have ignored that cachefs.walkfiles() returns filenames with a preceeding '/', which I have fixed now. Change-Id: I98b3094bd6c82b26984513ee81a1eab9bf253a34
* Show progress of downloads when --verbose is passed, not --debugSam Thursfield2015-05-064-4/+5
| | | | | | | This commit undoes behaviour changes from commit aa6dfcbb70c03dfeb3f9af02. Change-Id: Ie677fb9c4e6bcd6edeba2cdd87f4f6125dcae7a4
* GitDir: Fix setting fetch url when push url is already on-diskRichard Maw2015-05-061-2/+2
| | | | | | | | | | | | 290483010cfc7945cd4483fadd1d98c3b83efb3 broke morph checkout, which uses set_fetch_url on a repository that has been cloned, hence has its origin remote url config already on-disk. The fix prevents it changing the push_url when the fetch_url is set, unless it is an unnamed remote, as if the config is on-disk, this already does the right thing. Change-Id: I6204f664407bab3d7f8ecf0fcca72f5015dee55e
* Update distbuild protocol version to 3Sam Thursfield2015-05-051-1/+1
| | | | | | | | | Commit 84096556ea54d4af236f1fe5f7ccf61c1343016f changed the protocol without changing the protocol version. Versions of Morph between that one and this one may hang forever in 'morph distbuild' if trying to build on an incompatible distbuild network. Change-Id: I9194657f59a4b4a61a6fde7bd85105b56ca1a78d
* Add yarns for basic `morph anchor` functionalityRichard Maw2015-05-011-0/+131
| | | | Change-Id: I77a8a3aab887f5d14a372690502df3fdeba6db10
* Add `morph anchor` commandRichard Maw2015-05-012-0/+227
| | | | Change-Id: If9d92d7c75b9c4276b69c482c076c6fc1d4ccbbf
* yarns: Fix typo in system branch creation yarnRichard Maw2015-04-291-1/+1
| | | | Change-Id: I1df58c33987597d4aa5a8eb241b4de4ac72fe250
* yarns: Fix get-repo test falsely checking exit resultRichard Maw2015-04-291-6/+3
| | | | | | | "the user gets the repo" does not set exit-morph, so it is not valid to check whether it exited successfully. Change-Id: I05e2d5c1919eee6b714269642eb9c39bcf578bbc
* RemoteRefManager: Fail all ref updates when one failsRichard Maw2015-04-291-1/+27
| | | | | | | There's no API to do it in one push yet, but we can send a delete for all the branches that *did* commit. Change-Id: I671e9384b84657a3e9034d62818caa0ac0d8de1e
* GitDir: Set the fetch or push url when the other is setRichard Maw2015-04-291-0/+4
| | | | Change-Id: I500cb81fd0f133bd9f4e76d46bc0ff8a4f57fe50
* yarns: Have non-bogus trove configRichard Maw2015-04-291-7/+9
| | | | Change-Id: I5dec13df6c28eeb4e8c83ec41fb4bd119e2eebb1
* CachedRepo: Fix reference to _gitdirRichard Maw2015-04-291-1/+1
| | | | | | | 87f8dbefda89bf6cb9e4b88f23a5317b054da0d4 added a method that used _gitdir, but the patch to change it to gitdir was merged afterwards. Change-Id: Ibd9bff73a0fe69b3c1c2ff6acd02df6cea4a13de
* install-files.configure: make possible to overwrite symlinksJavier Jardón2015-04-301-1/+10
| | | | | | os.symlink will fail if the origin file/link already exist Change-Id: I8175c8dce699e55c3e39e35dfd45c0c19b8bd96d
* Add a test for partial deploymentAdam Coldrick2015-04-302-1/+54
| | | | Change-Id: Iaab620f3d9ebc037fe024db933b03e8f40ca40a4
* Allow the deployment of individual chunks/strata from systemsAdam Coldrick2015-04-302-40/+219
| | | | | | | | | | | | | This commit allows the specification of one or more strata/chunks in a deployment entry in a cluster morphology to deploy instead of the full system if --partial is set. These are listed in a 'partial-deploy-components' field in each deployment definition. The components must be in the system, and this only works for tarball or sysroot deployments. It SHOULD NOT be used when deploying production systems, as it has a number of limitations. Change-Id: I04ac58af57216335d9257f6620d09f18f61ea714
* morphlib: Add command to get build-log for a given chunk and system fileLauren Perry2015-04-302-0/+91
| | | | Change-Id: I09e9b17ef2e0fb94dbf5a96dca91062d64433add
* Add ssh keys conf extRichard Ipsum2015-04-301-0/+25
| | | | Change-Id: I4e7888cbff2e4708154538f8f0a48aeaa1a8a811
* Fix partial distbuilds of non-existant componentsAdam Coldrick2015-04-301-8/+9
| | | | | | | | | | Currently, attempting to distbuild a component which is not in the given system or doesn't exist at all will cause the full system to be built, rather than an error raised. This is because the logic which checks that all components were found is completely nonsensical. This commit makes it actually check the right thing. Change-Id: Ide4d7e3fa5f71e433f3a7b7c8c387fe594c92e43
* Add a CSV manifest generator.Adam Coldrick2015-04-304-3/+340
| | | | | | | | | | | | | | | | This adds a `morph generate-manifest-csv` command which creates a CSV manifest for a system containing license information, upstream URL and a guess at the version of each component in a system. The existing `morph generate-manifest` is also renamed to `morph generate-manifest-genivi` to improve the distinction between the two commands which generate a manifest. The basis of this commit was done by Michael Drake <michael.drake@codethink.co.uk>. Change-Id: I712de11eaa6e1564c5bae5f5f396e5e77484972f
* Check number of args given to build commandsRichard Ipsum2015-04-301-5/+38
| | | | Change-Id: I501632c4d7acde06e391df3752275a3afc334ba6
* Improve 'Deploy failed as system is not yet build' error.Sam Thursfield2015-04-301-4/+5
| | | | | | | | | | If a user had the wrong setting for artifact-cache-server then they could build a system with 'morph distbuild', then be told it wasn't built by 'morph deploy'. The logs do not show any info about which cache server was used, so it looks like a Morph bug. This change should make such a configuration problem much easier to spot. Change-Id: I932ca3c5caa46990f9bcd77d75b3862f49e0dfb8
* GitDirectory: Add a store_commit methodRichard Maw2015-04-301-4/+17
| | | | | | | commit-tree is usually sufficient, but I have a need to be able to create a commit directly. Change-Id: I80ba63eb9601aa1190554bb07522465ffb2cb5d9
* gitdir.PushFailureError: Show why pushes failedRichard Maw2015-04-301-3/+4
| | | | Change-Id: Ife3a809cbf241d8d5a283d7f010ccb5e4d7ea292
* CachedRepo: Expose the internal gitdir objectRichard Maw2015-04-302-27/+27
| | | | | | It's useful to be able to use this. Change-Id: Ib32d27ddb637f1b8ed683bdd8ec1db108529a163
* morph help: Expand upon the importance of the first trove-idRichard Maw2015-04-301-1/+3
| | | | Change-Id: I048687305054f08b0d8e01daa1366170b3eec323
* Install licensecheck.pl with morphlibAdam Coldrick2015-04-294-7/+618
| | | | Change-Id: If1b156a309236956d7a35136db35a8fd0ab3ad71
* Ignore BuildProgress messagesRichard Ipsum2015-04-291-1/+0
| | | | | | | | | | | | | | | | | | | | Once building starts we close the json machine on the initiator, but we may have received build progress events between processing our build-started event and closing the json machine, since there is not a nice way to tell the different types of build progress apart (they all use BuildProgress) we will ignore all BuildProgress messages for now. A possible fix for this is to introduce GraphProgress messages so that we can report the building of the graph without reporting other types of BuildProgress ("Waiting for worker" or "Transferring artifact to cache") that we're not interested in. Note that we will still report build failures or build success, so if there's a mistake in the definitions this will be reported before the detach can occur, similarly if the system is already built this will be reported before the detach happens. Change-Id: Ia006ccfba826d2c91f4dea6c028ecdcb5a2b02d6
* Remove n_state_machines_of_type functionRichard Ipsum2015-04-292-4/+2
| | | | Change-Id: Icfc3d1aa125196e208d7ac35f43f06c5f5a21ba4
* distbuild: Add distbuild status commandLauren Perry2015-04-297-10/+147
| | | | | | | | | 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-298-11/+301
| | | | | | | | | | | 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-293-15/+30
| | | | | | | | | | | | | | | 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
* Bump supported definitions format version to 3baserock-definitions-v3Javier Jardón2015-04-291-1/+1
| | | | | | | | | | | | Since commit 154a760fb884cee14c2604b8bfbe52b0e7c0d4b1 morph suports a new architecture (armv5) This is effectivly a change in the definitions format, as old morph doesnt recognizse this architecture and will fail if a system with this architecture is added to definitions Change-Id: I2adc3a4b103b35c8ca5ec6d4034b797fd10f2485
* Fix lines bigger than 79 characters in install-essential-files.configure.helpFrancisco Redondo Marchena2015-04-281-2/+2
| | | | | | This fixes morph check. Change-Id: I5f9c8f5e73c1976b623f9a75f97b5e9aa1887c44
* morphlib/builder.py: Add comment, os-release is now generated as an extensionJavier Jardón2015-04-281-0/+2
| | | | | | | | Do not remove this code for now as its possible that new versions of morph build old sytems without the install-essential-files extension Change-Id: I5e49d0bc6baee73bedf16469d922822e76286bc1
* Add install-essential-files configuration extensionJavier Jardón2015-04-282-0/+62
| | | | | | | This is meant to add essential system files like /etc/profile, /etc/os-release ... Change-Id: I3d67b3a452b32205c5d3c7303d128bda80ce75de
* distbuild: Fix NameError when worker disconnectsSam Thursfield2015-04-281-1/+1
| | | | Change-Id: Ifdaa92c209a4ca488c4447911bef9b1bf7d61438
* Add version guessing function to gitdir and cached repo.Michael Drake2015-04-282-0/+15
| | | | Change-Id: I1c79ce68a7a7534d36a9e83210e18a58e7b648e8
* get-repo: Delete partially cloned repo on errorsSam Thursfield2015-04-281-2/+9
| | | | | | | | | If a `morph get-repo` command hits an error or is interrupted while the 'git clone' operation is in progress, the partial clone is left around. When the user tries to run the command again, they hit an error saying the directory already exists. Change-Id: Id4bb57f2136049ede0ea900e7e359255617427ec
* Add armv5l to list of valid architecturesJavier Jardón2015-04-284-1/+11
| | | | | | | | Also add support to allow building compatible architectures on armv7 machines, as per the rationale in the comment in _validate_architecture(). Change-Id: Ie0fe4002523f1f92f576bac8b654d4ea6fad5cf2
* Add a test for `morph get-repo`Adam Coldrick2015-04-272-0/+67
| | | | Change-Id: Ie0ac708946c3b1d65d2022638c02d6a2d288ad9d
* Add a `morph get-repo` command to clone repositories from the cacheAdam Coldrick2015-04-272-0/+150
| | | | Change-Id: I0c175649bd98067ea69d471ebe6880aac5a25598
* Fix regression that caused original_ref to be lost in some buildsSam Thursfield2015-04-271-2/+3
| | | | | | | | | | Commit bd788c7219d8b ("Implement partial builds") caused the original_ref metadata to be lost in some cases. This meant that the metadata for built systems would have original_ref set to a SHA1 hex string, instead of the original named ref that the system was built from. Change-Id: Id31654ad60b411206ccc7ee70b46f005baa209ef