Making the java driver apply resource constraints and limits

This commit is contained in:
Diptanu Choudhury 2016-02-05 10:55:03 -08:00
parent 1ba1baa9ac
commit f4ea6a15c8
1 changed files with 7 additions and 4 deletions

View File

@ -158,10 +158,13 @@ func (d *JavaDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle,
return nil, err return nil, err
} }
executorCtx := &executor.ExecutorContext{ executorCtx := &executor.ExecutorContext{
TaskEnv: d.taskEnv, TaskEnv: d.taskEnv,
AllocDir: ctx.AllocDir, AllocDir: ctx.AllocDir,
TaskName: task.Name, TaskName: task.Name,
TaskResources: task.Resources, TaskResources: task.Resources,
FSIsolation: true,
ResourceLimits: true,
UnprivilegedUser: true,
} }
ps, err := exec.LaunchCmd(&executor.ExecCommand{Cmd: "java", Args: args}, executorCtx) ps, err := exec.LaunchCmd(&executor.ExecCommand{Cmd: "java", Args: args}, executorCtx)
if err != nil { if err != nil {