Skip to content

fix(ci): cache OCR Docker layers in backend builds - #147

Merged
HansonL622 merged 2 commits into
1024XEngineer:mainfrom
pionxe:codex/ocr-build-cache
Aug 21, 2026
Merged

fix(ci): cache OCR Docker layers in backend builds#147
HansonL622 merged 2 commits into
1024XEngineer:mainfrom
pionxe:codex/ocr-build-cache

Conversation

@pionxe

@pionxe pionxe commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use Buildx/GitHub Actions cache for the existing ocr-base Docker stage.
  • Run OCR runtime smoke checks when OCR inputs or CI workflows change.
  • Warm the OCR cache on main when OCR build inputs change.

Validation

  • actionlint and YAML parsing
  • CI path-routing and required-gate simulations
  • OCR Docker target build and final-image worker smoke
  • PaddleOcrProviderTest (10 tests)

Notes

  • Normal backend PRs read the OCR cache but do not write to it.
  • Cold or evicted caches may rebuild OCR once; this is a performance fallback, not a runtime behavior change.

Close #144

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow routing and Docker smoke-check changes are coherent, but the new main cache-warming path cannot reliably publish the cache with its current token permissions. The fixed-range diff was checked with git diff --check; the remaining issue is the missing permission required by the cache-to: type=gha export.

target: ocr-base
push: false
cache-from: type=gha,scope=unispeaking-ocr-v1
cache-to: type=gha,scope=unispeaking-ocr-v1,mode=max

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Grant permission to export the BuildKit cache

This workflow declares only contents: read, but the cache-to: type=gha exporter writes through the GitHub Actions cache service and requires write access. On every matching push to main, the build can complete and then fail while exporting the cache, so the intended warm cache is never populated and subsequent PR builds repeatedly fall back to the cold OCR build. Grant the workflow/job the required Actions cache write permission (or otherwise configure the cache service authorization) before relying on this warmer.

@HansonL622 HansonL622 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HansonL622
HansonL622 merged commit 28b0b29 into 1024XEngineer:main Aug 21, 2026
12 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.

fix(CI): 缓存现有 OCR Docker target,避免普通后端构建重复下载模型

2 participants