Sumatra Server

Django app that implements the server-side part of a Sumatra HttpRecordStore
Download

Sumatra Server Ranking & Summary

Advertisement

  • Rating:
  • License:
  • CeCILL
  • Publisher Name:
  • Andrew Davison
  • Publisher web site:
  • http://bitbucket.org/apdavison/

Sumatra Server Tags


Sumatra Server Description

Django app that implements the server-side part of a Sumatra HttpRecordStore Sumatra Server is a Django app that implements an HTTP-based store for records of computational experiments (e.g. scripted analyses, simulations), with the goal of supporting reproducible research.In particular, it implements the server-side counterpart to the HttpRecordStore client in Sumatra.It is based on the Piston framework.Getting startedThe following assumes that you already have a Django project to which you wish to add a record store for computational experiments. If you don't, you can download an example project here.You will need to have installed Sumatra Server, Sumatra, Piston and django-tagging. Add the following lines to the INSTALLED_APPS tuple in your settings.py:'sumatra_server','sumatra.web','sumatra.recordstore.django_store','tagging',Your INSTALLED_APPS should also contain 'django.contrib.auth' and 'django.contrib.contenttypes'.Now decide where in your URL structure the record store will live and edit your urls.py accordingly, e.g.: urlpatterns = patterns('', # other url mappings (r'^records/', include('sumatra_server.urls')),)Now update your database by running syncdb: python manage.py syncdb Creating tables ... Creating table sumatra_server_projectpermission Creating table django_store_project Creating table django_store_executable Creating table django_store_dependency Creating table django_store_repository Creating table django_store_parameterset Creating table django_store_launchmode Creating table django_store_datastore Creating table django_store_platforminformation Creating table django_store_record_platforms Creating table django_store_record_dependencies Creating table django_store_record Creating table tagging_tag Creating table tagging_taggeditemIf you would like to load some test data to try it out, run:python manage.py loaddata haggling permissionsThis will populate the record store with some simulation records, owned by a user "testuser" with password "abc123".APISumatra server implements a RESTful API, which returns either HTML or JSON, depending on the Accept header in the HTTP request. Normally, if you access the page through a web browser you should get the HTML version, while Sumatra or compatible tools will receive the JSON version. You can also override the Accept header by explicitly adding ?format=html or ?format=json to the end of the URL.JSON formatHere is an example of a simulation record encoded using JSON. This is the format that must be used to PUT a new record into the store: { "user": "testuser", "project_id": "TestProject", "label": "20100709-154255", "reason": "Simulation to test the HttpRecordStore with Sumatra Server", "outcome": "Eureka! Nobel prize here we come.", "executable": { "path": "/usr/local/bin/python", "version": "2.5.2", "name": "Python", "options": "" }, "repository": { "url": "/Users/andrew/tmp/SumatraTest", "type": "MercurialRepository" }, "version": "396c2020ca50", "diff": "", "main_file": "main.py", "parameters": { "content": "seed = 65785 # seed for random number generator\ndistr = \"uniform\" # statistical distribution to draw values from \nn = 100 # number of values to draw", "type": "SimpleParameterSet" }, "launch_mode": { "type": "SerialLaunchMode", "parameters": "{}" }, "timestamp": "2010-07-09 15:42:55", "duration": 0.58756184577941895, "datastore": { "type": "FileSystemDataStore", "parameters": "{'root': '/Users/andrew/tmp/SumatraTest/Data'}" }, "data_key": "", "dependencies": , "platforms": , "tags": "" }Most of these fields are write-once, i.e. if you PUT another record to the same URL, only changes in "reason", "outcome" and "tags" will be taken into account.AuthenticationSumatra Server uses HTTP Basic authentication, and validates against the user database of your Django project. Requirements: · Python · Django


Sumatra Server Related Software