Documentation ¶
Overview ¶
Collection of monitors to create synchronicity
Package realis provides the ability to use Thrift API to communicate with Apache Aurora.
Index ¶
- Constants
- Variables
- func ExponentialBackoff(backoff Backoff, logger Logger, condition ConditionFunc) error
- func GetCerts(certPath string) (*x509.CertPool, error)
- func IsTemporary(err error) bool
- func IsTimeout(err error) bool
- func Jitter(duration time.Duration, maxFactor float64) time.Duration
- func LeaderFromZK(cluster Cluster) (string, error)
- func LeaderFromZKOpts(options ...ZKOpt) (string, error)
- func LoadClusters(config string) (map[string]Cluster, error)
- func MasterNodesFromZK(cluster Cluster) (map[string][]string, error)
- func MasterNodesFromZKOpts(options ...ZKOpt) (map[string][]string, error)
- func MesosFromZKOpts(options ...ZKOpt) (string, error)
- func MesosMasterNodesFromZK(cluster Cluster) (map[string][]string, error)
- func MesosMasterNodesFromZKOpts(options ...ZKOpt) (map[string][]string, error)
- func ResourcesToMap(resources []*aurora.Resource) map[string]float64
- func TerminalUpdateStates() []aurora.JobUpdateStatus
- func ToRetryCount(err error) *retryErr
- type AuroraJob
- func (j *AuroraJob) AddDedicatedConstraint(role, name string) *AuroraJob
- func (j *AuroraJob) AddLabel(key string, value string) *AuroraJob
- func (j *AuroraJob) AddLimitConstraint(name string, limit int32) *AuroraJob
- func (j *AuroraJob) AddNamedPorts(names ...string) *AuroraJob
- func (j *AuroraJob) AddPorts(num int) *AuroraJob
- func (j *AuroraJob) AddURIs(extract bool, cache bool, values ...string) *AuroraJob
- func (j *AuroraJob) AddValueConstraint(name string, negated bool, values ...string) *AuroraJob
- func (j *AuroraJob) AuroraTask() *AuroraTask
- func (j *AuroraJob) BuildThermosPayload() error
- func (j *AuroraJob) CPU(cpus float64) *AuroraJob
- func (j *AuroraJob) Container(container Container) *AuroraJob
- func (j *AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) *AuroraJob
- func (j *AuroraJob) CronSchedule(cron string) *AuroraJob
- func (j *AuroraJob) Disk(disk int64) *AuroraJob
- func (j *AuroraJob) Environment(env string) *AuroraJob
- func (j *AuroraJob) ExecutorData(data string) *AuroraJob
- func (j *AuroraJob) ExecutorName(name string) *AuroraJob
- func (j *AuroraJob) GPU(gpu int64) *AuroraJob
- func (j *AuroraJob) GetInstanceCount() int32
- func (j *AuroraJob) InstanceCount(instCount int32) *AuroraJob
- func (j *AuroraJob) IsService(isService bool) *AuroraJob
- func (j *AuroraJob) JobConfig() *aurora.JobConfiguration
- func (j *AuroraJob) JobKey() aurora.JobKey
- func (j *AuroraJob) MaxFailure(maxFail int32) *AuroraJob
- func (j *AuroraJob) Name(name string) *AuroraJob
- func (j *AuroraJob) PartitionPolicy(reschedule bool, delay int64) *AuroraJob
- func (j *AuroraJob) Priority(priority int32) *AuroraJob
- func (j *AuroraJob) Production(production bool) *AuroraJob
- func (j *AuroraJob) RAM(ram int64) *AuroraJob
- func (j *AuroraJob) Role(role string) *AuroraJob
- func (j *AuroraJob) TaskConfig() *aurora.TaskConfig
- func (j *AuroraJob) ThermosExecutor(thermos ThermosExecutor) *AuroraJob
- func (j *AuroraJob) Tier(tier string) *AuroraJob
- type AuroraTask
- func (t *AuroraTask) AddDedicatedConstraint(role, name string) *AuroraTask
- func (t *AuroraTask) AddLabel(key string, value string) *AuroraTask
- func (t *AuroraTask) AddLimitConstraint(name string, limit int32) *AuroraTask
- func (t *AuroraTask) AddNamedPorts(names ...string) *AuroraTask
- func (t *AuroraTask) AddPorts(num int) *AuroraTask
- func (t *AuroraTask) AddURIs(extract bool, cache bool, values ...string) *AuroraTask
- func (t *AuroraTask) AddValueConstraint(name string, negated bool, values ...string) *AuroraTask
- func (t *AuroraTask) BuildThermosPayload() error
- func (t *AuroraTask) CPU(cpus float64) *AuroraTask
- func (t *AuroraTask) Clone() *AuroraTask
- func (t *AuroraTask) Container(container Container) *AuroraTask
- func (t *AuroraTask) Disk(disk int64) *AuroraTask
- func (t *AuroraTask) Environment(env string) *AuroraTask
- func (t *AuroraTask) ExecutorData(data string) *AuroraTask
- func (t *AuroraTask) ExecutorName(name string) *AuroraTask
- func (t *AuroraTask) GPU(gpu int64) *AuroraTask
- func (t *AuroraTask) IsService(isService bool) *AuroraTask
- func (t *AuroraTask) JobKey() aurora.JobKey
- func (t *AuroraTask) MaxFailure(maxFail int32) *AuroraTask
- func (t *AuroraTask) Name(name string) *AuroraTask
- func (t *AuroraTask) PartitionPolicy(policy aurora.PartitionPolicy) *AuroraTask
- func (t *AuroraTask) Priority(priority int32) *AuroraTask
- func (t *AuroraTask) Production(production bool) *AuroraTask
- func (t *AuroraTask) RAM(ram int64) *AuroraTask
- func (t *AuroraTask) Role(role string) *AuroraTask
- func (t *AuroraTask) TaskConfig() *aurora.TaskConfig
- func (t *AuroraTask) ThermosExecutor(thermos ThermosExecutor) *AuroraTask
- func (t *AuroraTask) Tier(tier string) *AuroraTask
- type Backoff
- type Client
- func (c *Client) AbortJobUpdate(updateKey aurora.JobUpdateKey, message string) error
- func (c *Client) AddInstances(instKey aurora.InstanceKey, count int32) error
- func (c *Client) AvailOfferReport() (OfferReport, error)
- func (c *Client) Close()
- func (c *Client) CreateJob(auroraJob *AuroraJob) error
- func (c *Client) CreateService(update *JobUpdate) (*aurora.StartJobUpdateResult_, error)
- func (c *Client) DescheduleCronJob(key aurora.JobKey) error
- func (c *Client) DrainHosts(hosts ...string) ([]*aurora.HostStatus, error)
- func (c *Client) EndMaintenance(hosts ...string) ([]*aurora.HostStatus, error)
- func (c *Client) FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.TaskConfig, error)
- func (c *Client) FitTasks(taskConfig *aurora.TaskConfig, offers []Offer) (int64, error)
- func (c *Client) ForceExplicitTaskReconciliation(batchSize *int32) error
- func (c *Client) ForceImplicitTaskReconciliation() error
- func (c *Client) GetInstanceIds(key aurora.JobKey, states []aurora.ScheduleStatus) ([]int32, error)
- func (c *Client) GetJobSummary(role string) (*aurora.JobSummaryResult_, error)
- func (c *Client) GetJobUpdateSummaries(jobUpdateQuery *aurora.JobUpdateQuery) (*aurora.GetJobUpdateSummariesResult_, error)
- func (c *Client) GetJobs(role string) (*aurora.GetJobsResult_, error)
- func (c *Client) GetPendingReason(query *aurora.TaskQuery) ([]*aurora.PendingReason, error)
- func (c *Client) GetQuota(role string) (*aurora.GetQuotaResult_, error)
- func (c *Client) GetSchedulerURL() string
- func (c *Client) GetTaskStatus(query *aurora.TaskQuery) ([]*aurora.ScheduledTask, error)
- func (c *Client) GetTasksWithoutConfigs(query *aurora.TaskQuery) ([]*aurora.ScheduledTask, error)
- func (r *Client) JobExists(key aurora.JobKey) (bool, error)
- func (c *Client) JobUpdateDetails(updateQuery aurora.JobUpdateQuery) ([]*aurora.JobUpdateDetails, error)
- func (c *Client) KillInstances(key aurora.JobKey, instances ...int32) (bool, error)
- func (c *Client) KillJob(key aurora.JobKey) error
- func (c *Client) MaintenanceHosts() ([]string, error)
- func (c *Client) MaintenanceStatus(hosts ...string) (*aurora.MaintenanceStatusResult_, error)
- func (c *Client) MonitorAutoPausedUpdate(key aurora.JobUpdateKey, interval, timeout time.Duration) (int, error)
- func (c *Client) MonitorHostMaintenance(hosts []string, modes []aurora.MaintenanceMode, ...) (map[string]bool, error)
- func (c *Client) MonitorInstances(key aurora.JobKey, instances int32, interval, timeout time.Duration) (bool, error)
- func (c *Client) MonitorJobUpdate(updateKey aurora.JobUpdateKey, interval, timeout time.Duration) (bool, error)
- func (c *Client) MonitorJobUpdateQuery(updateQuery aurora.JobUpdateQuery, interval time.Duration, ...) ([]*aurora.JobUpdateSummary, error)
- func (c *Client) MonitorJobUpdateStatus(updateKey aurora.JobUpdateKey, desiredStatuses []aurora.JobUpdateStatus, ...) (aurora.JobUpdateStatus, error)
- func (c *Client) MonitorScheduleStatus(key aurora.JobKey, instanceCount int32, ...) (bool, error)
- func (c *Client) Offers() ([]Offer, error)
- func (c *Client) PauseJobUpdate(updateKey *aurora.JobUpdateKey, message string) error
- func (c *Client) PerformBackup() error
- func (c *Client) PulseJobUpdate(updateKey aurora.JobUpdateKey) (aurora.JobUpdatePulseStatus, error)
- func (c *Client) RealisConfig() *clientConfig
- func (c *Client) ReestablishConn() error
- func (c *Client) RemoveInstances(key aurora.JobKey, count int) error
- func (c *Client) RestartInstances(key aurora.JobKey, instances ...int32) error
- func (c *Client) RestartJob(key aurora.JobKey) error
- func (c *Client) ResumeJobUpdate(updateKey aurora.JobUpdateKey, message string) error
- func (c *Client) RollbackJobUpdate(key aurora.JobUpdateKey, message string) error
- func (c *Client) SLADrainHosts(policy *aurora.SlaPolicy, timeout int64, hosts ...string) ([]*aurora.HostStatus, error)
- func (c *Client) ScheduleCronJob(auroraJob *AuroraJob) error
- func (c *Client) SetQuota(role string, cpu *float64, ramMb *int64, diskMb *int64) error
- func (c *Client) Snapshot() error
- func (c *Client) StartCronJob(key aurora.JobKey) error
- func (c *Client) StartJobUpdate(updateJob *JobUpdate, message string) (*aurora.StartJobUpdateResult_, error)
- func (c *Client) StartMaintenance(hosts ...string) ([]*aurora.HostStatus, error)
- type ClientOption
- func BackOff(b Backoff) ClientOption
- func BasicAuth(username, password string) ClientOption
- func CertsPath(certspath string) ClientOption
- func ClientCerts(clientKey, clientCert string) ClientOption
- func Debug() ClientOption
- func FailOnPermanentErrors() ClientOption
- func InsecureSkipVerify(InsecureSkipVerify bool) ClientOption
- func SchedulerUrl(url string) ClientOption
- func SetLogger(l Logger) ClientOption
- func ThriftBinary() ClientOption
- func ThriftJSON() ClientOption
- func Timeout(timeout time.Duration) ClientOption
- func Trace() ClientOption
- func ZKCluster(cluster *Cluster) ClientOption
- func ZKUrl(url string) ClientOption
- func ZookeeperOptions(opts ...ZKOpt) ClientOption
- type Cluster
- type ConditionFunc
- type Container
- type DockerContainer
- type Endpoint
- type JobUpdate
- func (j *JobUpdate) AddDedicatedConstraint(role, name string) *JobUpdate
- func (j *JobUpdate) AddInstanceRange(first, last int32) *JobUpdate
- func (j *JobUpdate) AddLabel(key string, value string) *JobUpdate
- func (j *JobUpdate) AddLimitConstraint(name string, limit int32) *JobUpdate
- func (j *JobUpdate) AddNamedPorts(names ...string) *JobUpdate
- func (j *JobUpdate) AddPorts(num int) *JobUpdate
- func (j *JobUpdate) AddURIs(extract bool, cache bool, values ...string) *JobUpdate
- func (j *JobUpdate) AddValueConstraint(name string, negated bool, values ...string) *JobUpdate
- func (j *JobUpdate) BatchSize(size int32) *JobUpdate
- func (j *JobUpdate) BatchUpdateStrategy(autoPause bool, batchSize int32) *JobUpdate
- func (j *JobUpdate) BuildThermosPayload() error
- func (j *JobUpdate) CPU(cpus float64) *JobUpdate
- func (j *JobUpdate) Container(container Container) *JobUpdate
- func (j *JobUpdate) Disk(disk int64) *JobUpdate
- func (j *JobUpdate) Environment(env string) *JobUpdate
- func (j *JobUpdate) ExecutorData(data string) *JobUpdate
- func (j *JobUpdate) ExecutorName(name string) *JobUpdate
- func (j *JobUpdate) InstanceCount(inst int32) *JobUpdate
- func (j *JobUpdate) IsService(isService bool) *JobUpdate
- func (j *JobUpdate) JobKey() aurora.JobKey
- func (j *JobUpdate) MaxFailedInstances(inst int32) *JobUpdate
- func (j *JobUpdate) MaxPerInstanceFailures(inst int32) *JobUpdate
- func (j *JobUpdate) Name(name string) *JobUpdate
- func (j *JobUpdate) PartitionPolicy(reschedule bool, delay int64) *JobUpdate
- func (j *JobUpdate) Priority(priority int32) *JobUpdate
- func (j *JobUpdate) Production(production bool) *JobUpdate
- func (j *JobUpdate) PulseIntervalTimeout(timeout time.Duration) *JobUpdate
- func (j *JobUpdate) QueueUpdateStrategy(groupSize int32) *JobUpdate
- func (j *JobUpdate) RAM(ram int64) *JobUpdate
- func (j *JobUpdate) Role(role string) *JobUpdate
- func (j *JobUpdate) RollbackOnFail(rollback bool) *JobUpdate
- func (j *JobUpdate) SlaAware(slaAware bool) *JobUpdate
- func (j *JobUpdate) TaskConfig() *aurora.TaskConfig
- func (j *JobUpdate) TaskMaxFailure(maxFail int32) *JobUpdate
- func (j *JobUpdate) ThermosExecutor(thermos ThermosExecutor) *JobUpdate
- func (j *JobUpdate) Tier(tier string) *JobUpdate
- func (j *JobUpdate) VariableBatchStrategy(autoPause bool, batchSizes ...int32) *JobUpdate
- func (j *JobUpdate) WaitForBatchCompletion(batchWait bool) *JobUpdate
- func (j *JobUpdate) WatchTime(timeout time.Duration) *JobUpdate
- type LevelLogger
- func (l LevelLogger) DebugPrint(a ...interface{})
- func (l LevelLogger) DebugPrintf(format string, a ...interface{})
- func (l LevelLogger) DebugPrintln(a ...interface{})
- func (l *LevelLogger) EnableDebug(enable bool)
- func (l *LevelLogger) EnableTrace(enable bool)
- func (l LevelLogger) TracePrint(a ...interface{})
- func (l LevelLogger) TracePrintf(format string, a ...interface{})
- func (l LevelLogger) TracePrintln(a ...interface{})
- type Logger
- type MaintenanceList
- type MesosAddress
- type MesosContainer
- type MesosInstance
- type NoopLogger
- type Offer
- type OfferCount
- type OfferGroupReport
- type OfferReport
- type ResourceType
- type ServiceInstance
- type TemporaryErr
- type ThermosConstraint
- type ThermosExecutor
- type ThermosProcess
- type ThermosTask
- type TransportProtocol
- type ZKOpt
Constants ¶
const VERSION = "2.28.0"
Variables ¶
var ActiveJobUpdateStates = make(map[aurora.JobUpdateStatus]bool)
var ActiveStates = make(map[aurora.ScheduleStatus]bool)
var AwaitingPulseJobUpdateStates = make(map[aurora.JobUpdateStatus]bool)
var LiveStates = make(map[aurora.ScheduleStatus]bool)
var SlaveAssignedStates = make(map[aurora.ScheduleStatus]bool)
var TerminalStates = make(map[aurora.ScheduleStatus]bool)
Functions ¶
func ExponentialBackoff ¶
func ExponentialBackoff(backoff Backoff, logger Logger, condition ConditionFunc) error
ExponentialBackoff is a modified version of the Kubernetes exponential-backoff code. It repeats a condition check with exponential backoff and checks the condition up to Steps times, increasing the wait by multiplying the previous duration by Factor.
If Jitter is greater than zero, a random amount of each duration is added (between duration and duration*(1+jitter)).
If the condition never returns true, ErrWaitTimeout is returned. Errors do not cause the function to return.
func IsTemporary ¶
func Jitter ¶
Jitter returns a time.Duration between duration and duration + maxFactor * duration.
This allows clients to avoid converging on periodic behavior. If maxFactor is 0.0, a suggested default value will be chosen.
func LeaderFromZK ¶
Retrieves current Aurora leader from ZK.
func LeaderFromZKOpts ¶
Retrieves current Aurora leader from ZK with a custom configuration.
func LoadClusters ¶
Loads clusters.json file traditionally located at /etc/aurora/clusters.json
func MasterNodesFromZK ¶ added in v2.29.0
Retrieves current Aurora master nodes from ZK.
func MasterNodesFromZKOpts ¶ added in v2.29.0
Retrieves current Mesos master nodes/leader from ZK with a custom configuration.
func MesosFromZKOpts ¶ added in v2.22.2
Retrieves current mesos leader from ZK with a custom configuration.
func MesosMasterNodesFromZK ¶ added in v2.29.0
Retrieves current Mesos Aurora master nodes from ZK.
func MesosMasterNodesFromZKOpts ¶ added in v2.29.0
Retrieves current mesos master nodes/leader from ZK with a custom configuration.
func ResourcesToMap ¶ added in v2.28.0
func TerminalUpdateStates ¶ added in v2.22.0
func TerminalUpdateStates() []aurora.JobUpdateStatus
TerminalUpdateStates returns a slice containing all the terminal states an update may be in. This is a function in order to avoid having a slice that can be accidentally mutated.
func ToRetryCount ¶
func ToRetryCount(err error) *retryErr
Helper function for testing verification to avoid whitebox testing as well as keeping retryErr as a private. Should NOT be used under any other context.
Types ¶
type AuroraJob ¶
type AuroraJob struct {
// contains filtered or unexported fields
}
Structure to collect all information pertaining to an Aurora job.
func (*AuroraJob) AddDedicatedConstraint ¶
func (*AuroraJob) AddLimitConstraint ¶
func (*AuroraJob) AddNamedPorts ¶
func (*AuroraJob) AddValueConstraint ¶
func (*AuroraJob) AuroraTask ¶
func (j *AuroraJob) AuroraTask() *AuroraTask
Get the current job configurations key to use for some realis calls.
func (*AuroraJob) BuildThermosPayload ¶
func (*AuroraJob) CronCollisionPolicy ¶
func (j *AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) *AuroraJob
func (*AuroraJob) CronSchedule ¶
func (*AuroraJob) Environment ¶
Set AuroraJob Key environment. Explicit changes to AuroraTask's job key are not needed because they share a pointer to the same JobKey.
func (*AuroraJob) ExecutorData ¶
func (*AuroraJob) ExecutorName ¶
func (*AuroraJob) GetInstanceCount ¶
How many instances of the job to run
func (*AuroraJob) InstanceCount ¶
How many instances of the job to run
func (*AuroraJob) JobConfig ¶
func (j *AuroraJob) JobConfig() *aurora.JobConfiguration
Get the current job configurations key to use for some realis calls.
func (*AuroraJob) MaxFailure ¶
func (*AuroraJob) PartitionPolicy ¶
func (*AuroraJob) Production ¶ added in v2.26.0
func (*AuroraJob) TaskConfig ¶
func (j *AuroraJob) TaskConfig() *aurora.TaskConfig
func (*AuroraJob) ThermosExecutor ¶
func (j *AuroraJob) ThermosExecutor(thermos ThermosExecutor) *AuroraJob
type AuroraTask ¶
type AuroraTask struct {
// contains filtered or unexported fields
}
func NewTask ¶
func NewTask() *AuroraTask
func TaskFromThrift ¶
func TaskFromThrift(config *aurora.TaskConfig) *AuroraTask
Helper method to convert aurora.TaskConfig to gorealis AuroraTask type
func (*AuroraTask) AddDedicatedConstraint ¶
func (t *AuroraTask) AddDedicatedConstraint(role, name string) *AuroraTask
From Aurora Docs: dedicated attribute. Aurora treats this specially, and only allows matching jobs to run on these machines, and will only schedule matching jobs on these machines. When a job is created, the scheduler requires that the $role component matches the role field in the job configuration, and will reject the job creation otherwise. A wildcard (*) may be used for the role portion of the dedicated attribute, which will allow any owner to elect for a job to run on the host(s)
func (*AuroraTask) AddLabel ¶
func (t *AuroraTask) AddLabel(key string, value string) *AuroraTask
Adds a Mesos label to the job. Note that Aurora will add the prefix "org.apache.aurora.metadata." to the beginning of each key.
func (*AuroraTask) AddLimitConstraint ¶
func (t *AuroraTask) AddLimitConstraint(name string, limit int32) *AuroraTask
From Aurora Docs: A constraint that specifies the maximum number of active tasks on a host with a matching attribute that may be scheduled simultaneously.
func (*AuroraTask) AddNamedPorts ¶
func (t *AuroraTask) AddNamedPorts(names ...string) *AuroraTask
Add a named port to the job configuration These are random ports as it's not currently possible to request specific ports using Aurora.
func (*AuroraTask) AddPorts ¶
func (t *AuroraTask) AddPorts(num int) *AuroraTask
Adds a request for a number of ports to the job configuration. The names chosen for these ports will be org.apache.aurora.port.X, where X is the current port count for the job configuration starting at 0. These are random ports as it's not currently possible to request specific ports using Aurora.
func (*AuroraTask) AddURIs ¶
func (t *AuroraTask) AddURIs(extract bool, cache bool, values ...string) *AuroraTask
Add a list of URIs with the same extract and cache configuration. Scheduler must have --enable_mesos_fetcher flag enabled. Currently there is no duplicate detection.
func (*AuroraTask) AddValueConstraint ¶
func (t *AuroraTask) AddValueConstraint(name string, negated bool, values ...string) *AuroraTask
From Aurora Docs: Add a Value constraint name - Mesos slave attribute that the constraint is matched against. If negated = true , treat this as a 'not' - to avoid specific values. Values - list of values we look for in attribute name
func (*AuroraTask) BuildThermosPayload ¶
func (t *AuroraTask) BuildThermosPayload() error
func (*AuroraTask) CPU ¶
func (t *AuroraTask) CPU(cpus float64) *AuroraTask
func (*AuroraTask) Clone ¶
func (t *AuroraTask) Clone() *AuroraTask
func (*AuroraTask) Container ¶
func (t *AuroraTask) Container(container Container) *AuroraTask
Set a container to run for the job configuration to run.
func (*AuroraTask) Disk ¶
func (t *AuroraTask) Disk(disk int64) *AuroraTask
func (*AuroraTask) Environment ¶
func (t *AuroraTask) Environment(env string) *AuroraTask
Set AuroraTask Key environment.
func (*AuroraTask) ExecutorData ¶
func (t *AuroraTask) ExecutorData(data string) *AuroraTask
Will be included as part of entire task inside the scheduler that will be serialized.
func (*AuroraTask) ExecutorName ¶
func (t *AuroraTask) ExecutorName(name string) *AuroraTask
Set name of the executor that will the task will be configured to.
func (*AuroraTask) GPU ¶
func (t *AuroraTask) GPU(gpu int64) *AuroraTask
func (*AuroraTask) IsService ¶
func (t *AuroraTask) IsService(isService bool) *AuroraTask
Restart the job's tasks if they fail
func (*AuroraTask) JobKey ¶
func (t *AuroraTask) JobKey() aurora.JobKey
func (*AuroraTask) MaxFailure ¶
func (t *AuroraTask) MaxFailure(maxFail int32) *AuroraTask
How many failures to tolerate before giving up.
func (*AuroraTask) Name ¶
func (t *AuroraTask) Name(name string) *AuroraTask
Set AuroraTask Key Name.
func (*AuroraTask) PartitionPolicy ¶
func (t *AuroraTask) PartitionPolicy(policy aurora.PartitionPolicy) *AuroraTask
Set a partition policy for the job configuration to implement.
func (*AuroraTask) Priority ¶ added in v2.25.0
func (t *AuroraTask) Priority(priority int32) *AuroraTask
set priority for preemption or priority-queueing
func (*AuroraTask) Production ¶ added in v2.26.0
func (t *AuroraTask) Production(production bool) *AuroraTask
func (*AuroraTask) RAM ¶
func (t *AuroraTask) RAM(ram int64) *AuroraTask
func (*AuroraTask) Role ¶
func (t *AuroraTask) Role(role string) *AuroraTask
Set AuroraTask Key Role.
func (*AuroraTask) TaskConfig ¶
func (t *AuroraTask) TaskConfig() *aurora.TaskConfig
func (*AuroraTask) ThermosExecutor ¶
func (t *AuroraTask) ThermosExecutor(thermos ThermosExecutor) *AuroraTask
func (*AuroraTask) Tier ¶
func (t *AuroraTask) Tier(tier string) *AuroraTask
type Backoff ¶
type Backoff struct { Duration time.Duration // the base duration Factor float64 // Duration is multiplied by a factor each iteration Jitter float64 // The amount of jitter applied each iteration Steps int // Exit with error after this many steps }
Backoff determines how the retry mechanism should react after each failure and how many failures it should tolerate.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
This client implementation uses a retry mechanism for all Thrift Calls. It will retry all calls which result in a temporary failure as well as calls that fail due to an EOF being returned by the http client. Most permanent failures are now being caught by the thriftCallWithRetries function and not being retried but there may be corner cases not yet handled.
func (*Client) AbortJobUpdate ¶
func (c *Client) AbortJobUpdate(updateKey aurora.JobUpdateKey, message string) error
AbortJobUpdate terminates a job update in the scheduler. It requires the updateId which can be obtained on the Aurora web UI. This API is meant to be synchronous. It will attempt to wait until the update transitions to the aborted state. However, if the job update does not transition to the ABORT state an error will be returned.
func (*Client) AddInstances ¶
func (c *Client) AddInstances(instKey aurora.InstanceKey, count int32) error
Scale up the number of instances under a job configuration using the configuration for specific instance to scale up.
func (*Client) AvailOfferReport ¶ added in v2.28.0
func (c *Client) AvailOfferReport() (OfferReport, error)
AvailOfferReport returns a detailed summary of offers available for use. For example, 2 nodes offer 32 cpus and 10 nodes offer 1 cpus.
func (*Client) Close ¶
func (c *Client) Close()
Releases resources associated with the realis client.
func (*Client) CreateJob ¶
Sends a create job message to the scheduler with a specific job configuration. Although this API is able to create service jobs, it is better to use CreateService instead as that API uses the update thrift call which has a few extra features available. Use this API to create ad-hoc jobs.
func (*Client) CreateService ¶
func (c *Client) CreateService(update *JobUpdate) (*aurora.StartJobUpdateResult_, error)
This API uses an update thrift call to create the services giving a few more robust features.
func (*Client) DrainHosts ¶
func (c *Client) DrainHosts(hosts ...string) ([]*aurora.HostStatus, error)
Set a list of nodes to DRAINING. This means nothing will be able to be scheduled on them and any existing tasks will be killed and re-scheduled elsewhere in the cluster. Tasks from DRAINING nodes are not guaranteed to return to running unless there is enough capacity in the cluster to run them.
func (*Client) EndMaintenance ¶
func (c *Client) EndMaintenance(hosts ...string) ([]*aurora.HostStatus, error)
func (*Client) FetchTaskConfig ¶
func (c *Client) FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.TaskConfig, error)
Get the task configuration from the aurora scheduler for a job
func (*Client) FitTasks ¶ added in v2.28.0
FitTasks computes the number tasks can be fit in a list of offer
func (*Client) ForceExplicitTaskReconciliation ¶
Force an Explicit reconciliation between Mesos and Aurora
func (*Client) ForceImplicitTaskReconciliation ¶
Force an Implicit reconciliation between Mesos and Aurora
func (*Client) GetInstanceIds ¶
Uses predefined set of states to retrieve a set of active jobs in Apache Aurora.
func (*Client) GetJobSummary ¶ added in v2.25.0
func (c *Client) GetJobSummary(role string) (*aurora.JobSummaryResult_, error)
func (*Client) GetJobUpdateSummaries ¶
func (c *Client) GetJobUpdateSummaries(jobUpdateQuery *aurora.JobUpdateQuery) (*aurora.GetJobUpdateSummariesResult_, error)
func (*Client) GetPendingReason ¶
Get pending reason
func (*Client) GetQuota ¶
func (c *Client) GetQuota(role string) (*aurora.GetQuotaResult_, error)
GetQuota returns the resource aggregate for the given role
func (*Client) GetSchedulerURL ¶ added in v2.28.0
func (*Client) GetTaskStatus ¶
Get information about task including a fully hydrated task configuration object
func (*Client) GetTasksWithoutConfigs ¶
GetTasksWithoutConfigs gets information about task including without a task configuration object. This is a more lightweight version of GetTaskStatus but contains less information as a result.
func (*Client) JobUpdateDetails ¶
func (c *Client) JobUpdateDetails(updateQuery aurora.JobUpdateQuery) ([]*aurora.JobUpdateDetails, error)
func (*Client) KillInstances ¶
Kill specific instances of a job. Returns true, nil if a task was actually killed as a result of this API call. Returns false, nil if no tasks were killed as a result of this call but there was no error making the call.
func (*Client) MaintenanceHosts ¶ added in v2.28.0
MaintenanceHosts list all the hosts under maintenance
func (*Client) MaintenanceStatus ¶
func (c *Client) MaintenanceStatus(hosts ...string) (*aurora.MaintenanceStatusResult_, error)
func (*Client) MonitorAutoPausedUpdate ¶ added in v2.22.0
func (c *Client) MonitorAutoPausedUpdate(key aurora.JobUpdateKey, interval, timeout time.Duration) (int, error)
MonitorAutoPausedUpdate is a special monitor for auto pause enabled batch updates. This monitor ensures that the update being monitored is capable of auto pausing and has auto pausing enabled. After verifying this information, the monitor watches for the job to enter the ROLL_FORWARD_PAUSED state and calculates the current batch the update is in using information from the update configuration.
func (*Client) MonitorHostMaintenance ¶
func (c *Client) MonitorHostMaintenance(hosts []string, modes []aurora.MaintenanceMode, interval, timeout time.Duration) (map[string]bool, error)
Monitor host status until all hosts match the status provided. Returns a map where the value is true if the host is in one of the desired mode(s) or false if it is not as of the time when the monitor exited.
func (*Client) MonitorInstances ¶
func (c *Client) MonitorInstances(key aurora.JobKey, instances int32, interval, timeout time.Duration) (bool, error)
Monitor a AuroraJob until all instances enter one of the LiveStates
func (*Client) MonitorJobUpdate ¶
func (c *Client) MonitorJobUpdate(updateKey aurora.JobUpdateKey, interval, timeout time.Duration) (bool, error)
MonitorJobUpdate polls the scheduler every certain amount of time to see if the update has succeeded. If the update entered a terminal update state but it is not ROLLED_FORWARD, this function will return an error.
func (*Client) MonitorJobUpdateQuery ¶
func (c *Client) MonitorJobUpdateQuery( updateQuery aurora.JobUpdateQuery, interval time.Duration, timeout time.Duration) ([]*aurora.JobUpdateSummary, error)
func (*Client) MonitorJobUpdateStatus ¶
func (c *Client) MonitorJobUpdateStatus(updateKey aurora.JobUpdateKey, desiredStatuses []aurora.JobUpdateStatus, interval, timeout time.Duration) (aurora.JobUpdateStatus, error)
MonitorJobUpdateStatus polls the scheduler for information about an update until the update enters one of the desired states or until the function times out.
func (*Client) MonitorScheduleStatus ¶
func (c *Client) MonitorScheduleStatus(key aurora.JobKey, instanceCount int32, desiredStatuses []aurora.ScheduleStatus, interval, timeout time.Duration) (bool, error)
Monitor a AuroraJob until all instances enter a desired status. Defaults sets of desired statuses provided by the thrift API include: ActiveStates, SlaveAssignedStates, LiveStates, and TerminalStates
func (*Client) PauseJobUpdate ¶
func (c *Client) PauseJobUpdate(updateKey *aurora.JobUpdateKey, message string) error
Pause AuroraJob Update. UpdateID is returned from StartJobUpdate or the Aurora web UI.
func (*Client) PerformBackup ¶
Force Aurora Scheduler to write backup file to a file in the backup directory
func (*Client) PulseJobUpdate ¶
func (c *Client) PulseJobUpdate(updateKey aurora.JobUpdateKey) (aurora.JobUpdatePulseStatus, error)
Pulse AuroraJob Update on Aurora. UpdateID is returned from StartJobUpdate or the Aurora web UI.
func (*Client) RealisConfig ¶
func (c *Client) RealisConfig() *clientConfig
func (*Client) ReestablishConn ¶
func (*Client) RemoveInstances ¶
Scale down the number of instances under a job configuration using the configuration of a specific instance Instances with a higher instance ID will be removed first. For example, if our instance ID list is [0,1,2,3] and we want to remove 2 instances, 2 and 3 will always be picked.
func (*Client) RestartInstances ¶
Restarts specific instances specified
func (*Client) RestartJob ¶
Restarts all active tasks under a job configuration.
func (*Client) ResumeJobUpdate ¶
func (c *Client) ResumeJobUpdate(updateKey aurora.JobUpdateKey, message string) error
Resume Paused AuroraJob Update. UpdateID is returned from StartJobUpdate or the Aurora web UI.
func (*Client) RollbackJobUpdate ¶
func (c *Client) RollbackJobUpdate(key aurora.JobUpdateKey, message string) error
func (*Client) SLADrainHosts ¶
func (c *Client) SLADrainHosts(policy *aurora.SlaPolicy, timeout int64, hosts ...string) ([]*aurora.HostStatus, error)
Start SLA Aware Drain. defaultSlaPolicy is the fallback SlaPolicy to use if a task does not have an SlaPolicy. After timeoutSecs, tasks will be forcefully drained without checking SLA.
func (*Client) ScheduleCronJob ¶
func (*Client) SetQuota ¶
SetQuota sets a quota aggregate for the given role TODO(zircote) Currently investigating an error that is returned from thrift calls that include resources for `NamedPort` and `NumGpu`
func (*Client) StartJobUpdate ¶
func (c *Client) StartJobUpdate(updateJob *JobUpdate, message string) (*aurora.StartJobUpdateResult_, error)
Update all tasks under a job configuration. Currently gorealis doesn't support for canary deployments.
func (*Client) StartMaintenance ¶
func (c *Client) StartMaintenance(hosts ...string) ([]*aurora.HostStatus, error)
type ClientOption ¶
type ClientOption func(*clientConfig)
func BackOff ¶
func BackOff(b Backoff) ClientOption
func BasicAuth ¶
func BasicAuth(username, password string) ClientOption
clientConfig sets for options in clientConfig.
func CertsPath ¶
func CertsPath(certspath string) ClientOption
func ClientCerts ¶
func ClientCerts(clientKey, clientCert string) ClientOption
func FailOnPermanentErrors ¶
func FailOnPermanentErrors() ClientOption
FailOnPermanentErrors - If the client encounters a connection error the standard library considers permanent, stop retrying and return an error to the user.
func InsecureSkipVerify ¶
func InsecureSkipVerify(InsecureSkipVerify bool) ClientOption
func SchedulerUrl ¶
func SchedulerUrl(url string) ClientOption
func SetLogger ¶
func SetLogger(l Logger) ClientOption
Using the word set to avoid name collision with Interface.
func ThriftBinary ¶
func ThriftBinary() ClientOption
func ThriftJSON ¶
func ThriftJSON() ClientOption
func Timeout ¶
func Timeout(timeout time.Duration) ClientOption
func ZKCluster ¶
func ZKCluster(cluster *Cluster) ClientOption
func ZKUrl ¶
func ZKUrl(url string) ClientOption
func ZookeeperOptions ¶
func ZookeeperOptions(opts ...ZKOpt) ClientOption
Use this option if you'd like to override default settings for connecting to Zookeeper. See zk.go for what is possible to set as an option.
type Cluster ¶
type Cluster struct { Name string `json:"name"` AgentRoot string `json:"slave_root"` AgentRunDir string `json:"slave_run_directory"` ZK string `json:"zk"` ZKPort int `json:"zk_port"` SchedZKPath string `json:"scheduler_zk_path"` MesosZKPath string `json:"mesos_zk_path"` SchedURI string `json:"scheduler_uri"` ProxyURL string `json:"proxy_url"` AuthMechanism string `json:"auth_mechanism"` }
type ConditionFunc ¶
ConditionFunc returns true if the condition is satisfied, or an error if the loop should be aborted.
type DockerContainer ¶
type DockerContainer struct {
// contains filtered or unexported fields
}
func NewDockerContainer ¶
func NewDockerContainer() *DockerContainer
func (*DockerContainer) AddParameter ¶
func (c *DockerContainer) AddParameter(name, value string) *DockerContainer
func (*DockerContainer) Build ¶
func (c *DockerContainer) Build() *aurora.Container
func (*DockerContainer) Image ¶
func (c *DockerContainer) Image(image string) *DockerContainer
type JobUpdate ¶
type JobUpdate struct {
// contains filtered or unexported fields
}
Structure to collect all information required to create job update
func JobUpdateFromAuroraTask ¶
func JobUpdateFromAuroraTask(task *AuroraTask) *JobUpdate
Creates an update with default values using an AuroraTask as the underlying task configuration. This function has a high level understanding of Aurora Tasks and thus will support copying a task that is configured to use Thermos.
func JobUpdateFromConfig ¶
func JobUpdateFromConfig(task *aurora.TaskConfig) *JobUpdate
JobUpdateFromConfig creates an update with default values using an aurora.TaskConfig primitive as the underlying task configuration. This function should not be used unless the implications of using a primitive value are understood. For example, the primitive has no concept of Thermos.
func NewJobUpdate ¶
func NewJobUpdate() *JobUpdate
Create a default JobUpdate object with an empty task and no fields filled in.
func (*JobUpdate) AddDedicatedConstraint ¶
func (*JobUpdate) AddInstanceRange ¶ added in v2.22.1
AddInstanceRange allows updates to only touch a certain specific range of instances
func (*JobUpdate) AddLimitConstraint ¶
func (*JobUpdate) AddNamedPorts ¶
func (*JobUpdate) AddValueConstraint ¶
func (*JobUpdate) BatchUpdateStrategy ¶ added in v2.22.0
func (*JobUpdate) BuildThermosPayload ¶
func (*JobUpdate) Environment ¶
func (*JobUpdate) ExecutorData ¶
func (*JobUpdate) ExecutorName ¶
func (*JobUpdate) InstanceCount ¶
Set instance count the job will have after the update.
func (*JobUpdate) MaxFailedInstances ¶
Max number of FAILED instances to tolerate before terminating the update.
func (*JobUpdate) MaxPerInstanceFailures ¶
Max number of instance failures to tolerate before marking instance as FAILED.
func (*JobUpdate) PartitionPolicy ¶
func (*JobUpdate) Production ¶ added in v2.26.0
func (*JobUpdate) PulseIntervalTimeout ¶
Sets the interval at which pulses should be received by the job update before timing out.
func (*JobUpdate) QueueUpdateStrategy ¶ added in v2.22.0
func (*JobUpdate) RollbackOnFail ¶
When False, prevents auto rollback of a failed update.
func (*JobUpdate) SlaAware ¶ added in v2.22.1
SlaAware makes the scheduler enforce the SLA Aware policy if the job meets the SLA awareness criteria. By default, the scheduler will only apply SLA Awareness to jobs in the production tier with 20 or more instances.
func (*JobUpdate) TaskConfig ¶
func (j *JobUpdate) TaskConfig() *aurora.TaskConfig
func (*JobUpdate) TaskMaxFailure ¶ added in v2.22.1
func (*JobUpdate) ThermosExecutor ¶
func (j *JobUpdate) ThermosExecutor(thermos ThermosExecutor) *JobUpdate
func (*JobUpdate) VariableBatchStrategy ¶ added in v2.22.0
func (*JobUpdate) WaitForBatchCompletion ¶
Wait for all instances in a group to be done before moving on.
type LevelLogger ¶
type LevelLogger struct { Logger // contains filtered or unexported fields }
func (LevelLogger) DebugPrint ¶
func (l LevelLogger) DebugPrint(a ...interface{})
func (LevelLogger) DebugPrintf ¶
func (l LevelLogger) DebugPrintf(format string, a ...interface{})
func (LevelLogger) DebugPrintln ¶
func (l LevelLogger) DebugPrintln(a ...interface{})
func (*LevelLogger) EnableDebug ¶
func (l *LevelLogger) EnableDebug(enable bool)
func (*LevelLogger) EnableTrace ¶
func (l *LevelLogger) EnableTrace(enable bool)
func (LevelLogger) TracePrint ¶
func (l LevelLogger) TracePrint(a ...interface{})
func (LevelLogger) TracePrintf ¶
func (l LevelLogger) TracePrintf(format string, a ...interface{})
func (LevelLogger) TracePrintln ¶
func (l LevelLogger) TracePrintln(a ...interface{})
type Logger ¶
type Logger interface { Println(v ...interface{}) Printf(format string, v ...interface{}) Print(v ...interface{}) }
type MaintenanceList ¶ added in v2.28.0
type MaintenanceList struct { Drained []string `json:"DRAINED"` Scheduled []string `json:"SCHEDULED"` Draining map[string][]string `json:"DRAINING"` }
hosts on [aurora-scheduler]/maintenance endpoint
type MesosAddress ¶ added in v2.22.2
type MesosContainer ¶
type MesosContainer struct {
// contains filtered or unexported fields
}
func NewMesosContainer ¶
func NewMesosContainer() *MesosContainer
func (*MesosContainer) AddVolume ¶
func (c *MesosContainer) AddVolume(hostPath, containerPath string, mode aurora.Mode) *MesosContainer
func (*MesosContainer) AppcImage ¶
func (c *MesosContainer) AppcImage(name, imageId string) *MesosContainer
func (*MesosContainer) Build ¶
func (c *MesosContainer) Build() *aurora.Container
func (*MesosContainer) DockerImage ¶
func (c *MesosContainer) DockerImage(name, tag string) *MesosContainer
type MesosInstance ¶ added in v2.22.2
type MesosInstance struct { Address MesosAddress `json:"address"` Version string `json:"version"` }
MesosInstance is defined for mesos json stored in ZK.
type NoopLogger ¶
type NoopLogger struct{}
func (NoopLogger) Print ¶
func (NoopLogger) Print(a ...interface{})
func (NoopLogger) Printf ¶
func (NoopLogger) Printf(format string, a ...interface{})
func (NoopLogger) Println ¶
func (NoopLogger) Println(a ...interface{})
type Offer ¶ added in v2.28.0
type Offer struct { ID struct { Value string `json:"value"` } `json:"id"` FrameworkID struct { Value string `json:"value"` } `json:"framework_id"` AgentID struct { Value string `json:"value"` } `json:"agent_id"` Hostname string `json:"hostname"` URL struct { Scheme string `json:"scheme"` Address struct { Hostname string `json:"hostname"` IP string `json:"ip"` Port int `json:"port"` } `json:"address"` Path string `json:"path"` Query []interface{} `json:"query"` } `json:"url"` Resources []struct { Name string `json:"name"` Type string `json:"type"` Ranges struct { Range []struct { Begin int `json:"begin"` End int `json:"end"` } `json:"range"` } `json:"ranges,omitempty"` Role string `json:"role"` Reservations []interface{} `json:"reservations"` Scalar struct { Value float64 `json:"value"` } `json:"scalar,omitempty"` } `json:"resources"` Attributes []struct { Name string `json:"name"` Type string `json:"type"` Text struct { Value string `json:"value"` } `json:"text"` } `json:"attributes"` ExecutorIds []struct { Value string `json:"value"` } `json:"executor_ids"` }
Offers on [aurora-scheduler]/offers endpoint
type OfferCount ¶ added in v2.28.0
type OfferGroupReport ¶ added in v2.28.0
type OfferGroupReport map[string]OfferCount
type OfferReport ¶ added in v2.28.0
type OfferReport map[string]OfferGroupReport
type ServiceInstance ¶
type TemporaryErr ¶
type TemporaryErr struct {
// contains filtered or unexported fields
}
func NewTemporaryError ¶
func NewTemporaryError(err error) *TemporaryErr
Retrying after receiving this error is advised
func (*TemporaryErr) Temporary ¶
func (t *TemporaryErr) Temporary() bool
type ThermosConstraint ¶
type ThermosConstraint struct {
Order []string `json:"order,omitempty"`
}
type ThermosExecutor ¶
type ThermosExecutor struct { Task ThermosTask `json:"task""` // contains filtered or unexported fields }
func (*ThermosExecutor) AddProcess ¶
func (t *ThermosExecutor) AddProcess(process ThermosProcess) *ThermosExecutor
Processes must have unique names. Adding a process whose name already exists will result in overwriting the previous version of the process.
func (*ThermosExecutor) Clone ¶
func (t *ThermosExecutor) Clone() *ThermosExecutor
Deep copy of Thermos executor
func (*ThermosExecutor) ProcessOrder ¶
func (t *ThermosExecutor) ProcessOrder(order ...string) *ThermosExecutor
Order in which the Processes should be executed. Index 0 will be executed first, index N will be executed last.
type ThermosProcess ¶
type ThermosProcess struct { Name string `json:"name"` Cmdline string `json:"cmdline"` Daemon bool `json:"daemon"` Ephemeral bool `json:"ephemeral"` MaxFailures int `json:"max_failures"` MinDuration int `json:"min_duration"` Final bool `json:"final"` }
func NewThermosProcess ¶
func NewThermosProcess(name, command string) ThermosProcess
type ThermosTask ¶
type ThermosTask struct { Processes map[string]*ThermosProcess `json:"processes"` Constraints []*ThermosConstraint `json:"constraints"` Resources thermosResources `json:"resources"` }
func (*ThermosTask) MarshalJSON ¶
func (t *ThermosTask) MarshalJSON() ([]byte, error)
Custom Marshaling for Thermos Task to match what Thermos expects
func (*ThermosTask) UnmarshalJSON ¶
func (t *ThermosTask) UnmarshalJSON(data []byte) error
Custom Unmarshaling to match what Thermos would contain
type TransportProtocol ¶
type TransportProtocol int
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
gen-go
|
|
Helper functions to process aurora.Response
|
Helper functions to process aurora.Response |