Skip to content

Make execution model more robust/flexible #21

@bitprophet

Description

@bitprophet

Description

  • Right now, relatively simple, calls each function one by one, and for each
    function, runs on each host one by one, and the host list may be different
    per-function.
  • What may make more sense is to specify host list "first", then for each
    host, you call each function in turn (in which case the order of functions
    may matter more than it does now). This would mean that the logic for host
    discovery changes a decent amount.
  • Do we want to allow this to be switched up dynamically? I.e. allow user
    to specify a "mode" (like in the old Fabric) to determine which of those
    two algorithms is used?
  • How do these decisions affect what decorators/etc can be applied? I.e.
    @hosts doesn't make any sense in the latter scenario because there is only
    one global host list per session. (But isn't that the more sensible
    solution? Is it ever useful to execute a fab command line and have the host
    list to change during the session?)
  • See mikeias' fork for one potential
    approach: preserves dynamic checking of host/role lists as attached to
    tasks via decorators, but thus requires one to call a function with the
    task name as a string, instead of simply calling the function itself. May
    be worth the tradeoff, and is definitely food for thought.
  • Also work in the concept of dependencies. Right now users have to explicitly call the other functions, which results in minor DRY violations in some cases at least.
    • Argument against dependencies would be that it could introduce magic, i.e. calling a function that is hooked into by other functions is no longer a straight "just calls this one function only".
    • Could also be a lot more complex to set up, depending on how the stuff above is approached (i.e. if the above is done without sacrificing a lot of simplicity, this almost definitely would)

As a possible stopgap (or maaaybe long term) simply refactor existing connection/execution stuff so it can be exposed to users, i.e. something encapsulating "call function X on Y host list". Which is essentially the same as mikeias' fork (2nd to last bullet point above) --but with the caveat that this method would not be the only or preferred way to call functions, instead just an additional tool for when the default exec model doesn't fit your needs.


Originally submitted by Jeff Forcier (bitprophet) on 2009-07-21 at 03:02pm EDT

Relations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions