vpelletier / python-functionfs

Pythonic API for linux's functionfs
GNU General Public License v3.0
40 stars 13 forks source link

FR: Option to do oneshot setup/teardown #32

Open dogtopus opened 1 year ago

dogtopus commented 1 year ago

This is similar to #31 except that python-functionfs will still be used to handle function provisioning instead of gt. This has the added benefit of not relying on an external program to provision the function, and simplifies the setup especially when there aren't a lot of different other functions running.

Essentially instead of gt load/gt rm, one could use something like my_function.py --setup/my_function.py --teardown to provision the function before running my_function.py as a function.

vpelletier commented 12 months ago

I do not see the advantages of the one-shot aspect of this feature: isn't functionfs.gadget already covering such need ?

dogtopus commented 12 months ago

Yes, but this will allow only 1 demon running instead of 2 currently with functionfs.gadget, with 1 of them being running as root and mostly stay idle IIRC.

vpelletier commented 12 months ago

Correct, it is there monitoring the processes and ready to trigger the teardown. So I guess the issue is the amount of memory it keeps allocated, is this correct ? I would expect it to be quite low, is it not ?

On the one hand I am not too enthusiastic at the idea of having to make the existing teardown code more complex (I suspect it will need to be), but on the other hand I would be happy to reduce the memory footprint. As I have not looked into it at all there could be easy gains.

dogtopus commented 12 months ago

it is quite low. I'm mainly having this as an after thought when I wrote down #31