mirror of
https://github.com/mudler/LocalAI.git
synced 2026-07-30 09:57:57 -04:00
The "Bump Backend dependencies" workflow has failed every night for the last two weeks. #11012 fixed one cause (repos renamed under localai-org); what is left is rate limiting. bump_deps.sh fans out to ~25 parallel matrix jobs that each query api.github.com anonymously. Anonymous calls are capped at 60/hour per source IP and GitHub-hosted runners egress through shared NAT addresses, so a random handful of jobs draw HTTP 403 and die at curl exit 22 with an empty response. Last night that hit ggml-org/whisper.cpp and mudler/depth-anything.cpp -- both public and resolvable, nothing wrong with either pin. Route every bump script through a shared gh_curl helper that sends GITHUB_TOKEN when present (1000/hour instead of 60) and retries transient failures, including the 403s that plain --retry ignores. The helper suppresses xtrace around the call so the Authorization header cannot land in a public job log. bump_docs.sh had a sharper version of the same bug: it piped an unchecked response into `jq -r .tag_name`, so a throttled request resolved to the string "null" and would have been published as the docs version. It now refuses to write anything it cannot resolve to a tag. Verified locally by running all four scripts end to end against their real upstreams: correct SHAs/tags written, exit 0; a nonexistent repo now fails with a named diagnostic instead of a bare exit 22 and leaves the pinned file untouched; the token is absent from the xtrace output; and the scripts still work unauthenticated. Assisted-by: Claude:opus-4.8 [Claude Code] Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
49 lines
1.9 KiB
Bash
Executable File
49 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# Bump the cublas13 vLLM wheel pin in requirements-cublas13-after.txt.
|
|
#
|
|
# vLLM's PyPI wheel is built against CUDA 12 so the cublas13 build pulls a
|
|
# cu130-flavoured wheel from vLLM's per-tag index at
|
|
# https://wheels.vllm.ai/<TAG>/cu130/. That URL segment is itself version-locked
|
|
# (no /latest/ alias upstream), so bumping vLLM means rewriting both the URL
|
|
# segment and the version constraint atomically. bump_deps.sh handles git-sha
|
|
# vars in Makefiles; this script handles the two-value rewrite specific to the
|
|
# vLLM requirements file.
|
|
set -xe
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/gh_curl.sh"
|
|
|
|
REPO=$1 # vllm-project/vllm
|
|
FILE=$2 # backend/python/vllm/requirements-cublas13-after.txt
|
|
VAR=$3 # VLLM_VERSION (used for output file names so the workflow can read them)
|
|
|
|
if [ -z "$FILE" ] || [ -z "$REPO" ] || [ -z "$VAR" ]; then
|
|
echo "usage: $0 <repo> <requirements-file> <var-name>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# /releases/latest returns the most recent non-prerelease tag.
|
|
LATEST_TAG=$(gh_curl -H "Accept: application/vnd.github+json" \
|
|
"https://api.github.com/repos/$REPO/releases/latest" \
|
|
| python3 -c "import json,sys; print(json.load(sys.stdin)['tag_name'])")
|
|
|
|
# Strip leading 'v' (vLLM tags are 'v0.20.0', the URL/version use '0.20.0').
|
|
NEW_VERSION="${LATEST_TAG#v}"
|
|
|
|
set +e
|
|
CURRENT_VERSION=$(grep -oE '^vllm==[0-9]+\.[0-9]+\.[0-9]+' "$FILE" | head -1 | cut -d= -f3)
|
|
set -e
|
|
|
|
# sed both lines unconditionally — peter-evans/create-pull-request opens no PR
|
|
# when the working tree is clean, so a no-op rewrite is safe.
|
|
sed -i "$FILE" \
|
|
-e "s|wheels\.vllm\.ai/[^/]*/cu130|wheels.vllm.ai/$NEW_VERSION/cu130|g" \
|
|
-e "s|^vllm==.*|vllm==$NEW_VERSION|"
|
|
|
|
if [ -z "$CURRENT_VERSION" ]; then
|
|
echo "Could not find vllm==X.Y.Z in $FILE."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Changes: https://github.com/$REPO/compare/v${CURRENT_VERSION}...${LATEST_TAG}" >> "${VAR}_message.txt"
|
|
echo "${NEW_VERSION}" >> "${VAR}_commit.txt"
|