JobbieOci
A very simple job queuing system that uses OCI Casper buckets as a backend.
Jobbie is intended to fill a gap in Oracle's OCI cloud whilst there is a lack
of a queueing service similar to Amazon's SNS/SQS. As soon as such a service
is introduced, it's unlikely that Jobbie will serve any further purpose.
Jobs are added to an 'execution group', which is used to group related
tasks together for consumption by a daemon. Multiple daemons can run in the
same execution group, but only one daemon will be able to claim the job. If
a daemon is unable to complete the job then it will eventually time out and
become claimable again.
Installation
gem install jobbie_oci
Usage
Ensure that you have a bucket in Casper and that you have permission to create
objects in it.
Jobbie can be run in one of two modes: Either client mode which can submit jobs
or list them, or daemon mode which takes jobs from the queue and executes them.
To run jobs in daemon mode, you will use:
jobbie daemon --exec-group=EXEC_GROUP --script-dir=SCRIPT_DIR
An execution group
is used to to group related tasks together. Jobs
submitted in the same execution group will be executed in the same way. For
example, you might create a job in the "cleanup_users" exec group, and a
jobbie daemon with a matching exec-group will be used to execute a script
to cleanup the user.
The script dir is the only directory in which scripts triggered by the
daemon are allowed to run. No fully qualified paths are allowed in the script
name.
Example
Suppose we have a script directory called scripts
and that we add to it a
script called cleanup_users
.
We could add a job to the queue as follows:
jobbie add --bucket my-bucket --exec-group=USERMGMT --script=cleanup_users user123
Meanwhile we could write start a daemon as follows:
jobbie daemon --bucket my-bucket --exec-group=USERMGMT --script-dir=scripts
.. and the daemon would pick up the job and execute the script as if
someone were to manually run:
./scripts/cleanup_users user123
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jobbie_oci.