52 Commits

Author SHA1 Message Date
Joshua Harlow
1267a2a04d Bring over pretty_tox.sh from nova/heat/others
Change-Id: Ie0373a30b6416eda26b9666c572f8c47089f7219
2015-02-21 20:37:13 -08:00
Joshua Harlow
6a6b50fb6c Bump up the env_builder.sh to 2.7.9
The latest python 2.x release is 2.7.9 and not
2.7.7 so when people are using this script to build
a useful environment (that is lacking py2.7) use this
newer version instead.

Change-Id: I2fdd035e0b4efcacd6ef2da04d6cd8a56dcca512
2015-02-03 16:50:55 -08:00
Joshua Harlow
55ad11f278 Add a WBE request state diagram + explanation
To make it more clear what the WBE request states are
and what they imply/mean add the appropriate documentation
and diagram that explains it and its states/concepts.

Change-Id: If25b5c6402aff6e294886cc6c5f248413183c4e4
2015-01-22 23:25:35 -08:00
Joshua Harlow
1ed0f22fd3 Use constants for runner state machine event names
Instead of using strings it is better if we can use constants (that
may be the same/adjusted strings) and use those instead in the state
machine used in the runner.

The names are adjusted (and the state graph diagram and docstring)
to reflect names that fit better with there intended meaning and
usage.

Change-Id: Iaf229d6e37730545ba9f2708d118697cb7145992
2015-01-15 20:56:23 -08:00
Joshua Harlow
1d84fdd094 Add edge labels for engine states
The engine state diagram benefits slightly from having
the event labels that cause transitions to other states
so we might as well include it in the generated diagram.

Change-Id: I733eba1d2dc6386c7b7ce8930fbfd41e29cdb602
2014-12-21 16:24:14 -08:00
Joshua Harlow
6a6aa795fe Some package additions and adjustments to the env_builder.sh
This just adjusts to install wget and certain other packages
before further work commences to ensure they are ready and
avaiable for further use.

Tested on rhel6.x as a cloud-init userdata script and it appears
to continue to work as expected.

Change-Id: Ia85715e27bc8342fd61d23e2c8a659dbce20aea9
2014-12-03 16:15:05 -08:00
Jenkins
87abb27f17 Merge "Add a sample script that can be used to build a test environment" 2014-12-03 21:01:01 +00:00
Joshua Harlow
c90e36020a Add the database schema to the sqlalchemy docs
In order to show people that are reading the docs what the current
schema for the database is create a helper tool that upgrades the
schema to the newest version and then uses tabulate to create a
restructured text version of that schema which is then included in
the documentation.

Change-Id: Id215f88430971a4a083f9739fb2ec59d971dc8fa
2014-10-10 06:24:39 +00:00
Joshua Harlow
96014cbba3 Color some of the states depending on there meaning
Instead of just having black text color adjust some of the
states text color depending on there type/name and highlight
some as red, green, orange depending on there underlying
meaning.

Color names are from:

http://www.graphviz.org/doc/info/colors.html

Change-Id: I89f8f90837551a257936d254516ada6130e7b6da
2014-09-20 20:39:13 -07:00
Joshua Harlow
155326b6e7 Update the state graph builder to use state machine type
To build the state diagrams switch from using a custom
algorithm that builds a state machine in a table to using
our state machine class to build those same machines before
translation into a dot diagram.

This also allows us to use the state machine that already
is being used in the action engine as the source of transitions
to build the dot diagram with.

Change-Id: I4a0d16a3fb7c620c2774b535ab952b5d5006e9e9
2014-09-09 12:09:09 -07:00
Joshua Harlow
8dc6e4f0fd Add a sample script that can be used to build a test environment
It can be difficult to figure out what to install to get a test
environment that can be used to test all the opportunistic tests,
zookeeper and mysql (with the right user and password and test
database).

This script provides a way to do this on rhel/ubuntu based
environments and can be used to examine how to do this for other
environment types.

I use it with nova boot (on rhel images) and it has worked out
great as a way to rebuild a clean test environment as I need.

Change-Id: I9aef7e5536aa38e951a6411a8e83097339a43955
2014-07-21 12:09:06 -07:00
Jenkins
1a7de75b1e Merge "Use the state_graph.py for all states diagrams" 2014-07-11 22:35:33 +00:00
Joshua Harlow
e54cb21d55 Use the state_graph.py for all states diagrams
Switch to using the `state_graph.py` and dot output
as the source of all of the state diagrams (this
makes it easy for anyone to recreate them by just
running the script in the tools directory).

Also update the state diagram creator to have engine
states as well as retry states and replaces all
existing state diagrams with the updated prettified
versions.

Also adjusts some nits around wording and grammar that
were encountered during this updating process.

Change-Id: Ia783aed6c4136763e1e34cbd0b3e57ffb1109abe
2014-07-06 12:21:34 -07:00
Joshua Harlow
510635a913 Remove check_doc.py and use doc8
Instead of using a helper script that is internal to taskflow
use the doc8 package (which was created based on the check_doc.py
work) instead. This avoids repeating duplicated code when a
stackforge/external pypi package can provide the same
functionality.

Change-Id: Ie5a43f96b20e34f3955657ad2ef8beba05a4300e
2014-06-18 23:59:53 -07:00
Joshua Harlow
cb87c6e2c5 Add a helper tool which clears zookeeper test dirs
Create a tool that can clear any leftover garbage left
by the testing of taskflow unit tests with zookeeper for
when this is needed (for example, a test does not clean up
correctly on its own).

Change-Id: Icfaf28273b76a6ca27683d174f111fba2858f055
2014-05-09 22:14:48 -07:00
Ivan A. Melnikov
f986a82731 Check documentation for simple style requirements
What is checked:
 - lines should not be longer than 79 characters, also
   there are few exceptions;
 - no tabulation for indentation;
 - no trailing whitespace.

Change-Id: Id5b5dff380460d1fb4ffeeb23f00864e7fc158ed
2014-05-08 12:11:18 +04:00
Joshua Harlow
5ca61f956e Add a directed graph type (new types module)
Most of the utility graph functions we have can
be connected to a directed graph class that itself
derives (and adds on to) the networkx base class.

Doing this allows for functionality that isn't exposed
in networkx to be exposed in our subclass (which is a
useful pattern to have).

It also makes it possible (if ever needed) to replace
the networkx usage in taskflow with something else if
this ever becomes a major request.

Change-Id: I0a825d5637236d7b5dbdbda0d426adb0183d5ba3
2014-04-20 17:28:27 -07:00
Doug Hellmann
5fb1a166b6 import run_cross_tests.sh from incubator
Change-Id: I0f35dcd5a3aece55a2924f18093efdaa62968640
2014-04-04 06:43:25 -07:00
Joshua Harlow
28fa164fcd Use the released toxgen tool instead of our copy
Update the docs to explain how to use the toxgen.py
released on pypi and use it to regenerate the tox.ini
file.

Change-Id: I9e0d28f0e40aa0280132a644260d028190b10974
2014-01-12 08:01:50 -08:00
Joshua Harlow
3d437df749 Add envs for different sqlalchemy versions
Adjust tests to skip the sqlalchemy test if
sqlalchemy is not installed. Adjust examples
to fallback to a directory based backend if
the sqlalchemy does not load or is not available.

Include a updated tox.ini (generated from the
toxgen.py script) that includes the new venv
variations.

Change-Id: I7686f09901a9b65d7c81b4e037b5bffc24aa7ef7
2014-01-09 11:09:08 -08:00
Joshua Harlow
d58427d317 Switch to just using tox
Instead of requiring all the complicated
venv management logic that tox already provides
just use tox directly instead. This maps more
closely to what jenkins does, and how most other
python development occurs (which does not typically
rely on custom venv scripts).

Change-Id: Iff6cf0a7eb24ddd2ef65ddd723d0e4cb803b9bb9
2014-01-02 10:38:15 -08:00
Joshua Harlow
533e3046e0 Update oslo-incubator copy to oslo-incubator commit 8b2b0b743
- Remove versionutils as it is not used and it has
  started to pull in oslo.cfg via its direct usage
  of the oslo-incubator log module

Change-Id: I364f00d9734b67fe5c7566ccd7a76e6eb18751c2
2013-12-21 11:28:31 -08:00
Ivan A. Melnikov
176d0a920e Support several output formats in state_graph tool
This commit adds -T aka --format option to state graph tool that
can be used to specify output format. Supported values are 'dot',
'svg', 'svgz' and 'png'.

Change-Id: I27a74b582726da24a1b05d4ffb72bde860fff417
2013-10-17 05:26:32 +00:00
Joshua Harlow
ee1d583721 Add task state verification
Change-Id: I85abee2a1112ce1b9bb708cb9129f06c794f83b1
2013-10-14 12:22:23 -07:00
Joshua Harlow
50d438384a Update oslo copy and bring over versionutils
Change-Id: I93ab20ae26033574e1f25ecc8276ffe291994ce6
2013-10-09 19:19:47 -07:00
Joshua Harlow
01fcad6616 Add state to dot->svg tool
Add a helper tool that can convert the
allowed state transitions into a dot graph
which itself then converts it into a browser
compatible svg file, which can then be looked
at to have a pretty state diagram.

Change-Id: I3cbbc75bd58182700ddc07f00395da5d1093a26c
2013-10-07 16:09:45 -07:00
Monty Taylor
9b7d463f68 Remove d2to dependency
Change-Id: I433711ba417dbb15f616fa488cec389f3138b00a
2013-09-30 10:39:23 -04:00
Ivan A. Melnikov
dd049eea69 Remove unused utility classes
Removing ThreadGroupExecutor allows to get rid of threading2
dependency. LastFedIter is also not used, so there is no
reason to keep it.

Change-Id: Id396ab59ebf1e2314ef620417d7cac09e1ab8d3b
2013-09-24 17:09:24 +04:00
Jenkins
645fc49c88 Merge "Add check that task provides all results it should" 2013-09-17 08:09:46 +00:00
Joshua Harlow
86c60dfa60 Use executors instead of pools
A executor is a more generic concept than a pool and
also seems to work better with eventlet. This is also
a more supported model of performing concurrent operations
than using the mostly unknown multiprocessing thread
pool implementation.

Fixes: bug 1225275

Change-Id: I09e9a9000bc88cc57d51342b83b31f97790a62e9
2013-09-13 22:09:03 -07:00
Ivan A. Melnikov
6272c83b36 Add check that task provides all results it should
Value returned from execute method of task should contain all
results that are mappend with task.rebind. To verify that we
check that the value can be indexed with all necessary indexes.
If that fails, we put warning to log.

Change-Id: I21aac7b36885668155c2d7bd2eedcf4eeba22b11
2013-09-13 13:51:18 +04:00
Joshua Harlow
d523d3651d Remove usage of oslo.db and oslo.config
Remove further reference to oslo-incubator database
layer which itself uses oslo.config and remove its
dependencies and resync with oslo-incubator after
applying these changes.

Implements blueprint eliminate-oslo-cfg

Change-Id: Ie1ee7affae75c60833c012c921e50d7b14026101
2013-09-12 20:01:06 +04:00
Joshua Harlow
45d350e80d Move toward using a backend+connection model
Instead of having a pretty restrictive module
based api for saving logbook objects it is much
more friendly and extensible to move toward a more
ceilometer-influenced engine and connection based
storage backend using stevedore to do the backend
loading instead of a custom registration/fetching
mechanism. This allows us to provide a base object
oriented backend api that can be easily inherited
from to allow for customized & pluggable backend
storage modules.

Implements blueprint stevedore-based-backends
Implements blueprint ceilometer-influenced-backends

Change-Id: Ib5868d3d9018b7aa1a3354858dcb90ca1a04055d
2013-09-12 20:01:06 +04:00
Joshua Harlow
fceabee18f 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
2013-08-26 12:45:21 -07:00
Joshua Harlow
dc56ff482a 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
2013-08-24 22:46:43 -07:00
Joshua Harlow
0ad4ed1c89 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
2013-08-18 09:17:51 -07:00
Joshua Harlow
acd545f9c2 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
2013-08-17 20:34:19 -07:00
Joshua Harlow
7f0f7a69ef Resync the latest oslo code.
Change-Id: Ia9a6ce983e01542f4f0f7601f9b2ae2aedd1ae34
2013-08-08 14:09:16 -07:00
Joshua Harlow
16c7b8aa19 Move to using pbr.
The new way to build packages and perform setuptools
interactions seems to be via the pbr library so to
play well with others, use said library.

Change-Id: I519503fdf59457dc554870b8e6ff61613ab30d11
2013-07-07 21:46:32 -07:00
Joshua Harlow
2d5f90fa24 Cleaning up various components.
1. In order to aid future features its useful to split
split apart the linear_flow and have a good base
class that is not connected to a ordered or linear flow.
2. Have the graph flow inherit from the linear flow since
it is performing a linear run using a topological ordering
of the tasks.

Change-Id: I287cd4a666caf09ca3a4cdf1d53814e9c6feb765
2013-06-28 16:06:10 -07:00
Angus Salkeld
6b17ba8ab7 Fix all flake8 E* and F* errors
This was mostly unused modules or local variables.

Change-Id: I39f9598ba8b64101a10f80bae448d27272abeddd
2013-06-26 11:04:30 +10:00
Angus Salkeld
339e43d03b Fix the current flake8 errors
The test pip ordering was resulting in the pep8 rules not really
running so this fixes that up and the resulting errors so we can
get a clean run.

Change-Id: Icc27be05cd513c4f04135c7e768007dbf9d07b10
2013-06-26 11:03:23 +10:00
Joshua Harlow
6ddf738bbb Dinky change to trigger jenkins so I can cleanup.
Change-Id: I5ff975bb5ded48a84341efa4ebfdae4bf430ab60
2013-06-19 13:20:31 -07:00
Joshua Harlow
711c19c84b Fix tests for python 2.6
Since python 2.6 is supported in openstack we need to
alter the format messages and the usage of functions
that exist in the 2.7 unittest by including unittest2
and using that instead.

Change-Id: I31c78d1f771603a6ad15ada50507cada0c5e331b
2013-06-05 12:18:56 -07:00
Joshua Harlow
41f1940e49 Resync with oslo-incubator. 2013-05-22 18:36:35 -07:00
Joshua Harlow
5218b676fc Include more dev testing packages + matching versions. 2013-05-22 18:17:13 -07:00
Joshua Harlow
61158ebdc3 Update dependencies for new db/distributed backends 2013-05-22 18:12:37 -07:00
Joshua Harlow
d8a62ee24e Start adding in a more generic DAG based workflow. 2013-05-14 17:49:51 -07:00
Joshua Harlow
7999de8de7 Begin adding testing functionality
Take the current run_tests.sh from glance and include
that as well as fill in the rest of the pieces needed
for those that use venv functionality. Start adding
memory tests.
2013-05-13 22:26:54 -07:00
Joshua Harlow
c0cf3f8d47 Rework how we should be using lists instead of ordereddicts for optimal usage. 2013-05-13 18:49:30 -07:00