8000 fix(documents): a hung LibreOffice can't block a worker; CI runs on the self-hosted runner by adeelahmad · Pull Request #27 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(documents): a hung LibreOffice can't block a worker; CI runs on the self-hosted runner - #27

Merged
adeelahmad merged 5 commits into
mainfrom
claude/self-hosted-runner-3c1oos
Oct 2, 2026
Merged

adeelahmad merged 5 commits into
mainfrom
claude/self-hosted-runner-3c1oos

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 2, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: every job ran on GitHub's ubuntu-latest runners, which use paid Actions minutes. Each push to a pull request also ran CI twice, once for push and once for pull_request.

After: every job on main (CI ×3, pre-commit, PR title, release ×2) runs on runs-on: self-hosted, which is Adeel's Mac runner. CI and pre-commit now:

  • run on pushes to main and on pull requests, and a newer push cancels the older run;
  • get a read-only GITHUB_TOKEN.

macOS support in CI

  • The apt steps run only when runner.os == 'Linux'.
  • On macOS, Homebrew installs ffmpeg, tesseract and poppler.

Speed on the self-hosted runner

The first pre-commit job on the Mac took 18 minutes. The causes and fixes:

  • setup-node uploaded a 130 MB pnpm store to GitHub's cache after every job, which took 9 minutes over a home uplink. It now caches only on GitHub's runners, since the store stays on the Mac's disk.
  • The frontend lint and Prettier hooks had pass_filenames: true. pre-commit therefore ran each whole-app command once per batch of files, in parallel, which took about 3 minutes. They now run once.
  • setup-uv kept uv's cache in the job's temp folder, which is deleted after each job. On self-hosted runners it now lives in the runner's tool cache.

LibreOffice can no longer hang a worker (app/domain/convert.py)

  • soffice starts soffice.bin, which keeps the output pipes open. On a timeout, subprocess.run killed soffice and then waited on those pipes forever, and soffice.bin outlived the conversion.
  • Converters now run in their own process group. That group is killed on timeout and after every run.
  • Reading a .doc from the command line (ingest.read_doc) gets the same timeout and its own LibreOffice profile.
  • New test: test_run_kills_what_the_converter_started. It fails without the change and passes with it.

Motivation and Context

The repository is running out of GitHub Actions minutes.

The Mac needs the following for these jobs:

  • FastAPI (SurrealDB server): Docker running.
  • Release: the gh CLI.

Not yet covered: the packaging PRs (#11 Synology, #12 Cloudron, #13 QNAP) still say ubuntu-latest. They will be switched in a follow-up after they merge. If the runner is offline, jobs wait in the queue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires documentation updates.
  • I have updated the documentation accordingly.
  • My change requires dependencies updates.
  • I have updated the dependencies accordingly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JifG4FUAcs7EFGrcotkEDz

@adeelahmad adeelahmad self-assigned this Oct 2, 2026
All workflows use runs-on: self-hosted. The apt steps in CI only run on Linux; on a macOS runner, ffmpeg,
tesseract and poppler come from Homebrew instead, and the LibreOffice tests skip.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JifG4FUAcs7EFGrcotkEDz
@adeelahmad
adeelahmad force-pushed the claude/self-hosted-runner-3c1oos branch from 721aff1 to 61993d1 Compare October 2, 2026 13:17
@adeelahmad adeelahmad changed the title ci: self-hosted Proxmox runners with GitHub-hosted fallback ci: run every job on the self-hosted runner Oct 2, 2026
… token

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JifG4FUAcs7EFGrcotkEDz
- pre-commit ran the frontend lint and Prettier hooks once per batch of files, in parallel, though each run
  checks the whole app (about 3 minutes on the Mac); they now run once
- setup-node saved pnpm's store to GitHub's cache after every job (130 MB, 9 minutes over a home uplink); the
  store already stays on the runner's disk, so the cache is now used on GitHub's runners only
- setup-uv kept uv's cache in the job's temp folder, emptied after every job; on the self-hosted runner it now
  lives in the tool cache

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JifG4FUAcs7EFGrcotkEDz
claude added 2 commits October 2, 2026 14:03
soffice starts soffice.bin, which kept the output pipes open: on a timeout, the worker killed soffice and then
waited on the pipes forever, and soffice.bin outlived the conversion. Converters now run in a process group of
their own that is killed on timeout and after every run. Reading a .doc on the command line gets the same
timeout and a profile of its own, so it no longer waits on (or disturbs) a LibreOffice the user has open.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JifG4FUAcs7EFGrcotkEDz
@adeelahmad adeelahmad changed the title ci: run every job on the self-hosted runner fix(documents): a hung LibreOffice can't block a worker; CI runs on the self-hosted runner Oct 2, 2026
@adeelahmad
adeelahmad marked this pull request as ready for review October 2, 2026 14:15
@adeelahmad
adeelahmad merged commit c92e3f5 into main Oct 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0