Skip to content

Commit

Permalink
Add env Is_First_Round to train worker
Browse files Browse the repository at this point in the history
Signed-off-by: JimmyYang20 <[email protected]>
  • Loading branch information
JimmyYang20 committed Aug 10, 2022
1 parent 6f4b1f6 commit ad11284
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,19 @@ func (c *Controller) createPod(job *sednav1.LifelongLearningJob, podtype sednav1
podTemplate = &job.Spec.TrainSpec.Template
// Env parameters for train

isFirstRound := "True"
jobConditions := job.Status.Conditions
// initial train stage have 5 type
if len(jobConditions) > 5 {
isFirstRound = "False"
}
workerParam.Env = map[string]string{
"NAMESPACE": job.Namespace,
"JOB_NAME": job.Name,
"WORKER_NAME": "train-worker-" + utilrand.String(5),

"LC_SERVER": c.cfg.LC.Server,
"KB_SERVER": c.cfg.KB.Server,
"NAMESPACE": job.Namespace,
"JOB_NAME": job.Name,
"WORKER_NAME": "train-worker-" + utilrand.String(5),
"IS_FIRST_ROUND": isFirstRound,
"LC_SERVER": c.cfg.LC.Server,
"KB_SERVER": c.cfg.KB.Server,
}

workerParam.Mounts = append(workerParam.Mounts,
Expand Down

0 comments on commit ad11284

Please sign in to comment.