AWS News Blog
Use AWS OpsWorks & Ruby to Build and Scale Simple Workflow Applications
From time to time, one of my blog posts will describe a way to make use of two AWS products or services together. Today I am going to go one better and show you how to bring the following trio of items in to play simultaneously:
- Amazon Simple Workflow (SWF) can help you to build, run, and scale background jobs that have parallel or sequential steps. SWF is a fully-managed state tracker and task coordinator that runs in the AWS cloud. You can read my blog post, Amazon Simple Workflow – Cloud-Based Workflow Management to learn more about SWF.
- AWS OpsWorks helps you deploy and operate applications of all shapes and sizes. You can define your application’s architecture using any desired combination of predefined OpsWorks templates and custom templates that you build yourself. OpsWorks also assists with scaling (based on time or system load) and dynamic configuration as part of scaling operations. To learn more, read AWS OpsWorks – Flexible Application Management in the Cloud Using Chef.
- The AWS Flow Framework for Ruby (also known as Ruby Flow) simplifies and streamlines the process of building applications for Simple Workflow. Ruby Flow removes the need for glue code and state machines and allows you to focus on your business logic. I first talked about this Ruby Gem in AWS Flow Framework for Ruby for the Simple Workflow Service.
All Together Now
With today’s launch, it is now even easier for you to build, host, and scale SWF applications in Ruby. A new, dedicated layer in OpsWorks simplifies the deployment of workflows and activities written in the AWS Flow Framework for Ruby. By combining AWS OpsWorks and SWF, you can easily set up a worker fleet that runs in the cloud, scales automatically, and makes use of advanced Amazon Elastic Compute Cloud (Amazon EC2) features.
This new layer is accessible from the AWS Management Console. As part of this launch, we are also releasing a new command-line utility called the runner. You can use this utility to test your workflow locally before pushing it to the cloud. The runner uses information provided in a new, JSON-based configuration file to register workflow and activity types, and start the workers.
Console Support
A Ruby Flow layer can be added to any OpsWorks stack that is running version 11.10 (or newer) of Chef. Simple add a new layer by choosing AWS Flow (Ruby) from the menu:
You can customize the layer if necessary (the defaults will work fine for most applications):
The layer will be created immediately and will include four Chef recipes that are specific to Ruby Flow (the recipes are available on GitHub):
The Runner
As part of today’s release we are including a new command-line utility, aws-flow-ruby
, also known as the runner. This utility is used by AWS OpsWorks to run your workflow code. You can also use it to test your SWF applications locally before you push them to the cloud.
The runner is configured using a JSON file that looks like this:
{
"domains": [{
"name": "BookingSample",
}],
"workflow_workers": [{
"task_list": "workflow_tasklist"
}],
"activity_workers": [{
"task_list": "activity_tasklist"
}]
}
Go With the Flow
The new Ruby Flow layer type is available now and you can start using it today. To learn more about it, take a look at the new OpsWorks section of the AWS Flow Framework for Ruby User Guide.
— Jeff;