metronome

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveRun

type ActiveRun struct {
	ID     string `json:"id,omitempty"`
	JobID  string `json:"jobId,omitempty"`
	Status string `json:"status,omitempty"`
}

ActiveRun metronome job activeRun struct, GET with "embed=activeRuns"

type Artifact

type Artifact struct {
	Uri        string `json:"uri,omitempty"`
	Extract    bool   `json:"extract,omitempty"`
	Executable bool   `json:"executable,omitempty"`
	Cache      bool   `json:"cache,omitempty"`
}

type Constraints

type Constraints struct {
	Attribute string `json:"attribute,omitempty"`
	Operator  string `json:"operator,omitempty"`
	Value     string `json:"value,omitempty"`
}

type Docker

type Docker struct {
	Image          string `json:"image"`
	ForcePullImage bool   `json:"forcePullImage,omitempty"`
}

TODO: accomplish the fields

type DockerParameter

type DockerParameter struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type JobHistory

type JobHistory struct {
	FailedFinishedRuns     []RunResult `json:"failedFinishedRuns,omitempty"`
	SuccessfulFinishedRuns []RunResult `json:"successfulFinishedRuns,omitempty"`
}

type Metronome

type Metronome struct {
	// contains filtered or unexported fields
}

func (*Metronome) Cancel

func (c *Metronome) Cancel(ctx context.Context, spec interface{}) (interface{}, error)

func (*Metronome) CapacityInfo

func (c *Metronome) CapacityInfo() apistructs.CapacityInfoData

func (*Metronome) CleanUpBeforeDelete

func (*Metronome) CleanUpBeforeDelete()

func (*Metronome) Create

func (c *Metronome) Create(ctx context.Context, specObj interface{}) (interface{}, error)

func (*Metronome) Destroy

func (c *Metronome) Destroy(ctx context.Context, specObj interface{}) error

func (*Metronome) Inspect

func (c *Metronome) Inspect(ctx context.Context, spec interface{}) (interface{}, error)

func (*Metronome) JobVolumeCreate

func (*Metronome) JobVolumeCreate(ctx context.Context, spec interface{}) (string, error)

func (*Metronome) KillPod

func (*Metronome) KillPod(podname string) error

func (*Metronome) Kind

func (c *Metronome) Kind() executortypes.Kind

func (*Metronome) Name

func (c *Metronome) Name() executortypes.Name

func (*Metronome) Precheck

func (m *Metronome) Precheck(ctx context.Context, specObj interface{}) (apistructs.ServiceGroupPrecheckData, error)

func (*Metronome) Remove

func (c *Metronome) Remove(ctx context.Context, specObj interface{}) error

Attention: DO NOT delete Metronome job that had active runs in it, if DELETE a metronome with active runs, there would be a 409 Error, with following info: "message":"There are active job runs. Override with stopCurrentJobRuns=true", Use DESTROY method instead

func (*Metronome) ResourceInfo

func (m *Metronome) ResourceInfo(brief bool) (apistructs.ClusterResourceInfoData, error)

func (*Metronome) SetNodeLabels

func (m *Metronome) SetNodeLabels(setting executortypes.NodeLabelSetting, hosts []string, labels map[string]string) error

func (*Metronome) Status

func (c *Metronome) Status(ctx context.Context, specObj interface{}) (apistructs.StatusDesc, error)

func (*Metronome) Update

func (c *Metronome) Update(ctx context.Context, specObj interface{}) (interface{}, error)

type MetronomeJob

type MetronomeJob struct {
	Id          string            `json:"id"`
	Description string            `json:"description,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Run         Run               `json:"run,omitempty"`
}

type MetronomeJobResult

type MetronomeJobResult struct {
	MetronomeJob
	ActiveRuns []ActiveRun `json:"activeRuns,omitempty"`
	History    JobHistory  `json:"history,omitempty"`
}

MetronomeJobResult used when GET Metronome job with "embed=history&embed=activeRuns"

type Placement

type Placement struct {
	Constraints []Constraints `json:"constraints,omitempty"`
}

TODO: accomplish the fields

type Restart

type Restart struct {
	Policy                string `json:"policy,omitempty"`
	ActiveDeadlineSeconds int    `json:"activeDeadlineSeconds,omitempty"`
}

TODO: accomplish the fields

type Run

type Run struct {
	Id             string            `json:"id,omitempty"`
	Artifacts      []Artifact        `json:"artifacts,omitempty"`
	Cmd            string            `json:"cmd,omitempty"`
	Cpus           float64           `json:"cpus"`
	Mem            float64           `json:"mem"` // "minimum": 32
	Disk           float64           `json:"disk"`
	Docker         Docker            `json:"docker,omitempty"`
	Env            map[string]string `json:"env,omitempty"`
	MaxLaunchDelay int               `json:"maxLaunchDelay,omitempty"`
	Placement      *Placement        `json:"placement,omitempty"`
	Restart        Restart           `json:"restart,omitempty"`
	//User           string            `json:"user,omitempty"`
	Volumes []Volume `json:"volumes,omitempty"`
}

type RunResult

type RunResult struct {
	//completedAt string `json:"completedAt,omitempty"`,
	//"createdAt": "2016-07-15T13:02:59.735+0000",
	Id     string `json:"id"`
	JobId  string `json:"jobId"`
	Status string `json:"status"`
}

TODO: accomplish the fields

type Volume

type Volume struct {
	ContainerPath string `json:"containerPath,omitempty"`
	HostPath      string `json:"hostPath,omitempty"`
	Mode          string `json:"mode,omitempty"`
}

Jump to

Keyboard shortcuts

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