bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Convert Runner class into interface #99

Closed warownia1 closed 2 years ago

warownia1 commented 3 years ago

All non-abstract methods of Runner should be extracted to the Scheduler or its helper classes. Runners should not contain any logic other than that needed to communicate with an underlying queuing system. This change will improve testability and unclutter the code by utilizing modularity and object composition over inheritance.

Runner:
  + submit(args: List[str], cwd: str) -> str
  + status(job: JobMetadata) -> JobStatus
  + cancel(job: JobMetadata)

Each method should have a batch_* variant with default implementation.

warownia1 commented 2 years ago

Advantaged of separation and composition over inheritance are:

New runner can be composed of the following components: command line builder (this opens a possibility to have a dedicated builder for windows), execution manager interface implementing submit, check_status, cancel, release/free methods, main logic gluing the components together.