Website Module

The website module uses Tornado, a fast and scalable python web server.

There are three groups of handlers:

  • Main website
    This is the external website users will see when interacting with IceProd. It has been broken down into several sub-handlers for easier maintenance.
  • JSONRPC
    This is the machine-readable portion of the website. Jobs talk to the server through this mechanism. The main website also uses this for various actions.
  • lib downloads
    This is a directory of downloads local to the IceProd instance. Usually this will be the necessary software to run the iceprod core.
class iceprod.server.modules.website.website(*args, **kwargs)[source]

The main website module.

Run the website, which is required for anything to work.

stop()[source]

Stop website

kill()[source]

Kill website

logrotate()[source]

Rotate the Nginx logs.

start()[source]

Run the website

iceprod.server.modules.website.catch_error(method)[source]

Decorator to catch and handle errors on handlers

iceprod.server.modules.website.authenticated_secure(method)[source]

Decorate methods with this to require that the user be logged in to a secure area.

If the user is not logged in, they will be redirected to the configured login url <RequestHandler.get_login_url>.

If you configure a login url with a query parameter, Tornado will assume you know what you’re doing and use it as-is. If not, it will add a next parameter so the login page knows where to send you once you’re logged in.

class iceprod.server.modules.website.MyHandler(application, request, **kwargs)[source]

Default Handler

initialize(cfg, modules, fileio, debug=False, statsd=None)[source]

Get some params from the website module

Parameters:
  • cfg – the global config
  • modules – modules handle
  • fileio – AsyncFileIO object
  • debug – debug flag (optional)
db_call(*args, **kwargs)[source]

Make a database call, returning the result

get()[source]

GET is invalid and returns an error

post()[source]

POST is invalid and returns an error

set_default_headers()[source]
class iceprod.server.modules.website.JSONRPCHandler(application, request, **kwargs)[source]

JSONRPC 2.0 Handler.

Call DB methods using RPC over json.

post(*args, **kwargs)[source]

Parses json in the jsonrpc format, returning results in jsonrpc format as well.

json_error(error, status=400, request_id=None)[source]

Create a proper jsonrpc error message

class iceprod.server.modules.website.LibHandler(application, request, **kwargs)[source]

Handler for iceprod library downloads.

These are straight http downloads like normal.

initialize(prefix, directory, **kwargs)[source]

Get some params from the website module

Parameters:
  • fileio – AsyncFileIO object
  • prefix – library url prefix
  • directory – library directory on disk
get(*args, **kwargs)[source]

Look up a library

class iceprod.server.modules.website.PublicHandler(application, request, **kwargs)[source]

Handler for public facing website

get_template_namespace()[source]
get_current_user()[source]
write_error(status_code=500, **kwargs)[source]

Write out custom error page.

class iceprod.server.modules.website.Default(application, request, **kwargs)[source]

Handle / urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Submit(application, request, **kwargs)[source]

Handle /submit urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Config(application, request, **kwargs)[source]

Handle /submit urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Site(application, request, **kwargs)[source]

Handle /site urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Dataset(application, request, **kwargs)[source]

Handle /dataset urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Task(application, request, **kwargs)[source]

Handle /task urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Job(application, request, **kwargs)[source]

Handle /job urls

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Documentation(application, request, **kwargs)[source]
get(*args, **kwargs)[source]
class iceprod.server.modules.website.Log(application, request, **kwargs)[source]
get(*args, **kwargs)[source]
class iceprod.server.modules.website.GroupsHandler(application, request, **kwargs)[source]

View/modify groups

get(*args, **kwargs)[source]
class iceprod.server.modules.website.UserAccount(application, request, **kwargs)[source]

View/modify a user account

get(*args, **kwargs)[source]
post(*args, **kwargs)[source]
class iceprod.server.modules.website.Help(application, request, **kwargs)[source]

Help Page

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Other(application, request, **kwargs)[source]

Handle any other urls - this is basically all 404

get(*args, **kwargs)[source]
class iceprod.server.modules.website.Login(application, request, **kwargs)[source]

Handle the login url

get(*args, **kwargs)[source]
post(*args, **kwargs)[source]
class iceprod.server.modules.website.Logout(application, request, **kwargs)[source]
get(*args, **kwargs)[source]