open-nomad/client
Seth Hoenig 87f4b71df0
client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672)
* client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips

This PR adds detection of asymetric core types (Power & Efficiency) (P/E)
when running on M1/M2 Apple Silicon CPUs. This functionality is provided
by shoenig/go-m1cpu which makes use of the Apple IOKit framework to read
undocumented registers containing CPU performance data. Currently working
on getting that functionality merged upstream into gopsutil, but gopsutil
would still not support detecting P vs E cores like this PR does.

Also refactors the CPUFingerprinter code to handle the mixed core
types, now setting power vs efficiency cpu attributes.

For now the scheduler is still unaware of mixed core types - on Apple
platforms tasks cannot reserve cores anyway so it doesn't matter, but
at least now the total CPU shares available will be correct.

Future work should include adding support for detecting P/E cores on
the latest and upcoming Intel chips, where computation of total cpu shares
is currently incorrect. For that, we should also include updating the
scheduler to be core-type aware, so that tasks of resources.cores on Linux
platforms can be assigned the correct number of CPU shares for the core
type(s) they have been assigned.

node attributes before

cpu.arch                  = arm64
cpu.modelname             = Apple M2 Pro
cpu.numcores              = 12
cpu.reservablecores       = 0
cpu.totalcompute          = 1000

node attributes after

cpu.arch                  = arm64
cpu.frequency.efficiency  = 2424
cpu.frequency.power       = 3504
cpu.modelname             = Apple M2 Pro
cpu.numcores.efficiency   = 4
cpu.numcores.power        = 8
cpu.reservablecores       = 0
cpu.totalcompute          = 37728

* fingerprint/cpu: follow up cr items
2023-03-28 08:27:58 -05:00
..
allocdir deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
allochealth allocrunner: fix health check monitoring for Consul services (#16402) 2023-03-10 14:43:31 -05:00
allocrunner nsd: always set deregister flag after deregistration of group (#16289) 2023-03-17 09:44:21 -05:00
allocwatcher deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
config deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
consul Merge branch 'main' into f-1.3-boogie-nights 2022-03-23 09:41:25 +01:00
devicemanager cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
dynamicplugins csi: avoid a nil pointer when handling plugin events (#15518) 2022-12-12 08:42:57 -05:00
fingerprint client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
interfaces client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
lib cgv1: do not disable cpuset manager if reserved interface already exists (#16467) 2023-03-13 17:00:17 -05:00
logmon deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
pluginmanager csi: avoid a nil pointer when handling plugin events (#15518) 2022-12-12 08:42:57 -05:00
servers main: remove deprecated uses of rand.Seed (#16074) 2023-02-07 09:19:38 -06:00
serviceregistration nsd: always set deregister flag after deregistration of group (#16289) 2023-03-17 09:44:21 -05:00
state Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
stats client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
structs client: add support for checks in nomad services 2022-07-12 17:09:50 -05:00
taskenv allocrunner: fix health check monitoring for Consul services (#16402) 2023-03-10 14:43:31 -05:00
testutil docker: disable driver when running as non-root on cgroups v2 hosts (#16063) 2023-02-06 14:09:19 -06:00
vaultclient vault: configure user agent on Nomad vault clients (#15745) 2023-01-10 10:39:45 -06:00
acl.go Accept Workload Identities for Client RPCs (#16254) 2023-02-27 10:17:47 -08:00
acl_test.go Accept Workload Identities for Client RPCs (#16254) 2023-02-27 10:17:47 -08:00
agent_endpoint.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
agent_endpoint_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
alloc_endpoint.go Accept Workload Identities for Client RPCs (#16254) 2023-02-27 10:17:47 -08:00
alloc_endpoint_test.go metrics: Add remaining server RPC rate metrics (#15901) 2023-01-27 08:29:53 -05:00
alloc_watcher_e2e_test.go deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
client.go client: don't use Status RPC for Consul discovery (#16490) 2023-03-16 15:38:33 -04:00
client_stats_endpoint.go Server side impl + touch ups 2018-02-15 13:59:02 -08:00
client_stats_endpoint_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
client_test.go implement pre-forwarding auth on select RPCs (#15513) 2023-01-24 10:52:07 -05:00
csi_endpoint.go CSI: allow updates to volumes on re-registration (#12167) 2022-03-07 11:06:59 -05:00
csi_endpoint_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
driver_manager_test.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
enterprise_client_oss.go gofmt all the files 2021-10-01 10:14:28 -04:00
fingerprint_manager.go fingerprint: lengthen Vault check after seen (#14693) 2022-09-26 12:14:19 -07:00
fingerprint_manager_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
fs_endpoint.go cleanup: replace TypeToPtr helper methods with pointer.Of (#14151) 2022-08-17 18:26:34 +02:00
fs_endpoint_test.go deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318) 2023-03-08 13:25:10 -06:00
gc.go chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
gc_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
heartbeatstop.go client: fix race in heartbeat tracker (#14119) 2022-08-16 09:41:08 -07:00
heartbeatstop_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
meta_endpoint.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
meta_endpoint_test.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
node_updater.go fix: batchFirstFingerprints does not update device on node after v1.3.5 (#15125) 2022-11-03 16:31:39 -05:00
rpc.go Dynamic Node Metadata (#15844) 2023-02-07 14:42:25 -08:00
rpc_test.go ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
testing.go client: fix data races in config handling (#14139) 2022-08-18 16:32:04 -07:00
util.go Revert "client: defensive against getting stale alloc updates" 2020-06-19 15:39:44 -04:00