Documentation
¶
Index ¶
- Constants
- func DRMAA2State(jc batchv1.JobInterface, jobid string) drmaa2interface.JobState
- func GetExitStatusOfJobContainer(cs kubernetes.Interface, namespace, podName string) (int32, int32, string, error)
- func GetFirstPod(pods []corev1.Pod) corev1.Pod
- func GetJobOutput(cs kubernetes.Interface, namespace string, jobID, podName string) ([]byte, error)
- func GetLastStartedPod(pods []corev1.Pod) corev1.Pod
- func GetMachineNameForPod(cs kubernetes.Interface, namespace, podName string) (string, error)
- func GetPodsForJob(cs kubernetes.Interface, namespace, jobID string) ([]corev1.Pod, error)
- func IsComplete(c *[]v1.JobCondition) bool
- func IsDeadlineTimeException(c []v1.JobCondition) bool
- func JobToJobInfo(jc batchv1.JobInterface, jobid string) (drmaa2interface.JobInfo, error)
- func NewAllocator() *allocator
- func NewClientSet() (*kubernetes.Clientset, error)
- type KubernetesTracker
- func (kt *KubernetesTracker) AddArrayJob(jt drmaa2interface.JobTemplate, begin int, end int, step int, maxParallel int) (string, error)
- func (kt *KubernetesTracker) AddJob(jt drmaa2interface.JobTemplate) (string, error)
- func (kt *KubernetesTracker) CloseMonitoringSession(name string) error
- func (kt *KubernetesTracker) DeleteJob(jobid string) error
- func (kt *KubernetesTracker) GetAllJobIDs(filter *drmaa2interface.JobInfo) ([]string, error)
- func (kt *KubernetesTracker) GetAllMachines(filter []string) ([]drmaa2interface.Machine, error)
- func (kt *KubernetesTracker) GetAllQueueNames(filter []string) ([]string, error)
- func (kt *KubernetesTracker) JobControl(jobid, state string) error
- func (kt *KubernetesTracker) JobInfo(jobID string) (drmaa2interface.JobInfo, error)
- func (kt *KubernetesTracker) JobInfoFromMonitor(id string) (ji drmaa2interface.JobInfo, err error)
- func (kt *KubernetesTracker) JobState(jobID string) (drmaa2interface.JobState, string, error)
- func (kt *KubernetesTracker) ListArrayJobs(id string) ([]string, error)
- func (kt *KubernetesTracker) ListJobCategories() ([]string, error)
- func (kt *KubernetesTracker) ListJobs() ([]string, error)
- func (kt *KubernetesTracker) OpenMonitoringSession(name string) error
- func (kt *KubernetesTracker) Wait(jobid string, timeout time.Duration, states ...drmaa2interface.JobState) error
- type KubernetesTrackerParameters
Constants ¶
const K8S_JT_EXTENSION_LABELS = "labels"
const K8S_JT_EXTENSION_NAMESPACE = "namespace"
Variables ¶
This section is empty.
Functions ¶
func DRMAA2State ¶
func DRMAA2State(jc batchv1.JobInterface, jobid string) drmaa2interface.JobState
func GetExitStatusOfJobContainer ¶ added in v0.3.20
func GetExitStatusOfJobContainer(cs kubernetes.Interface, namespace, podName string) (int32, int32, string, error)
GetExitStatusOfJobContainer returns the exit status of a job container.
func GetFirstPod ¶ added in v0.3.20
GetFirstPod is required when a job is deleted by deadline time. Here we have no control about restarts (seeing 3) as deadling takes precedence over backoff limits in Kubernetes. So, when deadline time is used there is no guarantee that we only have one pod.
func GetJobOutput ¶ added in v0.3.8
GetJobOutput returns the output of a job pod after after it has been finished.
func GetMachineNameForPod ¶ added in v0.3.20
func GetMachineNameForPod(cs kubernetes.Interface, namespace, podName string) (string, error)
func GetPodsForJob ¶ added in v0.3.20
func IsComplete ¶ added in v0.3.24
func IsComplete(c *[]v1.JobCondition) bool
func IsDeadlineTimeException ¶ added in v0.3.24
func IsDeadlineTimeException(c []v1.JobCondition) bool
func JobToJobInfo ¶
func JobToJobInfo(jc batchv1.JobInterface, jobid string) (drmaa2interface.JobInfo, error)
JobToJobInfo converts a kubernetes job to a DRMAA2 JobInfo representation.
func NewAllocator ¶ added in v0.3.0
func NewAllocator() *allocator
func NewClientSet ¶
func NewClientSet() (*kubernetes.Clientset, error)
NewClientSet create a new clientset by parsing the .kube/config file in the home directory.
Types ¶
type KubernetesTracker ¶
type KubernetesTracker struct {
// contains filtered or unexported fields
}
func New ¶
func New(jobsession string, namespace string, cs *kubernetes.Clientset) (*KubernetesTracker, error)
New creates a new KubernetesTracker either by using a given kubernetes Clientset or by allocating a new one (if the parameter is zero).
func (*KubernetesTracker) AddArrayJob ¶
func (kt *KubernetesTracker) AddArrayJob(jt drmaa2interface.JobTemplate, begin int, end int, step int, maxParallel int) (string, error)
func (*KubernetesTracker) AddJob ¶
func (kt *KubernetesTracker) AddJob(jt drmaa2interface.JobTemplate) (string, error)
AddJob converts the given DRMAA2 job template into a batchv1.Job and creates the job within Kubernetes.
func (*KubernetesTracker) CloseMonitoringSession ¶ added in v0.3.16
func (kt *KubernetesTracker) CloseMonitoringSession(name string) error
func (*KubernetesTracker) DeleteJob ¶
func (kt *KubernetesTracker) DeleteJob(jobid string) error
DeleteJob removes a finished job and the objects created along with the job (like configmaps and secrets) Kubernetes.
func (*KubernetesTracker) GetAllJobIDs ¶ added in v0.3.16
func (kt *KubernetesTracker) GetAllJobIDs(filter *drmaa2interface.JobInfo) ([]string, error)
func (*KubernetesTracker) GetAllMachines ¶ added in v0.3.16
func (kt *KubernetesTracker) GetAllMachines(filter []string) ([]drmaa2interface.Machine, error)
func (*KubernetesTracker) GetAllQueueNames ¶ added in v0.3.16
func (kt *KubernetesTracker) GetAllQueueNames(filter []string) ([]string, error)
GetAllQueueNames returns all namespaces. If filter is != nil it returns only existing namespaces which are defined by the filter.
func (*KubernetesTracker) JobControl ¶
func (kt *KubernetesTracker) JobControl(jobid, state string) error
JobControl changes the state of the given job by execution the given action (suspend, resume, hold, release, terminate).
func (*KubernetesTracker) JobInfo ¶
func (kt *KubernetesTracker) JobInfo(jobID string) (drmaa2interface.JobInfo, error)
func (*KubernetesTracker) JobInfoFromMonitor ¶ added in v0.3.16
func (kt *KubernetesTracker) JobInfoFromMonitor(id string) (ji drmaa2interface.JobInfo, err error)
JobInfoFromMonitor might collect job state and job info in a different way as a JobSession with persistent storage does
func (*KubernetesTracker) JobState ¶
func (kt *KubernetesTracker) JobState(jobID string) (drmaa2interface.JobState, string, error)
func (*KubernetesTracker) ListArrayJobs ¶
func (kt *KubernetesTracker) ListArrayJobs(id string) ([]string, error)
func (*KubernetesTracker) ListJobCategories ¶
func (kt *KubernetesTracker) ListJobCategories() ([]string, error)
ListJobCategories returns all container images which are currently found in the cluster. That does not mean that other container images can not be used.
func (*KubernetesTracker) ListJobs ¶
func (kt *KubernetesTracker) ListJobs() ([]string, error)
ListJobs returns a list of job IDs associated with the current DRMAA2 job session.
func (*KubernetesTracker) OpenMonitoringSession ¶ added in v0.3.16
func (kt *KubernetesTracker) OpenMonitoringSession(name string) error
func (*KubernetesTracker) Wait ¶
func (kt *KubernetesTracker) Wait(jobid string, timeout time.Duration, states ...drmaa2interface.JobState) error
Wait returns when the job is in one of the given states or when a timeout occurs (errors then).
type KubernetesTrackerParameters ¶ added in v0.3.7
type KubernetesTrackerParameters struct { Namespace string // if not set it will become "default" ClientSet *kubernetes.Clientset }
KubernetesTrackerParameters can be used as parameter in NewKubernetesSessionManager. Note, that the namespace if set must exist. If not set the "default" namespace is used.