[TransWarp] (also) New to PEAK
John Landahl
john at landahl.org
Wed Jun 18 17:40:01 EDT 2003
I'm also a newcomer to PEAK look for advice. I'm writing a complex
application that needs to be flexible and pluggable, and PEAK seems to do
much of what I need plus a lot more I hadn't considered yet. However, it's
hard to know where to get started, so Phillip, in response to your request
for specifics, I'll lay out what I'm trying to do in hopes that you can point
me in the right direction.
What I'm writing is a configuration management system in Python which uses
Cheetah templates for specification of config files and configuration
behaviors. The idea is to provide a model of the system on which the
application is running, in the form of a "system object". This system object
can then be told to do various things like "configure network interfaces",
ensure that a set of processes are running, set the hostname, install a
software package, etc. It will also be able to provide information about the
running system, such as disk space utilization, system load, the list of
packages and patches installed, and so on. By abstracting the interface to
the operating system this way, and by building the class hierarchy sensibly,
this will be able to work as well on Windows as it will on Solaris or Linux.
I already have my own basic component class which various manageable
components (e.g. the network interface class, the software package class)
subclass from, which is an obvious opportunity for using PEAK's component
capabilities right away. I also use a very basic textual format for
specifying components within the Cheetah templates, so I'm very interested in
the parsing/formatting capability described in the features doc ('domain
types can also define string parsing and formatting syntax, so you can create
domain-specific data languages or just string formats for data types').
In addition to configuration management, there will also be a job processing
subsystem, an event management subsystem, and a provisioning subsystem for
operating system installations. Each major subsystem will have both client
and server components which should be able to run anywhere -- e.g. a
configuration server will also be a configuration client, so it should be
able to run both components; at one site all the various services might run
on one machine while at another they might be separated, or there may be
local configuration services for each of several data centers. Clients
should be able to find their corresponding service through SLP, or some other
dynamic method such as asking the primary configuration service. There will
also be a publish/subscribe mechanism for moving messages around and between
the various systems, and some sort of RMI mechanism for communication between
clients and services. I've been using OSE (http://ose.sourceforge.net/) for
its publish/subscribe, request/respond, and scheduling capabilities, but am
also considering going to Twisted and possibly Jabber for pub/sub.
Regardless of what I use under the hood, I need to build a flexible framework
that provides generalized configuration, logging, and communication to and
between clients and services. The user should be able to configure which
clients and services will run using command line and config file options (I'm
using both Optik and ZConfig already), and what specific processes (method
calls, really) should run when, preferrably with a cron-like flexibility as
in OSE. Within the running process, any instantiated client object should be
able to ask the system object described above for information or to perform
tasks, so this is an obvious place to use PEAK's concept of a service. There
will most likely be some sort of communication manager to handle the IPC/RMI,
so this will need to be made available as a PEAK service as well.
So now to some specific questions:
1) I haven't been able to find any example PEAK programs (though I'm beginning
to try to digest Ulrich Eck's code) -- are there any out there that show how
to startup a basic PEAK application, define a few components and services,
use them to perform a simple task, and then exit on a certain condition
(keyboard interrupt, response from a user, etc.)?
2) How does one setup a PEAK service, and how do application components ask
for and make use of those services?
3) A lot of the data used by the system will be stored centrally either in an
RDBMS or ZODB (I might want to make this configurable so the end user can
pick whatever they prefer). It seems that PEAK's Data Manager framework can
handle this for me, but I don't yet know how this works. Are there any
example programs that show how to use persistence and data managers?
4) It seems that PEAK's scheduling capabilities are currently limited to
calling a method periodically (every x seconds). Will there be more advanced
scheduling in future versions?
5) How can various application components watch for events, either from the OS
(signals, keyboard interrupt, etc.) or from other components?
6) I'm still working on getting ZConfig to do what I want it to do... is there
a more basic way to tell PEAK which components to load and run?
I'm going to make my first attempt today of applying PEAK to what I've already
done so far and see how far I can get with it, after which I will almost
certainly come up with a few more questions. :) Thanks for the great work,
and if I can help at any point with documentation and such (after I know a
bit more about what I'm doing, of course), I'd be quite happy to contribute
to the project.
John Landahl
john at landahl.org
More information about the PEAK
mailing list