Documentation ¶
Index ¶
- Constants
- Variables
- func DeepCopy(events *armadaevents.EventSequence_Event) (*armadaevents.EventSequence_Event, error)
- func JobSetCancelRequestedWithStateFilter(states ...armadaevents.JobState) *armadaevents.EventSequence_Event
- func NewEventSequence(event ...*armadaevents.EventSequence_Event) *armadaevents.EventSequence
Constants ¶
View Source
const ( JobIdString = "01f3j0g1md4qx7z5qb148qnh4r" RunIdString = "123e4567-e89b-12d3-a456-426614174000" PartitionMarkerGroupIdString = "223e4567-e89b-12d3-a456-426614174000" )
Standard Set of events for common tests
View Source
const ( JobSetName = "testJobset" ExecutorId = "testCluster" NodeName = "testNode" Pool = "pool" PodName = "test-pod" Queue = "test-Queue" UserId = "testUser" Namespace = "test-ns" Priority = 3 NewPriority = 4 PodNumber = 6 ExitCode = 322 ErrMsg = "sample error message" DebugMsg = "sample debug message" LeaseReturnedMsg = "lease returned error message" TerminatedMsg = "test pod terminated message" UnschedulableMsg = "test pod is unschedulable" PartitionMarkerPartitionId = 456 )
Variables ¶
View Source
var (
JobIdProto, _ = armadaevents.ProtoUuidFromUlidString(JobIdString)
RunIdProto = armadaevents.ProtoUuidFromUuid(uuid.MustParse(RunIdString))
PartitionMarkerGroupIdProto = armadaevents.ProtoUuidFromUuid(uuid.MustParse(PartitionMarkerGroupIdString))
JobIdUuid = armadaevents.UuidFromProtoUuid(JobIdProto)
RunIdUuid = armadaevents.UuidFromProtoUuid(RunIdProto)
PartitionMarkerGroupIdUuid = armadaevents.UuidFromProtoUuid(PartitionMarkerGroupIdProto)
PriorityClassName = "test-priority"
Groups = []string{"group1", "group2"}
NodeSelector = map[string]string{"foo": "bar"}
Affinity = &v1.Affinity{
NodeAffinity: &v1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
NodeSelectorTerms: []v1.NodeSelectorTerm{
{
MatchExpressions: []v1.NodeSelectorRequirement{
{
Key: "noode-name",
Operator: v1.NodeSelectorOpNotIn,
Values: []string{"node-1"},
},
},
},
},
},
},
}
Tolerations = []v1.Toleration{{
Key: "fish",
Operator: "exists",
}}
BaseTime, _ = time.Parse("2006-01-02T15:04:05.000Z", "2022-03-01T15:04:05.000Z")
BaseTimeProto = protoutil.ToTimestamp(BaseTime)
)
View Source
var Assigned = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunAssigned{ JobRunAssigned: &armadaevents.JobRunAssigned{ RunId: RunIdProto, RunIdStr: RunIdString, JobId: JobIdProto, JobIdStr: JobIdString, ResourceInfos: []*armadaevents.KubernetesResourceInfo{ { ObjectMeta: &armadaevents.ObjectMeta{ KubernetesId: RunIdString, Name: PodName, Namespace: Namespace, ExecutorId: ExecutorId, }, Info: &armadaevents.KubernetesResourceInfo_PodInfo{ PodInfo: &armadaevents.PodInfo{ PodNumber: PodNumber, }, }, }, }, }, }, }
View Source
var JobCancelRequested = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_CancelJob{ CancelJob: &armadaevents.CancelJob{ JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobCancelled = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_CancelledJob{ CancelledJob: &armadaevents.CancelledJob{ JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobFailed = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobErrors{ JobErrors: &armadaevents.JobErrors{ JobId: JobIdProto, JobIdStr: JobIdString, Errors: []*armadaevents.Error{ { Terminal: true, Reason: &armadaevents.Error_PodError{ PodError: &armadaevents.PodError{ Message: ErrMsg, NodeName: NodeName, ContainerErrors: []*armadaevents.ContainerError{ {ExitCode: ExitCode}, }, }, }, }, }, }, }, }
View Source
var JobPreempted = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobErrors{ JobErrors: &armadaevents.JobErrors{ JobId: JobIdProto, JobIdStr: JobIdString, Errors: []*armadaevents.Error{ { Terminal: true, Reason: &armadaevents.Error_JobRunPreemptedError{ JobRunPreemptedError: &armadaevents.JobRunPreemptedError{}, }, }, }, }, }, }
View Source
var JobPreemptionRequested = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobPreemptionRequested{ JobPreemptionRequested: &armadaevents.JobPreemptionRequested{ JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobRejected = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobErrors{ JobErrors: &armadaevents.JobErrors{ JobId: JobIdProto, JobIdStr: JobIdString, Errors: []*armadaevents.Error{ { Terminal: true, Reason: &armadaevents.Error_JobRejected{ JobRejected: &armadaevents.JobRejected{ Message: ErrMsg, }, }, }, }, }, }, }
View Source
var JobReprioritiseRequested = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_ReprioritiseJob{ ReprioritiseJob: &armadaevents.ReprioritiseJob{ JobId: JobIdProto, JobIdStr: JobIdString, Priority: NewPriority, }, }, }
View Source
var JobReprioritised = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_ReprioritisedJob{ ReprioritisedJob: &armadaevents.ReprioritisedJob{ JobId: JobIdProto, JobIdStr: JobIdString, Priority: NewPriority, }, }, }
View Source
var JobRequeued = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRequeued{ JobRequeued: &armadaevents.JobRequeued{ JobId: JobIdProto, JobIdStr: JobIdString, SchedulingInfo: &schedulerobjects.JobSchedulingInfo{ Lifetime: 0, AtMostOnce: true, Preemptible: true, ConcurrencySafe: true, Version: 0, ObjectRequirements: []*schedulerobjects.ObjectRequirements{ { Requirements: &schedulerobjects.ObjectRequirements_PodRequirements{ PodRequirements: &schedulerobjects.PodRequirements{ NodeSelector: NodeSelector, Tolerations: Tolerations, PreemptionPolicy: "PreemptLowerPriority", Affinity: Affinity, ResourceRequirements: v1.ResourceRequirements{ Limits: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), }, Requests: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), }, }, }, }, }, }, }, UpdateSequenceNumber: 2, }, }, }
View Source
var JobRunCancelled = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunCancelled{ JobRunCancelled: &armadaevents.JobRunCancelled{ RunId: RunIdProto, RunIdStr: RunIdString, JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobRunFailed = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunErrors{ JobRunErrors: &armadaevents.JobRunErrors{ JobId: JobIdProto, JobIdStr: JobIdString, RunId: RunIdProto, RunIdStr: RunIdString, Errors: []*armadaevents.Error{ { Terminal: true, Reason: &armadaevents.Error_PodError{ PodError: &armadaevents.PodError{ Message: ErrMsg, DebugMessage: DebugMsg, NodeName: NodeName, ContainerErrors: []*armadaevents.ContainerError{ {ExitCode: ExitCode}, }, }, }, }, }, }, }, }
View Source
var JobRunPreempted = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunPreempted{ JobRunPreempted: &armadaevents.JobRunPreempted{ PreemptedJobId: JobIdProto, PreemptedJobIdStr: JobIdString, PreemptedRunId: RunIdProto, PreemptedRunIdStr: RunIdString, }, }, }
View Source
var JobRunSucceeded = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunSucceeded{ JobRunSucceeded: &armadaevents.JobRunSucceeded{ RunId: RunIdProto, RunIdStr: RunIdString, JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobRunUnschedulable = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunErrors{ JobRunErrors: &armadaevents.JobRunErrors{ JobId: JobIdProto, JobIdStr: JobIdString, RunId: RunIdProto, RunIdStr: RunIdString, Errors: []*armadaevents.Error{ { Terminal: false, Reason: &armadaevents.Error_PodUnschedulable{ PodUnschedulable: &armadaevents.PodUnschedulable{ NodeName: NodeName, ObjectMeta: &armadaevents.ObjectMeta{ ExecutorId: ExecutorId, }, Message: UnschedulableMsg, }, }, }, }, }, }, }
View Source
var JobSetCancelRequested = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_CancelJobSet{ CancelJobSet: &armadaevents.CancelJobSet{}, }, }
View Source
var JobSetReprioritiseRequested = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_ReprioritiseJobSet{ ReprioritiseJobSet: &armadaevents.ReprioritiseJobSet{ Priority: NewPriority, }, }, }
View Source
var JobSucceeded = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobSucceeded{ JobSucceeded: &armadaevents.JobSucceeded{ JobId: JobIdProto, JobIdStr: JobIdString, }, }, }
View Source
var JobValidated = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobValidated{ JobValidated: &armadaevents.JobValidated{ JobId: JobIdProto, JobIdStr: JobIdString, Pools: []string{"cpu"}, }, }, }
View Source
var LeaseReturned = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunErrors{ JobRunErrors: &armadaevents.JobRunErrors{ JobId: JobIdProto, JobIdStr: JobIdString, RunId: RunIdProto, RunIdStr: RunIdString, Errors: []*armadaevents.Error{ { Terminal: true, Reason: &armadaevents.Error_PodLeaseReturned{ PodLeaseReturned: &armadaevents.PodLeaseReturned{ Message: LeaseReturnedMsg, RunAttempted: true, }, }, }, }, }, }, }
View Source
var Leased = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunLeased{ JobRunLeased: &armadaevents.JobRunLeased{ RunId: RunIdProto, RunIdStr: RunIdString, JobId: JobIdProto, JobIdStr: JobIdString, ExecutorId: ExecutorId, NodeId: NodeName, Pool: Pool, HasScheduledAtPriority: true, ScheduledAtPriority: 15, UpdateSequenceNumber: 1, PodRequirementsOverlay: &schedulerobjects.PodRequirements{ Tolerations: []v1.Toleration{ { Key: "whale", Value: "true", Effect: v1.TaintEffectNoSchedule, }, }, }, }, }, }
View Source
var PartitionMarker = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_PartitionMarker{ PartitionMarker: &armadaevents.PartitionMarker{ GroupId: PartitionMarkerGroupIdProto, Partition: PartitionMarkerPartitionId, }, }, }
View Source
var Running = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_JobRunRunning{ JobRunRunning: &armadaevents.JobRunRunning{ RunId: RunIdProto, RunIdStr: RunIdString, JobId: JobIdProto, JobIdStr: JobIdString, ResourceInfos: []*armadaevents.KubernetesResourceInfo{ { Info: &armadaevents.KubernetesResourceInfo_PodInfo{ PodInfo: &armadaevents.PodInfo{ NodeName: NodeName, PodNumber: PodNumber, }, }, }, }, }, }, }
View Source
var ScheduledAtPriority = int32(15)
View Source
var Submit = &armadaevents.EventSequence_Event{ Created: testfixtures.BasetimeProto, Event: &armadaevents.EventSequence_Event_SubmitJob{ SubmitJob: &armadaevents.SubmitJob{ JobId: JobIdProto, JobIdStr: JobIdString, Priority: Priority, AtMostOnce: true, Preemptible: true, ConcurrencySafe: true, ObjectMeta: &armadaevents.ObjectMeta{ Namespace: Namespace, Name: "test-job", }, MainObject: &armadaevents.KubernetesMainObject{ ObjectMeta: &armadaevents.ObjectMeta{ Annotations: map[string]string{ "foo": "bar", configuration.FailFastAnnotation: "true", }, }, Object: &armadaevents.KubernetesMainObject_PodSpec{ PodSpec: &armadaevents.PodSpecWithAvoidList{ PodSpec: &v1.PodSpec{ NodeSelector: NodeSelector, Tolerations: Tolerations, PriorityClassName: PriorityClassName, Containers: []v1.Container{ { Name: "container1", Image: "alpine:latest", Command: []string{"myprogram.sh"}, Args: []string{"foo", "bar"}, Resources: v1.ResourceRequirements{ Limits: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), }, Requests: map[v1.ResourceName]resource.Quantity{ "memory": resource.MustParse("64Mi"), "cpu": resource.MustParse("150m"), }, }, }, }, }, }, }, }, }, }, }
Functions ¶
func DeepCopy ¶
func DeepCopy(events *armadaevents.EventSequence_Event) (*armadaevents.EventSequence_Event, error)
func JobSetCancelRequestedWithStateFilter ¶ added in v0.3.68
func JobSetCancelRequestedWithStateFilter(states ...armadaevents.JobState) *armadaevents.EventSequence_Event
func NewEventSequence ¶
func NewEventSequence(event ...*armadaevents.EventSequence_Event) *armadaevents.EventSequence
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.