Documentation ¶
Overview ¶
Collection of monitors to create synchronicity
Package realis provides the ability to use Thrift API to communicate with Apache Aurora.
Index ¶
- func AddBasicAuth(config *RealisConfig, username string, password string)
- func LeaderFromZK(cluster Cluster) (string, error)
- func LoadClusters(config string) (map[string]Cluster, error)
- type AuroraJob
- func (j AuroraJob) AddLabel(key string, value string) Job
- func (j AuroraJob) AddLimitConstraint(name string, limit int32) Job
- func (j AuroraJob) AddNamedPorts(names ...string) Job
- func (j AuroraJob) AddPorts(num int) Job
- func (j AuroraJob) AddURIs(extract bool, cache bool, values ...string) Job
- func (j AuroraJob) AddValueConstraint(name string, negated bool, values ...string) Job
- func (j AuroraJob) CPU(cpus float64) Job
- func (j AuroraJob) Container(container Container) Job
- func (j AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job
- func (j AuroraJob) CronSchedule(cron string) Job
- func (j AuroraJob) Disk(disk int64) Job
- func (j AuroraJob) Environment(env string) Job
- func (j AuroraJob) ExecutorData(data string) Job
- func (j AuroraJob) ExecutorName(name string) Job
- func (j AuroraJob) GetInstanceCount() int32
- func (j AuroraJob) InstanceCount(instCount int32) Job
- func (j AuroraJob) IsService(isService bool) Job
- func (j AuroraJob) JobConfig() *aurora.JobConfiguration
- func (j AuroraJob) JobKey() *aurora.JobKey
- func (j AuroraJob) MaxFailure(maxFail int32) Job
- func (j AuroraJob) Name(name string) Job
- func (j AuroraJob) RAM(ram int64) Job
- func (j AuroraJob) Role(role string) Job
- func (j AuroraJob) TaskConfig() *aurora.TaskConfig
- type Cluster
- type Container
- type DockerContainer
- type Endpoint
- type Job
- type MesosContainer
- type Monitor
- type NoopLogger
- type Realis
- type RealisConfig
- type ServiceInstance
- type UpdateJob
- func (u *UpdateJob) BatchSize(size int32) *UpdateJob
- func (u *UpdateJob) InstanceCount(inst int32) *UpdateJob
- func (u *UpdateJob) MaxFailedInstances(inst int32) *UpdateJob
- func (u *UpdateJob) MaxPerInstanceFailures(inst int32) *UpdateJob
- func (u *UpdateJob) RollbackOnFail(rollback bool) *UpdateJob
- func (u *UpdateJob) WaitForBatchCompletion(batchWait bool) *UpdateJob
- func (u *UpdateJob) WatchTime(milliseconds int32) *UpdateJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBasicAuth ¶
func AddBasicAuth(config *RealisConfig, username string, password string)
Helper function to add basic authorization needed to communicate with Apache Aurora.
func LeaderFromZK ¶
Loads leader from ZK endpoint.
Types ¶
type AuroraJob ¶
type AuroraJob struct {
// contains filtered or unexported fields
}
Structure to collect all information pertaining to an Aurora job.
func (AuroraJob) AddLabel ¶
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 (AuroraJob) AddLimitConstraint ¶
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 (AuroraJob) AddNamedPorts ¶
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 (AuroraJob) AddPorts ¶
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 (AuroraJob) AddURIs ¶
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 (AuroraJob) AddValueConstraint ¶
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 (AuroraJob) Container ¶ added in v1.0.2
Set a container to run for the job configuration to run. TODO (rdelvalle): Add no thermos mode where container is launched as a task and not an executor.
func (AuroraJob) CronCollisionPolicy ¶
func (j AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job
func (AuroraJob) CronSchedule ¶
func (AuroraJob) Environment ¶
Set Job Key environment.
func (AuroraJob) ExecutorData ¶
Will be included as part of entire task inside the scheduler that will be serialized.
func (AuroraJob) ExecutorName ¶
Set name of the executor that will the task will be configured to.
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 ¶
How many failures to tolerate before giving up.
func (AuroraJob) TaskConfig ¶
func (j AuroraJob) TaskConfig() *aurora.TaskConfig
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"` SchedURI string `json:"scheduler_uri"` ProxyURL string `json:"proxy_url"` AuthMechanism string `json:"auth_mechanism"` }
type DockerContainer ¶ added in v1.0.2
type DockerContainer struct {
// contains filtered or unexported fields
}
func NewDockerContainer ¶ added in v1.0.2
func NewDockerContainer() DockerContainer
func (DockerContainer) AddParameter ¶ added in v1.0.2
func (c DockerContainer) AddParameter(name, value string) DockerContainer
func (DockerContainer) Build ¶ added in v1.0.2
func (c DockerContainer) Build() *aurora.Container
func (DockerContainer) Image ¶ added in v1.0.2
func (c DockerContainer) Image(image string) DockerContainer
type Job ¶
type Job interface { // Set Job Key environment. Environment(env string) Job Role(role string) Job Name(name string) Job CPU(cpus float64) Job CronSchedule(cron string) Job CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job Disk(disk int64) Job RAM(ram int64) Job ExecutorName(name string) Job ExecutorData(data string) Job AddPorts(num int) Job AddLabel(key string, value string) Job AddNamedPorts(names ...string) Job AddLimitConstraint(name string, limit int32) Job AddValueConstraint(name string, negated bool, values ...string) Job AddURIs(extract bool, cache bool, values ...string) Job JobKey() *aurora.JobKey JobConfig() *aurora.JobConfiguration TaskConfig() *aurora.TaskConfig IsService(isService bool) Job InstanceCount(instCount int32) Job GetInstanceCount() int32 MaxFailure(maxFail int32) Job Container(container Container) Job }
type MesosContainer ¶ added in v1.0.2
type MesosContainer struct {
// contains filtered or unexported fields
}
TODO(rdelvalle): Implement Mesos container builder
type NoopLogger ¶ added in v1.0.4
type NoopLogger struct{}
func (NoopLogger) Printf ¶ added in v1.0.4
func (NoopLogger) Printf(format string, a ...interface{})
type Realis ¶
type Realis interface { AbortJobUpdate(updateKey aurora.JobUpdateKey, message string) (*aurora.Response, error) AddInstances(instKey aurora.InstanceKey, count int32) (*aurora.Response, error) CreateJob(auroraJob Job) (*aurora.Response, error) DescheduleCronJob(key *aurora.JobKey) (*aurora.Response, error) FetchTaskConfig(instKey aurora.InstanceKey) (*aurora.TaskConfig, error) GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error) JobUpdateDetails(updateQuery aurora.JobUpdateQuery) (*aurora.Response, error) KillJob(key *aurora.JobKey) (*aurora.Response, error) KillInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error) RestartInstances(key *aurora.JobKey, instances ...int32) (*aurora.Response, error) RestartJob(key *aurora.JobKey) (*aurora.Response, error) RollbackJobUpdate(key aurora.JobUpdateKey, message string) (*aurora.Response, error) ScheduleCronJob(auroraJob Job) (*aurora.Response, error) StartJobUpdate(updateJob *UpdateJob, message string) (*aurora.Response, error) StartCronJob(key *aurora.JobKey) (*aurora.Response, error) Close() }
func NewClient ¶
func NewClient(config RealisConfig) Realis
Create a new Client with a default transport layer
type RealisConfig ¶
type RealisConfig struct {
// contains filtered or unexported fields
}
Wrap object to provide future flexibility
func NewDefaultConfig ¶
func NewDefaultConfig(url string) (RealisConfig, error)
Create a default configuration of the transport layer, requires a URL to test connection with.
type ServiceInstance ¶
type UpdateJob ¶
type UpdateJob struct { Job // SetInstanceCount for job is hidden, access via full qualifier // contains filtered or unexported fields }
Structure to collect all information required to create job update
func NewUpdateJob ¶
func NewUpdateJob(config *aurora.TaskConfig) *UpdateJob
Create a default UpdateJob object.
func (*UpdateJob) InstanceCount ¶
Set instance count the job will have after the update.
func (*UpdateJob) MaxFailedInstances ¶
Max number of FAILED instances to tolerate before terminating the update.
func (*UpdateJob) MaxPerInstanceFailures ¶
Max number of instance failures to tolerate before marking instance as FAILED.
func (*UpdateJob) RollbackOnFail ¶
When False, prevents auto rollback of a failed update.
func (*UpdateJob) WaitForBatchCompletion ¶
Wait for all instances in a group to be done before moving on.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
gen-go
|
|
Helper functions to process aurora.Response
|
Helper functions to process aurora.Response |