Skip to main content

A pluggable Django app for managing research computing center project accounting.

Project description

OpenAcct is a pluggable Django app for managing research computing center project accounting.

It is intended to provide a flexible, scheduler-agnostic alternative to other Allocation and Account Management Database tools like Gold, Moab Account Manager, and the SlurmDBD. OpenAcct allows for definition of multiple Services per System, each with their own units of resource consumption and charge rates. Charging is managed through Transactions, which bind an amount of a Service’s resources consumed with an Account responsible for any charges incurred by that consumption. Transaction objects can be individually tracked, selectively charged, and refunded when needed to maintain an event-based history of account activity.

Installation

django-openacct can be installed from PyPI, and requires no external dependencies aside from Django.

?> pip install django-openacct

Quick Start

The following shows a small setup script being piped into the Django shell interpreter:

?> cat openacct_example.py

from openacct.models    import *
from openacct.shortcuts import *

# Create a System and Service for a cluster
cluster = System.objects.create(name='cluster', description='A Cluster')
service = Service.objects.create(
    name='cluster-core-hours', units='core-hours', system=cluster,
    charge_rate=0.05, description='CPU core usage * wallclock hours'
)

# Create Users
bob = User.objects.create(name='bob')
sue = User.objects.create(name='sue')
tux = User.objects.create(name='tux')

# Create Projects and grant access to the cluster's service
phys = create_project('phys', pi=bob, description='Physics Dept')
chem = create_project('chem', pi=sue, description='Chemsitry Dept')
grant_service_access(service, project=phys)
grant_service_access(service, project=chem)

# Add a user to the projects
add_user_to_project(tux, chem)
add_user_to_project('tux', 'phys')


?> ./manage.py shell < openacct_example.py

This example shows a basic setup for a center, with a single compute resource which is charged on a per core-hour basis. Several users and two projects, one for a Physics Department, and another for a Chemistry Department, are created.

Access to use a service is managed through Accounts, which are being implicitly created for each project. When passing the project parameter to grant_service_access, all active accounts are granted the same access. Accounts can be created explicitly and granted access individually when desired.

Finally, the user tux is added to both of the created projects, demonstrating how the shortcut functions will accept both the name of an object or the object itself for all parameters referencing one of the models in the schema.

With this setup in place, job records could be added to the database as Job objects, with Transactions making use of the cluster-core-hour service linked to them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-openacct-0.0.4.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

django_openacct-0.0.4-py2.py3-none-any.whl (14.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-openacct-0.0.4.tar.gz.

File metadata

  • Download URL: django-openacct-0.0.4.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.5

File hashes

Hashes for django-openacct-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6adde19ee2da02e4b539764fcb1240d3bf740f62acb1f9dc124e136f454d0246
MD5 3e175a75a5cb3d6b551ebf3b51833012
BLAKE2b-256 681819ff1528b2d1caadc084acea7c495f7a1e1f5e733c71e3f57d317400d88f

See more details on using hashes here.

File details

Details for the file django_openacct-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: django_openacct-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/2.7.5

File hashes

Hashes for django_openacct-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8ada79813b548510d47317caf1d5e07353cf1754ff0abc08ffd35ac39f45c066
MD5 843d6bf65a6641f7ee4bdd90b7cdfbb3
BLAKE2b-256 d61032dab8f0d1e45a885add5d7c8ae7e7c78707a99e5354951f6c246ab58908

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page