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

Commit

Permalink
Define interfaces for common job operators (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-he authored and k8s-ci-robot committed Apr 13, 2019
1 parent 6e6a349 commit 0fe2012
Showing 1 changed file with 22 additions and 0 deletions.
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

// 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

0 comments on commit 0fe2012

Please sign in to comment.