mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
numa: enable numa topology detection (#18146)
* client: refactor cgroups management in client * client: fingerprint numa topology * client: plumb numa and cgroups changes to drivers * client: cleanup task resource accounting * client: numa client and config plumbing * lib: add a stack implementation * tools: remove ec2info tool * plugins: fixup testing for cgroups / numa changes * build: update makefile and package tests and cl
This commit is contained in:
@@ -12,11 +12,10 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/client/lib/cgutil"
|
||||
"github.com/hashicorp/nomad/drivers/shared/capabilities"
|
||||
|
||||
"github.com/hashicorp/consul-template/signals"
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/nomad/client/lib/cgroupslib"
|
||||
"github.com/hashicorp/nomad/drivers/shared/capabilities"
|
||||
"github.com/hashicorp/nomad/drivers/shared/eventer"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor"
|
||||
"github.com/hashicorp/nomad/drivers/shared/resolvconf"
|
||||
@@ -332,17 +331,9 @@ func (d *Driver) buildFingerprint() *drivers.Fingerprint {
|
||||
return fp
|
||||
}
|
||||
|
||||
mount, err := cgutil.FindCgroupMountpointDir()
|
||||
if err != nil {
|
||||
if cgroupslib.GetMode() == cgroupslib.OFF {
|
||||
fp.Health = drivers.HealthStateUnhealthy
|
||||
fp.HealthDescription = drivers.NoCgroupMountMessage
|
||||
d.logger.Warn(fp.HealthDescription, "error", err)
|
||||
return fp
|
||||
}
|
||||
|
||||
if mount == "" {
|
||||
fp.Health = drivers.HealthStateUnhealthy
|
||||
fp.HealthDescription = drivers.CgroupMountEmpty
|
||||
return fp
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/client/lib/cgutil"
|
||||
|
||||
"github.com/hashicorp/nomad/ci"
|
||||
"github.com/hashicorp/nomad/client/lib/cgroupslib"
|
||||
ctestutil "github.com/hashicorp/nomad/client/testutil"
|
||||
"github.com/hashicorp/nomad/helper/pluginutils/hclutils"
|
||||
"github.com/hashicorp/nomad/helper/testlog"
|
||||
@@ -300,14 +299,11 @@ func basicTask(t *testing.T, name string, taskConfig *TaskConfig) *drivers.TaskC
|
||||
LinuxResources: &drivers.LinuxResources{
|
||||
MemoryLimitBytes: 134217728,
|
||||
CPUShares: 100,
|
||||
CpusetCgroupPath: cgroupslib.LinuxResourcesPath(allocID, name),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if cgutil.UseV2 {
|
||||
task.Resources.LinuxResources.CpusetCgroupPath = filepath.Join(cgutil.CgroupRoot, "testing.slice", cgutil.CgroupScope(allocID, name))
|
||||
}
|
||||
|
||||
require.NoError(t, task.EncodeConcreteDriverConfig(&taskConfig))
|
||||
return task
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user