Skip to content

Commit 9d22297

Browse files
authored
Merge branch 'main' into fix-max-token-bench
2 parents d2691a4 + 0a3af6e commit 9d22297

File tree

75 files changed

+3818
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3818
-678
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jobs:
4848
push: ${{ github.event_name != 'pull_request' }} # Only push on merge to main, not on PRs
4949
tags: |
5050
${{ inputs.is_nightly == true && format('ghcr.io/{0}/semantic-router/extproc:nightly-{1}', github.repository_owner, steps.date.outputs.date_tag) || format('ghcr.io/{0}/semantic-router/extproc:{1}', github.repository_owner, github.sha) }}
51-
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/extproc:latest', github.repository_owner) || '' }}
51+
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/extproc:latest', github.repository_owner) || '' }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Issue Manager
2+
3+
permissions: {}
4+
5+
on:
6+
issue_comment:
7+
types:
8+
- created
9+
- edited
10+
11+
jobs:
12+
execute:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
17+
steps:
18+
- uses: jpmcb/prow-github-actions@c44ac3a57d67639e39e4a4988b52049ef45b80dd # v2.0.0
19+
with:
20+
prow-commands: '/assign
21+
/unassign
22+
/lgtm
23+
/approve
24+
/area
25+
/priority
26+
/remove
27+
/close
28+
/reopen
29+
/lock
30+
/milestone
31+
/hold
32+
/cc
33+
/uncc'
34+
github-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/pre-commit.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
sudo apt-get install -y \
4646
make \
4747
build-essential \
48-
pkg-config
48+
pkg-config
4949
npm install -g markdownlint-cli
50-
pip install --user yamllint
50+
pip install --user yamllint codespell
5151
5252
- name: Cache Rust dependencies
5353
uses: actions/cache@v4
@@ -81,28 +81,13 @@ jobs:
8181
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
8282

8383
- name: Install pre-commit
84-
run: pip install pre-commit
84+
run: make precommit-install
8585

86-
- name: Run pre-commit on Go, Rust, JavaScript, Markdown, Yaml and Python files
87-
run: |
88-
# Find all Go, Rust, JavaScripts, Markdown and Python files (excluding vendored/generated code)
89-
FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o -name "*.js" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) \
90-
! -path "./target/*" \
91-
! -path "./candle-binding/target/*" \
92-
! -path "./.git/*" \
93-
! -path "./node_modules/*" \
94-
! -path "./vendor/*" \
95-
! -path "./__pycache__/*" \
96-
! -path "./site/*" \
97-
! -name "*.pb.go" \
98-
| tr '\n' ' ')
99-
100-
if [ -n "$FILES" ]; then
101-
echo "Running pre-commit on files: $FILES"
102-
pre-commit run --files $FILES
103-
else
104-
echo "No Go, Rust, JavaScript, Markdown, Yaml, or Python files found to check"
105-
fi
86+
- name: Run Code Spell Check
87+
run: make codespell
88+
89+
- name: Run pre-commit check
90+
run: make precommit-check
10691

10792
- name: Show pre-commit results
10893
if: failure()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create and publish Precommit Image
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
paths:
8+
- 'Dockerfile.precommit'
9+
10+
jobs:
11+
build_and_push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Generate date tag for nightly builds
29+
id: date
30+
if: inputs.is_nightly == true
31+
run: echo "date_tag=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
32+
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
file: ./Dockerfile.precommit
38+
push: ${{ github.event_name != 'pull_request' }} # Only push on merge to main, not on PRs
39+
tags: |
40+
${{ inputs.is_nightly != true && format('ghcr.io/{0}/semantic-router/precommit:latest', github.repository_owner) || '' }}

.prowlabels.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
area:
2+
- core
3+
- research
4+
- observability
5+
- networking
6+
- bench
7+
- environment
8+
- user-experience
9+
- docs
10+
- test-and-release
11+
12+
priority:
13+
- P0
14+
- P1
15+
- P2

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ The test suite includes:
205205
- **Envoy logs:** Check the terminal running `make run-envoy` for detailed request/response logs
206206
- **Router logs:** Check the terminal running `make run-router` for classification and routing decisions
207207
- **Rust library:** Use `RUST_LOG=debug` environment variable for detailed Rust logs
208+
- **Go library:** Use `SR_LOG_LEVEL=debug` environment variable for detailed Go logs
208209

209210
## Code Style and Standards
210211

Dockerfile.extproc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
1111
WORKDIR /app
1212

1313
# Copy only essential files for Rust build
14+
COPY tools/make/ tools/make/
1415
COPY Makefile ./
1516
COPY candle-binding/Cargo.toml candle-binding/
1617
COPY candle-binding/src/ candle-binding/src/
@@ -54,4 +55,4 @@ ENV LD_LIBRARY_PATH=/app/lib
5455

5556
EXPOSE 50051
5657

57-
CMD ["/app/extproc-server", "--config", "/app/config/config.yaml"]
58+
CMD ["/app/extproc-server", "--config", "/app/config/config.yaml"]

Dockerfile.precommit

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM golang:1.24
2+
3+
# Install Base env
4+
RUN apt-get update && apt-get install -y \
5+
make \
6+
build-essential \
7+
pkg-config \
8+
python3 \
9+
python3-pip
10+
11+
# Install Node.js and npm
12+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
13+
apt-get install -y nodejs
14+
15+
# Install Rust
16+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
17+
. $HOME/.cargo/env
18+
19+
# Markdown
20+
RUN npm install -g markdownlint-cli
21+
22+
# Install pre-commit and tools
23+
RUN pip install --break-system-packages pre-commit
24+
25+
# Yamllint
26+
RUN pip install --break-system-packages yamllint
27+
28+
# CodeSpell
29+
RUN pip install --break-system-packages codespell

0 commit comments

Comments
 (0)