Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Define interfaces for common job operators #12

Merged
merged 1 commit into from
Apr 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions job_controller/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"strings"

common "github.com/kubeflow/common/operator/v1"
"github.com/kubernetes-sigs/kube-batch/pkg/apis/scheduling/v1alpha1"
kubebatchclient "github.com/kubernetes-sigs/kube-batch/pkg/client/clientset/versioned"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -60,6 +61,27 @@ type ControllerInterface interface {

// Returns the Job from API server
GetJobFromAPIClient(namespace, name string) (metav1.Object, error)

// DeleteJob deletes the job
DeleteJob(job interface{}) error
gaocegege marked this conversation as resolved.
Show resolved Hide resolved

// UpdateJobStatus updates the job status and job conditions
UpdateJobStatus(job interface{}, replicas map[common.ReplicaType]*common.ReplicaSpec, jobStatus common.JobStatus) error

// CreateService creates the service
CreateService(job interface{}, service *v1.Service) error

// DeleteService deletes the service
DeleteService(job interface{}, service *v1.Service) error

// CreatePod creates the pod
CreatePod(job interface{}, podTemplate *v1.PodTemplate) error

// DeletePod deletes the pod
DeletePod(job interface{}, pod *v1.Pod) error

// SetClusterSpec sets the cluster spec for the pod
SetClusterSpec(job interface{}, podTemplate *v1.PodTemplate, rtype, index string) error
}

// JobControllerConfiguration contains configuration of operator.
Expand Down