Documentation
¶
Index ¶
- Constants
- func IsDirEmpty(path string) (bool, error)
- func PrepareEnvironment(cpus []int, dryRun bool) error
- func RevertEnvironment(dryRun bool) error
- type ActiveTaskRun
- type CoreMap
- type Job
- type JobParam
- type List
- type Proc
- type ProcValue
- type Queue
- func (st *Queue) Clear() error
- func (st *Queue) Dequeue() (interface{}, error)
- func (st *Queue) DequeueOrWaitForNextElement() (interface{}, error)
- func (st *Queue) DequeueOrWaitForNextElementContext(ctx context.Context) (interface{}, error)
- func (st *Queue) Enqueue(value interface{}) error
- func (st *Queue) GetCap() int
- func (st *Queue) IsLocked() bool
- func (st *Queue) Len() int
- func (st *Queue) Lock()
- func (st *Queue) Peak() (interface{}, error)
- func (st *Queue) Unlock()
- type QueueError
- type RuntimeConfig
- type Task
- type TaskParam
Constants ¶
const ( WaitForNextElementChanCapacity = 1000 QueueErrorCodeEmptyQueue = "empty-queue" QueueErrorCodeLockedQueue = "locked-queue" QueueErrorCodeIndexOutOfBounds = "index-out-of-bounds" QueueErrorCodeFullCapacity = "full-capacity" QueueErrorCodeInternalChannelClosed = "internal-channel-closed" )
Variables ¶
This section is empty.
Functions ¶
func IsDirEmpty ¶
IsDirEmpty is a method used to determine whether a directory is empty
func PrepareEnvironment ¶
func RevertEnvironment ¶
RevertEnvironment sets original Procfs entries
Types ¶
type ActiveTaskRun ¶
type ActiveTaskRun struct { Task *Task Runner *run.Runner CoreIds []int // the exact core numbers this task is using // contains filtered or unexported fields }
ActiveTaskRun contains information about a particular task's run.
func NewActiveTaskRun ¶
func NewActiveTaskRun(task *Task, run run.Run, coreIds []int, bridge *run.Bridge, dryRun bool, maxRetries int) (*ActiveTaskRun, error)
NewActiveTaskRun initializes the current task and the run step for the the specified cores.
func (*ActiveTaskRun) Start ¶
func (atr *ActiveTaskRun) Start() (int, time.Duration, error)
Start the task's run
func (*ActiveTaskRun) UUID ¶
func (atr *ActiveTaskRun) UUID() string
UUID returns the Unique ID for the task and run
type CoreMap ¶
CoreMap holds onto to a reference to the particular task which is currently running on the core number defined as the index.
func NewCoreMap ¶
CoreMap creates a fixed-length map of cores with their ID as index.
func (*CoreMap) All ¶
func (cm *CoreMap) All() map[int]*ActiveTaskRun
All returns a list of all of the cores and its tasks Warning: Concurrency should now be handled by the routine which uses this method.
func (*CoreMap) Get ¶
func (cm *CoreMap) Get(coreId int) *ActiveTaskRun
Get retrieves the ActiveTaskRun at the coreId
type Job ¶
type Job struct { Params []JobParam `yaml:"params"` Inputs []run.Input `yaml:"inputs"` Outputs []run.Output `yaml:"outputs"` Runs []run.Run `yaml:"runs"` // contains filtered or unexported fields }
func NewJob ¶
func NewJob(filePath string, cfg *RuntimeConfig, dryRun bool) (*Job, error)
NewJob prepares a job yaml file
type List ¶
List holds onto a generic out-of-order concurrency-safe array.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Fixed capacity FIFO (First In First Out) concurrent queue
func (*Queue) Dequeue ¶
Dequeue dequeues an element. Returns error if: queue is locked, queue is empty or internal channel is closed.
func (*Queue) DequeueOrWaitForNextElement ¶
DequeueOrWaitForNextElement dequeues an element (if exist) or waits until the next element gets enqueued and returns it. Multiple calls to DequeueOrWaitForNextElement() would enqueue multiple "listeners" for future enqueued elements.
func (*Queue) DequeueOrWaitForNextElementContext ¶
DequeueOrWaitForNextElementContext dequeues an element (if exist) or waits until the next element gets enqueued and returns it. Multiple calls to DequeueOrWaitForNextElementContext() would enqueue multiple "listeners" for future enqueued elements. When the passed context expires this function exits and returns the context' error.
func (*Queue) Enqueue ¶
Enqueue enqueues an element. Returns error if queue is locked or it is at full capacity.
type QueueError ¶
type QueueError struct {
// contains filtered or unexported fields
}
func NewQueueError ¶
func NewQueueError(code string, message string) *QueueError
func (*QueueError) Code ¶
func (st *QueueError) Code() string
func (*QueueError) Error ¶
func (st *QueueError) Error() string
type RuntimeConfig ¶
type RuntimeConfig struct { Cpus []int BridgeName string BridgeIface string BridgeSubnet string ScheduleGrace int WorkDir string AllowOverride bool MaxRetries int }
RuntimeConfig contains details about the runtime of wayfinder