From e661aad6c493e31b6bd8109ca3d5c90bec28626a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 May 2015 13:34:20 -0400 Subject: merge --- src/Propellor/Property/SiteSpecific/IABak.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/IABak.hs b/src/Propellor/Property/SiteSpecific/IABak.hs index fc56de85..fe2de7c8 100644 --- a/src/Propellor/Property/SiteSpecific/IABak.hs +++ b/src/Propellor/Property/SiteSpecific/IABak.hs @@ -63,12 +63,14 @@ graphiteServer = propertyList "iabak graphite server" $ props [ "[carbon]" , "pattern = ^carbon\\." , "retentions = 60:90d" - , "[iabak]" + , "[iabak-connections]" + , "pattern = ^iabak\\.shardstats\\.connections" + , "retentions = 1h:1y,3h:10y" + , "[iabak-default]" , "pattern = ^iabak\\." - , "retentions = 10m:30d,1h:1y,3h,10y" + , "retentions = 10m:30d,1h:1y,3h:10y" , "[default_1min_for_1day]" , "pattern = .*" - , "retentions = 60s:1d" ] & graphiteCSRF & cmdProperty "graphite-manage" ["syncdb", "--noinput"] `flagFile` "/etc/flagFiles/graphite-syncdb" -- cgit v1.3-2-g0d8e From 56fe313887dcc5af202e0f8efcf001a8418132e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 May 2015 14:50:23 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/IABak.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/IABak.hs b/src/Propellor/Property/SiteSpecific/IABak.hs index fe2de7c8..85e62477 100644 --- a/src/Propellor/Property/SiteSpecific/IABak.hs +++ b/src/Propellor/Property/SiteSpecific/IABak.hs @@ -33,7 +33,7 @@ gitServer knownhosts = propertyList "iabak git server" $ props & cmdProperty "ln" ["-sf", "/usr/local/IA.BAK/pushme.cgi", "/usr/lib/cgi-bin/pushme.cgi"] & File.containsLine "/etc/sudoers" "www-data ALL=NOPASSWD:/usr/local/IA.BAK/pushed.sh" & Cron.niceJob "shardstats" (Cron.Times "*/30 * * * *") (User "root") "/" - "/usr/local/IA.BAK/shardstats-all" + "/usr/local/IA.BAK/shardmaint-fast; /usr/local/IA.BAK/shardstats-all" & Cron.niceJob "shardmaint" Cron.Daily (User "root") "/" "/usr/local/IA.BAK/shardmaint" -- cgit v1.3-2-g0d8e From ff01339b8cf8bc812e9dd93519d065066ffba117 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 May 2015 15:49:30 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/IABak.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/IABak.hs b/src/Propellor/Property/SiteSpecific/IABak.hs index 85e62477..8ed3b38f 100644 --- a/src/Propellor/Property/SiteSpecific/IABak.hs +++ b/src/Propellor/Property/SiteSpecific/IABak.hs @@ -33,9 +33,9 @@ gitServer knownhosts = propertyList "iabak git server" $ props & cmdProperty "ln" ["-sf", "/usr/local/IA.BAK/pushme.cgi", "/usr/lib/cgi-bin/pushme.cgi"] & File.containsLine "/etc/sudoers" "www-data ALL=NOPASSWD:/usr/local/IA.BAK/pushed.sh" & Cron.niceJob "shardstats" (Cron.Times "*/30 * * * *") (User "root") "/" - "/usr/local/IA.BAK/shardmaint-fast; /usr/local/IA.BAK/shardstats-all" + "/usr/local/IA.BAK/shardstats-all" & Cron.niceJob "shardmaint" Cron.Daily (User "root") "/" - "/usr/local/IA.BAK/shardmaint" + "/usr/local/IA.BAK/shardmaint-fast; /usr/local/IA.BAK/shardmaint" registrationServer :: [Host] -> Property HasInfo registrationServer knownhosts = propertyList "iabak registration server" $ props -- cgit v1.3-2-g0d8e From b68b9ee16521967365bb18e4db375d27bb7859e0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 24 May 2015 16:38:18 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 36808919..89b8b46d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -30,7 +30,6 @@ scrollBox = propertyList "scroll server" $ props "libghc-bytestring-dev", "libghc-mtl-dev", "libghc-ncurses-dev", "libghc-random-dev", "libghc-monad-loops-dev", "libghc-text-dev", "libghc-ifelse-dev", "libghc-case-insensitive-dev", - "libghc-transformers-dev", "libghc-data-default-dev", "libghc-optparse-applicative-dev"] & userScriptProperty (User "scroll") [ "cd " ++ d "scroll" -- cgit v1.3-2-g0d8e From d38c48b97f796217f606ada43fbe13445f41417a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 26 May 2015 11:24:22 -0400 Subject: propellor spin --- config-joey.hs | 1 + src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index c4477f01..8c44d104 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -132,6 +132,7 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" & Systemd.persistentJournal & Docker.configured & Docker.docked (GitAnnexBuilder.standardAutoBuilderContainer dockerImage "amd64" 15 "2h") + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainerNspawn "amd64" 15 "2h") & Docker.docked (GitAnnexBuilder.standardAutoBuilderContainer dockerImage "i386" 45 "2h") & Docker.docked (GitAnnexBuilder.armelCompanionContainer dockerImage) & Docker.docked (GitAnnexBuilder.armelAutoBuilderContainer dockerImage (Cron.Times "1 3 * * *") "5h") diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 511fd888..6108bf1a 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -9,6 +9,8 @@ import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.File as File import qualified Propellor.Property.Docker as Docker +import qualified Propellor.Property.Systemd as Systemd +import qualified Propellor.Property.Chroot as Chroot import Propellor.Property.Cron (Times) builduser :: UserName @@ -105,6 +107,20 @@ standardAutoBuilderContainer dockerImage arch buildminute timeout = Docker.conta & autobuilder arch (Cron.Times $ show buildminute ++ " * * * *") timeout & Docker.tweaked +standardAutoBuilderContainerNspawn :: Architecture -> Int -> TimeOut -> Systemd.Container +standardAutoBuilderContainerNspawn arch buildminute timeout = Systemd.container name bootstrap + & os myos + & Apt.stdSourcesList + & Apt.unattendedUpgrades + & User.accountFor (User builduser) + & tree arch + & buildDepsApt + & autobuilder arch (Cron.Times $ show buildminute ++ " * * * *") timeout + where + name = arch ++ "-git-annex-builder" + bootstrap = Chroot.debootstrapped myos mempty + myos = System (Debian Unstable) arch + androidAutoBuilderContainer :: (System -> Docker.Image) -> Times -> TimeOut -> Docker.Container androidAutoBuilderContainer dockerImage crontimes timeout = androidContainer dockerImage "android-git-annex-builder" (tree "android") builddir -- cgit v1.3-2-g0d8e From 626f1af56f12be63cd78fa4910c55453c23cf5a0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 May 2015 12:38:45 -0400 Subject: Export CommandParam, boolSystem, safeSystem and shellEscape from 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. --- debian/changelog | 3 ++ src/Propellor/Bootstrap.hs | 1 - src/Propellor/CmdLine.hs | 1 - src/Propellor/Git.hs | 1 - src/Propellor/Property/Apache.hs | 1 - src/Propellor/Property/Chroot.hs | 1 - src/Propellor/Property/Cmd.hs | 20 ++++++++-- src/Propellor/Property/Cron.hs | 1 - src/Propellor/Property/Debootstrap.hs | 1 - src/Propellor/Property/Docker.hs | 1 - src/Propellor/Property/Firewall.hs | 1 - src/Propellor/Property/Git.hs | 1 - src/Propellor/Property/Mount.hs | 1 - src/Propellor/Property/OS.hs | 1 - src/Propellor/Property/Obnam.hs | 1 - src/Propellor/Property/Reboot.hs | 1 - src/Propellor/Property/Service.hs | 1 - src/Propellor/Property/SiteSpecific/GitHome.hs | 1 - src/Propellor/Property/SiteSpecific/JoeySites.hs | 1 - src/Propellor/Property/Ssh.hs | 1 - src/Propellor/Property/Systemd.hs | 1 - src/Propellor/Shim.hs | 1 - src/Propellor/Ssh.hs | 1 - src/Utility/SafeCommand.hs | 49 ++++++++++++------------ 24 files changed, 43 insertions(+), 50 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/debian/changelog b/debian/changelog index dc3b09de..96a9f745 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ propellor (2.5.0) UNRELEASED; urgency=medium more generic cmdProperty' (API change) * Add docker image related properties. Thanks, Antoine Eiche. + * Export CommandParam, boolSystem, safeSystem and shellEscape from + Propellor.Property.Cmd, so they are available for use in constricting + your own Properties when using propellor as a library. -- Joey Hess Thu, 07 May 2015 12:08:34 -0400 diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 51ba69a4..1cf921cf 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -6,7 +6,6 @@ module Propellor.Bootstrap ( ) where import Propellor -import Utility.SafeCommand import System.Posix.Files import Data.List diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 1298daf2..219fe026 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -18,7 +18,6 @@ import Propellor.Types.CmdLine import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Shim as Shim -import Utility.SafeCommand usage :: Handle -> IO () usage h = hPutStrLn h $ unlines diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 34bc43e2..0b9b4b35 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -3,7 +3,6 @@ module Propellor.Git where import Propellor import Propellor.PrivData.Paths import Propellor.Gpg -import Utility.SafeCommand import Utility.FileMode getCurrentBranch :: IO String diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index a7c7e690..fe81dcd8 100644 --- a/src/Propellor/Property/Apache.hs +++ b/src/Propellor/Property/Apache.hs @@ -4,7 +4,6 @@ import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service -import Utility.SafeCommand type ConfigFile = [String] diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index e56cb6ed..ec2b6679 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -19,7 +19,6 @@ import Propellor.Property.Chroot.Util import qualified Propellor.Property.Debootstrap as Debootstrap import qualified Propellor.Property.Systemd.Core as Systemd import qualified Propellor.Shim as Shim -import Utility.SafeCommand import qualified Data.Map as M import Data.List.Utils diff --git a/src/Propellor/Property/Cmd.hs b/src/Propellor/Property/Cmd.hs index 859302c8..23f1075b 100644 --- a/src/Propellor/Property/Cmd.hs +++ b/src/Propellor/Property/Cmd.hs @@ -1,11 +1,20 @@ {-# LANGUAGE PackageImports #-} module Propellor.Property.Cmd ( + -- * Properties for running commands and scripts cmdProperty, cmdProperty', cmdPropertyEnv, + Script, scriptProperty, userScriptProperty, + -- * Lower-level interface for running commands + CommandParam(..), + boolSystem, + boolSystemEnv, + safeSystem, + safeSystemEnv, + shellEscape ) where import Control.Applicative @@ -40,15 +49,18 @@ cmdPropertyEnv cmd params env = property desc $ liftIO $ do where desc = unwords $ cmd : params --- | A property that can be satisfied by running a series of shell commands. -scriptProperty :: [String] -> Property NoInfo +-- | A series of shell commands. (Without a leading hashbang.) +type Script = [String] + +-- | A property that can be satisfied by running a script. +scriptProperty :: Script -> Property NoInfo scriptProperty script = cmdProperty "sh" ["-c", shellcmd] where shellcmd = intercalate " ; " ("set -e" : script) --- | A property that can satisfied by running a series of shell commands, +-- | A property that can satisfied by running a script -- as user (cd'd to their home directory). -userScriptProperty :: User -> [String] -> Property NoInfo +userScriptProperty :: User -> Script -> Property NoInfo userScriptProperty (User user) script = cmdProperty "su" ["--shell", "/bin/sh", "-c", shellcmd, user] where shellcmd = intercalate " ; " ("set -e" : "cd" : script) diff --git a/src/Propellor/Property/Cron.hs b/src/Propellor/Property/Cron.hs index d2feaf3c..e9bb93ac 100644 --- a/src/Propellor/Property/Cron.hs +++ b/src/Propellor/Property/Cron.hs @@ -4,7 +4,6 @@ import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import Propellor.Bootstrap -import Utility.SafeCommand import Utility.FileMode import Data.Char diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 5d6a8bed..f29ae56b 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -15,7 +15,6 @@ import qualified Propellor.Property.Apt as Apt import Propellor.Property.Chroot.Util import Propellor.Property.Mount import Utility.Path -import Utility.SafeCommand import Utility.FileMode import Data.List diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index 3b8751f3..fd7e37b2 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -48,7 +48,6 @@ import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cmd as Cmd import qualified Propellor.Shim as Shim -import Utility.SafeCommand import Utility.Path import Utility.ThreadScheduler diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs index 66292c8b..ab57b122 100644 --- a/src/Propellor/Property/Firewall.hs +++ b/src/Propellor/Property/Firewall.hs @@ -18,7 +18,6 @@ import Data.Char import Data.List import Propellor -import Utility.SafeCommand import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Network as Network diff --git a/src/Propellor/Property/Git.hs b/src/Propellor/Property/Git.hs index 0fc22616..48871b40 100644 --- a/src/Propellor/Property/Git.hs +++ b/src/Propellor/Property/Git.hs @@ -4,7 +4,6 @@ import Propellor import Propellor.Property.File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service -import Utility.SafeCommand import Data.List diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index f4d10302..a081b1e7 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -1,7 +1,6 @@ module Propellor.Property.Mount where import Propellor -import Utility.SafeCommand type FsType = String type Source = String diff --git a/src/Propellor/Property/OS.hs b/src/Propellor/Property/OS.hs index 11fa6c82..5364456a 100644 --- a/src/Propellor/Property/OS.hs +++ b/src/Propellor/Property/OS.hs @@ -16,7 +16,6 @@ import qualified Propellor.Property.File as File import qualified Propellor.Property.Reboot as Reboot import Propellor.Property.Mount import Propellor.Property.Chroot.Util (stdPATH) -import Utility.SafeCommand import System.Posix.Files (rename, fileExist) import Control.Exception (throw) diff --git a/src/Propellor/Property/Obnam.hs b/src/Propellor/Property/Obnam.hs index da27e263..94b023f3 100644 --- a/src/Propellor/Property/Obnam.hs +++ b/src/Propellor/Property/Obnam.hs @@ -4,7 +4,6 @@ import Propellor import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Gpg as Gpg -import Utility.SafeCommand import Data.List diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs index 750968ff..d45969a8 100644 --- a/src/Propellor/Property/Reboot.hs +++ b/src/Propellor/Property/Reboot.hs @@ -1,7 +1,6 @@ module Propellor.Property.Reboot where import Propellor -import Utility.SafeCommand now :: Property NoInfo now = cmdProperty "reboot" [] diff --git a/src/Propellor/Property/Service.hs b/src/Propellor/Property/Service.hs index 8da502f7..9cc010e8 100644 --- a/src/Propellor/Property/Service.hs +++ b/src/Propellor/Property/Service.hs @@ -1,7 +1,6 @@ module Propellor.Property.Service where import Propellor -import Utility.SafeCommand type ServiceName = String diff --git a/src/Propellor/Property/SiteSpecific/GitHome.hs b/src/Propellor/Property/SiteSpecific/GitHome.hs index d6dce7c0..40f2ecd8 100644 --- a/src/Propellor/Property/SiteSpecific/GitHome.hs +++ b/src/Propellor/Property/SiteSpecific/GitHome.hs @@ -3,7 +3,6 @@ module Propellor.Property.SiteSpecific.GitHome where import Propellor import qualified Propellor.Property.Apt as Apt import Propellor.Property.User -import Utility.SafeCommand -- | Clones Joey Hess's git home directory, and runs its fixups script. installedFor :: User -> Property NoInfo diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 89b8b46d..f9a0e0c9 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -15,7 +15,6 @@ import qualified Propellor.Property.User as User import qualified Propellor.Property.Obnam as Obnam import qualified Propellor.Property.Apache as Apache import qualified Propellor.Property.Postfix as Postfix -import Utility.SafeCommand import Utility.FileMode import Data.List diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index 37e65728..785f2787 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -24,7 +24,6 @@ import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Service as Service import Propellor.Property.User -import Utility.SafeCommand import Utility.FileMode import System.PosixCompat diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 07cf81ee..78a99963 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -25,7 +25,6 @@ import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import Propellor.Property.Systemd.Core -import Utility.SafeCommand import Utility.FileMode import Data.List diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs index 5fc1ea05..ecf9f36a 100644 --- a/src/Propellor/Shim.hs +++ b/src/Propellor/Shim.hs @@ -8,7 +8,6 @@ module Propellor.Shim (setup, cleanEnv, file) where import Propellor import Utility.LinuxMkLibs -import Utility.SafeCommand import Utility.FileMode import Utility.FileSystemEncoding diff --git a/src/Propellor/Ssh.hs b/src/Propellor/Ssh.hs index 97c3eb6d..ac9295d1 100644 --- a/src/Propellor/Ssh.hs +++ b/src/Propellor/Ssh.hs @@ -1,7 +1,6 @@ module Propellor.Ssh where import Propellor -import Utility.SafeCommand import Utility.UserInfo import System.PosixCompat diff --git a/src/Utility/SafeCommand.hs b/src/Utility/SafeCommand.hs index 0704e69f..82e35049 100644 --- a/src/Utility/SafeCommand.hs +++ b/src/Utility/SafeCommand.hs @@ -17,16 +17,15 @@ import Data.Char import Control.Applicative import Prelude -{- A type for parameters passed to a shell command. A command can - - be passed either some Params (multiple parameters can be included, - - whitespace-separated, or a single Param (for when parameters contain - - whitespace), or a File. - -} -data CommandParam = Params String | Param String | File FilePath +-- | Parameters that can be passed to a shell command. +data CommandParam + = Params String -- ^ Contains multiple parameters, separated by whitespace + | Param String -- ^ A single parameter + | File FilePath -- ^ The name of a file deriving (Eq, Show, Ord) -{- Used to pass a list of CommandParams to a function that runs - - a command and expects Strings. -} +-- | Used to pass a list of CommandParams to a function that runs +-- a command and expects Strings. -} toCommand :: [CommandParam] -> [String] toCommand = concatMap unwrap where @@ -43,9 +42,10 @@ toCommand = concatMap unwrap -- path separator on Windows. pathseps = pathSeparator:"./" -{- Run a system command, and returns True or False - - if it succeeded or failed. - -} +-- | Run a system command, and returns True or False if it succeeded or failed. +-- +-- This and other command running functions in this module log the commands +-- run at debug level, using System.Log.Logger. boolSystem :: FilePath -> [CommandParam] -> IO Bool boolSystem command params = boolSystem' command params id @@ -59,7 +59,7 @@ boolSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Bo boolSystemEnv command params environ = boolSystem' command params $ \p -> p { env = environ } -{- Runs a system command, returning the exit status. -} +-- | Runs a system command, returning the exit status. safeSystem :: FilePath -> [CommandParam] -> IO ExitCode safeSystem command params = safeSystem' command params id @@ -74,23 +74,22 @@ safeSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Ex safeSystemEnv command params environ = safeSystem' command params $ \p -> p { env = environ } -{- Wraps a shell command line inside sh -c, allowing it to be run in a - - login shell that may not support POSIX shell, eg csh. -} +-- | Wraps a shell command line inside sh -c, allowing it to be run in a +-- login shell that may not support POSIX shell, eg csh. shellWrap :: String -> String shellWrap cmdline = "sh -c " ++ shellEscape cmdline -{- Escapes a filename or other parameter to be safely able to be exposed to - - the shell. - - - - This method works for POSIX shells, as well as other shells like csh. - -} +-- | Escapes a filename or other parameter to be safely able to be exposed to +-- the shell. +-- +-- This method works for POSIX shells, as well as other shells like csh. shellEscape :: String -> String shellEscape f = "'" ++ escaped ++ "'" where -- replace ' with '"'"' escaped = join "'\"'\"'" $ split "'" f -{- Unescapes a set of shellEscaped words or filenames. -} +-- | Unescapes a set of shellEscaped words or filenames. shellUnEscape :: String -> [String] shellUnEscape [] = [] shellUnEscape s = word : shellUnEscape rest @@ -107,19 +106,19 @@ shellUnEscape s = word : shellUnEscape rest | c == q = findword w cs | otherwise = inquote q (w++[c]) cs -{- For quickcheck. -} +-- | For quickcheck. prop_idempotent_shellEscape :: String -> Bool prop_idempotent_shellEscape s = [s] == (shellUnEscape . shellEscape) s prop_idempotent_shellEscape_multiword :: [String] -> Bool prop_idempotent_shellEscape_multiword s = s == (shellUnEscape . unwords . map shellEscape) s -{- Segments a list of filenames into groups that are all below the maximum - - command-line length limit. -} +-- | Segments a list of filenames into groups that are all below the maximum +-- command-line length limit. segmentXargsOrdered :: [FilePath] -> [[FilePath]] segmentXargsOrdered = reverse . map reverse . segmentXargsUnordered -{- Not preserving data is a little faster, and streams better when - - there are a great many filesnames. -} +-- | Not preserving order is a little faster, and streams better when +-- there are a great many filenames. segmentXargsUnordered :: [FilePath] -> [[FilePath]] segmentXargsUnordered l = go l [] 0 [] where -- cgit v1.3-2-g0d8e From 3c2349922da39cd913e5cde473ec03dda9fe3fb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 May 2015 18:27:25 -0400 Subject: propellor spin --- config-joey.hs | 2 +- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index 8c44d104..e61982e1 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -132,7 +132,7 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" & Systemd.persistentJournal & Docker.configured & Docker.docked (GitAnnexBuilder.standardAutoBuilderContainer dockerImage "amd64" 15 "2h") - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainerNspawn "amd64" 15 "2h") + ! Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainerNspawn "amd64" 15 "2h") & Docker.docked (GitAnnexBuilder.standardAutoBuilderContainer dockerImage "i386" 45 "2h") & Docker.docked (GitAnnexBuilder.armelCompanionContainer dockerImage) & Docker.docked (GitAnnexBuilder.armelAutoBuilderContainer dockerImage (Cron.Times "1 3 * * *") "5h") diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 6108bf1a..ee0adca2 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -119,7 +119,7 @@ standardAutoBuilderContainerNspawn arch buildminute timeout = Systemd.container where name = arch ++ "-git-annex-builder" bootstrap = Chroot.debootstrapped myos mempty - myos = System (Debian Unstable) arch + myos = System (Debian Testing) arch androidAutoBuilderContainer :: (System -> Docker.Image) -> Times -> TimeOut -> Docker.Container androidAutoBuilderContainer dockerImage crontimes timeout = -- cgit v1.3-2-g0d8e From 2c2247fc2338d1543999cbbe182ea93e052c2d91 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 27 May 2015 21:24:50 -0400 Subject: propellor spin --- config-joey.hs | 14 ++------ .../Property/SiteSpecific/GitAnnexBuilder.hs | 40 +++++++--------------- 2 files changed, 15 insertions(+), 39 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index 76c06bd2..50e712a0 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -75,7 +75,6 @@ darkstar = host "darkstar.kitenet.net" & Apt.buildDep ["git-annex"] `period` Daily & Docker.configured - ! Docker.docked gitAnnexAndroidDev & JoeySites.postfixClientRelay (Context "darkstar.kitenet.net") & JoeySites.dkimMilter @@ -130,9 +129,9 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" & Apt.unattendedUpgrades & Postfix.satellite & Systemd.persistentJournal - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainerNspawn "amd64" 15 "2h") - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainerNspawn "i386" 15 "2h") - & Apt.buildDep ["git-annex"] `period` Daily + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer "amd64" 15 "2h") + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer "i386" 15 "2h") + & Systemd.nspawned (GitAnnexBuilder.androidAutoBuilderContainer (Cron.Times "1 1 * * *") "3h") -- This is not a complete description of kite, since it's a -- multiuser system with eg, user passwords that are not deployed @@ -402,13 +401,6 @@ oldusenetShellBox = standardStableContainer "oldusenet-shellbox" & Docker.publish "4200:4200" & JoeySites.oldUseNetShellBox --- for development of git-annex for android, using my git-annex work tree -gitAnnexAndroidDev :: Docker.Container -gitAnnexAndroidDev = GitAnnexBuilder.androidContainer dockerImage "android-git-annex" doNothing gitannexdir - & Docker.volume ("/home/joey/src/git-annex:" ++ gitannexdir) - where - gitannexdir = GitAnnexBuilder.homedir "git-annex" - jerryPlay :: Docker.Container jerryPlay = standardContainer "jerryplay" Unstable "amd64" & alias "jerryplay.kitenet.net" diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index ee0adca2..eb831025 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -94,22 +94,9 @@ cabalDeps = flagFile go cabalupdated go = userScriptProperty (User builduser) ["cabal update && cabal install git-annex --only-dependencies || true"] cabalupdated = homedir ".cabal" "packages" "hackage.haskell.org" "00-index.cache" -standardAutoBuilderContainer :: (System -> Docker.Image) -> Architecture -> Int -> TimeOut -> Docker.Container -standardAutoBuilderContainer dockerImage arch buildminute timeout = Docker.container (arch ++ "-git-annex-builder") - (dockerImage $ System (Debian Testing) arch) - & os (System (Debian Testing) arch) - & Apt.stdSourcesList - & Apt.installed ["systemd"] - & Apt.unattendedUpgrades - & User.accountFor (User builduser) - & tree arch - & buildDepsApt - & autobuilder arch (Cron.Times $ show buildminute ++ " * * * *") timeout - & Docker.tweaked - -standardAutoBuilderContainerNspawn :: Architecture -> Int -> TimeOut -> Systemd.Container -standardAutoBuilderContainerNspawn arch buildminute timeout = Systemd.container name bootstrap - & os myos +standardAutoBuilderContainer :: Architecture -> Int -> TimeOut -> Systemd.Container +standardAutoBuilderContainer arch buildminute timeout = Systemd.container name bootstrap + & os osver & Apt.stdSourcesList & Apt.unattendedUpgrades & User.accountFor (User builduser) @@ -118,29 +105,25 @@ standardAutoBuilderContainerNspawn arch buildminute timeout = Systemd.container & autobuilder arch (Cron.Times $ show buildminute ++ " * * * *") timeout where name = arch ++ "-git-annex-builder" - bootstrap = Chroot.debootstrapped myos mempty - myos = System (Debian Testing) arch + bootstrap = Chroot.debootstrapped osver mempty + osver = System (Debian Testing) arch -androidAutoBuilderContainer :: (System -> Docker.Image) -> Times -> TimeOut -> Docker.Container -androidAutoBuilderContainer dockerImage crontimes timeout = - androidContainer dockerImage "android-git-annex-builder" (tree "android") builddir +androidAutoBuilderContainer :: Times -> TimeOut -> Systemd.Container +androidAutoBuilderContainer crontimes timeout = + androidContainer "android-git-annex-builder" (tree "android") builddir & Apt.unattendedUpgrades & autobuilder "android" crontimes timeout -- Android is cross-built in a Debian i386 container, using the Android NDK. androidContainer :: (IsProp (Property (CInfo NoInfo i)), (Combines (Property NoInfo) (Property i))) - => (System -> Docker.Image) - -> Docker.ContainerName + => Systemd.MachineName -> Property i -> FilePath - -> Docker.Container -androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.container name - (dockerImage osver) + -> Systemd.Container +androidContainer name setupgitannexdir gitannexdir = Systemd.container name bootstrap & os osver & Apt.stdSourcesList - & Apt.installed ["systemd"] - & Docker.tweaked & User.accountFor (User builduser) & File.dirExists gitbuilderdir & File.ownerGroup homedir (User builduser) (Group builduser) @@ -159,6 +142,7 @@ androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.containe [ "cd " ++ gitannexdir ++ " && ./standalone/android/install-haskell-packages" ] osver = System (Debian Testing) "i386" + bootstrap = Chroot.debootstrapped osver mempty -- armel builder has a companion container using amd64 that -- runs the build first to get TH splices. They need -- cgit v1.3-2-g0d8e From 8d98d4351b33c0df716dbaf269f5b5ac9db4a39a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 28 May 2015 09:34:47 -0400 Subject: reorder --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index eb831025..86bf104c 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -127,9 +127,9 @@ androidContainer name setupgitannexdir gitannexdir = Systemd.container name boot & User.accountFor (User builduser) & File.dirExists gitbuilderdir & File.ownerGroup homedir (User builduser) (Group builduser) - & buildDepsApt & flagFile chrootsetup ("/chrootsetup") `requires` setupgitannexdir + & buildDepsApt & flagFile haskellpkgsinstalled ("/haskellpkgsinstalled") where -- Use git-annex's android chroot setup script, which will install -- cgit v1.3-2-g0d8e From 78fecfcba47901c6c3ff5087cc091d802c5c99d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 29 May 2015 19:18:35 -0400 Subject: propellor spin --- config-joey.hs | 24 ++++++++++++++++++---- .../Property/SiteSpecific/GitAnnexBuilder.hs | 20 +++++++++--------- 2 files changed, 30 insertions(+), 14 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index 4978c8af..92a6c318 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -129,17 +129,33 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" & Apt.unattendedUpgrades & Postfix.satellite + & Apt.serviceInstalledRunning "ntp" & Systemd.persistentJournal - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer "amd64" 15 "2h") - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer "i386" 15 "2h") - & Systemd.nspawned (GitAnnexBuilder.androidAutoBuilderContainer (Cron.Times "1 1 * * *") "3h") + + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + (System (Debian Testing) "amd64") fifteenpast "2h") + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + (System (Debian Testing) "i386") fifteenpast "2h") + & Systemd.nspawned (GitAnnexBuilder.androidAutoBuilderContainer + (Cron.Times "1 1 * * *") "3h") + where + fifteenpast = Cron.Times "15 * * * *" honeybee :: Host -honeybee = standardSystem "honeybee.kitenet.net" Unstable "armhf" +honeybee = standardSystem "honeybee.kitenet.net" Testing "armhf" [ "Arm git-annex build box." ] & ipv6 "2001:4830:1600:187::2" + -- No unattended upgrades as there is currently no console access. + -- (Also, system is not currently running a stock kernel, + -- although it should be able to.) & Postfix.satellite + & Apt.serviceInstalledRunning "ntp" + & Apt.serviceInstalledRunning "aiccu" + + -- Using unstable to get new enough ghc for TH on arm. + & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + (System (Debian Unstable) "armel") (Cron.Daily) "22h") -- This is not a complete description of kite, since it's a -- multiuser system with eg, user passwords that are not deployed diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 86bf104c..6b73bee9 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -94,19 +94,19 @@ cabalDeps = flagFile go cabalupdated go = userScriptProperty (User builduser) ["cabal update && cabal install git-annex --only-dependencies || true"] cabalupdated = homedir ".cabal" "packages" "hackage.haskell.org" "00-index.cache" -standardAutoBuilderContainer :: Architecture -> Int -> TimeOut -> Systemd.Container -standardAutoBuilderContainer arch buildminute timeout = Systemd.container name bootstrap - & os osver - & Apt.stdSourcesList - & Apt.unattendedUpgrades - & User.accountFor (User builduser) - & tree arch - & buildDepsApt - & autobuilder arch (Cron.Times $ show buildminute ++ " * * * *") timeout +standardAutoBuilderContainer :: System -> Times -> TimeOut -> Systemd.Container +standardAutoBuilderContainer osver@(System _ arch) crontime timeout = + Systemd.container name bootstrap + & os osver + & Apt.stdSourcesList + & Apt.unattendedUpgrades + & User.accountFor (User builduser) + & tree arch + & buildDepsApt + & autobuilder arch crontime timeout where name = arch ++ "-git-annex-builder" bootstrap = Chroot.debootstrapped osver mempty - osver = System (Debian Testing) arch androidAutoBuilderContainer :: Times -> TimeOut -> Systemd.Container androidAutoBuilderContainer crontimes timeout = -- cgit v1.3-2-g0d8e From b5a8c7227b15bb4c821221c6f4c3ca8fd1e1a062 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 29 May 2015 22:51:32 -0400 Subject: workaround bug --- config-joey.hs | 11 +++++++++-- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index 92a6c318..510fd8da 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -25,6 +25,7 @@ import qualified Propellor.Property.Obnam as Obnam import qualified Propellor.Property.Gpg as Gpg import qualified Propellor.Property.Systemd as Systemd import qualified Propellor.Property.Journald as Journald +import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Property.OS as OS import qualified Propellor.Property.HostingProvider.CloudAtCost as CloudAtCost import qualified Propellor.Property.HostingProvider.Linode as Linode @@ -153,9 +154,15 @@ honeybee = standardSystem "honeybee.kitenet.net" Testing "armhf" & Apt.serviceInstalledRunning "ntp" & Apt.serviceInstalledRunning "aiccu" + -- Not using systemd-nspawn because it's broken (kernel issue?) + -- & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + -- osver Cron.Daily "22h") + & Chroot.provisioned + (Chroot.debootstrapped builderos mempty "/var/lib/containers/armel-git-annex-builder" + & GitAnnexBuilder.standardAutoBuilder builderos Cron.Daily "22h") + where -- Using unstable to get new enough ghc for TH on arm. - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer - (System (Debian Unstable) "armel") (Cron.Daily) "22h") + builderos = System (Debian Unstable) "armel" -- This is not a complete description of kite, since it's a -- multiuser system with eg, user passwords that are not deployed diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 6b73bee9..3c638721 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -97,6 +97,14 @@ cabalDeps = flagFile go cabalupdated standardAutoBuilderContainer :: System -> Times -> TimeOut -> Systemd.Container standardAutoBuilderContainer osver@(System _ arch) crontime timeout = Systemd.container name bootstrap + & standardAutoBuilder osver crontime timeout + where + name = arch ++ "-git-annex-builder" + bootstrap = Chroot.debootstrapped osver mempty + +standardAutoBuilder :: System -> Times -> TimeOut -> Property HasInfo +standardAutoBuilder osver@(System _ arch) crontime timeout = + propertyList "git-annex-builder" $ props & os osver & Apt.stdSourcesList & Apt.unattendedUpgrades @@ -104,9 +112,6 @@ standardAutoBuilderContainer osver@(System _ arch) crontime timeout = & tree arch & buildDepsApt & autobuilder arch crontime timeout - where - name = arch ++ "-git-annex-builder" - bootstrap = Chroot.debootstrapped osver mempty androidAutoBuilderContainer :: Times -> TimeOut -> Systemd.Container androidAutoBuilderContainer crontimes timeout = -- cgit v1.3-2-g0d8e From 446a2e4c9a3fe27782fd6d5d3228fc83a83fe82a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Jun 2015 13:55:07 -0400 Subject: update --- config-joey.hs | 19 +++-- .../Property/SiteSpecific/GitAnnexBuilder.hs | 88 +++++++--------------- 2 files changed, 40 insertions(+), 67 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/config-joey.hs b/config-joey.hs index 73c9687b..8e4ee9dc 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -133,9 +133,11 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" & Apt.serviceInstalledRunning "ntp" & Systemd.persistentJournal - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + & Systemd.nspawned (GitAnnexBuilder.autoBuilderContainer + GitAnnexBuilder.standardAutoBuilder (System (Debian Testing) "amd64") fifteenpast "2h") - & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer + & Systemd.nspawned (GitAnnexBuilder.autoBuilderContainer + GitAnnexBuilder.standardAutoBuilder (System (Debian Testing) "i386") fifteenpast "2h") & Systemd.nspawned (GitAnnexBuilder.androidAutoBuilderContainer (Cron.Times "1 1 * * *") "3h") @@ -151,15 +153,20 @@ honeybee = standardSystem "honeybee.kitenet.net" Testing "armhf" -- (Also, system is not currently running a stock kernel, -- although it should be able to.) & Postfix.satellite - & Apt.serviceInstalledRunning "ntp" & Apt.serviceInstalledRunning "aiccu" + & Apt.serviceInstalledRunning "swapspace" + & Apt.serviceInstalledRunning "ntp" -- Not using systemd-nspawn because it's broken (kernel issue?) - -- & Systemd.nspawned (GitAnnexBuilder.standardAutoBuilderContainer - -- osver Cron.Daily "22h") + -- & Systemd.nspawned (GitAnnexBuilder.autoBuilderContainer + -- GitAnnexBuilder.armAutoBuilder + -- builderos Cron.Daily "22h") & Chroot.provisioned (Chroot.debootstrapped builderos mempty "/var/lib/container/armel-git-annex-builder" - & GitAnnexBuilder.standardAutoBuilder builderos Cron.Daily "22h") + & "/etc/timezone" `File.hasContent` ["America/New_York"] + & GitAnnexBuilder.armAutoBuilder + builderos (Cron.Times "1 1 * * *") "12h" + ) where -- Using unstable to get new enough ghc for TH on arm. builderos = System (Debian Unstable) "armel" diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 3c638721..d64852aa 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -6,9 +6,7 @@ import Propellor import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.User as User import qualified Propellor.Property.Cron as Cron -import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.File as File -import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.Systemd as Systemd import qualified Propellor.Property.Chroot as Chroot import Propellor.Property.Cron (Times) @@ -50,8 +48,6 @@ autobuilder arch crontimes timeout = combineProperties "gitannexbuilder" $ props tree :: Architecture -> Property HasInfo tree buildarch = combineProperties "gitannexbuilder tree" $ props & Apt.installed ["git"] - -- gitbuilderdir directory already exists when docker volume is used, - -- but with wrong owner. & File.dirExists gitbuilderdir & File.ownerGroup gitbuilderdir (User builduser) (Group builduser) & gitannexbuildercloned @@ -86,6 +82,13 @@ buildDepsNoHaskellLibs = Apt.installed "alex", "happy", "c2hs" ] +haskellPkgsInstalled :: String -> Property NoInfo +haskellPkgsInstalled dir = flagFile go ("/haskellpkgsinstalled") + where + go = userScriptProperty (User builduser) + [ "cd " ++ builddir ++ " && ./standalone/ " ++ dir ++ "/install-haskell-packages" + ] + -- Installs current versions of git-annex's deps from cabal, but only -- does so once. cabalDeps :: Property NoInfo @@ -94,23 +97,36 @@ cabalDeps = flagFile go cabalupdated go = userScriptProperty (User builduser) ["cabal update && cabal install git-annex --only-dependencies || true"] cabalupdated = homedir ".cabal" "packages" "hackage.haskell.org" "00-index.cache" -standardAutoBuilderContainer :: System -> Times -> TimeOut -> Systemd.Container -standardAutoBuilderContainer osver@(System _ arch) crontime timeout = +autoBuilderContainer :: (System -> Property HasInfo) -> System -> Times -> TimeOut -> Systemd.Container +autoBuilderContainer mkprop osver@(System _ arch) crontime timeout = Systemd.container name bootstrap - & standardAutoBuilder osver crontime timeout + & mkprop osver + & buildDepsApt + & autobuilder arch crontime timeout where name = arch ++ "-git-annex-builder" bootstrap = Chroot.debootstrapped osver mempty -standardAutoBuilder :: System -> Times -> TimeOut -> Property HasInfo -standardAutoBuilder osver@(System _ arch) crontime timeout = +standardAutoBuilder :: System -> Property HasInfo +standardAutoBuilder osver@(System _ arch) = propertyList "git-annex-builder" $ props & os osver & Apt.stdSourcesList & Apt.unattendedUpgrades & User.accountFor (User builduser) & tree arch - & buildDepsApt + +armAutoBuilder :: System -> Times -> TimeOut -> Property HasInfo +armAutoBuilder osver@(System _ arch) crontime timeout = + propertyList "git-annex-builder (arm)" $ props + & standardAutoBuilder osver + & buildDepsNoHaskellLibs + -- Works around ghc crash with parallel builds on arm. + & (homedir ".cabal" "config") + `File.lacksLine` "jobs: $ncpus" + -- Install patched haskell packages for portability to + -- arm NAS's using old kernel versions. + & haskellPkgsInstalled "linux" & autobuilder arch crontime timeout androidAutoBuilderContainer :: Times -> TimeOut -> Systemd.Container @@ -135,7 +151,7 @@ androidContainer name setupgitannexdir gitannexdir = Systemd.container name boot & flagFile chrootsetup ("/chrootsetup") `requires` setupgitannexdir & buildDepsApt - & flagFile haskellpkgsinstalled ("/haskellpkgsinstalled") + & haskellPkgsInstalled "android" where -- Use git-annex's android chroot setup script, which will install -- ghc-android and the NDK, all build deps, etc, in the home @@ -143,55 +159,5 @@ androidContainer name setupgitannexdir gitannexdir = Systemd.container name boot chrootsetup = scriptProperty [ "cd " ++ gitannexdir ++ " && ./standalone/android/buildchroot-inchroot" ] - haskellpkgsinstalled = userScriptProperty (User builduser) - [ "cd " ++ gitannexdir ++ " && ./standalone/android/install-haskell-packages" - ] osver = System (Debian Testing) "i386" bootstrap = Chroot.debootstrapped osver mempty - --- armel builder has a companion container using amd64 that --- runs the build first to get TH splices. They need --- to have the same versions of all haskell libraries installed. -armelCompanionContainer :: (System -> Docker.Image) -> Docker.Container -armelCompanionContainer dockerImage = Docker.container "armel-git-annex-builder-companion" - (dockerImage $ System (Debian Unstable) "amd64") - & os (System (Debian Testing) "amd64") - & Apt.stdSourcesList - & Apt.installed ["systemd"] - -- This volume is shared with the armel builder. - & Docker.volume gitbuilderdir - & User.accountFor (User builduser) - -- Install current versions of build deps from cabal. - & tree "armel" - & buildDepsNoHaskellLibs - & cabalDeps - -- The armel builder can ssh to this companion. - & Docker.expose "22" - & Apt.serviceInstalledRunning "ssh" - & Ssh.authorizedKeys (User builduser) (Context "armel-git-annex-builder") - & Docker.tweaked - -armelAutoBuilderContainer :: (System -> Docker.Image) -> Times -> TimeOut -> Docker.Container -armelAutoBuilderContainer dockerImage crontimes timeout = Docker.container "armel-git-annex-builder" - (dockerImage $ System (Debian Unstable) "armel") - & os (System (Debian Testing) "armel") - & Apt.stdSourcesList - & Apt.installed ["systemd"] - & Apt.installed ["openssh-client"] - & Docker.link "armel-git-annex-builder-companion" "companion" - & Docker.volumes_from "armel-git-annex-builder-companion" - & User.accountFor (User builduser) - -- TODO: automate installing haskell libs - -- (Currently have to run - -- git-annex/standalone/linux/install-haskell-packages - -- which is not fully automated.) - & buildDepsNoHaskellLibs - & autobuilder "armel" crontimes timeout - `requires` tree "armel" - & Ssh.keyImported SshRsa (User builduser) (Context "armel-git-annex-builder") - & trivial writecompanionaddress - & Docker.tweaked - where - writecompanionaddress = scriptProperty - [ "echo \"$COMPANION_PORT_22_TCP_ADDR\" > " ++ homedir "companion_address" - ] `describe` "companion_address file" -- cgit v1.3-2-g0d8e From 802f3c968df2ea623bf24102f21b22808f52d9ee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 1 Jun 2015 18:34:15 -0400 Subject: descs --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index d64852aa..70075968 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -109,7 +109,7 @@ autoBuilderContainer mkprop osver@(System _ arch) crontime timeout = standardAutoBuilder :: System -> Property HasInfo standardAutoBuilder osver@(System _ arch) = - propertyList "git-annex-builder" $ props + propertyList "standard git-annex autobuilder" $ props & os osver & Apt.stdSourcesList & Apt.unattendedUpgrades @@ -118,7 +118,7 @@ standardAutoBuilder osver@(System _ arch) = armAutoBuilder :: System -> Times -> TimeOut -> Property HasInfo armAutoBuilder osver@(System _ arch) crontime timeout = - propertyList "git-annex-builder (arm)" $ props + propertyList "arm git-annex autobuilder" $ props & standardAutoBuilder osver & buildDepsNoHaskellLibs -- Works around ghc crash with parallel builds on arm. -- cgit v1.3-2-g0d8e From 4ac4855a78ce992110b4171c3deeae1c9258ec18 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jul 2015 11:14:54 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index f9a0e0c9..e876f0da 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -859,6 +859,8 @@ legacyWebSites = propertyList "legacy web sites" $ props , " AllowOverride None" , Apache.allowAll , "" + , "RewriteEngine On" + , "RewriteRule .* http://www.sowsearpoetry.org/ [L]" ] & alias "wortroot.kitenet.net" & alias "www.wortroot.kitenet.net" -- cgit v1.3-2-g0d8e From 9bd152cfc6f4279cf7cd852bd04d7ec53808a712 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jul 2015 23:15:54 -0400 Subject: update --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 70075968..1609c0c1 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -150,7 +150,6 @@ androidContainer name setupgitannexdir gitannexdir = Systemd.container name boot & File.ownerGroup homedir (User builduser) (Group builduser) & flagFile chrootsetup ("/chrootsetup") `requires` setupgitannexdir - & buildDepsApt & haskellPkgsInstalled "android" where -- Use git-annex's android chroot setup script, which will install -- cgit v1.3-2-g0d8e From 08ce9c766653619e8a019be5f89ce055be310527 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 Jul 2015 00:20:06 -0400 Subject: update --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 1609c0c1..7fd56b40 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -67,7 +67,6 @@ tree buildarch = combineProperties "gitannexbuilder tree" $ props buildDepsApt :: Property HasInfo buildDepsApt = combineProperties "gitannexbuilder build deps" $ props & Apt.buildDep ["git-annex"] - & Apt.installed ["liblockfile-simple-perl"] & buildDepsNoHaskellLibs & Apt.buildDepIn builddir `describe` "git-annex source build deps installed" @@ -158,5 +157,5 @@ androidContainer name setupgitannexdir gitannexdir = Systemd.container name boot chrootsetup = scriptProperty [ "cd " ++ gitannexdir ++ " && ./standalone/android/buildchroot-inchroot" ] - osver = System (Debian Testing) "i386" + osver = System (Debian (Stable "jessie")) "i386" bootstrap = Chroot.debootstrapped osver mempty -- cgit v1.3-2-g0d8e From 1d6972bb79361f81a07346f64778418da5d6c6df Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 Jul 2015 02:02:28 -0400 Subject: typo --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 7fd56b40..7f893431 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -85,7 +85,7 @@ haskellPkgsInstalled :: String -> Property NoInfo haskellPkgsInstalled dir = flagFile go ("/haskellpkgsinstalled") where go = userScriptProperty (User builduser) - [ "cd " ++ builddir ++ " && ./standalone/ " ++ dir ++ "/install-haskell-packages" + [ "cd " ++ builddir ++ " && ./standalone/" ++ dir ++ "/install-haskell-packages" ] -- Installs current versions of git-annex's deps from cabal, but only -- cgit v1.3-2-g0d8e From c167e6b75f8df8119c9c18de5f7f63b902642d57 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Jul 2015 20:58:52 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index e876f0da..4039ad0d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -387,7 +387,7 @@ twitRss = combineProperties "twitter rss" $ props -- Work around for expired ssl cert. pumpRss :: Property NoInfo pumpRss = Cron.job "pump rss" (Cron.Times "15 * * * *") (User "joey") "/srv/web/tmp.kitenet.net/" - "wget https://pump2rss.com/feed/joeyh@identi.ca.atom -O pump.atom.new --no-check-certificate 2>/dev/null; sed 's/ & / /g' pump.atom.new > pump.atom" + "wget https://rss.io.jpope.org/feed/joeyh@identi.ca.atom -O pump.atom.new --no-check-certificate 2>/dev/null; sed 's/ & / /g' pump.atom.new > pump.atom" ircBouncer :: Property HasInfo ircBouncer = propertyList "IRC bouncer" $ props -- cgit v1.3-2-g0d8e From 26fda3f39ade088afb9fd5001c364544f29d0146 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Jul 2015 11:48:30 -0400 Subject: ssh client needed for kiteshellbox --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/SiteSpecific') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 4039ad0d..b6524f69 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -405,7 +405,7 @@ ircBouncer = propertyList "IRC bouncer" $ props kiteShellBox :: Property NoInfo kiteShellBox = propertyList "kitenet.net shellinabox" - [ Apt.installed ["openssl", "shellinabox"] + [ Apt.installed ["openssl", "shellinabox", "openssh-client"] , File.hasContent "/etc/default/shellinabox" [ "# Deployed by propellor" , "SHELLINABOX_DAEMON_START=1" -- cgit v1.3-2-g0d8e