Warning, /swf-remote/README.md is written in an unsupported language. File is not indexed.
0001 # swf-remote
0002
0003 External PanDA production monitoring frontend for the ePIC experiment
0004 at the Electron Ion Collider. Provides open-internet access to PanDA
0005 monitoring services that live behind BNL's firewall.
0006
0007 **Live at https://epic-devcloud.org/**
0008
0009 ## Architecture
0010
0011 ```
0012 Browser → epic-devcloud.org (Django/Apache)
0013 ↓ proxy (DataTables AJAX, filter counts)
0014 SSH tunnel (autossh, persistent)
0015 ↓
0016 swf-monitor (BNL) → PanDA database
0017 ```
0018
0019 - **Web pages** proxy swf-monitor's DataTables AJAX endpoints through
0020 the SSH tunnel. Same templates, same URL structure.
0021 - **MCP server** (planned) re-exposes PanDA data for LLM access
0022 outside BNL, using thin REST endpoints on swf-monitor.
0023 - **No local PanDA data** — all data comes from swf-monitor in real time.
0024
0025 ## Sister projects
0026
0027 - [swf-monitor](https://github.com/BNLNPPS/swf-monitor) — Django web
0028 service at BNL with PanDA DB access, REST API, MCP server
0029 - [swf-testbed](https://github.com/BNLNPPS/swf-testbed) — Streaming
0030 workflow testbed orchestration and agents
0031 - [swf-common-lib](https://github.com/BNLNPPS/swf-common-lib) — Shared
0032 utilities for SWF agents
0033
0034 ## Pages
0035
0036 | Path | Description |
0037 |------|-------------|
0038 | `/` | PanDA Hub — links to all monitoring views |
0039 | `/panda/activity/` | Activity overview — job/task counts by status, user, site |
0040 | `/panda/jobs/` | Job list with DataTables filtering and search |
0041 | `/panda/jobs/<pandaid>/` | Job detail — full record, files, errors, log URLs |
0042 | `/panda/tasks/` | JEDI task list with DataTables filtering |
0043 | `/panda/tasks/<taskid>/` | Task detail with constituent jobs |
0044 | `/panda/errors/` | Error summary — top patterns ranked by frequency |
0045 | `/panda/diagnostics/` | Failed jobs with full error details |
0046
0047 ## Setup
0048
0049 ### Development
0050
0051 ```bash
0052 # Clone both repos side by side
0053 git clone https://github.com/BNLNPPS/swf-remote.git
0054 git clone https://github.com/BNLNPPS/swf-monitor.git
0055
0056 # Set up dev environment (venv, symlinks to swf-monitor templates)
0057 cd swf-remote
0058 bash setup-dev.sh
0059
0060 # Set up database and .env
0061 bash setup-server.sh
0062
0063 # Run dev server
0064 cd src && ../.venv/bin/python manage.py runserver
0065 ```
0066
0067 ### Production
0068
0069 ```bash
0070 # Full deploy: rsync, venv, deps, symlinks, migrations, Apache, SSL
0071 bash deploy/setup-apache.sh
0072
0073 # SSL (after DNS is pointing to the server)
0074 sudo certbot --apache -d epic-devcloud.org
0075 ```
0076
0077 ### SSH tunnel
0078
0079 The tunnel is managed by systemd via autossh. See
0080 `deploy/swf-remote-tunnel.service`. Requires SSH key access from
0081 the hosting server to swf-monitor's host via an SSH gateway.
0082
0083 ```bash
0084 sudo cp deploy/swf-remote-tunnel.service /etc/systemd/system/
0085 sudo systemctl daemon-reload
0086 sudo systemctl enable --now swf-remote-tunnel
0087 sudo systemctl status swf-remote-tunnel
0088 ```
0089
0090 ## Stack
0091
0092 - Django 5.2 (Python 3.11) — upgrading to Django 6.0 / Python 3.12
0093 after OS upgrade
0094 - PostgreSQL (local, for Django internals only)
0095 - Apache + mod_wsgi
0096 - httpx for upstream REST calls
0097 - autossh + systemd for persistent SSH tunnel
0098 - Let's Encrypt for HTTPS
0099
0100 ## Configuration
0101
0102 Environment variables prefixed `SWF_REMOTE_` to avoid collisions with
0103 other apps on the same server. See `.env.example`.
0104
0105 ## Template sharing
0106
0107 swf-remote shares templates with swf-monitor via symlink (created by
0108 `setup-dev.sh`). swf-remote overrides `base.html` (nav bar) and
0109 `panda_hub.html` (hub page). All other PanDA templates are used as-is
0110 from swf-monitor.
0111
0112 URL names use `app_name = 'monitor_app'` so `{% url %}` tags in shared
0113 templates resolve to swf-remote's own routes.