Remote encoding and transcription via Esup-Runner

💡 This documentation only applies to ESUP-Pod versions 4.2.0 and later.

Purpose

When USE_RUNNER_MANAGER = True, ESUP-Pod delegates encoding and transcription processing to one or more Esup-Runner services called Runner Managers.

Prerequisites

This document explains:

Flow Overview

  1. A user (or an internal process) triggers an encoding, transcription, or studio encoding task.
  2. Pod creates/sets a local Task with pending status.
  3. Pod attempts to send the task to a Runner Manager (/task/execute) using Bearer authentication.
  4. If no runner is reachable, the task remains pending (it will be retried by process_tasks).
  5. The runner executes the task, then calls the Pod webhook POST /runner/notify_task_end/.
  6. Pod updates the task status, then, if completed, downloads results (/task/result/<task_id>) and imports artifacts.
  7. Pod finalizes the task as completed and updates business objects (encoded files, subtitles, studio video, etc.).

settings_local.py Configuration

Recommended minimal configuration, in production:

USE_RUNNER_MANAGER = True
RM_TASKS_DELETED_AFTER_DAYS = 60
SECURE_SSL_REDIRECT = True

USE_RUNNER_MANAGER = True

RM_TASKS_DELETED_AFTER_DAYS = 60

SECURE_SSL_REDIRECT = True

Configuration via Administration

1. Runner Managers Administration

In Django admin, create at least one Runner Manager:

Best practices:

2. Test Connectivity

On a Runner Manager record, after entering values and saving, use the Test connection button:

Operations via Task Administration

The Task admin lets you manage the queue:

Useful action:

In parallel, the video interface also shows queue rank (rank) and the total number of pending tasks.

Role of process_tasks in Operations

The command:

python manage.py process_tasks

is the operational engine to run periodically. It:

  1. checks running tasks stuck for more than 2 hours and attempts reconciliation with the runner;
  2. submits pending tasks (encoding, transcription, studio) to available runners;
  3. applies priority scheduling (notably non-students before students);
  4. updates queue ranks;
  5. purges completed tasks according to RM_TASKS_DELETED_AFTER_DAYS.

Without running this command repeatedly:

Example every 3 minutes:

# Job for Esup-Runner tasks
*/3 * * * * /usr/bin/bash -c 'export WORKON_HOME=/home/pod/.virtualenvs; export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3; cd /usr/local/django_projects/podv4; source /usr/local/bin/virtualenvwrapper.sh; workon django_pod4; python manage.py process_tasks >> /usr/local/django_projects/podv4/pod/log/process_tasks.log 2>&1'

Tips:

Go-Live Checklist

  1. Enable USE_RUNNER_MANAGER = True.
  2. Set RM_TASKS_DELETED_AFTER_DAYS (e.g. 60).
  3. Create Runner Managers in administration (URL/token/priority/site).
  4. Validate each manager using Test connection.
  5. Deploy the process_tasks CRON job.
  6. Verify status transitions in Task admin: pending -> running -> completed.