Added Backend API Database Implementation

Added a SQLite backed backend API implementation
that interfaces with the database using sqlalchemy.
All of the unit tests associated are included as
well.

Change-Id: I0948fe85d381db4ef1305ed6234ca3e06f3c8760
Merge "Added Backend API Database Implementation"
File movements

In order to rework some of the persistence layer I would
like to move around some of the files first, keeping job
specifics in a jobs folder. Having some of the items which
are root level taskflow items (flow, task) be at the root
of the hiearchy. Also for now until the celery work is
commited move that, since it doesn't make sense in backends
anyway.

Change-Id: If6c149710b40f70d4ec69ee8e523defe8f5e766d
Use oslo's sqlalchemy layer

Bring over the sqlalchemy layer + dependents that
oslo provides so that we can use it in a dependent
commit to replace pieces of our own mini
sqlalchemy layer (that was derived from oslos)

Change-Id: Ifda2fd5c5b8eb1d71a4cfce2a2e0046a23010270
Nicer way to make task out of any callable

This commit introduces taskflow.functor_task.FunctorTask class, which is
adapter that can be used to make a task from any callable. Dependencies,
revert callable, name and version can be specified at the moment of
construction.

Partially implements blueprint refactor-decorators
Change-Id: If92de20a67ea6c228abb0a78edaa837b98581646
Refactor decorators

Make decorator code lean and mean by employing FunctorTask to implement
them. This results in:
- making everything we call 'task' to provide same interface;
- encouraging distinction between task classes and task instances;
- code becoming simpler.

Implements: blueprint refactor-decorators
Change-Id: I43f4ae2db2b7a20f294e2f2d91d53e151a60b139
Do not have the runner modify the uuid

The uuid is used for result tracking and
prefixing it with 'r-' makes it hard to
find that uuid later so leave the uuid
that is selected as is.

Change-Id: I05fed5c197a8d9dc41daedc630ecfa22145bd46c
Rework the persistence layer

1. Simplify the exposed api to reduce race conditions
   which could occur if we allowed flow details, task
   details and log books to be deleted at different
   times; reduce this down to just being able to save and
   delete from logbooks (and only save/update for flow
   and task details to) to reduce the problem cases.
2. Introduce a alembic migration with a proper schema so that
   the initial database can be created in the first place,
   adjust its exposed fields and relations to be defined
   by said schema.
3. Use oslo db models instead of our own.

Change-Id: I78bbedf87d506d3f39157198638937c933235b7b
Change namings in functor_task and add docs to its __init__

Change-Id: If260cfbeeee60e177c832a143f8ddc9f6fc71600
Merge "Do not have the runner modify the uuid"
Add a locally running threaded flow

Propose a new graph flow that will run every task
in the graph at the same time but will use a count
down latch concept to ensure that a tasks dependents
are provided before the task itself can run. This
allows for tasks to run in parallel (if they have
no dependents or are placed in disjoint parts of
graph).

Note: although this flow uses threads it is typically
expected that the underlying threads would be greenthreads
since python native threading is still suboptimal (for
various reasons).

Implements: blueprint locally-run-many-at-once

Change-Id: If434abd77758aa12fc99da395a2559995305a853
Merge "Change namings in functor_task and add docs to its __init__"
Merge "Add a locally running threaded flow"
LazyPluggable is no longer used.

After adjusting the persistence layer
the existing class is not needed since
we allow for more than one impl to be
active.

Change-Id: Ia59bc58902de8f63a08268dd639e10b7d246ecc7
Use the same root test class.

Instead of being strongly tied to unittest2 make
it easier for taskflow to switch to another root
class (testr?) by abstracting out the unittest2
usage. This also enables some useful functionality
to exist in that root test class that other tasks
can take advantage of.

Change-Id: I381b6fb07e47f984b44cde439a17f39a1c1d32ac
Check examples when running tests

Add testcase that executes all examples from taskflow/examples
directory. For examples with somewhat deterministic output the output
is also checked.

This commit also fixes couple of examples broken by recent decorators
refactoring.

Change-Id: I3e65eabde43e1dd26b442d8f7dd3f062bf80703d
Require uuid + move functor_task to task.py

Require details have a uuid of an originating
runner, remove tasks having there own uuid since
only when a task is added to a flow does it obtain
a uuid.

Move functor_task to task.py since it is task releated
and seems better connected in task.py instead of as its
own module.

Change-Id: I8c441e184afcdd697d077f166f2e550fcafcd385
Add get_callable_name utility function

Code that makes name from a callable was moved from functor
task to utils and enhanced to better support more use cases.

Change-Id: I1280a31553c5051079e60b31cd1796f51485f040
Add get_required_callable_args utility function

Move code that gets callable args from functor task to utils.py and
enhance it to support more use cases.

We do not rely on naming conventions for 'self' and 'cls' parameters any
more; we look at the collable if it is bound method instead.

Change-Id: Ie1a9a7cc727b5fbc2780aba28b1d0253e5bc0ea4
Add features to task.Task

Old Task class renamed to BaseTask, and new Task class deriving from it
added in place of it. This new class adds following features:
- if no name is passed to task, name is autogenerated from task type
- all __call__ argument names (except 'context') are added to task
  requirements.

Change-Id: Ied69857932088b6e25d4817d2a8afeddccad36d8