Closed stevenvanrossem closed 7 years ago
This is done right?
I want to link the the REST api in son-emu to the docker.update command in containernet to easily change the resource allocation (cpu,mem) using docker.update Then also son-profile can easily adapt cpu,mem as defined in the ped file. currently only works for cpu, planning to add mem (or all docker.update supported resources)
Ah ok fine for me. The dummy GK can already do such things when resource limits are defined in the VNFDs. Maybe this helps as a reference.
indeed, I see cgset is used in containernet to set cpu and mem limits, is there any reason why cgset was chosen over docker.update?
docker.update was not available at the time it was done :-D Should be migrated to docker.update.
docker update is now used by containernet, son-emu rest api calls the new containernet api: f5bc21167b7ccef15485f3980e52a5ee42aff35a https://github.com/sonata-nfv/son-emu/pull/199
On the son-emu emulated infrastructure, it will be more efficient to dynamically change resources in a running service, iso deploying a new package. (On the real infrastructure in the SP, deploying a new package is probably the only possible way) This will make it easier to test resource allocation in son-emu, and automate it.
the easiest solution might be to apply resource constraints using the docker update command: https://docs.docker.com/engine/reference/commandline/update/
Also: to dynamically change resource constraints during runtime, the REST API of son-emu can be extended to control the same parameters as docker update
e.g. PATCH request to /compute/{dc_label}/{compute_name} putting the paramters and value in the JSON load