Skip to content
neyric edited this page Jan 13, 2013 · 8 revisions

Although aws-swf can be installed with npm, it is recommanded to clone the git repository to have access to the activities/ and examples/ directories :

$ git clone git://github.com/neyric/aws-swf.git
$ cd aws-swf
$ [sudo] npm link

If you want to install aws-swf with the node package manager :

$ [sudo] npm install -g aws-swf

The -g option should make the swf-* commands available from your shell.

It is then recommended to call the swf-set-credentials command, which will ask you for your AWS credentials, and store them in a config file. Those credentials will then be used by all others swf-* commands.

$ [sudo] swf-set-credentials

If you don't call set your credentials, you will have to call the commands with the credentials passed as options :

$ swf-register --accessKeyId "... your accessKeyId ..." --secretAccessKey "... your secret key id..." ...

Install activities dependencies

Each activity must provide a package.json file (standard node.js module).

This file usually contains dependencies to other npm packages. You will need to install those dependencies before using the activity.

$ cd activities/soap
$ npm install

Activity configuration

Some activities will require to configure credentials to work properly.

The activity needs configuration if a config.example.js file exist in their directory.

In this case, copy config.example.js to config.js, and edit it with your credentials.

Running activity deamons

Some activities require a background deamon, which is called by an external process to mark the activity as completed.

Here are the activities which currently use a deamon :

  • mturk : poll Amazon Mechanichal Turk for new assignements, and mark the activities as completed
  • WebDriver : runs phantomJS in the background
  • humantask : HTTP server to display the activity in a browser

To start those deamons, use the npm start command :

$ cd activities/mturk/
$ npm start