Flask Application for monitoring and managing a BOINC cluster (multiple hosts).
Also includes python API bindings for the XML RPC_GUI API that the BOINC core client exposes.
- There's currently a lack of easily deployable web applications to manage and monitor multiple BOINC clients (as a cluster of sorts)
- A flask application that utilizes the existing python code provided by boinc-indicator. A huge thanks to Rodrigo Silva who wrote that code for Linux in python and saved myself a lot of time of having to reimplement the RPC API in python (BOINC itself uses C/C++)
-
rpc.py
is a re-write ofgui_rpc_client.{h,cpp}
in Python. Should provide the GUI_RPC API as faithfully as possible, in a Pythonic way, similar to what PyGTK/PyGI/PyGObject/gir bindings do with Gtk/GLib/etc libs. It starts as direct copy-and-paste of the C++ code as comments, and is progressively translated to Python code. C++ structs and enums are converted to classes,class RpcClient()
being the port ofstruct RPC_CLIENT
. -
client.py
is a conversion ofboinccmd
, not only from C++ to Python, but also from a command-line utility to an API library. Usesrpc.RpcClient
calls to provide an interface that closely matches the command-line options ofboinccmd
, ported as methods of aBoincClient
class. -
boinccluster.py
is the Flask application code which utilizes the BOINC client code in client.py which in turn uses rpc.py -
Since API and BOINC Cluster Flask application are distinct, in the future they they can be packaged separately and most likely will be when I find the time to isolate and ensure that code is of sufficient quality.
- Dealing with timeouts when a client is offline or not available. There's a balance to be struct right now since the code isn't aware of if it's attempted a connection prior to each attempt. Currently it's hardcoded in
rpc.py
but I plan to move it to the configuration long term and implement a way to detect the host is offline and stop attempting connections.
- Python (tested in 3.10)
- BOINC Client install accessible via TCP/IP LAN
Package and modules names are not set in stone yet. Actually, API is still a non-working stub. But, assuming a boinc
package in PYTHONPATH
, it will be something like:
For the client API (emulating the options of boinccmd
):
from client import BoincClient
bc = BoincClient()
status = bc.get_cc_status()
For the XML GUI_RPC API:
from rpc import RpcClient
rpc = RpcClient()
rpc.init()
status = rpc.get_status()
The idea is to make the client API somewhat higher-lever and a bit more straightforward than the GUI_RPC, since it automatically deals with deals with exchange_version()
, read_gui_rpc_password()
and authorize()
, but it also may have fewer features. Maybe in the future we realize having 2 layers is pointless, and merge both in a single module that provides both complete feature set and straightforward usage. Only time (or you) will tell.
- Rodigo Silva (MestreLion) [email protected]
- Jonathan Drake (drakej)
Copyright (C) 2013 Rodigo Silva (MestreLion) [email protected]. Copyright (C) 2020 Jonathan Drake (drakej).
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.