This add-on is operated by Iron.io
Scalable workers to process your background jobs using Docker containers.
IronWorker Job Workers As A Service
Last updated July 20, 2022
Table of Contents
IronWorker is a massively scalable task queue/job queue that makes it easy for you offload front end tasks, run background jobs, and process many tasks at once – all in the cloud and with no servers to set up and manage. It can also function as a cron-in-the-cloud service, running tasks on a schedule you define.
IronWorker has partnered with Heroku to make using both services together even easier.
IronWorker Setup on Heroku
1) Install the IronWorker addon for Heroku, Iron’s CLI tool and client library (ruby example)
$ heroku addons:create iron_worker
-----> Adding iron_worker to strong-mountain-405... done, v29 (free)
$ curl -sSL https://cli.iron.io/install | sh
$ gem install iron_worker
2) Configuration: retrieve Token and Project ID
$ heroku config | grep IRON
IRON_WORKER_PROJECT_ID => 123456789
IRON_WORKER_TOKEN => aslkdjflaksuilaks
3) Deploy Your Jobs: Zip and Upload your code to Iron or Register your Docker Image with Iron using CLI tool
To achieve this, please carry out the following steps
a. You’ll need Docker installed and running on your machine to use this. Run:
docker info
This should print information about your Docker installation. If it doesn’t, you don’t have Docker setup properly.
b. You’ll want to install the new Iron cli tool as well (not totally necessary, but makes things a lot easier):
curl -sSL https://cli.iron.io/install | sh
Or if you’d prefer to download it yourself, you can grab the latest release from here: https://github.com/iron-io/ironcli/releases
c. Check that the Iron cli tool was installed properly:
iron --version
d. Clone this repo:
git clone https://github.com/iron-io/dockerworker.git
And cd into the directory:
cd dockerworker
Now you’re ready to try the examples, choose the directory for the language you want to try.
4) Access Client and Start Pushing Your Jobs
client = IronWorker::Client.new(:token => 'IRON_WORKER_TOKEN', :project_id => 'IRON_WORKER_PROJECT_ID')
Troubleshooting
When trying to troubleshoot a worker, the best first step is to try and run the worker locally. If the worker runs locally, it should run on the cloud. You can also access your worker logs through the Iron.io HUD. These logs will show you any errors thrown or debug messages you log while the worker is running.
The most common source of worker errors is a mismatch between your local environment and the cloud’s environment. Double-check your Gemfile
and your Ruby version – workers run under Ruby >1.9. Also, make sure your Gemfile.lock
has been updated. Run bundle install
to make sure.
Issues should get logged with Heroku Support. You’re also welcome to stop by the Iron.io support chat room and chat with Iron’s staff about issues. You can also find more resources and documentation on the Iron.io Dev Center.