fix(framework) Adding the option to pass args into run_supernode and run_superlink
Issue
Description
It's not possible to pass arguments into run_supernode and run_superlink when calling those functions programmatically in a script as opposed to calling them from the CLI.
Related issues/PRs
NA
Proposal
Explanation
Add an optional arguments parameter to both of those functions that will override the local args variable if it's passed in. This way, the functions can be called in a script with any parameters needed while it still works for the regular CLI use case.
Checklist
- [x] Implement proposed change
- [ ] Write tests
- [ ] Update documentation
- [ ] Make CI checks pass
- [x] Ping maintainers on Slack (channel
#contributions)
Any other comments?
Hi @panh99! Any comments about this?
Hello @lotif! Thanks for opening this PR. For our understanding, may I ask what is the architecture/usecase that you've in mind that requires running the SuperLink and SuperNode programmatically?
For context, our intention is that the SuperLink and SuperNodes should be started as long-running services which do not have to be programmatically called in a script. That is, we treat the SuperLink and SuperNodes as the infrastructure layer of a Flower deployment. This layer should be orchestrated e.g. by Kubernetes (see for instance this Flower x GCP guide). For further reference, a high-level write-up of the runtime comparison and usage is here.
Hi @lotif, friendly ping - we're interested in understanding the motivation behind this change, could you help us understand your use case better?
While it is a simple change code-wise, it'd imply that we add the SuperLink/SuperNode Python interface to the public API of Flower.
Thanks for the response, @chongshenng @danieljanes . We have 2 use cases for that: we have pyhton scripts that kick off FL trainings and we have integration tests that run full FL trainings on test data to make sure everything is working as expected. In both cases, it's easier to manage the status of the clients and servers when they are called from within the script as opposed to kicking off separate processes for them.
My idea is that it would be easy enough to add the ability to pass in the arguments to run_supernode and run_superlink so we can call them as functions as opposed to only have those parsing the arguments from the command line.