Re: domain-specific language



On 8/18/05, Ara.T.Howard <Ara.T.Howard@xxxxxxxx> wrote:
> On Fri, 19 Aug 2005, Joe Van Dyk wrote:
>
> > I'm writing an application that controls a group/cluster of linux
> > computers/nodes. I need to have a configuration file that lists the
> > nodes in the cluster.
> >
> > It would be neat if the configuration file was in Ruby. If I had
> > nodes named node1 and node3, the configuration file could look a
> > little like:
> >
> > node :node1 do
> > ip 192.whatever
> > title "Node 1"
> > end
> >
> > node :node2 do
> > ip 192.whatever
> > title "Node 2"
> > end
> >
> > So, is there some standard Ruby idiom for how to read a file and
> > execute the code? Just load the file and instance_eval it?
>
>
> harp:~ > cat a.rb
> config = <<-config
> nodes :
> 1 :
> ip : 192.whatever
> title : node 1
> 2 :
> ip : 192.whatever
> title : node 2
> config
>
> require 'yaml'
>
> config = YAML::load config
>
> config['nodes'].each do |nid, node|
> puts "node <#{ nid }> => <#{ node.inspect }>"
> end
>
>
> harp:~ > ruby a.rb
> node <1> => <{"title"=>"node 1", "ip"=>"192.whatever"}>
> node <2> => <{"title"=>"node 2", "ip"=>"192.whatever"}>
>
> so all you have to do is 'YAML::load(IO::read(configfile))'.
>
> what kind of clustering are you working with?
>
> you may, or may not, find this useful:
>
> http://raa.ruby-lang.org/project/rq/
> http://www.linuxjournal.com/article/7922

Thanks for the pointers.

Essentially, there's a bunch of applications that need to be started
on a few machines.

Imagine you have 20 applications. You need to start those
applications on three different machines (nodes in a cluster). Some
applications will run on all machines, some applications will only run
on some machines. All the applications take many (20 or so)
environment options and command-line arguments and a user needs to be
able to change those options/arguments.

The users need to be able to select what application will get run on
what computer. They need to be able to make sure that the
applications haven't died, and if they have, to restart the
application. They need to be able to view log files for the
applications. Since these are real-time applications, the "cluster
manager application" that takes requests from the user's GUI and
distributes them to the computers in the cluster will probably need to
enforce certain restrictions on the user (i.e. can't run too many
cpu-intensive applications on one computer).

And because the applications and their env options and command-line
args change frequently, depending on what the user's objectives are,
it needs to be heavily driven by configuration files (that hopefully
are easy to change). I figure Ruby's syntax would be a good fit for
the configuration files.

The current design:

The GUI. The GUI is populated primarily from configuration files that
detail the available applications, their environment options and
command-line arguments.

The Cluster Manager. This connects the Node Managers to the GUIs.
Sends start and kill application requests from the GUIs to the Node
Managers, and sends node status updates from the nodes to the GUIs (so
the GUIs can see what's going on with each node and their
applications). Uses XML-RPC for communication (non-ruby clients will
need to access this).

The Node Manager. Starts and Kills applications on a node and sends
status updates (what applications are running, the node load average,
stuff like that) to the Cluster Manager. Uses DRb for communication
with the Cluster Manager.


.



Relevant Pages

  • Re: Great SWT Program
    ... GUIs allow you to be productive earlier than that point, ... they tend to be incredibly ineffecient for the power user. ... some GUI applications are better than others ... Yeah, yeah, probably ...
    (comp.lang.java.programmer)
  • Re: Anyone know why the Alpha market is so so quiet?
    ... they need to test their Apps before they release OS patches.] ... I think it would help if Ron pointed out exactly what testing he performs on ... each system and the hosted applications, after each one of these yum fests. ... Some VMS & Rdb patches, though, can't be *adequately* tested on the QA cluster because it's not as powerful as the main cluster and can't simulate the same load. ...
    (comp.os.vms)
  • Re: Active/Passive to Active/Active
    ... windows service in A/A cluster. ... With the above setup there are no issues with A/P setup... ... You should NOT install applications in the Cluster Group on ... The articles you read are wrong, MSCS does NOT do loadbalancing. ...
    (microsoft.public.windows.server.clustering)
  • Re: Generic battery interface
    ... so that they'd be easy to enter into configuration files. ... Yet applications today want automatic discovery of devices and don't ... want to rely on udev getting the names right. ... system accelerometer readouts, either the readouts change very slowly ...
    (Linux-Kernel)
  • Re: FTP install order W2K Cluster
    ... >I would strongly suggest that you use NLB to setup your load-balanced FTP ... > "Your choice of cluster technologies (server clusters or Network Load ... > applications that have long-running in-memory state or frequently updated ...
    (microsoft.public.windows.server.clustering)