summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Docker.hs
AgeCommit message (Collapse)Author
2017-07-05avoid buffering container chain outputJoey Hess
When provisioning a container, output was buffered until the whole process was done; now output will be displayed immediately. I know this didn't used to be a problem. I belive it was introduced by accident when propellor started using concurrent-output. I know I've seen it for a while and never was bothered enough to get to the bottom of it; apparently "a while" was longer than I thought. Also refactored code to do with chain provisioning to all be in Propellor.Engine and avoided some duplication. This commit was sponsored by Anthony DeRobertis on Patreon.
2017-05-15Removed dependency on MissingH, instead depends on split and hashable.Joey Hess
MissingH is a heavy dependency, which pulls in parsec and a bunch of stuff. So eliminating it makes propellor easier to install and less likely to fail to build. changesFileContent now uses hashable's hash. This may not be stable across upgrades, I'm not sure -- but it's surely ok here, as the hash is not stored. socketFile also uses hash. I *think* this is ok, even if it's not stable. If it's not stable, an upgrade might make propellor hash a hostname to a different number, but with 9 digets of number in use, the chances of a collision are small. In any case, I've opned a bug report asking for the stability to be documented, and I think it's intended to be stable, only the documentation is bad. NB: I have not checked that the arch linux and freebsd packages for the new deps, that Propellor.Bootstrap lists, are the right names or even exist. Since propellor depends on hashable, it could be changed to use unordered-containers, rather than containers, which would be faster and perhaps less deps too. This commit was sponsored by Alexander Thompson on Patreon.
2017-03-11don't propagate DNS info from DiskImage chrootsJoey Hess
* DiskImage building properties used to propagate DNS info out from the chroot used to build the disk image to the Host. That is no longer done, since that chroot only exists as a side effect of the disk image creation and servers will not be running in it. * The IsInfo types class's propagateInfo function changed to use a PropagateInfo data type. (API change) This is particularly important when using hostChroot, since the host could well have DNS settings then. This commit was sponsored by Ole-Morten Duesund on Patreon.
2017-02-26use ConfigurableValue where applicableJoey Hess
* Removed fromPort (use val instead). (API change) * Removed several Show instances that were only used for generating configuration, replacing with ConfigurableValue instances. (API change) It's somewhat annoying that IsInfo requires a Show instance. That's needed to be able to display Info in ghci, but some non-derived Show instances had to be kept to support that.
2017-02-26Added ConfigurableValue type classJoey Hess
* Added ConfigurableValue type class, for values that can be used in a config file, or to otherwise configure a program. * The val function converts such values to String. This was motivated by the bug caused by type Port = Int changing to newtype Port = Port Int deriving Show After that change, some things that used show port to generate config files were broken. By using the ConfigurableValue type class instead, such breakage can be prevented.
2017-02-04addArchLinux support to Docker.installedZihao Wang
Signed-off-by: Zihao Wang <dev@wzhd.org>
2016-03-27improve haddocks and move code around to make them more clearJoey Hess
2016-03-27fix buildJoey Hess
2016-03-27ported SystemdJoey Hess
added mising method in docker
2016-03-26ported dockerJoey Hess
Also, implemented modifyHostProps to add properties to an existing host. Using it bypasses some type safety. Its use in docker is safe though. But, in Conductor, the use of it was not really safe, because it was used with a DebianLike property. Fixed that by making Ssh.installed target all unix's, although it will fail on non-DebianLike ones.
2016-03-26ported propagateContainerJoey Hess
Renamed several utility functions along the way.
2016-03-25rename toProp to toChildPropertiesJoey Hess
and note that it's not meant to be used by regular users
2016-03-25continued portingJoey Hess
2016-03-25ported Property.ListJoey Hess
I wanted to keep propertyList [foo, bar] working, but had some difficulty making the type class approach work. Anyway, that's unlikely to be useful, since foo and bar probably have different types, or could easiy have their types updated breaking it.
2016-03-07add fromPort functionFélix Sipma
(cherry picked from commit c3a23f89092d1ef8367c37ab8993ea7031124f4b)
2015-12-05UncheckedProperty for cmdProperty et alJoey Hess
* Properties that run an arbitrary command, such as cmdProperty and scriptProperty are converted to use UncheckedProperty, since they cannot tell on their own if the command truely made a change or not. (API Change) Transition guide: - When GHC complains about an UncheckedProperty, add: `assume` MadeChange - Since these properties used to always return MadeChange, that change is always safe to make. - Or, if you know that the command should modifiy a file, use: `changesFile` filename * A few properties have had their Result improved, for example Apt.buldDep and Apt.autoRemove now check if a change was made or not.
2015-11-01merge from concurrent-outputJoey Hess
2015-10-28propellor spinJoey Hess
2015-10-28have to flush concurrent output before printing result when chainingJoey Hess
2015-10-27use a shared global for the MessageHandleJoey Hess
2015-10-27Explicit Info/NoInfo for RevertableProperty (API change)Joey Hess
RevertableProperty used to be assumed to contain info, but this is now made explicit, with RevertableProperty HasInfo or RevertableProperty NoInfo. Transition guide: - If you define a RevertableProperty, expect some type check failures like: "Expecting one more argument to ‘RevertableProperty’". - Change it to "RevertableProperty NoInfo" - The compiler will then tell you if it needs "HasInfo" instead. - If you have code that uses the RevertableProperty constructor that fails to type check, use the more powerful <!> operator
2015-10-18fix typo: propigate → propagateFelix Gruber
2015-10-10propellor spinJoey Hess
2015-10-10Improved documentation, particularly of the Propellor module.Joey Hess
This involved some code changes, including some renaming of instance methods. (ABI change)
2015-09-30change HostContext for containersJoey Hess
Privdata that uses HostContext inside a container will now have the name of the container as its context, rather than the name of the host(s) where the container is used. This allows eg, having different passwords for a user in different containers. Note that previously, propellor would prompt using the container name as the context, but not actually use privdata using that context; so this is a bug fix. I don't entirely like the implementation; I had to put the code to change the context in PropAccum, and it's not generalized past PrivInfo.
2015-09-14clean up privdata excess/lacking newline issueJoey Hess
* PrivData converted to newtype (API change). * Stopped stripping trailing newlines when setting PrivData; this was previously done to avoid mistakes when pasting eg passwords with an unwanted newline. Instead, PrivData consumers should use either privDataLines or privDataVal, to extract respectively lines or a value (without internal newlines) from PrivData.
2015-09-13avoid bracketsJoey Hess
2015-09-13Follow some hlint suggestions.Mario Lang
2015-09-06Added Propellor.Property.Rsync. WIP; untestedJoey Hess
Convert Info to use Data.Dynamic, so properties can export and consume info of any type that is Typeable and a Monoid, including data types private to a module. (API change) Thanks to Joachim Breitner for the idea.
2015-06-16Replace String type synonym Docker.Image by a data type which allows to ↵Antoine Eiche
specify an image name and an optional tag. This also introduces the class ImageIdentifier which is internally used by some Docker methods.
2015-06-04Add Docker environment property which allows to specify environment ↵Antoine Eiche
variables to containers.
2015-06-01Docker: volume and publish accept Bound FilePath and Bound Port, ↵Joey Hess
respectively. They also continue to accept Strings, for backwards compatability.
2015-05-27Export CommandParam, boolSystem, safeSystem and shellEscape from ↵Joey Hess
Propellor.Property.Cmd, so they are available for use in constricting your own Properties when using propellor as a library. Several imports of Utility.SafeCommand now redundant.
2015-05-24remove unnecessary use of ensurePropertyJoey Hess
2015-05-16add trivial HasImage instance for ImageJoey Hess
2015-05-16Add HasImage type class which provides getImageName method to extract an ↵Antoine Eiche
image name. Image related functions now require a HasImage instance.
2015-05-12Docker images related properties.Antoine Eiche
- a property to pull image from standard Docker Hub registry. - a property to build image from a local directory (with a Dockerfile).
2015-05-12add Docker.Container field labels containerImage and containerHostAntoine Eiche
2015-01-24GADT properties seem to work (untested)Joey Hess
* 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-24added GADT to determine between a property with info and withoutJoey Hess
Not yet used
2015-01-19split out types to improve haddock for Propellor.TypesJoey Hess
2015-01-19rename HostLike to PropAccumJoey Hess
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-18Property treeJoey Hess
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-01Detect #774376 and refuse to use docker if the system is so broken that ↵Joey Hess
docker exec doesn't enter a chroot.
2014-12-21Revert ensureProperty warning message, too many false positives in places ↵Joey Hess
where Info is correctly propigated. Better approach needed.
2014-12-21propellor spinJoey Hess
2014-12-14broke up big function to describe PrivDataFieldJoey Hess
2014-12-09improve haddock formating of filenamesJoey Hess
2014-12-08propellor spinJoey Hess
(cherry picked from commit 1d02d589c79781cc4b0bd82467edbdf64c40f34d)
2014-11-27remove -i, seems not needed and may be causing problemJoey Hess