clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

To support pdsh regular expression filtering

Open haiwu opened this issue 11 years ago • 4 comments
trafficstars

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.

haiwu avatar Oct 02 '14 05:10 haiwu

For now, you can do this with the following bash construct: clush -w $(nodeset -a | egrep 'part_of_hostname|another_part_of_hostname') ...

degremont avatar Mar 21 '15 09:03 degremont

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

degremont avatar Mar 21 '15 09:03 degremont

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 ',' ?

thiell avatar Jul 11 '15 01:07 thiell

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.

degremont avatar Jul 12 '15 10:07 degremont