From: Antoine Durr <antoine@(email surpressed)>
Subject: Re: semi dynamic hostgroups/criteria hosts file
   Date: Wed, 30 May 2007 16:05:44 -0400
Msg# 1560
View Complete Thread (7 articles) | All Threads
Last Next
On 2007-05-30 11:35:22 -0700, Greg Ercolano <erco@(email surpressed)> said:

Antoine Durr wrote:
Is there a way to have the set of hostgroups to which a host belongs
be configured from a program, rather than entered statically into the
Rush hosts file?

	No, rush only gets its hostgroup info from the rush/etc/hosts file.

	Rush parses and caches this file, and only reloads it when it
	sees the datestamp change, or when 'rush -reload hosts' is used
	to force a reload immediately.

I don't need fast dynamic updating. I just wanted to avoid having the same lists (or similar, but eventually diverging lists) in two different places. I think the solution is to have a cron job regenerate the rush hosts list once per day and invoke 'rush -reload hosts'.

How frequently does Rush check the file for a datestamp change? On every queue submit?

This all came out of when I was tweaking one of the submit scripts. I'm finding that users in general have a hard time grasping the complexity of +any=5@100 syntax (even I have to step through it each time), so I'm breaking apart the hostgroups, maxcpus, and priority into separate input fields. Then for the hostgroups field, I run the 'hostgroups' command and generate the option list from that, so that the user is presented with a list of choices for what to put in there.


	There are no hooks where rush can 'run a program' to get this
	info. That could maybe be arranged, just for the hostgroup info,
	but I didn't want to go there, because future modifications might
	involve accessing the hostgroup information fairly often, if it
	were to ever be changed to being dynamic.

	So it will probably always be a file that is 'cached', updated
	only when changed or 'poked' with a reload, to keep things from
	bottlenecking.

	In a very old render queue design, I tried to implement scheduling
	and host grouping as a script, and I very quickly found that
	the script was too much overhead (too slow) to manage the high
	turnaround needed in high volume environments, so I stopped
	researching that idea pretty quickly.

I have a standalone program (called 'hostgroups', appropriately
enought!) that if I give it 'fgs2' as a parameter, returns a list that
looks similar to '+any,+linux,+server'.  How do I wedge my program into
this list here or onto what Rush things are the host groups?



-- Antoine

Floq FX Inc.
10839 Washington Blvd.
Culver City, CA 90232
310/430-2473


Last Next