Safe Haskell | None |
---|
Node freeing scheduler
Synopsis
- options :: IO [OptType]
- arguments :: [ArgCompletion]
- annotateOpCode :: Timestamp -> String -> Annotator
- onlyExternal :: (List, List) -> Node -> Bool
- noSecondaries :: Node -> Bool
- allInstancesOnOnlineNodes :: (List, List) -> Bool
- allNodesCapacityFor :: Instance -> (List, List) -> Bool
- balance :: (List, List) -> ((List, List), [MoveJob])
- onlineOfflineNode :: Bool -> (List, List) -> Ndx -> (List, List)
- onlineOfflineNodes :: Bool -> [Ndx] -> (List, List) -> ((List, List), [MoveJob])
- offlineNodes :: [Ndx] -> (List, List) -> ((List, List), [MoveJob])
- onlineNodes :: [Ndx] -> (List, List) -> ((List, List), [MoveJob])
- canOnlineOffline :: Bool -> Instance -> (List, List) -> [Node] -> Bool
- canOffline :: Instance -> (List, List) -> [Node] -> Bool
- sufficesOnline :: Instance -> (List, List) -> [Node] -> Bool
- greedyOfflineNodes :: Instance -> (List, List) -> [Node] -> [Node]
- tryOnline :: Instance -> (List, List) -> [Node] -> Maybe [Node]
- instanceFromSpecAndFactor :: String -> Double -> ISpec -> Instance
- getMoveOpCodes :: List -> List -> [JobSet] -> Result [([[OpCode]], String)]
- getTagOpCodes :: [Node] -> Result [([[OpCode]], String)]
- getPowerOffOpCodes :: [Node] -> Result [([[OpCode]], String)]
- getPowerOnOpCodes :: [Node] -> Result [([[OpCode]], String)]
- maybeExecJobs :: Options -> String -> Result [([[OpCode]], String)] -> IO (Result ())
- main :: Options -> [String] -> IO ()
Documentation
arguments :: [ArgCompletion] Source #
The list of arguments supported by the program.
annotateOpCode :: Timestamp -> String -> Annotator Source #
Wraps an OpCode
in a MetaOpCode
while also adding a comment
about what generated the opcode.
onlyExternal :: (List, List) -> Node -> Bool Source #
Within a cluster configuration, decide if the node hosts only externally-mirrored instances.
noSecondaries :: Node -> Bool Source #
Predicate of not being secondary node for any instance
allInstancesOnOnlineNodes :: (List, List) -> Bool Source #
Predicate whether, in a configuration, all running instances are on online nodes.
allNodesCapacityFor :: Instance -> (List, List) -> Bool Source #
Predicate whether, in a configuration, each node has enough resources to additionally host the given instance.
balance :: (List, List) -> ((List, List), [MoveJob]) Source #
Balance a configuration, possible for 0 steps, till no further improvement is possible.
onlineOfflineNode :: Bool -> (List, List) -> Ndx -> (List, List) Source #
In a configuration, mark a node as online or offline.
onlineOfflineNodes :: Bool -> [Ndx] -> (List, List) -> ((List, List), [MoveJob]) Source #
Offline or online a list nodes, and return the state after a balancing attempt together with the sequence of moves that lead there.
offlineNodes :: [Ndx] -> (List, List) -> ((List, List), [MoveJob]) Source #
Offline a list of nodes, and return the state after balancing with the sequence of moves that lead there.
onlineNodes :: [Ndx] -> (List, List) -> ((List, List), [MoveJob]) Source #
Online a list of nodes, and return the state after balancing with the sequence of moves that lead there.
canOnlineOffline :: Bool -> Instance -> (List, List) -> [Node] -> Bool Source #
Predicate on whether a list of nodes can be offlined or onlined simultaneously in a given configuration, while still leaving enough capacity on every node for the given instance.
canOffline :: Instance -> (List, List) -> [Node] -> Bool Source #
Predicate on whether a list of nodes can be offlined simultaneously.
sufficesOnline :: Instance -> (List, List) -> [Node] -> Bool Source #
Predicate on whether onlining a list of nodes suffices to get enough free resources for given instance.
greedyOfflineNodes :: Instance -> (List, List) -> [Node] -> [Node] Source #
Greedily offline the nodes, starting from the last element, and return the list of nodes that could simultaneously be offlined, while keeping the resources specified by an instance.
tryOnline :: Instance -> (List, List) -> [Node] -> Maybe [Node] Source #
Try to provide enough resources by onlining an initial segment of a list of nodes. Return Nothing, if even onlining all of them is not enough.
instanceFromSpecAndFactor :: String -> Double -> ISpec -> Instance Source #
From a specification, name, and factor create an instance that uses that factor times the specification, rounded down.
getMoveOpCodes :: List -> List -> [JobSet] -> Result [([[OpCode]], String)] Source #
Get opcodes for the given move job.
getTagOpCodes :: [Node] -> Result [([[OpCode]], String)] Source #
Get opcodes for tagging nodes with standby.
getPowerOffOpCodes :: [Node] -> Result [([[OpCode]], String)] Source #
Get opcodes for powering off nodes