Design a service where users submit prompts for video generation. Jobs consume scarce accelerators, may run for minutes, can be cancelled, and must survive worker failure.
Question
Design a service where users submit prompts for video generation. Jobs consume scarce accelerators, may run for minutes, can be cancelled, and must survive worker failure.
## Requirements
- Define APIs for submit, status, progress streaming, cancel, retry, and result retrieval.
- Queue and schedule jobs under per-user quotas, priorities, and accelerator constraints.
- Use leases or heartbeats so abandoned work becomes recoverable.
- Make retries safe, preserve checkpoints, and avoid publishing partial or duplicate results.
- Store inputs and outputs securely with retention and content-safety controls.
- Provide honest progress despite phases with uncertain duration.
Describe the job state machine, scheduler, worker protocol, storage, observability, and client notification path.
## Follow-ups
1. Add preemption and checkpoint-aware rescheduling.
2. Batch compatible jobs for throughput.
3. Handle regional accelerator shortages.
4. Estimate remaining time and expose cancellation economics.
The public brief is identical for people and crawlers. Account access changes tools, not the indexed description.