mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
executor: update driver references
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/hashicorp/nomad/client/fingerprint"
|
||||
cstructs "github.com/hashicorp/nomad/client/structs"
|
||||
"github.com/hashicorp/nomad/drivers/shared/eventer"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor/structs"
|
||||
"github.com/hashicorp/nomad/plugins/base"
|
||||
"github.com/hashicorp/nomad/plugins/drivers"
|
||||
"github.com/hashicorp/nomad/plugins/drivers/utils"
|
||||
@@ -330,13 +330,13 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *cstru
|
||||
return nil, nil, fmt.Errorf("failed to create executor: %v", err)
|
||||
}
|
||||
|
||||
execCmd := &executor.ExecCommand{
|
||||
execCmd := &structs.ExecCommand{
|
||||
Cmd: absPath,
|
||||
Args: args,
|
||||
Env: cfg.EnvList(),
|
||||
User: cfg.User,
|
||||
ResourceLimits: true,
|
||||
Resources: &executor.Resources{
|
||||
Resources: &structs.Resources{
|
||||
CPU: cfg.Resources.NomadResources.CPU,
|
||||
MemoryMB: cfg.Resources.NomadResources.MemoryMB,
|
||||
DiskMB: cfg.Resources.NomadResources.DiskMB,
|
||||
@@ -426,7 +426,7 @@ func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.E
|
||||
func (d *Driver) handleWait(ctx context.Context, handle *taskHandle, ch chan *drivers.ExitResult) {
|
||||
defer close(ch)
|
||||
var result *drivers.ExitResult
|
||||
ps, err := handle.exec.Wait()
|
||||
ps, err := handle.exec.Wait(ctx)
|
||||
if err != nil {
|
||||
result = &drivers.ExitResult{
|
||||
Err: fmt.Errorf("executor: error waiting on process: %v", err),
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package java
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-plugin"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor/structs"
|
||||
"github.com/hashicorp/nomad/plugins/drivers"
|
||||
)
|
||||
|
||||
type taskHandle struct {
|
||||
exec executor.Executor
|
||||
exec structs.Executor
|
||||
pid int
|
||||
pluginClient *plugin.Client
|
||||
logger hclog.Logger
|
||||
@@ -57,7 +58,7 @@ func (h *taskHandle) run() {
|
||||
}
|
||||
h.stateLock.Unlock()
|
||||
|
||||
ps, err := h.exec.Wait()
|
||||
ps, err := h.exec.Wait(context.Background())
|
||||
|
||||
h.stateLock.Lock()
|
||||
defer h.stateLock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user