|
| 1 | +# HyperFlow: a distributed workflow execution engine |
| 2 | + |
| 3 | +HyperFlow provides a model of computation and an execution engine for complex, distributed [workflow](http://en.wikipedia.org/wiki/Workflow) applications which consist of a set of **processes** performing well-defined **functions** and exchanging **signals**. Browse the [wiki pages](https://github.com/dice-cyfronet/hyperflow/wiki) to learn more about the HyperFlow workflow model. |
| 4 | + |
| 5 | + |
| 6 | +## Getting started |
| 7 | + |
| 8 | +### Installing Hyperflow |
| 9 | + |
| 10 | +Hyperflow requires [node.js](http://nodejs.org) runtime. Stable version may be installed using npm package manager: |
| 11 | + |
| 12 | +```shell |
| 13 | +$ npm install -g hyperflow |
| 14 | +``` |
| 15 | + |
| 16 | +You can install bleeding-edge from GitHub: |
| 17 | + |
| 18 | +```shell |
| 19 | +$ npm install -g https://github.com/dice-cyfronet/hyperflow/archive/develop.tar.gz |
| 20 | +``` |
| 21 | + |
| 22 | +Hyperflow also requires [Redis](http://redis.io) server. |
| 23 | + |
| 24 | +```shell |
| 25 | +# on Debian/Ubuntu |
| 26 | +$ sudo apt-get install redis-server |
| 27 | + |
| 28 | +# on RedHat or CentOS |
| 29 | +$ sudo yum install redis |
| 30 | +``` |
| 31 | + |
| 32 | +### Installing additional modules |
| 33 | + |
| 34 | +`hyperflow` package provides only core functionality, while additional packages can bundle *functions* and *graphs*. The functions may be later referenced from workflow graph as `$npm_package_name:$function_name`. |
| 35 | + |
| 36 | +We provide: |
| 37 | + |
| 38 | +* `hyperflow-amqp` – allows remote execution of tasks by using AMQP queues, |
| 39 | +* `hyperflow-map-reduce` – functions for constructing Map-Reduce workflows, |
| 40 | +* `hyperflow-pegasus` – support for executing [Pegasus](http://...) DAX workflows, |
| 41 | +* `hyperflow-montage` – support for executing [Montage](http://...) workflow. |
| 42 | + |
| 43 | +See [wiki page](http://...) to see how to create hyperflow function packages. |
| 44 | + |
| 45 | +### Running *hello world* workflow |
| 46 | + |
| 47 | +```shell |
| 48 | +$ git clone http://github.com/dice-cyfronet/hyperflow-hello-world.git |
| 49 | +$ cd hyperflow-hello-world |
| 50 | +$ hflow start |
| 51 | +Hyperflow starting! |
| 52 | +Listening on *:1234, webui: http://1.2.3.4:1234/ |
| 53 | +hello-world workflow loaded, sending initial signals. |
| 54 | +Workflow id is 9876. |
| 55 | +``` |
| 56 | +### Advanced options |
| 57 | + |
| 58 | +``` |
| 59 | +hflow start [--background] [--functions functions.js] [--graph graph.json|graph.js] [--config config.json] [--set-KEY=VALUE] |
| 60 | +hflow resume [workflow_id] [--functions functions.js] [--graph graph.json|graph.js] [--config config.json] [--set-KEY=VALUE] |
| 61 | +hflow terminate [workflow_id] |
| 62 | +hflow status [workflow_id] |
| 63 | +hflow watch_events [workflow_id] |
| 64 | +``` |
| 65 | + |
| 66 | +### Workflow directory structure |
| 67 | + |
| 68 | +Workflow is a directory that bundles all files required and contains: |
| 69 | + |
| 70 | +* workflow graph: |
| 71 | + * `graph.json` – static workflow graph in JSON, or |
| 72 | + * `graph.js` – graph generation code as node.js module, |
| 73 | +* `config.json` – hyperflow configuration and workflow parameters, |
| 74 | +* `functions.js` – functions specific for given workflow. |
| 75 | + |
| 76 | +## Configuration |
| 77 | + |
| 78 | +Configuration is provided in JSON format, while some options may be also specified as environment variables. Hyperflow reads and merges the config in the following order: |
| 79 | + |
| 80 | +* defaults (see [default_config.json](default_config.json)), |
| 81 | +* `/etc/hyperflow.json`, |
| 82 | +* `~/.hyperflow.json`, |
| 83 | +* `hyperflow.json` placed in the same directory as workflow JSON file, |
| 84 | +* `$HYPERFLOW_CONFIG`, |
| 85 | +* options from environment variables e.g. `$REDIS_URL`, |
| 86 | +* options from command line arguments. |
| 87 | + |
| 88 | +Options are: |
| 89 | + |
| 90 | +* `packages` – list of function packages that are required by workflow (e.g. `montage/functions`), |
| 91 | +* `graph` – filename of graph file (defaults to `./graph.[js|json]`), may use also bundled graphs (e.g. `montage/graph`), |
| 92 | +* `port` or `$PORT` (defaults to 1234), |
| 93 | +* `redis_url` or `$REDIS_URL` (defaults to: `redis://127.0.0.1:6379/0`), |
| 94 | +* `amqp_url` or `$AMQP_URL` (defaults to `amqp://localhost`), |
| 95 | +* `amqp_executor_config` (defaults to `{"storage": "local", "workdir": "/tmp/"}`). |
0 commit comments