Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Schema string
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes struct { Duration string `yaml:"duration,omitempty" json:"duration,omitempty"` Cwd string `yaml:"cwd,omitempty" json:"cwd,omitempty"` Environment Environment `yaml:"environment,omitempty" json:"environment,omitempty"` }
type Environment ¶
type Group ¶
type Group struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Resources string `json:"resources,omitempty" yaml:"resources,omitempty"` Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"` Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty"` }
type Jobspec ¶
type Jobspec struct { Version int `json:"version" yaml:"version"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"` Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"` Groups Groups `json:"groups,omitempty" yaml:"groups,omitempty"` Requires map[string]string `json:"requires,omitempty" yaml:"requires,omitempty"` }
func LoadJobspecYaml ¶
LoadJobspecYaml loads a jobspec from a yaml file path
func NewSimpleJobspec ¶
NewSimpleJobSpec generates a simple jobspec for nodes, command, tasks, and (optionally) a name
func (*Jobspec) GetJobName ¶
Helper function to get a job name, derived from the command
func (*Jobspec) GetScheduledSlots ¶
GetScheduledSlots returns all slots marked for scheduling If none are marked, we assume they all are
func (*Jobspec) JobspecToJson ¶
JobspectoJson convets back to json string
func (*Jobspec) JobspecToYaml ¶
JobspectoYaml convets back to yaml (as string)
type Resource ¶
type Resource struct { Type string `yaml:"type,omitempty" json:"type,omitempty"` Unit string `yaml:"unit,omitempty" json:"unit,omitempty"` Count int32 `yaml:"count,omitempty" json:"count,omitempty"` With []Resource `yaml:"with,omitempty" json:"with,omitempty"` Label string `yaml:"label,omitempty" json:"label,omitempty"` Exclusive bool `yaml:"exclusive,omitempty" json:"exclusive,omitempty"` Schedule bool `yaml:"schedule,omitempty" json:"schedule,omitempty"` }
type Task ¶
type Task struct { Group string `json:"group,omitempty" yaml:"group,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Replicas int `json:"replicas,omitempty" yaml:"replicas,omitempty"` Resources string `json:"resources,omitempty" yaml:"resources,omitempty"` Command []string `json:"command,omitempty" yaml:"command,omitempty"` Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty"` }
Click to show internal directories.
Click to hide internal directories.