Skip to content

Commit

Permalink
job/task: Set runner path and cmd or error
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk>
  • Loading branch information
nderjung committed Dec 27, 2020
1 parent 4fbfe58 commit 3c3306c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions job/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (atr *ActiveTaskRun) Start() (int, error) {
os.MkdirAll(workDir, os.ModePerm)
}

runner, err := run.NewRunner(&run.RunnerConfig{
config := &run.RunnerConfig{
Log: atr.log,
CacheDir: atr.Task.cacheDir,
WorkDir: workDir,
Expand All @@ -170,9 +170,15 @@ func (atr *ActiveTaskRun) Start() (int, error) {
Image: atr.run.Image,
CpuSets: []int{},
Devices: []string{},
Path: "",
Cmd: "",
})
}
if atr.run.Path != "" {
config.Path = atr.run.Path
} else if atr.run.Cmd != "" {
config.Cmd = atr.run.Cmd
} else {
return 1, fmt.Errorf("Run did not specify path or cmd: %s", atr.run.Name)
}
runner, err := run.NewRunner(config)
if err != nil {
return 1, err
}
Expand Down

0 comments on commit 3c3306c

Please sign in to comment.