Skip to content

Commit 9bc5be1

Browse files
authored
Merge pull request opendatahub-io#2 from zdtsw-forking/sync_llmd
[sync]: change from upstream main
2 parents 5034c5f + b58db1a commit 9bc5be1

File tree

105 files changed

+8892
-904
lines changed

Some content is hidden

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

105 files changed

+8892
-904
lines changed

.git-blame-ignore-revs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Commits to ignore in git blame
2+
3+
# 2026-02-26 Remove services/ exclusion from pre-commit checks (#362)
4+
e5338a369bacd92f27379edd2933660a7ecbd8d9
5+
6+
# 2026-02-24 build: Add pre-commit checks to CI (#342)
7+
10df45fa8bd0ab58ca8f246a540bafb0049f142d

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
2+
.github/workflows/*.campaign.g.md linguist-generated=true merge=ours

.github/actions/docker-build-and-push/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
required: false
2222
description: Path to Dockerfile relative to context (defaults to Dockerfile in context)
2323
default: ''
24+
platform:
25+
required: false
26+
description: Target platform(s) for build (e.g., linux/amd64, linux/amd64,linux/arm64)
27+
default: 'linux/amd64'
2428
runs:
2529
using: "composite"
2630
steps:
@@ -32,6 +36,7 @@ runs:
3236
shell: bash
3337
env:
3438
GITHUB_TOKEN: ${{ inputs.github-token }}
39+
GITHUB_ACTOR: ${{ github.actor }}
3540

3641
- name: Print image info
3742
run: |
@@ -51,7 +56,7 @@ runs:
5156
DOCKERFILE_ARG="-f ${DOCKERFILE}"
5257
fi
5358
docker buildx build \
54-
--platform linux/amd64 \
59+
--platform ${PLATFORM} \
5560
${DOCKERFILE_ARG} \
5661
-t "${REGISTRY}/${IMAGE_NAME}:${TAG}" \
5762
--push "${CONTEXT}"
@@ -62,3 +67,4 @@ runs:
6267
IMAGE_NAME: ${{ inputs.image-name }}
6368
TAG: ${{ inputs.tag }}
6469
CONTEXT: ${{ inputs.context }}
70+
PLATFORM: ${{ inputs.platform }}

.github/mergify.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pull_request_rules:
2+
- name: comment-pre-commit-failure
3+
description: Comment on PR when pre-commit check fails
4+
conditions:
5+
- check-failure=Run pre-commit hooks
6+
- -closed
7+
- -draft
8+
actions:
9+
comment:
10+
message: |
11+
Hi @{{author}}, the pre-commit checks have failed. Please run:
12+
13+
```bash
14+
uv pip install pre-commit
15+
pre-commit install
16+
pre-commit run --all-files
17+
```
18+
19+
Then, commit the changes and push to your branch.
20+
21+
For future commits, `pre-commit` will run automatically on changed files before each commit.
22+

.github/workflows/auto-assign.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- name: Auto assign reviewers
2121
env:

.github/workflows/check-typos.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/ci-examples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout source
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v6
1414

1515
- name: Cache system (apt) dependencies
1616
uses: actions/cache@v4

.github/workflows/ci-pr-checks.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout source
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515

1616
- name: Cache system (apt) dependencies
1717
uses: actions/cache@v4
@@ -34,7 +34,7 @@ jobs:
3434
run: ls -la
3535

3636
- name: Extract Go version from go.mod
37-
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
37+
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> "$GITHUB_ENV"
3838

3939
- name: Set up Go with cache
4040
uses: actions/setup-go@v5
@@ -62,6 +62,12 @@ jobs:
6262
go mod download
6363
make install-python-deps
6464
65+
- name: Run pre-commit hooks
66+
id: pre-commit
67+
uses: pre-commit/action@v3.0.1
68+
with:
69+
extra_args: --all-files --hook-stage manual
70+
6571
- name: Install golangci-lint without running it
6672
uses: golangci/golangci-lint-action@v8
6773
with:
@@ -72,8 +78,10 @@ jobs:
7278
run: |
7379
# Export the CGO flags required for the linter to parse CGo files.
7480
# This duplicates some logic from the Makefile but is necessary for the CI step.
75-
export CGO_CFLAGS="$(python3.12-config --cflags)"
76-
export CGO_LDFLAGS="$(python3.12-config --ldflags --embed) -ldl -lm"
81+
CGO_CFLAGS="$(python3.12-config --cflags)"
82+
CGO_LDFLAGS="$(python3.12-config --ldflags --embed) -ldl -lm"
83+
export CGO_CFLAGS
84+
export CGO_LDFLAGS
7785
export CGO_ENABLED=1
7886
7987
# Now run the linting command from the Makefile

.github/workflows/ci-release-uds-tokenizer.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,19 @@ jobs:
3737
fi
3838
shell: bash
3939

40-
- name: Build UDS tokenizer image
41-
run: |
42-
PUSH_ARG=""
43-
if [[ "${{ github.event_name }}" == "push" ]]; then
44-
PUSH_ARG="--push"
45-
fi
46-
docker buildx build \
47-
--platform linux/amd64 \
48-
-t ${{ steps.tag.outputs.image }} \
49-
${PUSH_ARG} \
50-
-f services/uds_tokenizer/Dockerfile \
51-
services/uds_tokenizer
52-
shell: bash
40+
- name: Build and push UDS tokenizer image
41+
uses: ./.github/actions/docker-build-and-push
42+
with:
43+
tag: ${{ steps.tag.outputs.tag }}
44+
image-name: llm-d-uds-tokenizer
45+
registry: ghcr.io/${{ github.repository_owner }}
46+
github-token: ${{ secrets.GHCR_TOKEN }}
47+
context: services/uds_tokenizer
48+
dockerfile: services/uds_tokenizer/Dockerfile
49+
platform: linux/amd64,linux/arm64
5350

5451
- name: Run Trivy scan
5552
if: github.event_name == 'push'
5653
uses: ./.github/actions/trivy-scan
5754
with:
58-
image: ${{ steps.tag.outputs.image }}
55+
image: ghcr.io/${{ github.repository_owner }}/llm-d-uds-tokenizer:${{ steps.tag.outputs.tag }}

.github/workflows/ci-release.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout source
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616

1717
- name: Set project name from repository
1818
id: version
@@ -40,10 +40,11 @@ jobs:
4040
with:
4141
tag: ${{ steps.tag.outputs.tag }}
4242
image-name: ${{ steps.version.outputs.project_name }}
43-
registry: ghcr.io/llm-d
43+
registry: ghcr.io/${{ github.repository_owner }}
4444
github-token: ${{ secrets.GHCR_TOKEN }}
45+
platform: linux/amd64,linux/arm64
4546

4647
- name: Run Trivy scan
4748
uses: ./.github/actions/trivy-scan
4849
with:
49-
image: ghcr.io/llm-d/${{ steps.version.outputs.project_name }}:${{ steps.tag.outputs.tag }}
50+
image: ghcr.io/${{ github.repository_owner }}/${{ steps.version.outputs.project_name }}:${{ steps.tag.outputs.tag }}

0 commit comments

Comments
 (0)