-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
Our current os:: interface for linux combines container and machine logic. When running in a container, we return container-scoped values, and when outside a container, we return host values. For example, os::physical_memory returns the container memory limit when run inside a container, not the host machine's memory.
This abstraction is convenient for most use cases, but some might need explicit access to both values. For those, we should add additional interfaces to retrieve machine and container values separately.
For example, instead of only having os::physical_memory, we could also have os::machine_physical_memory and os::container_memory.
To support this, an os::is_containerized function should also be added. This is needed so that advanced users can check which value/function to use.
This abstraction is convenient for most use cases, but some might need explicit access to both values. For those, we should add additional interfaces to retrieve machine and container values separately.
For example, instead of only having os::physical_memory, we could also have os::machine_physical_memory and os::container_memory.
To support this, an os::is_containerized function should also be added. This is needed so that advanced users can check which value/function to use.