hellt / vrnetlab

Make VM-based Network OSes run in Containerlab
https://containerlab.dev
MIT License
129 stars 88 forks source link

Adjusting memory and cpu using the containerlab config / environment variables #184

Closed jmussmann closed 5 months ago

jmussmann commented 7 months ago

Currently it is not possible to adjust the cpu and memory via environment variables. It seems that there is something implemented in commit 68590a6, but this is only used for sros and very specific to it.

I think a global more general form would be good and than adding a specific function to sros.

I am already working on a solution. Would you accept such a change.

Does anyone maybe have a better idea to cover dynamic cpu and memory assignments via the containerlab config.

hellt commented 7 months ago

Hi @jmussmann yes, the cpu/ram tuning was a stopgap I did for SR OS specifically, but I agree that it needs to be a generic function implemented in common/vrnetlab.py so that every image gets to enjoy it.

I think env var approach is still ok from the API side of things, so it is a matter of reading those two env vars in the vrnetlab code and apply them respectively.

hellt commented 5 months ago

done in #198