KatharaFramework / Kathara

A lightweight container-based network emulation system.
https://www.kathara.org/
GNU General Public License v3.0
462 stars 64 forks source link

Feature/ allow ulimits parameters configuration of the devices #302

Closed g4br-i closed 3 months ago

g4br-i commented 3 months ago

I've introduced the possibility to set ulimits in the devices via lab.conf file

-Changed files The following files have been modified:

- How to verify it

- Description for the changelog Lab.conf now supports ulimits configuration at device creation, this solves cases where specific containers need to be run with custom values as in "docker run --ulimit memlock=819200000:819200000 ..."

g4br-i commented 3 months ago

with the latest commit i've added:

https://github.com/KatharaFramework/Kathara/blob/c9f7d13a5a1ec7a4e12a84ee07841488d9b4b3cf/src/Kathara/model/Machine.py#L212-L223 this addresses some edge case that i did not consider initially, like setting ulimit less the -1 and fixing a wrong behaviour i've introduced by imposing only that hard must be bigger than soft ( i was not considering the case hard=-1 which is equal to unlimited and soft being a value like 1024).

i've also added the warning for kubernets

https://github.com/KatharaFramework/Kathara/blob/c9f7d13a5a1ec7a4e12a84ee07841488d9b4b3cf/src/Kathara/manager/kubernetes/KubernetesMachine.py#L306-L308

also a bunch of new tests:

https://github.com/KatharaFramework/Kathara/blob/c9f7d13a5a1ec7a4e12a84ee07841488d9b4b3cf/tests/model/machine_test.py#L306C1-L324C60