hs-mesos-0.20.1.0

Safe HaskellNone
LanguageHaskell2010

System.Mesos.Types

Contents

Synopsis

Core Framework & Executor types

Masters & Slaves

data MasterInfo Source

Describes a master. This will probably have more fields in the future which might be used, for example, to link a framework web UI to a master web UI.

data SlaveInfo Source

Describes a slave. Note that the slaveInfoSlaveID field is only available after a slave is registered with the master, and is made available here to facilitate re-registration. If checkpoint is set, the slave is checkpointing its own information and potentially frameworks' information (if a framework has checkpointing enabled).

Frameworks & Executors

data ExecutorInfo Source

Constructors

ExecutorInfo 

Fields

executorInfoExecutorID :: !ExecutorID
 
executorInfoFrameworkID :: !FrameworkID
 
executorInfoCommandInfo :: !CommandInfo
 
executorInfoContainerInfo :: !(Maybe ContainerInfo)

Executor provided with a container will launch the container with the executor's CommandInfo and we expect the container to act as a Mesos executor.

executorInfoResources :: ![Resource]
 
executorName :: !(Maybe ByteString)
 
executorSource :: !(Maybe ByteString)

Source is an identifier style string used by frameworks to track the source of an executor. This is useful when it's possible for different executor ids to be related semantically.

NOTE: Source is exposed alongside the resource usage of the executor via JSON on the slave. This allows users to import usage information into a time series database for monitoring.

executorData :: !(Maybe ByteString)
 

data FrameworkInfo Source

Describes a framework. If the user field is set to an empty string Mesos will automagically set it to the current user. Note that the ID is only available after a framework has registered, however, it is included here in order to facilitate scheduler failover (i.e., if it is set then the SchedulerDriver expects the scheduler is performing failover). The amount of time that the master will wait for the scheduler to failover before removing the framework is specified by frameworkFailoverTimeout. If frameworkCheckpoint is set, framework pid, executor pids and status updates are checkpointed to disk by the slaves. Checkpointing allows a restarted slave to reconnect with old executors and recover status updates, at the cost of disk I/O. The frameworkRole field is used to group frameworks for allocation decisions, depending on the allocation policy being used. If the frameworkHostname field is set to an empty string Mesos will automagically set it to the current hostname.

Resource allocation

data Request Source

Describes a request for resources that can be used by a framework to proactively influence the allocator.

Constructors

Request 

Fields

requestSlaveID :: !(Maybe SlaveID)

If value is provided, then this request is assumed to only apply to resources on the given slave.

reqResources :: ![Resource]
 

newtype Filters Source

Constructors

Filters 

Fields

refuseSeconds :: Maybe Double

Time to consider unused resources refused. Note that all unused resources will be considered refused and use the default value (below) regardless of whether Filters was passed to SchedulerDriver::launchTasks. You MUST pass Filters with this field set to change this behavior (i.e., get another offer which includes unused resources sooner or later than the default).

Defaults to 5.0 if not set.

Launching Tasks

data TaskInfo Source

Describes a task. Passed from the scheduler all the way to an executor (see SchedulerDriver::launchTasks and Executor::launchTask).

A different executor can be used to launch this task, and subsequent tasks meant for the same executor can reuse the same ExecutorInfo struct.

Constructors

TaskInfo 

Fields

taskName :: !ByteString
 
taskID :: !TaskID
 
taskSlaveID :: !SlaveID
 
taskResources :: ![Resource]
 
taskImplementation :: !TaskExecutionInfo
 
taskData :: !(Maybe ByteString)
 
taskContainer :: !(Maybe ContainerInfo)

Task provided with a container will launch the container as part of this task paired with the task's CommandInfo.

taskHealthCheck :: !(Maybe HealthCheck)

A health check for the task (currently in *alpha* and initial support will only be for TaskInfo's that have a CommandInfo).

data CommandInfo Source

Describes a command, executed via:

/bin/sh -c value

Any URIs specified are fetched before executing the command. If the executable field for an uri is set, executable file permission is set on the downloaded file. Otherwise, if the downloaded file has a recognized archive extension (currently [compressed] tar and zip) it is extracted into the executor's working directory. In addition, any environment variables are set before executing the command (so they can be used to "parameterize" your command).

Constructors

CommandInfo 

Fields

commandInfoURIs :: ![CommandURI]
 
commandEnvironment :: !(Maybe [(ByteString, ByteString)])
 
commandValue :: !CommandValue
 
commandUser :: !(Maybe ByteString)

Enables executor and tasks to run as a specific user. If the user field is present both in FrameworkInfo and here, the CommandInfo user value takes precedence.

data Resource Source

Describes a resource on a machine. A resource can take on one of three types: scalar (double), a list of finite and discrete ranges (e.g., [1-10, 20-30]), or a set of items.

N.B. there is a slight deviation from the C++ API: the Haskell bindings convert Text values into a single element Set value in order to avoid having to expose yet another data type.

Task & Executor Status Updates

data Status Source

Indicates the state of the scheduler and executor driver after function calls.

data TaskStatus Source

Describes the current status of a task.

Constructors

TaskStatus 

Fields

taskStatusTaskID :: !TaskID
 
taskStatusState :: !TaskState
 
taskStatusMessage :: !(Maybe ByteString)

Possible message explaining state.

taskStatusData :: !(Maybe ByteString)
 
taskStatusSlaveID :: !(Maybe SlaveID)
 
taskStatusExecutorID :: !(Maybe ExecutorID)
 
taskStatusTimestamp :: !(Maybe Double)
 
taskStatusHealthy :: !(Maybe Bool)

Describes whether the task has been determined to be healthy (true) or unhealthy (false) according to the HealthCheck field in the command info.

data TaskState Source

Describes possible task states. IMPORTANT: Mesos assumes tasks that enter terminal states (see below) imply the task is no longer running and thus clean up any thing associated with the task (ultimately offering any resources being consumed by that task to another task).

Constructors

Staging

Initial state. Framework status updates should not use.

Starting 
TaskRunning 
Finished

TERMINAL.

Failed

TERMINAL.

Killed

TERMINAL.

Lost

TERMINAL.

Identifiers

newtype SlaveID Source

A unique ID assigned to a slave. Currently, a slave gets a new ID whenever it (re)registers with Mesos. Framework writers shouldn't assume any binding between a slave ID and and a hostname.

Constructors

SlaveID 

newtype OfferID Source

A unique ID assigned to an offer.

Constructors

OfferID 

newtype TaskID Source

A framework generated ID to distinguish a task. The ID must remain unique while the task is active. However, a framework can reuse an ID _only_ if a previous task with the same ID has reached a terminal state (e.g., Finished, Lost, Killed, etc.). See isTerminal for a utility function to simplify checking task state.

Constructors

TaskID 

newtype ExecutorID Source

A framework generated ID to distinguish an executor. Only one executor with the same ID can be active on the same slave at a time.

Constructors

ExecutorID 

newtype ContainerID Source

A slave generated ID to distinguish a container. The ID must be unique between any active or completed containers on the slave. In particular, containers for different runs of the same (framework, executor) pair must be unique.

Constructors

ContainerID 

Containerization Support

data Mode Source

Constructors

ReadWrite

Mount the volume in R/W mode

ReadOnly

Mount the volume as read-only

data ContainerType Source

Constructors

Docker 
Unknown Int

Not technically a container type. Represents the 'type' enum field if we get a container type that isn't Docker (e.g. from Mesos releases > 0.20)

Health Checks

data HealthCheck Source

Constructors

HealthCheck 

Fields

healthCheckStrategy :: !HealthCheckStrategy
 
healthCheckDelaySeconds :: !(Maybe Double)

Amount of time to wait until starting the health checks.

healthCheckIntervalSeconds :: !(Maybe Double)

Interval between health checks.

healthCheckTimeoutSeconds :: !(Maybe Double)

Amount of time to wait for the health check to complete.

healthCheckConsecutiveFailures :: !(Maybe Word32)

Number of consecutive failures until considered unhealthy.

healthCheckGracePeriodSeconds :: !(Maybe Double)

Amount of time to allow failed health checks since launch.

data HealthCheckStrategy Source

Constructors

HTTPCheck 

Fields

httpCheckPort :: !Word32

Port to send the HTTP request.

httpCheckPath :: !(Maybe ByteString)

HTTP request path. (defaults to "/".

httpCheckStatuses :: ![Word32]

Expected response statuses. Not specifying any statuses implies that any returned status is acceptable.

CommandCheck 

Fields

commandCheckCommand :: !CommandInfo

Command health check.

Resource Usage & Performance Statistics

data ResourceStatistics Source

Constructors

ResourceStatistics 

Fields

resourceStatisticsTimestamp :: !Double
 
resourceStatisticsCPUsUserTimeSecs :: !(Maybe Double)

Total CPU time spent in user mode

resourceStatisticsCPUsSystemTimeSecs :: !(Maybe Double)

Total CPU time spent in kernel mode.

resourceCPUsLimit :: !Double

Number of CPUs allocated.

resourceCPUsPeriods :: !(Maybe Word32)

cpu.stat on process throttling (for contention issues).

resourceCPUsThrottled :: !(Maybe Word32)

cpu.stat on process throttling (for contention issues).

resourceCPUsThrottledTimeSecs :: !(Maybe Double)

cpu.stat on process throttling (for contention issues).

resourceMemoryResidentSetSize :: !(Maybe Word64)

Resident set size

resourceMemoryLimitBytes :: !(Maybe Word64)

Amount of memory resources allocated.

resourceMemoryFileBytes :: !(Maybe Word64)
 
resourceMemoryAnonymousBytes :: !(Maybe Word64)
 
resourceMemoryMappedFileBytes :: !(Maybe Word64)
 
resourcePerformanceStatistics :: !(Maybe PerformanceStatistics)
 
resourceNetRxPackets :: !(Maybe Word64)
 
resourceNetRxBytes :: !(Maybe Word64)
 
resourceNetRxErrors :: !(Maybe Word64)
 
resourceNetRxDropped :: !(Maybe Word64)
 
resourceNetTxPackets :: !(Maybe Word64)
 
resourceNetTxBytes :: !(Maybe Word64)
 
resourceNetTxErrors :: !(Maybe Word64)
 
resourceNetTxDropped :: !(Maybe Word64)
 

data ResourceUsage Source

Describes a snapshot of the resource usage for an executor.

Resource usage is for an executor. For tasks launched with an explicit executor, the executor id is provided. For tasks launched without an executor, our internal executor will be used. In this case, we provide the task id here instead, in order to make this message easier for schedulers to work with.

Constructors

ResourceUsage 

Fields

resourceUsageSlaveID :: !SlaveID
 
resourceUsageFrameworkID :: !FrameworkID
 
resourceUsageExecutorID :: !(Maybe ExecutorID)

If present, this executor was explicitly specified.

resourceUsageExecutorName :: !(Maybe ByteString)

If present, this executor was explicitly specified.

resourceUsageTaskID :: !(Maybe TaskID)

If present, this task did not have an executor.

resourceUsageStatistics :: !(Maybe ResourceStatistics)

If missing, the isolation module cannot provide resource usage.

data PerformanceStatistics Source

Constructors

PerformanceStatistics 

Fields

performanceStatisticsTimestamp :: !Double

Start of sample interval, in seconds since the Epoch.

performanceStatisticsDuration :: !Double

Duration of sample interval, in seconds.

performanceStatisticsCycles :: !(Maybe Word64)

Hardware events

performanceStatisticsStalledCyclesFrontend :: !(Maybe Word64)
 
performanceStatisticsStalledCyclesBackend :: !(Maybe Word64)
 
performanceStatisticsInstructions :: !(Maybe Word64)
 
performanceStatisticsCacheReferences :: !(Maybe Word64)
 
performanceStatisticsCacheMisses :: !(Maybe Word64)
 
performanceStatisticsBranches :: !(Maybe Word64)
 
performanceStatisticsBranchMisses :: !(Maybe Word64)
 
performanceStatisticsBusCycles :: !(Maybe Word64)
 
performanceStatisticsRefCycles :: !(Maybe Word64)
 
performanceStatisticsCpuClock :: !(Maybe Double)

Software events

performanceStatisticsTaskClock :: !(Maybe Double)
 
performanceStatisticsPageFaults :: !(Maybe Word64)
 
performanceStatisticsMinorFaults :: !(Maybe Word64)
 
performanceStatisticsMajorFaults :: !(Maybe Word64)
 
performanceStatisticsContextSwitches :: !(Maybe Word64)
 
performanceStatisticsCpuMigrations :: !(Maybe Word64)
 
performanceStatisticsAlignmentFaults :: !(Maybe Word64)
 
performanceStatisticsEmulationFaults :: !(Maybe Word64)
 
performanceStatisticsL1DcacheLoads :: !(Maybe Word64)

Hardware cache events

performanceStatisticsL1DcacheLoadMisses :: !(Maybe Word64)
 
performanceStatisticsL1DcacheStores :: !(Maybe Word64)
 
performanceStatisticsL1DcacheStoreMisses :: !(Maybe Word64)
 
performanceStatisticsL1DcachePrefetches :: !(Maybe Word64)
 
performanceStatisticsL1DcachePrefetchMisses :: !(Maybe Word64)
 
performanceStatisticsL1IcacheLoads :: !(Maybe Word64)
 
performanceStatisticsL1IcacheLoadMisses :: !(Maybe Word64)
 
performanceStatisticsL1IcachePrefetches :: !(Maybe Word64)
 
performanceStatisticsL1IcachePrefetchMisses :: !(Maybe Word64)
 
performanceStatisticsLlcLoads :: !(Maybe Word64)
 
performanceStatisticsLlcLoadMisses :: !(Maybe Word64)
 
performanceStatisticsLlcStores :: !(Maybe Word64)
 
performanceStatisticsLlcStoreMisses :: !(Maybe Word64)
 
performanceStatisticsLlcPrefetches :: !(Maybe Word64)
 
performanceStatisticsLlcPrefetchMisses :: !(Maybe Word64)
 
performanceStatisticsDtlbLoads :: !(Maybe Word64)
 
performanceStatisticsDtlbLoadMisses :: !(Maybe Word64)
 
performanceStatisticsDtlbStores :: !(Maybe Word64)
 
performanceStatisticsDtlbStoreMisses :: !(Maybe Word64)
 
performanceStatisticsDtlbPrefetches :: !(Maybe Word64)
 
performanceStatisticsDtlbPrefetchMisses :: !(Maybe Word64)
 
performanceStatisticsItlbLoads :: !(Maybe Word64)
 
performanceStatisticsItlbLoadMisses :: !(Maybe Word64)
 
performanceStatisticsBranchLoads :: !(Maybe Word64)
 
performanceStatisticsBranchLoadMisses :: !(Maybe Word64)
 
performanceStatisticsNodeLoads :: !(Maybe Word64)
 
performanceStatisticsNodeLoadMisses :: !(Maybe Word64)
 
performanceStatisticsNodeStores :: !(Maybe Word64)
 
performanceStatisticsNodeStoreMisses :: !(Maybe Word64)
 
performanceStatisticsNodePrefetches :: !(Maybe Word64)
 
performanceStatisticsNodePrefetchMisses :: !(Maybe Word64)
 

Instances

Eq PerformanceStatistics 
Show PerformanceStatistics 
CPPValue PerformanceStatistics 
HasTimestamp PerformanceStatistics Double 
HasDuration PerformanceStatistics Double 
HasPerformanceStatistics ResourceStatistics (Maybe PerformanceStatistics) 
HasTaskClock PerformanceStatistics (Maybe Double) 
HasStalledCyclesFrontend PerformanceStatistics (Maybe Word64) 
HasStalledCyclesBackend PerformanceStatistics (Maybe Word64) 
HasRefCycles PerformanceStatistics (Maybe Word64) 
HasPageFaults PerformanceStatistics (Maybe Word64) 
HasNodeStores PerformanceStatistics (Maybe Word64) 
HasNodeStoreMisses PerformanceStatistics (Maybe Word64) 
HasNodePrefetches PerformanceStatistics (Maybe Word64) 
HasNodePrefetchMisses PerformanceStatistics (Maybe Word64) 
HasNodeLoads PerformanceStatistics (Maybe Word64) 
HasNodeLoadMisses PerformanceStatistics (Maybe Word64) 
HasMinorFaults PerformanceStatistics (Maybe Word64) 
HasMajorFaults PerformanceStatistics (Maybe Word64) 
HasLlcStores PerformanceStatistics (Maybe Word64) 
HasLlcStoreMisses PerformanceStatistics (Maybe Word64) 
HasLlcPrefetches PerformanceStatistics (Maybe Word64) 
HasLlcPrefetchMisses PerformanceStatistics (Maybe Word64) 
HasLlcLoads PerformanceStatistics (Maybe Word64) 
HasLlcLoadMisses PerformanceStatistics (Maybe Word64) 
HasL1IcachePrefetches PerformanceStatistics (Maybe Word64) 
HasL1IcachePrefetchMisses PerformanceStatistics (Maybe Word64) 
HasL1IcacheLoads PerformanceStatistics (Maybe Word64) 
HasL1IcacheLoadMisses PerformanceStatistics (Maybe Word64) 
HasL1DcacheStores PerformanceStatistics (Maybe Word64) 
HasL1DcacheStoreMisses PerformanceStatistics (Maybe Word64) 
HasL1DcachePrefetches PerformanceStatistics (Maybe Word64) 
HasL1DcachePrefetchMisses PerformanceStatistics (Maybe Word64) 
HasL1DcacheLoads PerformanceStatistics (Maybe Word64) 
HasL1DcacheLoadMisses PerformanceStatistics (Maybe Word64) 
HasItlbLoads PerformanceStatistics (Maybe Word64) 
HasItlbLoadMisses PerformanceStatistics (Maybe Word64) 
HasInstructions PerformanceStatistics (Maybe Word64) 
HasEmulationFaults PerformanceStatistics (Maybe Word64) 
HasDtlbStores PerformanceStatistics (Maybe Word64) 
HasDtlbStoreMisses PerformanceStatistics (Maybe Word64) 
HasDtlbPrefetches PerformanceStatistics (Maybe Word64) 
HasDtlbPrefetchMisses PerformanceStatistics (Maybe Word64) 
HasDtlbLoads PerformanceStatistics (Maybe Word64) 
HasDtlbLoadMisses PerformanceStatistics (Maybe Word64) 
HasCycles PerformanceStatistics (Maybe Word64) 
HasCpuMigrations PerformanceStatistics (Maybe Word64) 
HasCpuClock PerformanceStatistics (Maybe Double) 
HasContextSwitches PerformanceStatistics (Maybe Word64) 
HasCacheReferences PerformanceStatistics (Maybe Word64) 
HasCacheMisses PerformanceStatistics (Maybe Word64) 
HasBusCycles PerformanceStatistics (Maybe Word64) 
HasBranches PerformanceStatistics (Maybe Word64) 
HasBranchMisses PerformanceStatistics (Maybe Word64) 
HasBranchLoads PerformanceStatistics (Maybe Word64) 
HasBranchLoadMisses PerformanceStatistics (Maybe Word64) 
HasAlignmentFaults PerformanceStatistics (Maybe Word64) 

Task Status

Credentials & ACLs

data Credential Source

Credential used for authentication.

NOTE: credentialPrincipal is used for authenticating the framework with the master. This is different from frameworkUser which is used to determine the user under which the framework's executors/tasks are run.