simulator

package
v0.3.98 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSimulator        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSimulator          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSimulator = fmt.Errorf("proto: unexpected end of group")
)

Functions

func SchedulingConfigFromFilePath

func SchedulingConfigFromFilePath(filePath string) (configuration.SchedulingConfig, error)

func SchedulingConfigsFromFilePaths

func SchedulingConfigsFromFilePaths(filePaths []string) ([]configuration.SchedulingConfig, error)

func SchedulingConfigsFromPattern

func SchedulingConfigsFromPattern(pattern string) ([]configuration.SchedulingConfig, error)

Types

type Event

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

type EventLog

type EventLog []Event

func (EventLog) Len

func (el EventLog) Len() int

func (EventLog) Less

func (el EventLog) Less(i, j int) bool

func (*EventLog) Pop

func (el *EventLog) Pop() any

func (*EventLog) Push

func (el *EventLog) Push(x any)

func (EventLog) Swap

func (el EventLog) Swap(i, j int)

type Executor

type Executor struct {
	Name          string          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	NodeTemplates []*NodeTemplate `protobuf:"bytes,2,rep,name=node_templates,json=nodeTemplates,proto3" json:"nodeTemplates,omitempty"`
}

func (*Executor) Descriptor

func (*Executor) Descriptor() ([]byte, []int)

func (*Executor) GetName

func (m *Executor) GetName() string

func (*Executor) GetNodeTemplates

func (m *Executor) GetNodeTemplates() []*NodeTemplate

func (*Executor) Marshal

func (m *Executor) Marshal() (dAtA []byte, err error)

func (*Executor) MarshalTo

func (m *Executor) MarshalTo(dAtA []byte) (int, error)

func (*Executor) MarshalToSizedBuffer

func (m *Executor) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Executor) ProtoMessage

func (*Executor) ProtoMessage()

func (*Executor) Reset

func (m *Executor) Reset()

func (*Executor) Size

func (m *Executor) Size() (n int)

func (*Executor) String

func (m *Executor) String() string

func (*Executor) Unmarshal

func (m *Executor) Unmarshal(dAtA []byte) error

func (*Executor) XXX_DiscardUnknown

func (m *Executor) XXX_DiscardUnknown()

func (*Executor) XXX_Marshal

func (m *Executor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Executor) XXX_Merge

func (m *Executor) XXX_Merge(src proto.Message)

func (*Executor) XXX_Size

func (m *Executor) XXX_Size() int

func (*Executor) XXX_Unmarshal

func (m *Executor) XXX_Unmarshal(b []byte) error

type ExecutorGroup

type ExecutorGroup struct {
	Executors []*Executor `protobuf:"bytes,1,rep,name=executors,proto3" json:"executors,omitempty"`
}

func (*ExecutorGroup) Descriptor

func (*ExecutorGroup) Descriptor() ([]byte, []int)

func (*ExecutorGroup) GetExecutors

func (m *ExecutorGroup) GetExecutors() []*Executor

func (*ExecutorGroup) Marshal

func (m *ExecutorGroup) Marshal() (dAtA []byte, err error)

func (*ExecutorGroup) MarshalTo

func (m *ExecutorGroup) MarshalTo(dAtA []byte) (int, error)

func (*ExecutorGroup) MarshalToSizedBuffer

func (m *ExecutorGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ExecutorGroup) ProtoMessage

func (*ExecutorGroup) ProtoMessage()

func (*ExecutorGroup) Reset

func (m *ExecutorGroup) Reset()

func (*ExecutorGroup) Size

func (m *ExecutorGroup) Size() (n int)

func (*ExecutorGroup) String

func (m *ExecutorGroup) String() string

func (*ExecutorGroup) Unmarshal

func (m *ExecutorGroup) Unmarshal(dAtA []byte) error

func (*ExecutorGroup) XXX_DiscardUnknown

func (m *ExecutorGroup) XXX_DiscardUnknown()

func (*ExecutorGroup) XXX_Marshal

func (m *ExecutorGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecutorGroup) XXX_Merge

func (m *ExecutorGroup) XXX_Merge(src proto.Message)

func (*ExecutorGroup) XXX_Size

func (m *ExecutorGroup) XXX_Size() int

func (*ExecutorGroup) XXX_Unmarshal

func (m *ExecutorGroup) XXX_Unmarshal(b []byte) error

type JobTemplate

type JobTemplate struct {
	// Number of jobs to create from this template.
	Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// Number of jobs created from this template that have succeeded.
	// Maintained by the simulator.
	NumberSuccessful int64 `protobuf:"varint,2,opt,name=numberSuccessful,proto3" json:"numberSuccessful,omitempty"`
	// Queue to which this template belongs. Populated automatically.
	Queue string `protobuf:"bytes,3,opt,name=queue,proto3" json:"queue,omitempty"`
	// Unique id for this template. An id is generated if empty.
	Id                string                           `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"`
	JobSet            string                           `protobuf:"bytes,5,opt,name=job_set,json=jobSet,proto3" json:"jobSet,omitempty"`
	QueuePriority     uint32                           `protobuf:"varint,6,opt,name=queue_priority,json=queuePriority,proto3" json:"queuePriority,omitempty"`
	PriorityClassName string                           `protobuf:"bytes,7,opt,name=priority_class_name,json=priorityClassName,proto3" json:"priorityClassName,omitempty"`
	Requirements      schedulerobjects.PodRequirements `protobuf:"bytes,8,opt,name=requirements,proto3" json:"requirements"`
	// List of template ids that must be completed before this template is submitted.
	Dependencies []string `protobuf:"bytes,9,rep,name=dependencies,proto3" json:"dependencies,omitempty"`
	// Minimum time from which jobs are created from this template.
	MinSubmitTime time.Time `protobuf:"bytes,10,opt,name=min_submit_time,json=minSubmitTime,proto3,stdtime" json:"minSubmitTime"`
	// Job runtime mean in seconds.
	RuntimeMean int64 `protobuf:"varint,11,opt,name=runtime_mean,json=runtimeMean,proto3" json:"runtimeMean,omitempty"`
	// Job runtime variance in seconds squared.
	// If zero, runtime is deterministic.
	RuntimeVariance int64 `protobuf:"varint,12,opt,name=runtime_variance,json=runtimeVariance,proto3" json:"runtimeVariance,omitempty"`
}

func (*JobTemplate) Descriptor

func (*JobTemplate) Descriptor() ([]byte, []int)

func (*JobTemplate) GetDependencies

func (m *JobTemplate) GetDependencies() []string

func (*JobTemplate) GetId

func (m *JobTemplate) GetId() string

func (*JobTemplate) GetJobSet

func (m *JobTemplate) GetJobSet() string

func (*JobTemplate) GetMinSubmitTime

func (m *JobTemplate) GetMinSubmitTime() time.Time

func (*JobTemplate) GetNumber

func (m *JobTemplate) GetNumber() int64

func (*JobTemplate) GetNumberSuccessful

func (m *JobTemplate) GetNumberSuccessful() int64

func (*JobTemplate) GetPriorityClassName

func (m *JobTemplate) GetPriorityClassName() string

func (*JobTemplate) GetQueue

func (m *JobTemplate) GetQueue() string

func (*JobTemplate) GetQueuePriority

func (m *JobTemplate) GetQueuePriority() uint32

func (*JobTemplate) GetRequirements

func (m *JobTemplate) GetRequirements() schedulerobjects.PodRequirements

func (*JobTemplate) GetRuntimeMean

func (m *JobTemplate) GetRuntimeMean() int64

func (*JobTemplate) GetRuntimeVariance

func (m *JobTemplate) GetRuntimeVariance() int64

func (*JobTemplate) Marshal

func (m *JobTemplate) Marshal() (dAtA []byte, err error)

func (*JobTemplate) MarshalTo

func (m *JobTemplate) MarshalTo(dAtA []byte) (int, error)

func (*JobTemplate) MarshalToSizedBuffer

func (m *JobTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*JobTemplate) ProtoMessage

func (*JobTemplate) ProtoMessage()

func (*JobTemplate) Reset

func (m *JobTemplate) Reset()

func (*JobTemplate) Size

func (m *JobTemplate) Size() (n int)

func (*JobTemplate) String

func (m *JobTemplate) String() string

func (*JobTemplate) Unmarshal

func (m *JobTemplate) Unmarshal(dAtA []byte) error

func (*JobTemplate) XXX_DiscardUnknown

func (m *JobTemplate) XXX_DiscardUnknown()

func (*JobTemplate) XXX_Marshal

func (m *JobTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*JobTemplate) XXX_Merge

func (m *JobTemplate) XXX_Merge(src proto.Message)

func (*JobTemplate) XXX_Size

func (m *JobTemplate) XXX_Size() int

func (*JobTemplate) XXX_Unmarshal

func (m *JobTemplate) XXX_Unmarshal(b []byte) error

type NodeTemplate

type NodeTemplate struct {
	Number         int64                         `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	Taints         []v1.Taint                    `protobuf:"bytes,2,rep,name=taints,proto3" json:"taints"`
	Labels         map[string]string             `` /* 153-byte string literal not displayed */
	TotalResources schedulerobjects.ResourceList `protobuf:"bytes,4,opt,name=total_resources,json=totalResources,proto3" json:"totalResources"`
}

func (*NodeTemplate) Descriptor

func (*NodeTemplate) Descriptor() ([]byte, []int)

func (*NodeTemplate) GetLabels

func (m *NodeTemplate) GetLabels() map[string]string

func (*NodeTemplate) GetNumber

func (m *NodeTemplate) GetNumber() int64

func (*NodeTemplate) GetTaints

func (m *NodeTemplate) GetTaints() []v1.Taint

func (*NodeTemplate) GetTotalResources

func (m *NodeTemplate) GetTotalResources() schedulerobjects.ResourceList

func (*NodeTemplate) Marshal

func (m *NodeTemplate) Marshal() (dAtA []byte, err error)

func (*NodeTemplate) MarshalTo

func (m *NodeTemplate) MarshalTo(dAtA []byte) (int, error)

func (*NodeTemplate) MarshalToSizedBuffer

func (m *NodeTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NodeTemplate) ProtoMessage

func (*NodeTemplate) ProtoMessage()

func (*NodeTemplate) Reset

func (m *NodeTemplate) Reset()

func (*NodeTemplate) Size

func (m *NodeTemplate) Size() (n int)

func (*NodeTemplate) String

func (m *NodeTemplate) String() string

func (*NodeTemplate) Unmarshal

func (m *NodeTemplate) Unmarshal(dAtA []byte) error

func (*NodeTemplate) XXX_DiscardUnknown

func (m *NodeTemplate) XXX_DiscardUnknown()

func (*NodeTemplate) XXX_Marshal

func (m *NodeTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeTemplate) XXX_Merge

func (m *NodeTemplate) XXX_Merge(src proto.Message)

func (*NodeTemplate) XXX_Size

func (m *NodeTemplate) XXX_Size() int

func (*NodeTemplate) XXX_Unmarshal

func (m *NodeTemplate) XXX_Unmarshal(b []byte) error

type Pool

type Pool struct {
	Name           string           `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	ExecutorGroups []*ExecutorGroup `protobuf:"bytes,2,rep,name=executor_groups,json=executorGroups,proto3" json:"executorGroups,omitempty"`
}

func (*Pool) Descriptor

func (*Pool) Descriptor() ([]byte, []int)

func (*Pool) GetExecutorGroups

func (m *Pool) GetExecutorGroups() []*ExecutorGroup

func (*Pool) GetName

func (m *Pool) GetName() string

func (*Pool) Marshal

func (m *Pool) Marshal() (dAtA []byte, err error)

func (*Pool) MarshalTo

func (m *Pool) MarshalTo(dAtA []byte) (int, error)

func (*Pool) MarshalToSizedBuffer

func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Pool) ProtoMessage

func (*Pool) ProtoMessage()

func (*Pool) Reset

func (m *Pool) Reset()

func (*Pool) Size

func (m *Pool) Size() (n int)

func (*Pool) String

func (m *Pool) String() string

func (*Pool) Unmarshal

func (m *Pool) Unmarshal(dAtA []byte) error

func (*Pool) XXX_DiscardUnknown

func (m *Pool) XXX_DiscardUnknown()

func (*Pool) XXX_Marshal

func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pool) XXX_Merge

func (m *Pool) XXX_Merge(src proto.Message)

func (*Pool) XXX_Size

func (m *Pool) XXX_Size() int

func (*Pool) XXX_Unmarshal

func (m *Pool) XXX_Unmarshal(b []byte) error

type Queue

type Queue struct {
	Name         string         `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Weight       float64        `protobuf:"fixed64,2,opt,name=weight,proto3" json:"weight,omitempty"`
	JobTemplates []*JobTemplate `protobuf:"bytes,3,rep,name=job_templates,json=jobTemplates,proto3" json:"jobTemplates,omitempty"`
}

func (*Queue) Descriptor

func (*Queue) Descriptor() ([]byte, []int)

func (*Queue) GetJobTemplates

func (m *Queue) GetJobTemplates() []*JobTemplate

func (*Queue) GetName

func (m *Queue) GetName() string

func (*Queue) GetWeight

func (m *Queue) GetWeight() float64

func (*Queue) Marshal

func (m *Queue) Marshal() (dAtA []byte, err error)

func (*Queue) MarshalTo

func (m *Queue) MarshalTo(dAtA []byte) (int, error)

func (*Queue) MarshalToSizedBuffer

func (m *Queue) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Queue) ProtoMessage

func (*Queue) ProtoMessage()

func (*Queue) Reset

func (m *Queue) Reset()

func (*Queue) Size

func (m *Queue) Size() (n int)

func (*Queue) String

func (m *Queue) String() string

func (*Queue) Unmarshal

func (m *Queue) Unmarshal(dAtA []byte) error

func (*Queue) XXX_DiscardUnknown

func (m *Queue) XXX_DiscardUnknown()

func (*Queue) XXX_Marshal

func (m *Queue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Queue) XXX_Merge

func (m *Queue) XXX_Merge(src proto.Message)

func (*Queue) XXX_Size

func (m *Queue) XXX_Size() int

func (*Queue) XXX_Unmarshal

func (m *Queue) XXX_Unmarshal(b []byte) error

type Simulator

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

Simulator captures the parameters and state of the Armada simulator.

func NewSimulator

func NewSimulator(testCase *TestCase, schedulingConfig configuration.SchedulingConfig) (*Simulator, error)

func (*Simulator) C

func (s *Simulator) C() <-chan *armadaevents.EventSequence

func (*Simulator) Run

func (s *Simulator) Run() error

type TestCase

type TestCase struct {
	Name       string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	RandomSeed int64   `protobuf:"varint,2,opt,name=random_seed,json=randomSeed,proto3" json:"randomSeed,omitempty"`
	Pools      []*Pool `protobuf:"bytes,3,rep,name=pools,proto3" json:"pools,omitempty"`
	Queues     []Queue `protobuf:"bytes,4,rep,name=queues,proto3" json:"queues"`
}

TODO: Runtime family. Workflow manager delay. Job pending delay.

func TestCaseFromBytes

func TestCaseFromBytes(yamlBytes []byte) (*TestCase, error)

TestCaseFromBytes unmarshalls bytes into a TestCase.

func TestCaseFromFilePath

func TestCaseFromFilePath(filePath string) (*TestCase, error)

func TestCasesFromFilePaths

func TestCasesFromFilePaths(filePaths []string) ([]*TestCase, error)

func TestCasesFromPattern

func TestCasesFromPattern(pattern string) ([]*TestCase, error)

func (*TestCase) Descriptor

func (*TestCase) Descriptor() ([]byte, []int)

func (*TestCase) GetName

func (m *TestCase) GetName() string

func (*TestCase) GetPools

func (m *TestCase) GetPools() []*Pool

func (*TestCase) GetQueues

func (m *TestCase) GetQueues() []Queue

func (*TestCase) GetRandomSeed

func (m *TestCase) GetRandomSeed() int64

func (*TestCase) Marshal

func (m *TestCase) Marshal() (dAtA []byte, err error)

func (*TestCase) MarshalTo

func (m *TestCase) MarshalTo(dAtA []byte) (int, error)

func (*TestCase) MarshalToSizedBuffer

func (m *TestCase) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestCase) ProtoMessage

func (*TestCase) ProtoMessage()

func (*TestCase) Reset

func (m *TestCase) Reset()

func (*TestCase) Size

func (m *TestCase) Size() (n int)

func (*TestCase) String

func (m *TestCase) String() string

func (*TestCase) Unmarshal

func (m *TestCase) Unmarshal(dAtA []byte) error

func (*TestCase) XXX_DiscardUnknown

func (m *TestCase) XXX_DiscardUnknown()

func (*TestCase) XXX_Marshal

func (m *TestCase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TestCase) XXX_Merge

func (m *TestCase) XXX_Merge(src proto.Message)

func (*TestCase) XXX_Size

func (m *TestCase) XXX_Size() int

func (*TestCase) XXX_Unmarshal

func (m *TestCase) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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