#275 shuffle around and rename *Runner and similar classes to make modules easier to read and consistent naming
Closed: Fixed Opened by kparal.

When we introduced disposable clients, our runner.py got much longer and harder to read. As discussed collectively, we would like to make it easier to navigate in once again. The current proposal is this:

  1. move LocalRunner from runner.py to executor.py and rename it to Executor
  2. move logic from Runner and RemoteRunner to governor.py and shape it into SSHGovernor and DisposableGovernor. It could follow a similar structure to http://fpaste.org/260063/78548144/ . If you think it's going to be beneficial, introduce also RemoteGovernor, which would be a parent for those two, and would document all shared methods (so that you don't need to have the same docstrings in both classes). OTOH, if their API is not similar enough, or there are just a few methods, it might not be worth it. PS: We think that "governor" is a good name for describing what this does, but more suggestions welcome.
  3. rename runner.py to main.py
  4. introduce method in main.py which will contain the decision logic whether we run things in local mode or in remote mode (and in which remote mode). Based on the outcome, create the proper class (i.e. Executor or SSHGovernor or DisposableGovernor, alternatively the method in question can return the proper instance right away) and run it.
  5. move Tee from remote_exec.py to file_utils.py
  6. rename RemoteExec from remote_exec.py to ParamikoHelper or SSHClient (other suggestions welcome)
  7. get rid of vm.Image, if not used anywhere

When writing documentation in docstrings, use terms like "executor", "governor", "local mode", "remote mode" (and more concretely "ssh mode" and "disposable mode").


This ticket had assigned some Differential requests:
D550
D528

{meme, src=megusta}

rename RemoteExec from remote_exec.py to ParamikoHelper or SSHClient (other suggestions welcome)

Let's not use SSHClient as it might get confusing: http://paramiko-docs.readthedocs.org/en/latest/api/client.html#paramiko.client.SSHClient

Btw, @lbrabec, please feel free to propose a diff new the new layout before actually spending time on fixing tests or documentation :-)

a couple of small things:
* Executer is arguably not a word and looks strange to me as a native English speaker - Executor may be better
* I think it's too early to remove vm.Image since we don't have logic to find images yet - the code that was proposed from D528 may fit well there

As far as terminology goes, I'm not a huge fan of Governor. It has implications of limiting functionality in my mind and sounds weird in this situation. Would keeping the governor bits as runner and keeping the executor bits separate still seem confusing?

@tflink: I have responded to D550 so that the discussion is at one place.

Closing (D550).

Metadata Update from @kparal:
- Issue tagged with: easyfix

Metadata