EASY TO USE CONFIGURATION SYNTAX! Re: [noctool-devel] compact configurations for identical machines

Jim Prewett download at hpc.unm.edu
Thu May 29 03:02:59 UTC 2008


Hi all,

I came up with a straw-man to shoot some holes in... I came up with a 
function, RANGE that is super easy to use to produce a set of machine 
names - Like I said earlier, I'm trying to figure out how to make this 
syntax workable.

;; trust me, this makes *some* sense... 
(defun range (start end fmts)
  (loop for fmt in fmts
       nconc
       (loop for i from start to end collect
            (format NIL fmt i))))

;; now, we can call range for a simple cluster
> (cl-user::range 1 3 '("small~2,'0d"))
("small01" "small02" "small03")

;; we can also call it recursively to make more complex numbering schemes
NOCTOOL> (cl-user::range 0 9 (cl-user::range 1 2 '("rtr-~2,'0d-~~3,'0d")))
("rtr-01-000" "rtr-01-001" "rtr-01-002" "rtr-01-003" "rtr-01-004"
 "rtr-01-005" "rtr-01-006" "rtr-01-007" "rtr-01-008" "rtr-01-009"
 "rtr-02-000" "rtr-02-001" "rtr-02-002" "rtr-02-003" "rtr-02-004"
 "rtr-02-005" "rtr-02-006" "rtr-02-007" "rtr-02-008" "rtr-02-009")

The inner range produces a list of format strings for the outer if thats 
not clear (which is why RANGE takes a list of format strings).

I realize this is pretty much ugly as sin... BUT, to me it seems a 
*mostly* reasonable way to specify an extremely large/complex network - 
which shouldn't have to be a 1 line config file written by a jr admin ;)  
Its OK to need a *little* fu if you're monitoring 3,000 routers ;)  I 
*NEED* for this to be doable in a halfway reasonable way - all I care 
about is large compute clusters and, to a lesser extent, the networks that 
surround them: I want to cater to *my* ("supercomputing") community.  
We're all here for selfish reasons, right? :)

Jim

James E. Prewett                    Jim at Prewett.org download at hpc.unm.edu 
Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/ 
Designated Security Officer         OpenPGP key: pub 1024D/31816D93    
HPC Systems Engineer III   UNM HPC  505.277.8210

On Wed, 28 May 2008, Jim Prewett wrote:

> 
> I'm still thinking about this one... 
> 
> > Or, wait, even better!
> > 
> > Does this look at least vaguely sane?
> > (cluster ("rtr-~3,'0d" 1 10)
> >   (machine name linux-host
> >      (user "testuser")))
> 
> Using your example from earlier, how would we specify something like 
> "rtr-f01-001" through "rtr-f03-999".  This is *different* than your 
> objection to my initial syntax - what in the heck would a format string 
> look like if this were actually trying to specify 3000 or so routers... (* 
> OK, imagine we're either not FORMAT ninjas or we're using something that 
> doesn't make julienne fries in addition to printing, like C's printf ;)  
> I UNDERSTAND IT IS POSSIBLE TO CURE CANCER WITH A SINGLE INVOCATION OF 
> FORMAT ;) *)
> 
> This seems like a better place to screw things up royally than I had 
> initially anticipated :P :)  Its going to be difficult to get this right 
> I'm thinking...
> 
> *To get something working*, I'm thinking we should just accept a format 
> string something like Ingvar's suggestion quoted above.  There are, 
> hopefully, more interesting problems to solve. :)
> 
> Jim
> _______________________________________________
> noctool-devel mailing list
> noctool-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/noctool-devel
> 



More information about the Noctool-devel mailing list