Repository navigation
Several transcription replicas, and timings for every job step - #23
Merged
Merged
Conversation
pod-block can now run several captions jobs at once (PODBLOCK_CAPTION_WORKERS) against a whisper Deployment with more than one replica, spread across nodes. - whisper: say "waiting" as soon as a request arrives at a busy replica, so the client can hang up and try again; on SIGTERM, finish the episode in hand, send away the ones waiting, refuse new ones, then exit. - whisper: replicas share one models folder; downloads hold a lock file in it, and the speaker models land under temporary names and are moved into place whole. - captions: with more than one captions worker, a busy replica is hung up on and the episode sent again with backoff, for up to 10 minutes; a transcription cut off part way is asked for once more. - captions: read the answer's lines as they arrive (urllib3's read1); iter_lines held short lines back until 512 bytes had come. - deployment: two whisper replicas on a ReadWriteMany models volume, rolling updates, an hour's grace to finish an episode, and spread across nodes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AWa5fjs4UUXUR1r87xsZ19
Each job's Context now has a Timer (podblock/timing.py) that its steps
report to; when the job ends, the steps that finished are saved in a new
`timings` table (migration 17), kept 90 days.
- process: download, fingerprint, the wait for another job's repeats,
finding repeats and each of its parts (loading fingerprints, comparing
pairs, storing new blocks, rescans, splitting, dropping nested and
short blocks, bumpers, reports), cut and waveform. Re-cuts are saved as
kind `recut`.
- edit and unlearn: the repeats work and its wait.
- captions: sending the audio, waiting for a free transcriber (with the
number of tries), transcribing and who speaks when. The service now
says {"working": true} when an episode's turn comes, so waiting and
decoding are told apart, and logs each episode's own times.
- /timings (admin, linked from Jobs): per kind of job and step, runs,
median, slowest 10%, time per hour of audio and total, over 7, 30 or
90 days, and the latest jobs step by step. /timings.csv has every row.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AWa5fjs4UUXUR1r87xsZ19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits: the transcription service can now run as several replicas across nodes, and every job now records how long each step takes, with an admin page to read the results.
Several transcription replicas
PODBLOCK_CAPTION_WORKERSsets how many captions jobs run at once. Set it to the number of whisper replicas.{"waiting": true}as soon as a request arrives. With more than one captions worker, pod-block hangs up and sends the episode again after a backoff (2 s, doubling up to 30 s), so the Service can pick another replica. After 10 minutes of busy answers it waits its turn where it is.read1.iter_lines()held them back until 512 bytes had come, so a short "waiting" line could go unseen for minutes./models/.fetch.lockwhile it downloads; the others wait, then load what it fetched. Speaker models are downloaded under temporary names and moved into place whole.storageClassNamemarked CHANGE, with a note on what to do without one);terminationGracePeriodSeconds: 3600;Job timings
Recording: each job's
Contexthas aTimer(podblock/timing.py). Steps that finish are saved in a newtimingstable (migration 17) and kept 90 days. Only a job that finishes gets a whole-job row.Process jobs:
Re-cuts are saved as kind
recut, so they can be told apart from first downloads.Edit and unlearn jobs: the find-repeats work and the wait for it.
Captions jobs: sending the audio, waiting for a free transcriber (with the number of tries), transcribing, and who speaks when. The service now sends
{"working": true}when an episode's turn comes, so time spent waiting isn't counted as decoding. Older clients ignore the new line. The service also logs each episode's own times.Page:
/timingsis admin-only and linked from Jobs. For 7, 30 or 90 days, it shows per kind of job and step: runs, median, slowest 10%, time per hour of audio, and total. It also lists the latest jobs step by step./timings.csvhas every row.Testing
pytest: 231 passed.ruff check: clean.Generated by Claude Code