Skip to content

Commit

Permalink
Add a new field SchedulerName to the controller config file format
Browse files Browse the repository at this point in the history
This commit adds a new field SchedulerName to the controller config
file format. The purpose of the field is specifying the scheduler name
of the pods created by tf-operator and let the scheduler (which
wouldn't be the default scheduler) handle them. It would be convenient
for letting kube-batchd (a component of kube-arbitrator) handle the
pods.
  • Loading branch information
mitake committed Feb 22, 2018
1 parent f4a4e3d commit ffb9ebf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/apis/tensorflow/v1alpha1/types.go
Expand Up @@ -184,6 +184,10 @@ type ControllerConfig struct {

// Path to the file containing the grpc server source
GrpcServerFilePath string

// SchedulerName will be assigned to v1.Pod.Spec.SchedulerName for specifying a scheduler
// which handles the pods of tf-operator
SchedulerName string
}

// AcceleratorVolume represents a host path that must be mounted into
Expand Down
2 changes: 2 additions & 0 deletions pkg/trainer/replicas.go
Expand Up @@ -177,6 +177,8 @@ func (s *TFReplicaSet) Create(config *tfv1alpha1.ControllerConfig) error {
// Make a copy of the template because we will modify it below. .
newPodSpecTemplate := s.Spec.Template.DeepCopy()

newPodSpecTemplate.Spec.SchedulerName = config.SchedulerName

newJ := &batch.Job{
ObjectMeta: meta_v1.ObjectMeta{
Name: s.jobName(index),
Expand Down

0 comments on commit ffb9ebf

Please sign in to comment.