From fbba9639d6d5b65d62aefe6d716e018c1a67e6c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 02:34:42 -0400 Subject: propellor spin --- config-joey.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 3bf01114..9d54b512 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - ! Docker.docked hosts "webserver" + & Docker.docked hosts "test" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" -- cgit v1.3-2-g0d8e From 45ce3a5e8ccf90e357dbaf6e0152daa4de88b7fd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:28:10 -0400 Subject: propellor spin --- config-joey.hs | 2 +- src/Propellor/Property/Docker.hs | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 9d54b512..3bf01114 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - & Docker.docked hosts "test" + ! Docker.docked hosts "webserver" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index de3c64fb..8c2f3701 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -30,8 +30,6 @@ module Propellor.Property.Docker ( cpuShares, link, ContainerAlias, - restart, - RestartPolicy(..), -- * Internal use chain, ) where @@ -152,7 +150,7 @@ findContainer mhost cid cn mk = case mhost of mkContainer :: ContainerId -> Host -> Maybe Container mkContainer cid@(ContainerId hn _cn) h = Container <$> fromVal (_dockerImage info) - <*> pure (map (\mkparam -> mkparam hn) (_dockerRunParams info)) + <*> pure (map (\a -> a hn) (_dockerRunParams info)) where info = _dockerinfo $ hostInfo h' h' = h @@ -161,7 +159,6 @@ mkContainer cid@(ContainerId hn _cn) h = Container -- name the container in a predictable way so we -- and the user can easily find it later & name (fromContainerId cid) - & restart RestartAlways -- | Causes *any* docker images that are not in use by running containers to -- be deleted. And deletes any containers that propellor has set up @@ -277,27 +274,6 @@ link linkwith calias = genProp "link" $ \hn -> -- Each container has its own alias namespace. type ContainerAlias = String --- | Restart policy to apply when a container exits. -restart :: RestartPolicy -> Property -restart policy = runProp "restart" (serialize policy) - where - serialize NoRestart = "no" - serialize (RestartOnFailure Nothing) = "on-failure" - serialize (RestartOnFailure n) = "on-failure:" ++ show n - serialize RestartAlways = "always" - --- | NoRestart makes docker not restart a container when it exits --- Note that this includes not restarting it on boot! --- --- RestartOnFailure will restart the container if it exits nonzero. --- A max-retry value can be provided to prevent repeated restarts. --- --- RestartAlways is the default for docker containers configured by --- propellor; as well as keeping badly behaved containers running, --- it ensures that containers get started back up after reboot or --- after docker is upgraded. -data RestartPolicy = NoRestart | RestartOnFailure (Maybe Int) | RestartAlways - -- | A container is identified by its name, and the host -- on which it's deployed. data ContainerId = ContainerId HostName ContainerName -- cgit v1.3-2-g0d8e From bbec7021f84766d5a783c1f320066b27e04a225b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:31:00 -0400 Subject: Revert "propellor spin" This reverts commit 45ce3a5e8ccf90e357dbaf6e0152daa4de88b7fd. --- config-joey.hs | 2 +- src/Propellor/Property/Docker.hs | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 3bf01114..9d54b512 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - ! Docker.docked hosts "webserver" + & Docker.docked hosts "test" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 8c2f3701..de3c64fb 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -30,6 +30,8 @@ module Propellor.Property.Docker ( cpuShares, link, ContainerAlias, + restart, + RestartPolicy(..), -- * Internal use chain, ) where @@ -150,7 +152,7 @@ findContainer mhost cid cn mk = case mhost of mkContainer :: ContainerId -> Host -> Maybe Container mkContainer cid@(ContainerId hn _cn) h = Container <$> fromVal (_dockerImage info) - <*> pure (map (\a -> a hn) (_dockerRunParams info)) + <*> pure (map (\mkparam -> mkparam hn) (_dockerRunParams info)) where info = _dockerinfo $ hostInfo h' h' = h @@ -159,6 +161,7 @@ mkContainer cid@(ContainerId hn _cn) h = Container -- name the container in a predictable way so we -- and the user can easily find it later & name (fromContainerId cid) + & restart RestartAlways -- | Causes *any* docker images that are not in use by running containers to -- be deleted. And deletes any containers that propellor has set up @@ -274,6 +277,27 @@ link linkwith calias = genProp "link" $ \hn -> -- Each container has its own alias namespace. type ContainerAlias = String +-- | Restart policy to apply when a container exits. +restart :: RestartPolicy -> Property +restart policy = runProp "restart" (serialize policy) + where + serialize NoRestart = "no" + serialize (RestartOnFailure Nothing) = "on-failure" + serialize (RestartOnFailure n) = "on-failure:" ++ show n + serialize RestartAlways = "always" + +-- | NoRestart makes docker not restart a container when it exits +-- Note that this includes not restarting it on boot! +-- +-- RestartOnFailure will restart the container if it exits nonzero. +-- A max-retry value can be provided to prevent repeated restarts. +-- +-- RestartAlways is the default for docker containers configured by +-- propellor; as well as keeping badly behaved containers running, +-- it ensures that containers get started back up after reboot or +-- after docker is upgraded. +data RestartPolicy = NoRestart | RestartOnFailure (Maybe Int) | RestartAlways + -- | A container is identified by its name, and the host -- on which it's deployed. data ContainerId = ContainerId HostName ContainerName -- cgit v1.3-2-g0d8e From 857fedc06e18ee3a0fc5099ec692812072574437 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:55:41 -0400 Subject: propellor spin --- config-joey.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 9d54b512..992a8b4e 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - & Docker.docked hosts "test" + -- & Docker.docked hosts "test" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" -- cgit v1.3-2-g0d8e From b08cd1040f62dd9af340cb793e45d600c5855b08 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Oct 2014 11:57:13 -0400 Subject: propellor spin --- config-joey.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 992a8b4e..9d54b512 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,7 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - -- & Docker.docked hosts "test" + & Docker.docked hosts "test" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" -- cgit v1.3-2-g0d8e From b5ab8a7f9fedc283cd561b8a414748ecee3868fd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 24 Oct 2014 09:57:52 -0400 Subject: prep release --- config-joey.hs | 1 - debian/changelog | 4 ++-- propellor.cabal | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'config-joey.hs') diff --git a/config-joey.hs b/config-joey.hs index 9d54b512..fb90651e 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -53,7 +53,6 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured ! Docker.docked hosts "android-git-annex" - & Docker.docked hosts "test" clam :: Host clam = standardSystem "clam.kitenet.net" Unstable "amd64" diff --git a/debian/changelog b/debian/changelog index 69a580b0..c580b3ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -propellor (0.9.1) UNRELEASED; urgency=medium +propellor (0.9.1) unstable; urgency=medium * Docker: Add ability to control when containers restart. * Docker: Default to always restarting containers, so they come back up after reboots and docker daemon upgrades. * Fix loop when a docker host that does not exist was docked. - -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 + -- Joey Hess Fri, 24 Oct 2014 09:57:31 -0400 propellor (0.9.0) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 5843894e..282a5e04 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 0.9.0 +Version: 0.9.1 Cabal-Version: >= 1.6 License: BSD3 Maintainer: Joey Hess -- cgit v1.3-2-g0d8e