Manage resource constraints per sandbox
Here is the preliminary proposal (needs further discussion):
1. Create the sandbox container with resource constraints (i.e. cpu, memory, etc). This is done in nova driver since it uses flavor, and needs some work in native docker driver.
2. Create user's container by using the option --cgroup-parent to join the cgroup of its sandbox container.
As a result, the sandbox will define the total amount of resources that all its containers inside can leverage.
Whiteboard
@Hongbin, There are two questions which come to my mind as of now are:
1. How do we handle container with no resource constraint, since the flavor restricts the sandbox with limited resources?
2. How do we prevent over utilisation of resources for finding the optimum flavor?
Pradeep-
@Pradeep, I don't have a perfect solution in mind. Perhaps, we should make --cpu/--memory mandatory, or introduce 'flavor' (similar to Nova). Please feel free to propose ideas if you have some.
-- hongbin 2017-03-01
@Hongbin, I like this BP, since container composition may need this BP to realize the "cpu and memory limitation" just like K8s
-- kevinz 2017-03-13
@Kevin, got it. I marked the direction as approved.
-- hongbin 2017-03-13