job

package
v0.0.0-...-a7fce05 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2022-2023 Lawrence Livermore National Security, LLC

(c.f. AUTHORS, NOTICE.LLNS, COPYING)

This is part of the Flux resource manager framework. For details, see https://github.com/flux-framework.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (

	// MiniCluster State
	// Requested:
	//     The default when the job is requested
	// Waiting + in waiting queue:
	//     The job is waiting to be admitted (there are resources) - before added to heap
	// Waiting + in heap:
	//     There are resources, and the job has permission to run. We are creating the
	//     MiniCluster (in the heap) and reconciling until it's all there.
	// Ready:
	//     We finished creating the MiniCluster, and it's ready to run!
	// Running:
	//     Resources are created, and status is switched from Waiting -> Running by MiniCluster
	//     This should be when we kick off the command. The job is running
	// Finished:
	//     When resources are done
	// Finished the job is finished running!
	ConditionJobRequested string = "JobRequested"
	ConditionJobWaiting   string = "JobWaitingForResources"
	ConditionJobReady     string = "JobMiniClusterReady"
	ConditionJobRunning   string = "JobRunning"
	ConditionJobFinished  string = "JobFinished"
)
View Source
const (
	// Job statuses for logging purposes
	Waiting   = "waiting"
	Finished  = "finished"
	Running   = "running"
	Requested = "requested"
)

Variables

This section is empty.

Functions

func FindCondition

func FindCondition(status *api.MiniClusterStatus, conditionType string) int

FindConditionIndex finds the provided condition from the given status and returns the index. Returns -1 if the condition is not present.

func FlagConditionFinished

func FlagConditionFinished(job *api.MiniCluster)

func FlagConditionReady

func FlagConditionReady(job *api.MiniCluster)

func FlagConditionRunning

func FlagConditionRunning(job *api.MiniCluster)

func FlagConditionWaiting

func FlagConditionWaiting(job *api.MiniCluster)

func GetCondition

func GetCondition(job *api.MiniCluster) string

GetCondition gets the active condition If we eventually allow more than one condition this can return multiple

func GetJobConditions

func GetJobConditions() []metav1.Condition

getJobConditions inits the job conditions. By default, the job request is true since this is the first state it hits!

func HasCondition

func HasCondition(job *api.MiniCluster, condition string) bool

func IsFinished

func IsFinished(job *batchv1.Job) bool

Determine if the job is finished

func JobsEqual

func JobsEqual(jobA *api.MiniCluster, jobB *api.MiniCluster) bool

JobsEqual takes a hash of the specs and assesses equality

func UpdateCondition

func UpdateCondition(job *api.MiniCluster, conditionType string)

UpdateCondition sets all conditions to false except for the selected

Types

type Info

type Info struct {
	Obj *api.MiniCluster

	// If admitted, the name of the running queue
	RunningQueue string
}

Info holds job data in the flux manager

func NewInfo

func NewInfo(job *api.MiniCluster) *Info

func (*Info) JobKey

func (i *Info) JobKey() string

Jump to

Keyboard shortcuts

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