Commit Graph

68 Commits

Author SHA1 Message Date
Joey Hess 0ee04ecc43 GADT properties seem to work (untested)
* Property has been converted to a GADT, and will be Property NoInfo
  or Property HasInfo.
  This was done to make sure that ensureProperty is only used on
  properties that do not have Info.
  Transition guide:
  - Change all "Property" to "Property NoInfo" or "Property WithInfo"
    (The compiler can tell you if you got it wrong!)
  - To construct a RevertableProperty, it is useful to use the new
    (<!>) operator
  - Constructing a list of properties can be problimatic, since
    Property NoInto and Property WithInfo are different types and cannot
    appear in the same list. To deal with this, "props" has been added,
    and can built up a list of properties of different types,
    using the same (&) and (!) operators that are used to build
    up a host's properties.
2015-01-24 22:38:51 -04:00
Joey Hess 414ee7eee6 added GADT to determine between a property with info and without
Not yet used
2015-01-24 16:53:59 -04:00
Joey Hess 603e6d3406 split out types to improve haddock for Propellor.Types 2015-01-19 15:09:03 -04:00
Joey Hess 1ae21965aa rename HostLike to PropAccum
This is more general; it doesn't need to contain a Host.
It would, for example, be possible to make Property itself be an instance
of PropAccum.
2015-01-19 14:15:49 -04:00
Joey Hess afee550e70 Property tree
Properties now form a tree, instead of the flat list used before.

This simplifies propigation of Info from the Properties used inside a
container to the outer host; the Property that docks the container on the
host can just have as child properties all the inner Properties, and their
Info can then be gathered recursively. (Although in practice it still needs
to be filtered, since not all Info should propigate out of a container.)

Note that there is no change to how Properties are actually satisfied.
Just because a Property lists some child properties, this does not mean
they always have their propertySatisfy actions run. It's still up to the
parent property to run those actions.

That's necessary so that a container's properties can be satisfied inside
it, not outside. It also allows property combinators to
add the combined Properties to their childProperties list, even if,
like onChange, they don't always run the child properties at all.

Testing: I tested that the exact same Info is calculated before and after
this change, for every Host in my config file.
2015-01-18 18:46:38 -04:00
Joey Hess d5cfadd899 Detect #774376 and refuse to use docker if the system is so broken that docker exec doesn't enter a chroot. 2015-01-01 15:41:31 -04:00
Joey Hess dc36a98fc1 Revert ensureProperty warning message, too many false positives in places where Info is correctly propigated. Better approach needed. 2014-12-21 21:33:03 -04:00
Joey Hess d194765e10
propellor spin 2014-12-21 21:14:11 -04:00
Joey Hess 23399416f1 broke up big function to describe PrivDataField 2014-12-14 16:14:05 -04:00
Joey Hess 2e2438ae66 improve haddock formating of filenames 2014-12-09 14:22:37 -04:00
Joey Hess 4e9b01a8a7 propellor spin
(cherry picked from commit 1d02d589c7)
2014-12-08 01:07:25 -04:00
Joey Hess 4c2eac2d3c
remove -i, seems not needed and may be causing problem 2014-11-27 19:10:39 -04:00
Joey Hess 96ecbaad25 pute full path to bin/propellor inside shim 2014-11-22 22:10:53 -04:00
Joey Hess 6c92f1034f split out info types 2014-11-21 18:55:33 -04:00
Joey Hess a4f04fcb02
propellor spin 2014-11-20 15:15:28 -04:00
Joey Hess b8b746a7f1 starting work on a Chroot module
factored out info up-propigation code rom Docker
2014-11-20 14:15:26 -04:00
Joey Hess 5e4c57652c fix docker container provisioning
Since the containers are no longer on the host list, they were not found
while provisioning, oops.

To fix, had to add to a host's info a map of the containers docked to it.

Unfortunately, that required Propellor.Types.Info be glommed into
Propellor.Types, since it needed to refer to Host.
2014-11-20 00:21:40 -04:00
Joey Hess d49d251897 separate docker container type
Docker containers are now a separate data type, cannot be included in the
main host list, and are instead passed to Docker.docked. (API change)
2014-11-19 23:11:34 -04:00
Joey Hess 803e1407a0 improve display 2014-11-19 01:40:56 -04:00
Joey Hess 1872ee1ffc
propellor spin 2014-11-19 01:32:09 -04:00
Joey Hess 4dddbb725d prevent multiple concurrent provisioning inside docker container
Lock a lock file while provisioning inside, otherwise propellor could be
running to init the container when the system has just booted, or the
container was just started from being stopped, and at the same time,
propellor run outside the container chains into it to provision.

Previously, simplesh prevented this in a different way.
2014-11-19 01:28:38 -04:00
Joey Hess 05086b3abe
propellor spin 2014-11-19 01:02:13 -04:00
Joey Hess f8b71c0ab4
propellor spin 2014-11-19 00:38:11 -04:00
Joey Hess 325fe4037b
propellor spin 2014-11-19 00:30:06 -04:00
Joey Hess 2bbb2aa6e2 remove --docker; use Continue
And --chain was already not used.
2014-11-18 18:52:00 -04:00
Joey Hess 4a0cac113c fix color display when running propellor inside docker 2014-11-18 17:53:42 -04:00
Joey Hess 9755b761bb Docker: Stop using docker.io; that was a compat symlink in the Debian package which has been removed in docker.io 1.3.1~dfsg1-2. 2014-11-08 15:55:58 -04:00
Joey Hess f5b5159f76 don't need RestartPolicy data type; simplify 2014-10-23 12:28:33 -04:00
Joey Hess 73a75cbefc Fix loop when a docker host that does not exist was docked.
The problem is it fell back to looking for an alias for the bad hostname,
but to get the aliases, it needs to know which hosts are docked where,
so looped.
2014-10-23 12:11:43 -04:00
Joey Hess e6924a894d Revert "Revert "Revert "propellor spin"""
This reverts commit 26bef2486d.
2014-10-23 11:46:15 -04:00
Joey Hess 26bef2486d Revert "Revert "propellor spin""
This reverts commit 8d353813bf.
2014-10-23 11:42:34 -04:00
Joey Hess 8d353813bf Revert "propellor spin"
This reverts commit ac7b182b5a.
2014-10-23 11:39:29 -04:00
Joey Hess ac7b182b5a
propellor spin 2014-10-23 11:36:06 -04:00
Joey Hess bdf3e37066 Revert "propellor spin"
This reverts commit 80f5b53f1b.
2014-10-23 11:33:00 -04:00
Joey Hess bbec7021f8 Revert "propellor spin"
This reverts commit 45ce3a5e8c.
2014-10-23 11:31:00 -04:00
Joey Hess 45ce3a5e8c
propellor spin 2014-10-23 11:28:10 -04:00
Joey Hess 80f5b53f1b
propellor spin 2014-10-23 11:26:05 -04:00
Joey Hess 5bfeb3f9aa Revert "propellor spin"
This reverts commit 7637ea0af9.
2014-10-23 11:25:07 -04:00
Joey Hess 7637ea0af9
propellor spin 2014-10-23 11:23:25 -04:00
Joey Hess 856a4c673c
propellor spin 2014-10-23 03:27:40 -04:00
Joey Hess 93099b8627 bugfix 2014-10-23 03:18:52 -04:00
Joey Hess a0e4c872b6
propellor spin 2014-10-23 02:50:50 -04:00
Joey Hess 9e3485a13b
propellor spin 2014-10-23 02:41:47 -04:00
Joey Hess 9d7a442182
propellor spin 2014-10-23 02:36:08 -04:00
Joey Hess fbba9639d6
propellor spin 2014-10-23 02:34:42 -04:00
Joey Hess 2be1255b89
propellor spin 2014-10-10 13:51:52 -04:00
Joey Hess df0c0e56cb Docker: Avoid committing container every time it's started up.
This was using a lot of disk space. Instead, start the container, and then
use the running container to check if docker is running it with the right
params. In the unlikely case that the params have changed, we still need to
commit the container and restart it. The common case of eg a reboot no
longer commits though.
2014-10-10 13:47:41 -04:00
Joey Hess c120355272
propellor spin 2014-10-10 13:25:30 -04:00
Joey Hess ff9647cf9d
propellor spin 2014-10-10 13:21:42 -04:00
Joey Hess 6a674c79d7 fix some accidental uses of spaces, rather than tabs, for indentation 2014-10-08 13:14:21 -04:00