clustershell
clustershell copied to clipboard
To support pdsh regular expression filtering
pdsh allows regular expression if running it as "pdsh -a -w '/part_of_hostname|another_part_of_hostname/'".
If clush really wants to replace pdsh, it should have the same feature sets.
For now, you can do this with the following bash construct:
clush -w $(nodeset -a | egrep 'part_of_hostname|another_part_of_hostname') ...
Regarding implementing such features in ClusterShell should be done improving the nodeset arithmetics.
A new pattern, may be /pattern/, should be added as a filter to the computed nodeset, using regexp propably.
ie: NodeSet("mynode,@mygroup&/my_pattern/")
This ables to:
- remove some nodes:
@group!/pattern/ - grep some nodes:
@group&/pattern/
XOR (^) and UNION (,) would be useless
I'm not sure why we need this. Sounds like we mix node arithmetics and pattern matching... We have external node groups support which I think is more powerful that inline pattern matching usages. Group sources can be implemented using regexp.
To better understand, should the pattern be applied on each node or the folded nodeset? eg. on nodeset -af or nodeset -ae -S ',' ?
mix node arithmetics and pattern matching
This is definitely this. But I do not really see a problem here.
We have external node groups support which I think is more powerful that inline pattern matching usages.
I do not see how. The feature here is more generic. I do not see how you can fix this with groups.
Let see: @slurm:parallel&@automate:prod&/foo/ meaning node in group slurm:parallel and in production containing the word foo in their names.
should the pattern be applied on each node or the folded nodeset?
each node. This pattern is just here to filter the node selection.