docker: fix container build tag selection lag#778
Conversation
Ensure fetch_llama_tag matches build tags precisely and sorts them numerically to select the newest bNNNN build. - Restrict tag matches to ^-b[0-9]+$ to avoid matching static tags and other backend architectures. - Sort matching tags numerically using version sort (sort -V) instead of lexicographical sort to correctly prioritize newer builds. fixes mostlygeek#777
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthroughfetch_llama_tag() in ChangesContainer tag selection refinement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker/build-container.sh`:
- Around line 104-106: The pipeline populating found_tag (using jq and sort -V)
is masking failures because declaring and assigning with local in one statement
hides the pipeline exit status; split the declaration and assignment (e.g.,
first declare local found_tag, then assign found_tag=$(...) ), and ensure the
function or script has set -o pipefail (or explicitly check the pipeline's exit
status) so jq/sort errors cause an immediate failure instead of being treated as
"no tag found" and continuing pagination.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0e8c5c9f-f61e-40af-b42b-cce32538c064
📒 Files selected for processing (1)
docker/build-container.sh
Line 104 declares and assigns `found_tag` in one statement. In bash, that masks the pipeline's exit status, so a broken `jq` expression or unsupported `sort -V` gets treated as "no tag found" and the loop keeps paginating instead of failing with the real error. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
I don't think there is a bug here. The current scripts find the latest containers correctly. I manually dispatched the container job and it picked up the latest container. The lag comes from when the cronjob to build containers runs and when the llama.cpp project finishes publishing new containers. If the llama-swap job runs before llama.cpp's container scripts are finished we get the lag. One tweak we can do is to move the cronjob to about 10hrs after the llama.cpp's nightly container build scripts. This gives them enough time to finish and reduces the likelihood of running before the new containers are published. |
Ensure fetch_llama_tag matches build tags precisely and sorts them numerically to select the newest bNNNN build.
fixes #777