spec

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerPull = "pull"
	DockerRun  = "run"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Docker

type Docker struct {
	Image string `yaml:"image"`
	// Action can be pull, run
	Action string                 `yaml:"action"`
	Ports  []Port                 `yaml:"ports"`
	XXX    map[string]interface{} `yaml:",inline"`
}

Docker run using docker

func (*Docker) Validate

func (c *Docker) Validate() error

type Exec

type Exec struct {
	Command string   `yaml:"command"`
	Args    []string `yaml:"args"`
	// TODO: environment variable
	XXX map[string]interface{} `yaml:",inline"`
}

Exec run task using os/exec where Command is path of binary or can be found in PATH

func (*Exec) Validate

func (c *Exec) Validate() error

type Job

type Job struct {
	Name      string                 `yaml:"name"`
	Reason    string                 `yaml:"reason"`
	Framework string                 `yaml:"framework"`
	Workload  string                 `yaml:"workload"`
	Database  string                 `yaml:"database"`
	Nodes     []Node                 `yaml:"nodes"`
	Stages    []Stage                `yaml:"stages"`
	Pipelines []Pipeline             `yaml:"pipelines"`
	XXX       map[string]interface{} `yaml:",inline"`
}

Job describes a benchmark job, it's hardware requirement, how to run the workload

func (*Job) Validate

func (c *Job) Validate() error

type Node

type Node struct {
	// Name is used in config to refer specific node, it should be unique in job
	Name string `yaml:"name"`
	// Type specify type of nodes, currently only two types, database and loader
	Type string `yaml:"type"`
	// TODO: resource requirement
	// TODO: tags?
	XXX map[string]interface{} `yaml:",inline"`
}

Node describes requirement for different types of nodes and individual nodes

func (*Node) Validate

func (c *Node) Validate() error

type NodeSelector

type NodeSelector struct {
	Name string                 `yaml:"name"`
	Type string                 `yaml:"type"`
	XXX  map[string]interface{} `yaml:",inline"`
}

NodeSelector is used by stages to select nodes to run task on

func (*NodeSelector) Validate

func (c *NodeSelector) Validate() error

type Pipeline

type Pipeline struct {
	Stages []string               `yaml:"stages"`
	XXX    map[string]interface{} `yaml:",inline"`
}

func (*Pipeline) Validate

func (c *Pipeline) Validate() error

type Port

type Port struct {
	Guest int                    `yaml:"guest"`
	Host  int                    `yaml:"host"`
	XXX   map[string]interface{} `yaml:",inline"`
}

type Shell

type Shell struct {
	Command string                 `yaml:"command"`
	XXX     map[string]interface{} `yaml:",inline"`
}

Shell run using sh -c

func (*Shell) Validate

func (c *Shell) Validate() error

type Stage

type Stage struct {
	Name      string `yaml:"name"`
	Selectors []Node `yaml:"selectors"`
	// Background specify if there are background task in this stage, a stage with background does not stop until specified
	Background bool                   `yaml:"background"`
	Tasks      []Task                 `yaml:"tasks"`
	XXX        map[string]interface{} `yaml:",inline"`
}

func (*Stage) Validate

func (c *Stage) Validate() error

type Task

type Task struct {
	// Background decides if the task is a long running process
	Background bool   `yaml:"background"`
	Driver     string `yaml:"driver"`
	// Ready defines commands to check the server is up and running
	// a background task is finished when all tasks in Ready can run without error
	// there can NOT be background task in Ready
	Ready []Task `yaml:"ready"`
	// Shutdown defines commands to run after the long running process is killed
	// TODO: though you can use docker stop to stop a background started by docker start ...
	Shutdown []Task `yaml:"shutdown"`

	// Drivers
	Shell  *Shell                 `yaml:"shell"`
	Exec   *Exec                  `yaml:"exec"`
	Docker *Docker                `yaml:"docker"`
	XXX    map[string]interface{} `yaml:",inline"`
}

func (*Task) Validate

func (c *Task) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL