Documentation ¶
Index ¶
- func ValidateNewExecution(_ context.Context, execution Execution) error
- type ErrExecutionAlreadyExists
- type ErrExecutionAlreadyTerminal
- type ErrExecutionHistoryNotFound
- type ErrExecutionNotFound
- type ErrExecutionsNotFoundForJob
- type ErrInvalidExecutionState
- type ErrInvalidExecutionVersion
- type ErrNilExecution
- type Execution
- type ExecutionHistory
- type ExecutionState
- type ExecutionStore
- type ExecutionSummary
- type UpdateExecutionStateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrExecutionAlreadyExists ¶
type ErrExecutionAlreadyExists struct {
ExecutionID string
}
ErrExecutionAlreadyExists is returned when an execution already exists
func NewErrExecutionAlreadyExists ¶
func NewErrExecutionAlreadyExists(id string) ErrExecutionAlreadyExists
func (ErrExecutionAlreadyExists) Error ¶
func (e ErrExecutionAlreadyExists) Error() string
type ErrExecutionAlreadyTerminal ¶
type ErrExecutionAlreadyTerminal struct { ExecutionID string Actual ExecutionState NewState ExecutionState }
ErrExecutionAlreadyTerminal is returned when an execution is already in terminal state and cannot be updated.
func NewErrExecutionAlreadyTerminal ¶
func NewErrExecutionAlreadyTerminal(id string, actual ExecutionState, newState ExecutionState) ErrExecutionAlreadyTerminal
func (ErrExecutionAlreadyTerminal) Error ¶
func (e ErrExecutionAlreadyTerminal) Error() string
type ErrExecutionHistoryNotFound ¶
type ErrExecutionHistoryNotFound struct {
ExecutionID string
}
ErrExecutionHistoryNotFound is returned when the execution is not found
func NewErrExecutionHistoryNotFound ¶
func NewErrExecutionHistoryNotFound(id string) ErrExecutionHistoryNotFound
func (ErrExecutionHistoryNotFound) Error ¶
func (e ErrExecutionHistoryNotFound) Error() string
type ErrExecutionNotFound ¶
type ErrExecutionNotFound struct {
ExecutionID string
}
ErrExecutionNotFound is returned when the execution is not found
func NewErrExecutionNotFound ¶
func NewErrExecutionNotFound(id string) ErrExecutionNotFound
func (ErrExecutionNotFound) Error ¶
func (e ErrExecutionNotFound) Error() string
type ErrExecutionsNotFoundForJob ¶ added in v0.3.24
type ErrExecutionsNotFoundForJob struct {
JobID string
}
ErrExecutionsNotFoundForJob is returned when the execution is not found for a given job
func NewErrExecutionsNotFoundForJob ¶ added in v0.3.24
func NewErrExecutionsNotFoundForJob(id string) ErrExecutionsNotFoundForJob
func (ErrExecutionsNotFoundForJob) Error ¶ added in v0.3.24
func (e ErrExecutionsNotFoundForJob) Error() string
type ErrInvalidExecutionState ¶
type ErrInvalidExecutionState struct { ExecutionID string Actual ExecutionState Expected ExecutionState }
ErrInvalidExecutionState is returned when an execution is in an invalid state.
func NewErrInvalidExecutionState ¶
func NewErrInvalidExecutionState(id string, actual ExecutionState, expected ExecutionState) ErrInvalidExecutionState
func (ErrInvalidExecutionState) Error ¶
func (e ErrInvalidExecutionState) Error() string
type ErrInvalidExecutionVersion ¶
ErrInvalidExecutionVersion is returned when an execution has an invalid version.
func NewErrInvalidExecutionVersion ¶
func NewErrInvalidExecutionVersion(id string, actual int, expected int) ErrInvalidExecutionVersion
func (ErrInvalidExecutionVersion) Error ¶
func (e ErrInvalidExecutionVersion) Error() string
type ErrNilExecution ¶
type ErrNilExecution struct{}
ErrNilExecution is returned when the execution is nil
func NewErrNilExecution ¶
func NewErrNilExecution() ErrNilExecution
func (ErrNilExecution) Error ¶
func (e ErrNilExecution) Error() string
type Execution ¶
type Execution struct { ID string Job model.Job RequesterNodeID string ResourceUsage model.ResourceUsageData State ExecutionState Version int CreateTime time.Time UpdateTime time.Time LatestComment string }
func GetActiveExecution ¶
GetActiveExecution returns the active execution for a given job. In case of a bug where we have more than a single active execution, the latest one is returned
func NewExecution ¶
type ExecutionHistory ¶
type ExecutionHistory struct { ExecutionID string PreviousState ExecutionState NewState ExecutionState NewVersion int Comment string Time time.Time }
type ExecutionState ¶
type ExecutionState int
const ( ExecutionStateUndefined ExecutionState = iota ExecutionStateCreated ExecutionStateBidAccepted ExecutionStateRunning ExecutionStateWaitingVerification ExecutionStateResultAccepted ExecutionStatePublishing ExecutionStateCompleted ExecutionStateFailed ExecutionStateCancelled )
func (ExecutionState) IsActive ¶
func (s ExecutionState) IsActive() bool
IsActive returns true if the execution is active
func (ExecutionState) IsExecuting ¶
func (s ExecutionState) IsExecuting() bool
IsExecuting returns true if the execution is running in the backend
func (ExecutionState) IsTerminal ¶
func (s ExecutionState) IsTerminal() bool
IsTerminal returns true if the execution is terminal
func (ExecutionState) String ¶
func (i ExecutionState) String() string
type ExecutionStore ¶
type ExecutionStore interface { // GetExecution returns the execution for a given id GetExecution(ctx context.Context, id string) (Execution, error) // GetExecutions returns all the executions for a given job GetExecutions(ctx context.Context, jobID string) ([]Execution, error) // GetExecutionHistory returns the history of an execution GetExecutionHistory(ctx context.Context, id string) ([]ExecutionHistory, error) // CreateExecution creates a new execution for a given job CreateExecution(ctx context.Context, execution Execution) error // UpdateExecutionState updates the execution state UpdateExecutionState(ctx context.Context, request UpdateExecutionStateRequest) error // DeleteExecution deletes an execution DeleteExecution(ctx context.Context, id string) error // GetExecutionCount returns a count of all executions that completed // successfully on this compute node GetExecutionCount(ctx context.Context) uint }
ExecutionStore A metadata store of job executions handled by the current compute node
type ExecutionSummary ¶
type ExecutionSummary struct { ExecutionID string `json:"ExecutionID"` JobID string `json:"JobID"` State string `json:"State"` ResourceUsage model.ResourceUsageData `json:"ResourceUsage"` }
Summary of an execution that is used in logging and debugging.
func NewExecutionSummary ¶
func NewExecutionSummary(execution Execution) ExecutionSummary
NewExecutionSummary generate a summary from an execution
type UpdateExecutionStateRequest ¶
type UpdateExecutionStateRequest struct { ExecutionID string NewState ExecutionState ExpectedState ExecutionState ExpectedVersion int Comment string }