This code is intended for use as a worker that runs jobs queued using python-rq. In particular, those jobs are expected to be queued using, e.g.
import rq
q = rq.Queue(connection=StrictRedis(host='redis'))
q.enqueue('webhook.job', payload)
where payload
is a dictionary representing a JSON webhook generated by a
private Docker registry
(e.g. the GitLab Container Registry)
or the special webhooks generated by DockerHub.
The Webhook Queue queues webhooks
for use by this worker and exposes the redis queue to the localhost
.
The CVMFS publishing code derives largely from code developed by Brian Bockelman and Derek Weitzel of the University of Nebraska and the Open Science Grid (OSG). Their code was modified to support Python 3, arbitrary CVMFS filesystems and to simplify intermediate steps in the unpacking of the Docker image. Their work was released under the Apache License 2.0 as is this work.
Although it has now diverged greatly, the file cvmfs/publisher.py
was
originally forked from work performed by Vanessa Sochat for the Singularity
project. This is noted within the file and that file remains under the 3-Clause
BSD License.
Install this code to a directory of your choice and run rq worker
. You may
need to set environment variables as below.
LC_ALL=C.UTF-8 LANG=C.UTF-8 rq worker
This code is deliberately aimed at Python 3. I have made no attempt to make it
Python 2.x compatible though I'd imagine it might require only importing the
future print
function. I'd gladly accept pull requests to support Python 2.x.