Skip to content

Commit 75cd042

Browse files
authored
fix: CI error & pre-commit & add MiniLM-L12-v2 & docker-compose-down (#450)
* fix python pre-commit error & add MiniLM-L12-v2 & docker-compose-down Signed-off-by: JaredforReal <w13431838023@gmail.com> * update bert_model model_id Signed-off-by: JaredforReal <w13431838023@gmail.com> * fix python pre-commit error Signed-off-by: JaredforReal <w13431838023@gmail.com> * fix ci build error Signed-off-by: JaredforReal <w13431838023@gmail.com> --------- Signed-off-by: JaredforReal <w13431838023@gmail.com>
1 parent ea580ac commit 75cd042

File tree

19 files changed

+178
-153
lines changed

19 files changed

+178
-153
lines changed

.github/workflows/docker-publish.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
workflow_call:
66
inputs:
77
tag_suffix:
8-
description: 'Custom tag suffix for the Docker image'
8+
description: "Custom tag suffix for the Docker image"
99
required: false
1010
type: string
11-
default: ''
11+
default: ""
1212
is_nightly:
13-
description: 'Whether this is a nightly build'
13+
description: "Whether this is a nightly build"
1414
required: false
1515
type: boolean
1616
default: false
@@ -20,7 +20,7 @@ on:
2020
type: boolean
2121
default: true
2222
push:
23-
branches: [ "main" ]
23+
branches: ["main"]
2424
pull_request:
2525
paths:
2626
- ".github/workflows/docker-publish.yml"
@@ -42,16 +42,32 @@ jobs:
4242
# Multi-architecture build strategy:
4343
# - AMD64: Native build on ubuntu-latest (fast)
4444
# - ARM64: Cross-compilation on ubuntu-latest (faster than emulation)
45-
# arch: ${{ github.event_name == 'pull_request' && fromJSON('["amd64"]') || fromJSON('["amd64", "arm64"]') }}
45+
# arch: ${{ github.event_name == 'pull_request' && fromJSON('["amd64"]') || fromJSON('["amd64", "arm64"]') }}
4646
arch: ["amd64", "arm64"]
4747
fail-fast: false
4848

4949
steps:
50+
- name: Free up disk space
51+
run: |
52+
echo "Before cleanup:"
53+
df -h
54+
sudo rm -rf /usr/share/dotnet
55+
sudo rm -rf /usr/local/lib/android
56+
sudo rm -rf /opt/ghc
57+
sudo rm -rf /opt/hostedtoolcache/CodeQL
58+
sudo docker image prune --all --force
59+
echo "After cleanup:"
60+
df -h
61+
5062
- name: Check out the repo
5163
uses: actions/checkout@v4
5264

5365
- name: Set up Docker Buildx
5466
uses: docker/setup-buildx-action@v3
67+
with:
68+
driver-opts: |
69+
image=moby/buildkit:latest
70+
network=host
5571
5672
- name: Set up QEMU for cross-compilation
5773
if: matrix.arch == 'arm64'
@@ -172,6 +188,14 @@ jobs:
172188
fi
173189
fi
174190
191+
- name: Additional cleanup for llm-katan (large Python packages)
192+
if: matrix.image == 'llm-katan'
193+
run: |
194+
echo "Freeing up more space for llm-katan build..."
195+
sudo apt-get clean
196+
sudo rm -rf /var/lib/apt/lists/*
197+
df -h
198+
175199
- name: Build and push ${{ matrix.image }} Docker image
176200
id: build
177201
uses: docker/build-push-action@v5
@@ -182,10 +206,8 @@ jobs:
182206
push: ${{ github.event_name != 'pull_request' }}
183207
load: ${{ github.event_name == 'pull_request' }}
184208
tags: ${{ steps.tags.outputs.tags }}
185-
cache-from: |
186-
type=gha
187-
type=local,src=/tmp/.buildx-cache
188-
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
209+
cache-from: type=gha
210+
cache-to: type=gha,mode=max
189211
build-args: |
190212
BUILDKIT_INLINE_CACHE=1
191213
CARGO_BUILD_JOBS=${{ github.event_name == 'pull_request' && '8' || '16' }}

.github/workflows/test-and-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
key: ${{ runner.os }}-models-v1-${{ hashFiles('tools/make/models.mk') }}
6565
restore-keys: |
6666
${{ runner.os }}-models-v1-
67+
continue-on-error: true # Don't fail the job if caching fails
6768

6869
- name: Check go mod tidy
6970
run: make check-go-mod-tidy

.pre-commit-config.yaml

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
# Basic hooks for Go, Rust, Python And JavaScript files only
5-
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v6.0.0
7-
hooks:
8-
- id: trailing-whitespace
9-
files: \.(go|rs|py|js)$
10-
- id: end-of-file-fixer
11-
files: \.(go|rs|py|js)$
12-
- id: check-added-large-files
13-
args: ['--maxkb=500']
14-
files: \.(go|rs|py|js)$
4+
# Basic hooks for Go, Rust, Python And JavaScript files only
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.2.0
7+
hooks:
8+
- id: trailing-whitespace
9+
files: \.(go|rs|py|js)$
10+
- id: end-of-file-fixer
11+
files: \.(go|rs|py|js)$
12+
- id: check-added-large-files
13+
args: ["--maxkb=500"]
14+
files: \.(go|rs|py|js)$
1515

16-
# Go specific hooks
17-
- repo: local
18-
hooks:
19-
- id: go-fmt
20-
name: go fmt
21-
entry: gofmt -w
22-
language: system
23-
files: \.go$
16+
# Go specific hooks
17+
- repo: local
18+
hooks:
19+
- id: go-fmt
20+
name: go fmt
21+
entry: gofmt -w
22+
language: system
23+
files: \.go$
2424

25-
- repo: local
26-
hooks:
27-
- id: golang-lint
28-
name: go lint
29-
entry: make go-lint
30-
language: system
31-
files: \.go$
32-
pass_filenames: false
25+
- repo: local
26+
hooks:
27+
- id: golang-lint
28+
name: go lint
29+
entry: make go-lint
30+
language: system
31+
files: \.go$
32+
pass_filenames: false
3333

34-
# Markdown specific hooks
35-
- repo: local
36-
hooks:
37-
- id: md-fmt
38-
name: md fmt
39-
entry: bash -c "make markdown-lint"
40-
language: system
41-
files: \.md$
42-
exclude: ^(\node_modules/|CLAUDE\.md)
34+
# Markdown specific hooks
35+
- repo: local
36+
hooks:
37+
- id: md-fmt
38+
name: md fmt
39+
entry: bash -c "make markdown-lint"
40+
language: system
41+
files: \.md$
42+
exclude: ^(\node_modules/|CLAUDE\.md)
4343

44-
# Yaml specific hooks
45-
- repo: local
46-
hooks:
47-
- id: yaml-and-yml-fmt
48-
name: yaml/yml fmt
49-
entry: bash -c "make markdown-lint"
50-
language: system
51-
files: \.(yaml|yml)$
52-
exclude: ^(\node_modules/)
44+
# Yaml specific hooks
45+
- repo: local
46+
hooks:
47+
- id: yaml-and-yml-fmt
48+
name: yaml/yml fmt
49+
entry: bash -c "make markdown-lint"
50+
language: system
51+
files: \.(yaml|yml)$
52+
exclude: ^(\node_modules/)
5353

54-
# JavaScript and TypeScript specific hooks
55-
- repo: local
56-
hooks:
57-
- id: js-ts-lint
58-
name: js/ts lint
59-
entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint'
60-
language: system
61-
files: \.(js|ts|tsx)$
62-
exclude: ^(\node_modules/)
63-
pass_filenames: false
54+
# JavaScript and TypeScript specific hooks
55+
- repo: local
56+
hooks:
57+
- id: js-ts-lint
58+
name: js/ts lint
59+
entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint'
60+
language: system
61+
files: \.(js|ts|tsx)$
62+
exclude: ^(\node_modules/)
63+
pass_filenames: false
6464

65-
# Rust specific hooks
66-
- repo: local
67-
hooks:
68-
- id: cargo-fmt
69-
name: cargo fmt
70-
entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt'
71-
language: system
72-
files: \.rs$
73-
pass_filenames: false
74-
- id: cargo-check
75-
name: cargo check
76-
entry: bash -c 'cd candle-binding && cargo check'
77-
language: system
78-
files: \.rs$
79-
pass_filenames: false
65+
# Rust specific hooks
66+
- repo: local
67+
hooks:
68+
- id: cargo-fmt
69+
name: cargo fmt
70+
entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt'
71+
language: system
72+
files: \.rs$
73+
pass_filenames: false
74+
- id: cargo-check
75+
name: cargo check
76+
entry: bash -c 'cd candle-binding && cargo check'
77+
language: system
78+
files: \.rs$
79+
pass_filenames: false
8080

81-
# Python specific hooks
82-
- repo: https://github.com/psf/black
83-
rev: 25.1.0
84-
hooks:
85-
- id: black
86-
language_version: python3
87-
files: \.py$
88-
exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/)
89-
90-
- repo: https://github.com/PyCQA/isort
91-
rev: 6.0.1
92-
hooks:
93-
- id: isort
94-
args: ["--profile", "black"]
95-
files: \.py$
96-
exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/)
81+
# Python specific hooks
82+
# isort must run before black
83+
- repo: https://github.com/PyCQA/isort
84+
rev: 5.13.2
85+
hooks:
86+
- id: isort
87+
args: ["--profile", "black", "--line-length", "88"]
88+
files: \.py$
89+
exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/)
9790

91+
- repo: https://github.com/psf/black
92+
rev: 25.1.0
93+
hooks:
94+
- id: black
95+
language_version: python3
96+
files: \.py$
97+
exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/)
9898
# Commented out flake8 - only reports issues, doesn't auto-fix
9999
# - repo: https://github.com/PyCQA/flake8
100100
# rev: 7.3.0

config/config-mcp-classifier-example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# BERT model for semantic caching and tool selection
1616
bert_model:
17-
model_id: "sentence-transformers/all-MiniLM-L6-v2"
17+
model_id: models/all-MiniLM-L12-v2
1818
threshold: 0.85
1919
use_cpu: true
2020

config/config.development.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# for local development and debugging.
44

55
bert_model:
6-
model_id: sentence-transformers/all-MiniLM-L12-v2
6+
model_id: models/all-MiniLM-L12-v2
77
threshold: 0.6
88
use_cpu: true
99

config/config.e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
bert_model:
2-
model_id: sentence-transformers/all-MiniLM-L12-v2
2+
model_id: models/all-MiniLM-L12-v2
33
threshold: 0.6
44
use_cpu: true
55
semantic_cache:

config/config.production.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# for production deployment with Jaeger or other OTLP-compatible backends.
44

55
bert_model:
6-
model_id: sentence-transformers/all-MiniLM-L12-v2
6+
model_id: models/all-MiniLM-L12-v2
77
threshold: 0.6
88
use_cpu: true
99

config/config.recipe-accuracy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# - Jailbreak protection enabled
1414

1515
bert_model:
16-
model_id: sentence-transformers/all-MiniLM-L12-v2
16+
model_id: models/all-MiniLM-L12-v2
1717
threshold: 0.7 # Higher threshold for better precision
1818
use_cpu: true
1919

config/config.recipe-latency.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# - Minimal observability overhead
1414

1515
bert_model:
16-
model_id: sentence-transformers/all-MiniLM-L12-v2
16+
model_id: models/all-MiniLM-L12-v2
1717
threshold: 0.4 # Very low threshold for fast matching
1818
use_cpu: true
1919

config/config.recipe-token-efficiency.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# - Larger batch sizes for efficient processing
1414

1515
bert_model:
16-
model_id: sentence-transformers/all-MiniLM-L12-v2
16+
model_id: models/all-MiniLM-L12-v2
1717
threshold: 0.5 # Lower threshold for faster matching
1818
use_cpu: true
1919

0 commit comments

Comments
 (0)