backends

package
v0.0.0-...-d8b821e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterSuffix         = "-master"
	WorkerSetSuffix      = "-workerset"
	ServiceAccountSuffix = "-launcher"
	RoleSuffix           = ServiceAccountSuffix + "-role"
	RolebindingSuffix    = ServiceAccountSuffix + "-rolebinding"

	JobLabelKey       = "chainerjob.kubeflow.org/name"
	RoleLabelKey      = "chainerjob.kubeflow.org/role"
	WorkersetLabelKey = "chainerjob.kubeflow.org/workersetname"
	RoleMaster        = "master"
	RoleWorkerSet     = "workerset"

	PodManagementPolicy = appsv1.ParallelPodManagement
)
View Source
const (
	ErrResourceExists = "ErrResourceExists"

	MessageResourceExists = "Resource %q already exists and is not managed by ChainerJob"
)

Variables

This section is empty.

Functions

func CreateJobIfNotExist

func CreateJobIfNotExist(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	jobLister batchlister.JobLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *batchv1.Job,
) (*batchv1.Job, error)

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	cmLister corelister.ConfigMapLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *corev1.ConfigMap,
) (*corev1.ConfigMap, error)

func CreateOrUpdateRole

func CreateOrUpdateRole(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	roleLister rbaclister.RoleLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *rbacv1.Role,
) (*rbacv1.Role, error)

func CreateOrUpdateRoleBinding

func CreateOrUpdateRoleBinding(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	roleBindingLister rbaclister.RoleBindingLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *rbacv1.RoleBinding,
) (*rbacv1.RoleBinding, error)

func CreateOrUpdateStatefulSet

func CreateOrUpdateStatefulSet(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	statefulSetLister appslister.StatefulSetLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *appsv1.StatefulSet,
) (*appsv1.StatefulSet, error)

func CreateServiceAccountIfNotExist

func CreateServiceAccountIfNotExist(
	chjob *apisv1alpha1.ChainerJob,
	kubeClient kubernetes.Interface,
	saLister corelister.ServiceAccountLister,
	recorder record.EventRecorder,
	newResource func(chj *apisv1alpha1.ChainerJob) *corev1.ServiceAccount,
) (*corev1.ServiceAccount, error)

func NewMasterJob

func NewMasterJob(chjob *apisv1alpha1.ChainerJob) *batchv1.Job

func NewRole

func NewRole(chjob *apisv1alpha1.ChainerJob) *rbacv1.Role

func NewRoleBindings

func NewRoleBindings(chjob *apisv1alpha1.ChainerJob) *rbacv1.RoleBinding

func NewServiceAccount

func NewServiceAccount(chjob *apisv1alpha1.ChainerJob) *corev1.ServiceAccount

func NewWorkerSet

func NewWorkerSet(chjob *apisv1alpha1.ChainerJob, done bool, name string) *appsv1.StatefulSet

func UpdateChainerJobStatus

func UpdateChainerJobStatus(
	chjob *apisv1alpha1.ChainerJob,
	status *batchv1.JobStatus,
	kubeflowClient clientset.Interface,
) error

Types

type Backend

type Backend interface {
	SyncChainerJob(chjob *apisv1alpha1.ChainerJob) error
}

Backend is interface for various backends

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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