mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +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:
@@ -23,7 +23,6 @@ import (
|
||||
uuidparse "github.com/hashicorp/go-uuid"
|
||||
"github.com/hashicorp/nomad/client"
|
||||
clientconfig "github.com/hashicorp/nomad/client/config"
|
||||
"github.com/hashicorp/nomad/client/lib/cgutil"
|
||||
"github.com/hashicorp/nomad/client/state"
|
||||
"github.com/hashicorp/nomad/command/agent/consul"
|
||||
"github.com/hashicorp/nomad/command/agent/event"
|
||||
@@ -842,15 +841,6 @@ func convertClientConfig(agentConfig *Config) (*clientconfig.Config, error) {
|
||||
}
|
||||
conf.BindWildcardDefaultHostNetwork = agentConfig.Client.BindWildcardDefaultHostNetwork
|
||||
|
||||
conf.CgroupParent = cgutil.GetCgroupParent(agentConfig.Client.CgroupParent)
|
||||
if agentConfig.Client.ReserveableCores != "" {
|
||||
cores, err := cpuset.Parse(agentConfig.Client.ReserveableCores)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse 'reservable_cores': %v", err)
|
||||
}
|
||||
conf.ReservableCores = cores.ToSlice()
|
||||
}
|
||||
|
||||
if agentConfig.Client.NomadServiceDiscovery != nil {
|
||||
conf.NomadServiceDiscovery = *agentConfig.Client.NomadServiceDiscovery
|
||||
}
|
||||
|
||||
@@ -12,10 +12,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/shoenig/test/must"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/hashicorp/nomad/ci"
|
||||
cstructs "github.com/hashicorp/nomad/client/structs"
|
||||
"github.com/hashicorp/nomad/helper/pointer"
|
||||
@@ -24,6 +20,9 @@ import (
|
||||
"github.com/hashicorp/nomad/nomad/structs/config"
|
||||
"github.com/hashicorp/nomad/testutil"
|
||||
"github.com/hashicorp/raft"
|
||||
"github.com/shoenig/test/must"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestAgent_RPC_Ping(t *testing.T) {
|
||||
@@ -745,19 +744,6 @@ func TestAgent_ClientConfig_JobMaxSourceSize(t *testing.T) {
|
||||
must.Eq(t, 1e6, serverConf.JobMaxSourceSize)
|
||||
}
|
||||
|
||||
func TestAgent_ClientConfig_ReservedCores(t *testing.T) {
|
||||
ci.Parallel(t)
|
||||
conf := DefaultConfig()
|
||||
conf.Client.Enabled = true
|
||||
conf.Client.ReserveableCores = "0-7"
|
||||
conf.Client.Reserved.Cores = "0,2-3"
|
||||
a := &Agent{config: conf}
|
||||
c, err := a.clientConfig()
|
||||
must.NoError(t, err)
|
||||
must.Eq(t, []uint16{0, 1, 2, 3, 4, 5, 6, 7}, c.ReservableCores)
|
||||
must.Eq(t, []uint16{0, 2, 3}, c.Node.ReservedResources.Cpu.ReservedCpuCores)
|
||||
}
|
||||
|
||||
// Clients should inherit telemetry configuration
|
||||
func TestAgent_Client_TelemetryConfiguration(t *testing.T) {
|
||||
ci.Parallel(t)
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/hashicorp/nomad/client/allocrunner/taskrunner"
|
||||
"github.com/hashicorp/nomad/client/config"
|
||||
"github.com/hashicorp/nomad/client/devicemanager"
|
||||
"github.com/hashicorp/nomad/client/lib/proclib"
|
||||
"github.com/hashicorp/nomad/client/pluginmanager/drivermanager"
|
||||
regMock "github.com/hashicorp/nomad/client/serviceregistration/mock"
|
||||
"github.com/hashicorp/nomad/client/serviceregistration/wrapper"
|
||||
@@ -169,6 +170,7 @@ func TestConsul_Integration(t *testing.T) {
|
||||
DriverManager: drivermanager.TestDriverManager(t),
|
||||
StartConditionMetCh: closedCh,
|
||||
ServiceRegWrapper: wrapper.NewHandlerWrapper(logger, serviceClient, regMock.NewServiceRegistrationHandler(logger)),
|
||||
Wranglers: proclib.New(&proclib.Configs{Logger: testlog.HCLogger(t)}),
|
||||
}
|
||||
|
||||
tr, err := taskrunner.NewTaskRunner(config)
|
||||
|
||||
Reference in New Issue
Block a user