cadvisor/container
Rohit Agarwal 4a35130019 Collect container-level GPU metrics using NVML.
When cAdvisor starts up, it would read the `vendor` files in
`/sys/bus/pci/devices/*` to see if any NVIDIA devices (vendor ID: 0x10de) are
attached to the node. If no NVIDIA devices are found, this code path would
become dormant for the rest of cAdvisor lifetime. If NVIDIA devices are found,
we would start a goroutine that would check for the presence of NVML by trying
to dynamically load it at regular intervals. We need to do this regular
checking instead of doing it just once because it may happen that cAdvisor is
started before the NVIDIA drivers and NVML are installed.  Once the NVML
dynamic loading succeeds, we would use NVML’s query methods to find out how
many devices exist on the node and create a map from their minor numbers to
their handles and cache that map. The goroutine would exit at this point.

If we detected the presence of NVML in the previous step, whenever a new
container is detected by cAdvisor, cAdvisor would read the `devices.list` file
from the container's devices cgroup. The `devices.list` file lists the
major:minor number of all the devices that the container is allowed to access.
If we find any device with major number 195 (which is the major number assigned
to NVIDIA devices), we would cache the list of corresponding minor numbers for
that container.

During every housekeeping operation, in addition to collecting all the existing
metrics, we will use the cached NVIDIA device minor numbers and the map from
minor numbers to device handles to get metrics for GPU devices attached to the
container.
2017-11-06 11:54:59 -08:00
..
common Merge pull request #1784 from majst01/misspelled-errors 2017-10-30 10:02:08 -07:00
crio CRI-O: fix handling of overlay2 storage 2017-10-21 12:05:40 +02:00
docker monitor diff directory for overlay2 2017-10-11 14:13:42 -07:00
libcontainer Collect container-level GPU metrics using NVML. 2017-11-06 11:54:59 -08:00
raw Report container FS metrics into prometheus /metrics 2017-04-24 20:46:55 -04:00
rkt Report container FS metrics into prometheus /metrics 2017-04-24 20:46:55 -04:00
systemd Refactor container watching out of raw handler into its own inteface / package 2016-05-11 20:27:10 -07:00
testing Add in the ability to expose the ip address of a container. 2016-07-13 13:58:43 -04:00
container.go *: add CRI-O handler 2017-09-05 17:01:58 +02:00
factory_test.go Move mocks to testing package to remove +build tags 2016-07-06 14:15:43 -07:00
factory.go Add udp and udp6 network statistics 2017-04-10 20:41:51 +01:00