Giter Club home page Giter Club logo

boinc-cluster's Introduction

BOINC Cluster

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.

The Problem

  • There's currently a lack of easily deployable web applications to manage and monitor multiple BOINC clients (as a cluster of sorts)

The Solution

  • 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++)

The Approach

  • rpc.py is a re-write of gui_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 of struct RPC_CLIENT.

  • client.py is a conversion of boinccmd, not only from C++ to Python, but also from a command-line utility to an API library. Uses rpc.RpcClient calls to provide an interface that closely matches the command-line options of boinccmd, ported as methods of a BoincClient 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.

The Challenges

  • 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.

Requirements

  • Python (tested in 3.10)
  • BOINC Client install accessible via TCP/IP LAN

Using the API library

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.

Written by

Licenses and Copyright

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.