clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

Improved API and clush Worker selection

Open thiell opened this issue 6 years ago • 5 comments

Currently, there is a mismatch between the API (eg. local/distant worker selection) and the options offered by clush. It's not great. The API could be improved for a better worker selection: at the moment task.shell() offers options like tree=None|False|True and remote=False|True but not a direct worker selection, so it's not easy for clush itself simply to control the worker selection in command line.

From an end-user point of view, it would be great to allow something as simple as this:

  • clush --worker=tree
  • clush --worker=ssh
  • clush --worker=exec

But it's not that simple. First, note that --worker=tree is not recognized at the moment. Also the Tree worker is used only if topology.conf is available (otherwise, it's useless). Then, there is a notion of local and distant worker that can be used by the tree worker (depending on remote=yes|no).

Note that clush --worker=ssh should definitely be a way to disable the tree mode, but this doesn't work, so I'm going to submit a patch for this.

thiell avatar Sep 30 '19 02:09 thiell

Also related to #291

thiell avatar Sep 30 '19 05:09 thiell

I think that most end users (those who invoke clush directly) only care about what the last worker (distant worker) actually is. That is, I might like to say --worker=ssh or --worker=rsh and not care if it uses the tree topology or not (default to use the tree if topology.conf exists even if --worker=rsh).

mattaezell avatar Apr 01 '20 02:04 mattaezell

That's a very interesting comment. We don't have enough feedback on that part as I was always working in environment where ssh was the official way to connect to any node.

I can understand that some other environments/clusters uses mrsh or other tools as the main way to connect and execute remote commands on other nodes. In that case, I can imagine that the way to reach Gateways should be the same than the way to reach last nodes from the gateways themselves. Is your setup different?

degremont avatar Apr 05 '20 18:04 degremont

In that case, I can imagine that the way to reach Gateways should be the same than the way to reach last nodes from the gateways themselves. Is your setup different?

No, but that's not really what I'm talking about.

The fact that tree mode is implemented as a worker is an implementation detail that is not obvious/relevant for the casual end-user. The questions "should I use gateway nodes" and "what protocol do I use to talk to the end node" don't necessarily need to be related.

Note that clush --worker=ssh should definitely be a way to disable the tree mode, but this doesn't work, so I'm going to submit a patch for this.

This doesn't seem obvious to me. I think that something like clush --worker=ssh --tree=true should be valid.

mattaezell avatar Apr 06 '20 18:04 mattaezell

There is likely room for improvements in this area.

That's not easy to manage all possible use cases and keep that simple enough for sysadmins. Your case is even adding a new use case where you want to control the worker selection on the final gateways.

degremont avatar Apr 07 '20 16:04 degremont