The New Docker Based IronWorker Development Workflow

docker Iron

Overview

Creating a simple IronWorker worker can be quick and easy. But if you’ve used IronWorker to build a complex worker, you may have found the experience a bit cumbersome.

The reason is that sometimes you just don’t know if your worker will run the same way it does when you run it locally, due to the local environment or perhaps missing dependencies.

The typical development process for building an IronWorker looked something like this:

  1. Write/debug your worker.
  2. Upload your worker – this can take some time large with a lot of dependencies - even more so if you are doing remote builds (remote builds are sometimes required to ensure your code or dependencies with native extensions are built on the right architecture).
  3. Queue a task to run your worker.
  4. Wait for it to run (may take a few seconds).
  5. View the log on the Iron.io console, aka HUD (another few seconds to pull it up).
  6. Repeat... over and over until it works right.

If you have to do a lot of debugging, this can waste a lot of time and cause some serious pain.

 

Table of Contents

Related Reading: What is a docker container?

Achieve Cloud Elasticity with Iron

Speak to us to find how you can achieve cloud elasticity with a serverless messaging queue and background task solution with free handheld support.

Introducing a New Workflow

This upload process has changed because now you can test your worker locally in the exact same environment as when running on the IronWorker platform using Iron.io’s public Docker images. Plus, you can upload workers and interact with the system with a new CLI tool written in Go.

The new workflow is only slightly different:

  1. Ensure all dependencies for your worker are in the current directory or in sub-directories.
  2. Create an input/payload example file (check this into source control as an example).
  3. Build/run/test your worker inside an Iron.io image container.
  4. Debug/test until you get it working properly.
  5. Once it works as expected, upload it to IronWorker.

That's it. You should only need to do this process once unless you want to make changes. The reason being is that if your worker works inside our Docker images, it will work the same way when it’s running on the IronWorker platform.

Iron.io Serverless Tools

Speak to us to learn how IronWorker and IronMQ are essential products for your application to become cloud elastic.

dockerhero

The process may similar on paper, but it’s a big change in practice. There are a number of benefits you get from this new workflow:

  • No Ruby dependency to use the command line tools. The new cli tool is written in Go.
  • No remote builds necessary. You can build it locally no matter what operating system you are using.
  • No packaging “magic.” The iron_worker_ng cli tool did a lot of work to create IronWorker code packages that worked across languages and operating systems.
  • No.worker files to define your dependencies.
  • Faster development.

Try It Using Some New Examples

We’ve created a repository with examples in a bunch of different languages so you can try it out: https://github.com/iron-io/dockerworker

Note: you can still do things as you've always been doing, but we believe this provides a better, more consistent, and quicker development process.

Give it a try and let us know what you think!

Iron

Unlock the Cloud with Iron.io

Find out how IronWorker and IronMQ can help your application obtain the cloud with fanatical customer support, reliable performance, and competitive pricing.

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.