open-nomad/client/fingerprint
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
..
test_fixtures cni: handle multi-path cni_path when fingerprinting plugins (#16163) 2023-02-13 14:55:56 -06:00
arch.go
arch_test.go
bridge.go
bridge_default.go client: Add option to enable hairpinMode on Nomad bridge (#15961) 2023-02-02 10:12:15 -05:00
bridge_linux.go client: Add option to enable hairpinMode on Nomad bridge (#15961) 2023-02-02 10:12:15 -05:00
bridge_linux_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
cgroup.go CI: make make check clean on macOS (#14528) 2022-09-09 12:26:34 -04:00
cgroup_default.go
cgroup_linux.go CI: make make check clean on macOS (#14528) 2022-09-09 12:26:34 -04:00
cgroup_test.go
cni.go fingerprint: add fingerprinting for CNI plugins presense and version (#15452) 2022-12-05 14:22:47 -06:00
cni_test.go
consul.go client: accommodate Consul 1.14.0 gRPC and agent self changes. (#15309) 2022-11-21 09:19:09 -06:00
consul_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
cpu.go client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
cpu_darwin_test.go client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
cpu_default.go client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
cpu_default_test.go client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
cpu_linux.go client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
env_aws.go
env_aws_cpu.go env/aws: update ec2 cpu info data (#16417) 2023-03-09 14:33:21 -08:00
env_aws_test.go
env_azure.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
env_azure_test.go
env_digitalocean.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
env_digitalocean_test.go
env_gce.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
env_gce_test.go
fingerprint.go client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
fingerprint_default.go
fingerprint_linux.go
fingerprint_test.go
host.go
host_test.go
landlock.go client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
landlock_test.go client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
memory.go
memory_test.go
network.go
network_default.go
network_linux.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
network_test.go
network_windows.go
nomad.go
nomad_test.go
plugins_cni.go cni: handle multi-path cni_path when fingerprinting plugins (#16163) 2023-02-13 14:55:56 -06:00
plugins_cni_test.go cni: handle multi-path cni_path when fingerprinting plugins (#16163) 2023-02-13 14:55:56 -06:00
signal.go
signal_test.go
storage.go client: add disk_total_mb and disk_free_mb config options (#15852) 2023-01-24 09:14:22 -05:00
storage_test.go
storage_unix.go
storage_windows.go
structs.go
vault.go vault: configure user agent on Nomad vault clients (#15745) 2023-01-10 10:39:45 -06:00
vault_test.go fingerprint: lengthen Vault check after seen (#14693) 2022-09-26 12:14:19 -07:00
zstorage_windows.go