- Create entrypoint.sh to handle SMB mount on container startup - Read credentials from settings.json and mount //172.18.210.5/ame - Bind-mount subdirectories (watch, output, logs) to container paths - Update Dockerfile with cifs-utils and entrypoint script - Update docker-compose.yml with SYS_ADMIN capability for mounting - Add comprehensive SMB configuration section to README - Include troubleshooting guide and alternative approaches - Maintain backward compatibility with local volumes - Never expose passwords to browser (server-side storage only) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
186 lines
7.3 KiB
Markdown
186 lines
7.3 KiB
Markdown
# AME Remote Job Manager
|
|
|
|
A web-based job submission and monitoring tool for Adobe Media Encoder (AME) in a Grassvalley AMPP environment. Editors upload `.prproj` files through the browser, the server remaps `.gves` proxy paths to high-resolution UNC paths, then delivers the remapped project to AME's watch folder for automated rendering.
|
|
|
|
## How It Works
|
|
|
|
1. Editor uploads a Premiere Pro `.prproj` file via the web UI
|
|
2. The server parses and remaps any `.gves` proxy media paths to their high-res UNC equivalents
|
|
3. The remapped project file is written to AME's watch folder
|
|
4. AME picks up the file, renders it, and writes output to the output folder
|
|
5. The job manager polls both folders and updates job status automatically: `queued → encoding → complete`
|
|
|
|
## Features
|
|
|
|
- `.prproj` path remapping — replaces `.gves` proxy references with full-resolution UNC paths
|
|
- Dry-run analysis mode — inspect what paths would be remapped before submitting
|
|
- Real-time job status tracking via watch folder and output folder polling
|
|
- AME log parsing — reads `AMEEncodingLog.txt` and error logs for encoding stats
|
|
- SMB/UNC path configuration via the settings UI
|
|
- Session-based authentication
|
|
- Docker-ready with volume-backed persistent storage
|
|
|
|
## Prerequisites
|
|
|
|
- Docker and Docker Compose (with `SYS_ADMIN` capability enabled for SMB mounting)
|
|
- Adobe Media Encoder running on a Windows machine with a configured watch folder
|
|
- SMB network share accessible at `//172.18.210.5/ame` containing:
|
|
- `watch` — folder where .prproj files are picked up by AME
|
|
- `output` — folder where AME writes encoded files
|
|
- `logs` — folder where AME writes `AMEEncodingLog.txt`
|
|
- Network connectivity from Docker host to SMB server
|
|
- `.prproj` files that reference `.gves` proxy media on the AMPP platform
|
|
|
|
## Quick Start
|
|
|
|
1. Clone the repo and copy the example env file:
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
2. Edit `.env`:
|
|
|
|
```env
|
|
PORT=3100
|
|
AUTH_USER=admin
|
|
AUTH_PASS=changeme
|
|
|
|
# Docker volume mount paths
|
|
WATCH_FOLDER=/watch
|
|
OUTPUT_FOLDER=/output
|
|
AME_LOG_DIR=/ame-logs
|
|
|
|
# Polling interval (ms)
|
|
POLL_INTERVAL_MS=5000
|
|
|
|
# Job timeout — mark as error if AME hasn't produced output after this long (ms)
|
|
JOB_TIMEOUT_MS=3600000
|
|
```
|
|
|
|
3. Mount your watch folder and AME log directory in `docker-compose.yml`, then start:
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
4. Open `http://localhost:3100` in your browser and log in.
|
|
|
|
## Docker Compose Example
|
|
|
|
```yaml
|
|
services:
|
|
ame-job-manager:
|
|
build: .
|
|
ports:
|
|
- "3100:3100"
|
|
volumes:
|
|
- /mnt/ame-watch:/watch # AME watch folder (SMB mount or local)
|
|
- /mnt/ame-output:/output # AME output folder
|
|
- /mnt/ame-logs:/ame-logs # AME log directory (contains AMEEncodingLog.txt)
|
|
- job-data:/data
|
|
env_file: .env
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
job-data:
|
|
```
|
|
|
|
## SMB Network Share Configuration
|
|
|
|
The Docker container can automatically mount an SMB share on startup using credentials stored in the Settings GUI. This is useful when the watch folder, output folder, and logs are on a remote network share.
|
|
|
|
### How It Works
|
|
|
|
1. The `entrypoint.sh` script reads SMB credentials from `settings.json` (persisted in `/data`)
|
|
2. On container startup, it mounts the SMB share at `/mnt/smb-share` using `mount -t cifs`
|
|
3. It then bind-mounts subdirectories to `/watch`, `/output`, and `/ame-logs`
|
|
4. The Node.js app accesses these paths as if they were local
|
|
|
|
### Configuration Steps
|
|
|
|
1. **Start the container** (it will run with fallback Docker volumes if no SMB credentials yet)
|
|
|
|
2. **Open the Settings panel** in the web UI (⚙️ icon in header)
|
|
|
|
3. **Fill in SMB credentials:**
|
|
- **SMB Username**: e.g., `encoder` or `DOMAIN\encoder`
|
|
- **SMB Password**: Network password (stored server-side, never exposed to browser)
|
|
- **SMB Domain/Workgroup**: Optional, e.g., `WORKGROUP` or `BMG`
|
|
- **Notes**: Optional reference, e.g., `\\172.18.210.5\ame`
|
|
|
|
4. **Create subdirectories on the SMB share** (if they don't exist):
|
|
```
|
|
\\172.18.210.5\ame\
|
|
├── watch\ (AME's watch folder)
|
|
├── output\ (AME's output folder)
|
|
└── logs\ (Contains AMEEncodingLog.txt)
|
|
```
|
|
|
|
5. **Restart the container** — it will mount the SMB share on next startup
|
|
|
|
### Troubleshooting SMB Mount Issues
|
|
|
|
- **Mount failed**: Check that credentials are correct and the SMB server is reachable
|
|
- **Permission denied**: Verify the SMB user has read/write access to the share
|
|
- **Container falls back to local volumes**: Check Docker logs for mount errors: `docker logs ame-job-manager`
|
|
- **Shares already mounted locally**: If the watch/output/logs folders are already mounted on the Docker host via `/etc/fstab`, use bind-mounts in `docker-compose.yml` instead:
|
|
|
|
```yaml
|
|
volumes:
|
|
- /mnt/host-smb-share/watch:/watch
|
|
- /mnt/host-smb-share/output:/output
|
|
- /mnt/host-smb-share/logs:/ame-logs
|
|
```
|
|
|
|
In this case, you don't need to configure SMB credentials in the app settings.
|
|
|
|
## Job Lifecycle
|
|
|
|
| Status | Meaning |
|
|
|--------|---------|
|
|
| `queued` | File written to watch folder, waiting for AME to pick it up |
|
|
| `encoding` | File disappeared from watch folder — AME is actively rendering |
|
|
| `complete` | Output file detected in the output folder |
|
|
| `error` | Job timed out or AME log reported an error |
|
|
|
|
The server polls both folders every `POLL_INTERVAL_MS` milliseconds to detect status transitions.
|
|
|
|
## Path Remapping
|
|
|
|
The core function of this tool is to make `.prproj` files renderable on a high-res render machine. Premiere projects created on AMPP workstations often reference `.gves` proxy files. This server rewrites those references to the corresponding UNC/high-res paths before handing the project to AME.
|
|
|
|
The remapping logic lives in `prproj-remapper.js`. You can test a remap without submitting a job using the analyze endpoint or the dry-run button in the UI.
|
|
|
|
## API Reference
|
|
|
|
| Method | Endpoint | Description |
|
|
|--------|----------|-------------|
|
|
| POST | `/api/login` | Authenticate and get a session ID |
|
|
| POST | `/api/logout` | End session |
|
|
| POST | `/api/jobs` | Submit a `.prproj` file and create a job |
|
|
| POST | `/api/jobs/analyze` | Dry-run analysis of a `.prproj` (no submission) |
|
|
| GET | `/api/jobs` | List all jobs |
|
|
| GET | `/api/jobs/:id` | Get a single job by ID |
|
|
| DELETE | `/api/jobs/:id` | Delete a job record |
|
|
| GET | `/api/status` | System status — folder health, job counts, AME log stats |
|
|
| GET | `/api/ame/logs` | Full AME log data with recent entries |
|
|
| GET | `/api/settings` | Get current settings |
|
|
| POST | `/api/settings` | Update settings (watch folder, SMB config, etc.) |
|
|
|
|
All endpoints except `/api/login` require an `x-session-id` header from a valid login.
|
|
|
|
## Environment Variables
|
|
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `PORT` | `3100` | HTTP port |
|
|
| `AUTH_USER` | `admin` | Login username |
|
|
| `AUTH_PASS` | `password` | Login password |
|
|
| `WATCH_FOLDER` | `/watch` | Path AME watches for new projects |
|
|
| `OUTPUT_FOLDER` | `/output` | Path AME writes rendered output to |
|
|
| `DATA_DIR` | `/data` | Persistent storage for job records and sessions |
|
|
| `UPLOAD_TEMP` | `/tmp/uploads` | Temp dir for incoming file uploads |
|
|
| `POLL_INTERVAL_MS` | `5000` | How often to poll watch/output folders (ms) |
|
|
| `JOB_TIMEOUT_MS` | `3600000` | Time before a stuck job is marked as error (ms) |
|
|
| `AME_LOG_DIR` | `/ame-logs` | Directory containing `AMEEncodingLog.txt` |
|