How washu-it-ris/coldfront-wustl-fork works
Project type and purpose
• ColdFront is a full-stack, open-source resource and allocation management system built on Django (Python).
• It provides a self-service web portal for HPC centers to manage users, projects, grants, allocations, publications, and integrate with third-party systems via plugins (e.g., Qumulo, FreeIPA, LDAP, SLURM, XDMoD).
High-level file-structure analysis
• Top-level directories:
• coldfront/ – Django project (config, core apps, plugin loader)
• coldfront/plugins/ – plugin modules for external integrations
• coldfront/static/ & coldfront/templates/ – shared static assets and global templates
• docs/ – MkDocs documentation
• Core apps follow Django’s MVC (Model→Template→View) pattern: core/allocation, core/project, core/user etc.
• Plugins implement their own Django apps, management commands, REST/HTML views, tasks, and, in the Qumulo case, a small React front-end.
Key components
a. Client-side (Browser/SPA)
• Static assets served (CSS/JS)
• React-based UI (Qumulo plugin)
• Traditional Django templates for core pages
b. Web-server / Application layer
• Nginx (or similar) as reverse-proxy/static-file server
• Gunicorn (WSGI) hosting the Django project (manage.py, config/wsgi.py)
• Django apps (“core” + loaded “plugins”)
c. Persistence layer
• Relational database (PostgreSQL/MySQL) for all Django models
• Django migrations to evolve schema
d. Asynchronous/task layer
• Celery (or Django-Q/Beat) for scheduled tasks defined in core/*/tasks.py and plugins/*/tasks.py
• Broker (RabbitMQ/Redis) for queuing
e. Email / Notification service
• SMTP server for sending system-generated emails (core/utils/mail.py, templates/email/*.txt)
f. External services (via plugins)
• Qumulo REST API client
• Active Directory / FreeIPA (LDAP)
• SLURM scheduler
• XDMoD monitoring
• Custom plugin endpoints
Relationships & interactions
• Browser → Nginx → Gunicorn → Django URL dispatcher (config/urls.py)
• Views → Models → Database (ORM)
• Views trigger signals/tasks for asynchronous workflows (e.g., email reminders, allocation ACL resets)
• Celery Beat triggers periodic tasks → Plugin services → External systems
• Management commands (CLI) for one-off scripts and scheduled CRON jobs (via Django-crontab or Celery Beat)
• Plugins are discovered via Django’s INSTALLED_APPS and hooked into the core through URLs, templates, static files, and signals
Architectural patterns & principles
• MVC/MVT: clear separation of Models, Templates, and Views
• Plugin architecture: core system defines extension points; each plugin is an independent Django app that registers URLs, templates, static resources, and tasks
• Command pattern: management commands for administrative workflows
• Signal-based decoupling: apps and plugins communicate via Django signals
• Asynchronous/off-loaded workload: long-running or periodic jobs handled by Celery
b. Inside App Server, subdivide into “Core Django Apps” and “Plugin Apps”
• HTTP(s) requests (Browser → Nginx → Gunicorn → Django URLs)
• ORM calls (Django → Database)
• Task enqueues (Django Views/Signals → Broker → Celery workers)
• Email dispatch (Django/Celery → SMTP)
• External API calls (Plugin Services → Qumulo/LDAP/SLURM/etc.)
d. Component with key technologies (e.g., React, Django, PostgreSQL, Celery, RabbitMQ)