python-functionfs icon indicating copy to clipboard operation
python-functionfs copied to clipboard

FR: Option to do oneshot setup/teardown

Open dogtopus opened this issue 2 years ago • 4 comments

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.

dogtopus avatar Jul 24 '23 03:07 dogtopus

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

vpelletier avatar Jul 30 '23 13:07 vpelletier

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.

dogtopus avatar Jul 30 '23 13:07 dogtopus

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.

vpelletier avatar Jul 30 '23 14:07 vpelletier

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

dogtopus avatar Jul 30 '23 14:07 dogtopus