mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-04 11:33:22 -05:00
* ci(gallery): have the checksum bot write the model library The checksum bot edited gallery/index.yaml, which is a generated copy of gallery/models/index.yaml. The model library check fails any PR where the copy differs from the generated one, and an edit made to the copy never reaches the source. Point the checker at the library, read the files under .model.files as the library keeps them, and run modelcatalog after the checker so the PR carries both files. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * ci(gallery): have the other index bots write the model library The gallery agent and the variant proposer still read and wrote the generated gallery copy, so their pull requests failed the model library check and their changes never reached the source. The gallery agent now appends library entries to gallery/models/index.yaml, converting its entries with the gallery package and skipping ids the library already has. Its duplicate check reads the same file. The variant proposer decodes the library shape (the body under model:) and splices variants into the model body through a library layout in galleryedit. The anchor refusal goes: the library has no anchors. Its tests use library entries. Both workflows run modelcatalog after the bot and before the pull request step, and use the Go version from go.mod. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
60 lines
2.4 KiB
YAML
60 lines
2.4 KiB
YAML
name: Check if checksums are up-to-date
|
|
on:
|
|
schedule:
|
|
- cron: 0 20 * * *
|
|
workflow_dispatch:
|
|
jobs:
|
|
checksum_check:
|
|
if: github.repository == 'mudler/LocalAI'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Configure apt mirror on runner
|
|
uses: ./.github/actions/configure-apt-mirror
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y pip wget
|
|
pip install huggingface_hub
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Generate the gRPC stubs the Go packages import
|
|
# modelcatalog imports them and they are not in the tree. Same pinned
|
|
# tools as the model library workflow.
|
|
run: |
|
|
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip
|
|
sudo unzip -j -d /usr/local/bin protoc.zip bin/protoc
|
|
rm protoc.zip
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
|
|
PATH="$PATH:$HOME/go/bin" make protogen-go
|
|
- name: 'Setup yq'
|
|
uses: dcarbone/install-yq-action@v1.3.1
|
|
with:
|
|
version: 'v4.44.2'
|
|
download-compressed: true
|
|
force: true
|
|
|
|
- name: Checksum checker 🔧
|
|
run: |
|
|
export HF_HOME=/hf_cache
|
|
sudo mkdir /hf_cache
|
|
sudo chmod 777 /hf_cache
|
|
# The model library is the source. The checker edits it.
|
|
bash .github/checksum_checker.sh gallery/models/index.yaml
|
|
- name: Regenerate the gallery copy from the library
|
|
# gallery/index.yaml is generated; the model library check fails the
|
|
# PR when it differs from the generated copy.
|
|
run: go run ./scripts/models/cmd/modelcatalog --library gallery/models/index.yaml --out gallery/index.yaml
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.UPDATE_BOT_TOKEN }}
|
|
push-to-fork: ci-forks/LocalAI
|
|
commit-message: ':arrow_up: Checksum updates in the model library'
|
|
title: 'chore(model-gallery): :arrow_up: update checksum'
|
|
branch: "update/checksum"
|
|
body: Updating checksums in gallery/models/index.yaml and regenerating gallery/index.yaml
|
|
signoff: true
|