uzh / vm-mad

Dynamically grow or shrink GridEngine clusters using cloud-based nodes
https://arxiv.org/abs/1302.2529
Apache License 2.0
3 stars 2 forks source link

draft composite object to use many providers at the same time #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We need a way to interface to multiple providers.

Since all providers expose the same basic interface (defined in the
`vmmmad.provider.NodeProvider` class), then we can apply the
"Composite" pattern here.

Please draft code for a `MultiProvider` class:

- the class is initialized with instances of `NodeProvider` classes
  (e.g., an `SmscgProvider` plus an `EC2Provider`)

- when the `start_vm` method is invoked the `MultiProvider` decides
  which of the registered providers should be used for actually
  starting the VM.  Since this decision is a matter of policy, a
  suitable "policy" interface should be designed, so that sysadmins
  can implement any policy they like by subclassing the
  `MultiProvider` and overriding the "policy methods".

- when the `stop_vm` or `update_vm` methods are invoked, the call is
  simply routed to the real provider that actually instanciated the
  VM.

Original issue reported on code.google.com by riccardo.murri@gmail.com on 26 Apr 2012 at 10:07