thiell/test — Issue #43: External group support to NodeSet
Author: thiell
Created: 2012-03-03 16:29:02+00:00
State: open
Labels: Lib/NodeSet

The group external calls used in clush.conf has shown a great usability and this kind of groups should be added to an extension of NodeSet.

Add a configuration file to manage groups requests primitives (upcalls) and support several namespaces (or contexts).

For each namespace, defines 2 or 3 external calls (upcalls):
1. '''direct mapping''': !GroupName -> list of !GroupName | !NodeSet
2. '''group listing''': returns a list of !GroupNames
3. '''reverse mapping''': !GroupName | !NodeSet -> best !GroupNames (optional)

For example, with flat files (can be a default configuration):
1. {{{ awk '/%(group):/ { print $2 }' }}}
2. {{{ awk -F: '{ print $1 }' }}}
3. None

For example, we could easily add a slurm binding:
1. {{{ sinfo -h -o "%N" -p %(group) }}}
2. {{{ sinfo -h -o "%P" }}}
3. {{{ sinfo -h -N -o "%P" -n %(node) }}}

Another example with a getent binding:
1. {{{ getent netgroup %(group) }}}
2. {{{ getent netgroup }}} (see if possible)
3.

or use {{{ ldapsearch }}}.

We see that a class (!NodeGroups ?) that takes a configuration file as parameter is needed with 3 methods like:
1. {{{ expand() }}}
2. {{{ list() }}}
3. {{{ fold() }}}

Requests caching needs to be added to this class for faster queries.