Gentoo Archives: gentoo-scire

From: Rodrigo Lazo <rlazo.paz@×××××.com>
To: Gentoo Scire mailing list <gentoo-scire@l.g.o>
Subject: [gentoo-scire] Event framework proposal
Date: Tue, 02 Oct 2007 16:43:25
Message-Id: 86fy0twk5f.fsf@mash.doux
Hi all,

Here is the proposal for an event based framework for scire. I wrote
it as part of the SoC program. 


Scire's event framework proposal

Author:     Rodrigo Lazo
Time-stamp: "2007-08-20 12:53:27"


SCIRE aims to "create a widely extensible common portal for
administrative tasks for multiple Linux client machines"[1]. To be
able to achive this extensibility goal, SCIRE must provide some entry
points for the third-party extensions. We propose that the backend
entry points were event-based. Scire's core will provide some "hooks"
for the important events (e.g pre-client-creation-hook,

Detailed Proposal

The event-based method to extend an application is used for example on
the netfilter project ("netfilter is a set of hooks inside the Linux
kernel that allows kernel modules to register callback functions with
the network stack."[2]), Emacs (""Hooks" are an important mechanism
for customization of Emacs.  A hook is a Lisp variable which holds a
list of functions, to be called on some well-defined occasion."[3])
and so on. 

Scire has some features that could be called to be part of "the core"
system, and they include, but under no means are restrict to: client
(individual and groupal) management, profiles management and job
management (including scripts). Using event-based hooks could allow
some nice features without affecting the core system (that by all
means should stay as minimal and clean as possible to avoid security
problems and to reduce maintenance overheat. Here an example:

Sample adding Client routine:	 

	|  Pre-client-add-hook		   
	+----------------------------o (send a sms to the scire root)	   
+-------o---------+  client-add-hook	 	  
| Client add      -------------------o (logging on a third party module)
|   Mechanism     |	 
	|  Post-client-add-hook		 
	+----------------------------o (create a job to gather client info)

All the modules to interact dinamically could be loaded and unloaded
for the system while running, achiving a more stable system. 

Implementation Problems

Right now the scire code is splitted. The backend, written on Python,
implements basically the communication between the client and the
server; the frontend, written on PHP, interacts with the user. The
difficult lies on creating a unified event-based system that could
react to events launched by any of the two enviroments (e.g. when a
client fails it could be detected by the backend, but the users
resolution of the problem is only detected by the frontend).

Proposed Modules to make use of this mechanism
* Successful Job's reschedule
* Logging module
* User notification module (sms, e-mail)
* Job output postprocessing
* etc


Rodrigo Lazo (rlazo)
gentoo-scire@g.o mailing list