Metadata-Version: 2.4
Name: inferyx-monitoring
Version: 1.0.49
Summary: Monitor batch pipelines via API and email alerts — install and deploy on Linux servers from PyPI
Author-email: Inferyx DevOps <devops@inferyx.com>
License: Copyright (c) 2026 Inferyx. All rights reserved.
        
        Proprietary software. Unauthorized copying, distribution, or use is prohibited
        unless agreed in writing with Inferyx.
        
        For open-source release, replace this file with your chosen license (e.g. MIT, Apache-2.0)
        before publishing to public PyPI.
        
Keywords: batch,monitoring,pipeline,email,inferyx
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: fastapi>=0.110.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: uvicorn[standard]>=0.27.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: admin
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: check-manifest; extra == "dev"
Dynamic: license-file

# inferyx-monitoring

**Version:** 1.0.49 · **PyPI:** [inferyx-monitoring](https://pypi.org/project/inferyx-monitoring/)

Batch monitor + admin UI. One package, one service, **one install directory**.

---

## Commands

| Step | Command |
|------|---------|
| **Install** (new server) | `sudo bash release/install.sh` |
| **Upgrade** (existing) | `sudo bash release/upgrade.sh` |
| **Build** (maintainer) | `./scripts/release.sh` |
| **Publish** (maintainer) | `./scripts/release.sh --publish` |
| **Test locally** (WSL) | `sudo bash scripts/test-local.sh all` |

After pip install, scripts are at:  
`/opt/pipeline-monitor/.venv/share/inferyx-monitoring/install.sh`

Maintainer docs: [docs/BUILD.md](docs/BUILD.md) · Release notes: [docs/CHANGELOG.md](docs/CHANGELOG.md)

---

## Project layout

```
Monitor/
├── docs/              BUILD.md (git), CHANGELOG.md (PyPI wheel)
├── development/       Local dev templates + gitignored secrets
├── release/           install.sh, upgrade.sh, templates (shipped in wheel)
├── scripts/           release.sh, build-ui.sh, test-local.sh (maintainers)
├── admin-ui/          Angular source
└── inferyx_pipeline_monitor/
    └── data/          .env.example, batch_file.csv.example (single .env template)
```

---

## Install directory (`/opt/pipeline-monitor`)

Everything lives in **one path**:

```
/opt/pipeline-monitor/
├── .venv/
├── .env
├── batch_file.csv
├── auth.policy
├── www/                 Admin UI static files
├── secrets/             google_client_secret, session_secret
└── logs/
    └── monitor.log      Monitor output + admin audit (JSON lines)
```

| URL | Purpose |
|-----|---------|
| `https://<host>/monitoring/admin/` | Admin UI (nginx) |
| `https://<host>/monitoring/api/` | Admin API (nginx → `127.0.0.1:8090`) |

---

## Install (new server)

```bash
sudo bash release/install.sh
# Pin version:  sudo bash release/install.sh --pin 1.0.49
```

Then edit config and nginx:

```bash
sudo -u inferyx vi /opt/pipeline-monitor/.env
sudo vi /opt/pipeline-monitor/auth.policy
echo 'GOOGLE_SECRET' | sudo tee /opt/pipeline-monitor/secrets/google_client_secret
sudo chmod 600 /opt/pipeline-monitor/secrets/google_client_secret

sudo cp /opt/pipeline-monitor/.venv/share/inferyx-monitoring/nginx.conf.example \
  /etc/nginx/sites-available/pipeline-monitor
sudo ln -sf /etc/nginx/sites-available/pipeline-monitor /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
```

Verify:

```bash
sudo systemctl status inferyx-monitoring.service
curl -s http://127.0.0.1:8090/api/health
curl -s http://127.0.0.1:8090/api/ui/status
```

---

## Upgrade (existing server)

```bash
sudo bash /opt/pipeline-monitor/.venv/share/inferyx-monitoring/upgrade.sh
```

Upgrades pip, merges missing `.env` keys, redeploys `www/`, updates systemd, restarts.  
Migrates old `/etc/pipeline-monitor/` and `/var/www/pipeline-monitor-admin/` if found.

---

## Configuration

### `.env` (required)

Template: `inferyx_pipeline_monitor/data/.env.example` (only source — copy to `/opt/pipeline-monitor/.env`).

Required keys: `PIPELINE_SMTP_HOST`, `PIPELINE_SMTP_PORT`, `PIPELINE_SMTP_USERNAME`, `PIPELINE_SMTP_PASSWORD`, `PIPELINE_FROM_NAME`, `PIPELINE_MAIL_TO`, `PIPELINE_API_BASE_URL`, `PIPELINE_API_TOKEN`, `PIPELINE_API_TOKEN_HEADER`, `PIPELINE_DEVOPS_EMAIL`

### `auth.policy` (Google SSO)

Template: `release/auth.policy.example`. Set `client_secret_path`, `redirect_uri`, and `allowed_domains`.  
Add the same `redirect_uri` in Google Cloud Console.

### Nginx

Full template: `share/inferyx-monitoring/nginx.conf.example` (after pip install)

---

## Troubleshooting

| Symptom | Check |
|---------|--------|
| Admin UI "Unavailable" | `curl http://127.0.0.1:8090/api/ui/status` and nginx `/monitoring/api/` |
| Service restart loop | `journalctl -u inferyx-monitoring -n 50` — missing `.env` keys |
| Admin up, monitor retrying | Fix `.env`; monitor auto-restarts every 10s |
| Logs | `tail -f /opt/pipeline-monitor/logs/monitor.log` |

---

## What's new in 1.0.49

- Batch Data: CSV upload (column validation) and download current data
- Release scripts in `release/` folder (PyPI wheel build fix)
