iRODS connector for Django / Celery
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


ga_irods - iRODS connector for Django with Celery

ga_irods is a Django+Celery -> iRODS connector. The idea is that you can use this module to write webapps that call a data grid (iRODS) in a web-scale manner. Every iCommand is a Celery task. All iRODS environments are stored as model instances in a database.

This is all very well and good, but how to you use it? Assuming you know a bit about iRODS, have or know someone who has an account, and are familiar with the icommands clients (these are commands analogous to the unix file system commands, but with an i- prepended), then usage of this app is quite simple. First, add 'ga_irods' to your list of INSTALLED_APPS in Django's Then run:

$ python syncdb

That will add the RodsEnvironment model to the admin tool. Now, assuming you're an admin on your django installation (you should be if you can run at all), then you can add RodsEnvironments for each User in the system. I capitalize User, because the owner of every RodsEnvironment must be an actual User in the django.contrib.auth application. Finally, make sure that celeryd is running and that django-celery is installed and listed in INSTALLED_APPS.

Once environments are setup, you can write a webapp that manipulates iRODS. One might attach a RodsEnvironment to a session object, then use this to accomplish things in an example view like so in your

from ga_irods import tasks as itasks

def my_view(request):
    if not 'rodsenvironment' in request.session:
        # redirect to allow the user to select from his/her environments
        stdout, stderr = itasks.ils.delay(request.GET['path']).get()
        return render_to_response('mytemplate.html', lsresults=stdout)

For more information on icommands see the project documentation.