Skip to content

Commit b98b862

Browse files
authored
Merge release v1.0.10-beta
Release v1.0.10-beta
2 parents 364766b + a1cbffd commit b98b862

945 files changed

Lines changed: 98742 additions & 9777 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.git
22
.github
3-
dist/
3+
dist/*
4+
!dist/docker-packages/
5+
!dist/docker-packages/**
46
compat-artifacts/
57
.cache/
68
benchmarks/results

.github/workflows/ci.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ jobs:
6262
fail-fast: false
6363
matrix:
6464
include:
65-
- runner: ubuntu-24.04
65+
- runner: king
6666
arch-label: linux-amd64
67+
local-lsquic-cache-dir: /opt/king/cache/lsquic/runtime
6768
- runner: ubuntu-24.04-arm
6869
arch-label: linux-arm64
70+
local-lsquic-cache-dir: ""
6971

7072
steps:
7173
- name: Checkout repository
@@ -74,8 +76,17 @@ jobs:
7476
- name: Install system dependencies
7577
run: bash ./infra/scripts/install-ci-system-dependencies.sh
7678

79+
- name: Restore local pinned LSQUIC runtime cache
80+
id: restore-local-lsquic-runtime-cache
81+
if: matrix.local-lsquic-cache-dir != ''
82+
env:
83+
KING_CI_LOCAL_LSQUIC_CACHE_DIR: ${{ matrix.local-lsquic-cache-dir }}
84+
KING_LSQUIC_RUNTIME_PREFIX: ${{ github.workspace }}/.cache/king/lsquic/runtime/prefix
85+
run: bash ./infra/scripts/local-lsquic-runtime-cache.sh restore --github-output "${GITHUB_OUTPUT}"
86+
7787
- name: Restore pinned LSQUIC runtime cache
7888
id: restore-lsquic-runtime-cache
89+
if: steps.restore-local-lsquic-runtime-cache.outputs.cache-hit != 'true'
7990
uses: actions/cache/restore@v5
8091
with:
8192
path: .cache/king/lsquic/runtime/prefix
@@ -86,8 +97,7 @@ jobs:
8697
env:
8798
KING_LSQUIC_RUNTIME_PREFIX: ${{ github.workspace }}/.cache/king/lsquic/runtime/prefix
8899
run: |
89-
if [[ "${{ steps.restore-lsquic-runtime-cache.outputs.cache-hit }}" == "true" ]] \
90-
&& bash ./infra/scripts/build-lsquic-runtime.sh --verify-current; then
100+
if bash ./infra/scripts/build-lsquic-runtime.sh --verify-current; then
91101
echo "cache-current=true" >> "${GITHUB_OUTPUT}"
92102
exit 0
93103
fi
@@ -100,6 +110,13 @@ jobs:
100110
KING_LSQUIC_RUNTIME_PREFIX: ${{ github.workspace }}/.cache/king/lsquic/runtime/prefix
101111
run: bash ./infra/scripts/build-lsquic-runtime.sh
102112

113+
- name: Save local pinned LSQUIC runtime cache
114+
if: matrix.local-lsquic-cache-dir != '' && steps.restore-local-lsquic-runtime-cache.outputs.cache-hit != 'true'
115+
env:
116+
KING_CI_LOCAL_LSQUIC_CACHE_DIR: ${{ matrix.local-lsquic-cache-dir }}
117+
KING_LSQUIC_RUNTIME_PREFIX: ${{ github.workspace }}/.cache/king/lsquic/runtime/prefix
118+
run: bash ./infra/scripts/local-lsquic-runtime-cache.sh save
119+
103120
- name: Save pinned LSQUIC runtime cache
104121
if: steps.verify-lsquic-runtime-cache.outputs.cache-current != 'true'
105122
uses: actions/cache/save@v5
@@ -187,6 +204,11 @@ jobs:
187204
working-directory: extension
188205
run: ../infra/scripts/check-stub-parity.sh
189206

207+
- name: Run model-optional inference verification matrix
208+
if: matrix.shard-index == 1
209+
working-directory: extension
210+
run: ../bin/king-inference-verify-matrix --json
211+
190212
- name: Run canonical PHPT suite
191213
working-directory: extension
192214
env:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: King Local Inference Runner
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- main
10+
types:
11+
- opened
12+
- synchronize
13+
- reopened
14+
workflow_dispatch:
15+
16+
concurrency:
17+
group: king-local-inference-runner-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
env:
24+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
25+
KING_CI_LOCAL_INFERENCE_MODEL_DIR: /opt/king/cache/inference-models
26+
KING_CI_LOCAL_LSQUIC_CACHE_DIR: /opt/king/cache/lsquic/runtime
27+
28+
jobs:
29+
local-inference-runner:
30+
name: Local inference cache readiness
31+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
32+
runs-on: king
33+
timeout-minutes: 10
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v6
38+
39+
- name: Resolve local GGUF inference model cache
40+
id: inference-model
41+
run: bash ./infra/scripts/local-inference-model-cache.sh resolve --require --github-output "${GITHUB_OUTPUT}"
42+
43+
- name: Export local inference model path
44+
env:
45+
MODEL_PRESENT: ${{ steps.inference-model.outputs.model-present }}
46+
MODEL_PATH: ${{ steps.inference-model.outputs.model-realpath }}
47+
run: |
48+
test "${MODEL_PRESENT}" = "true"
49+
test -r "${MODEL_PATH}"
50+
printf 'KING_INFERENCE_TEST_MODEL_PATH=%s\n' "${MODEL_PATH}" >> "${GITHUB_ENV}"
51+
printf 'KING_INFERENCE_CPU_TEST_MODEL_PATH=%s\n' "${MODEL_PATH}" >> "${GITHUB_ENV}"
52+
53+
- name: Verify heavy native dependency cache hook
54+
run: |
55+
test -x ./infra/scripts/local-lsquic-runtime-cache.sh
56+
test -n "${KING_CI_LOCAL_LSQUIC_CACHE_DIR}"
57+
58+
- name: Verify no public inference port is exposed
59+
run: bash ./infra/scripts/check-inference-port-exposure.sh --ports 8080,18129

.github/workflows/release-merge-publish.yml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
REGISTRY: ghcr.io
2222
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
2323
PHP_BASE_MAX_AGE_DAYS: "14"
24+
KING_CI_LOCAL_DOCKER_BUILDX_CACHE_DIR: /opt/king/cache/docker/buildx
2425

2526
jobs:
2627
resolve-release-merge:
@@ -158,6 +159,13 @@ jobs:
158159
- name: Set up Docker Buildx
159160
uses: docker/setup-buildx-action@v4
160161

162+
- name: Resolve Docker Buildx cache
163+
id: base-buildx-cache
164+
run: |
165+
bash ./infra/scripts/resolve-docker-buildx-cache.sh \
166+
--scope "php-base-${{ matrix.php-version }}" \
167+
--github-output "${GITHUB_OUTPUT}"
168+
161169
- name: Log in to Container Registry
162170
uses: docker/login-action@v4
163171
with:
@@ -251,11 +259,18 @@ jobs:
251259
push: true
252260
tags: ${{ steps.meta-base.outputs.ref }}
253261
labels: ${{ steps.meta-base.outputs.labels }}
254-
cache-from: type=gha
255-
cache-to: type=gha,mode=max
262+
cache-from: ${{ steps.base-buildx-cache.outputs.cache-from }}
263+
cache-to: ${{ steps.base-buildx-cache.outputs.cache-to }}
256264
build-args: |
257265
PHP_VERSION=${{ matrix.php-version }}
258266
267+
- name: Commit local Docker Buildx cache
268+
if: steps.decide-base.outputs.rebuild == 'true' && steps.base-buildx-cache.outputs.use-local-cache == 'true'
269+
run: |
270+
bash ./infra/scripts/commit-docker-buildx-cache.sh \
271+
--cache-dir "${{ steps.base-buildx-cache.outputs.local-cache-dir }}" \
272+
--next-dir "${{ steps.base-buildx-cache.outputs.local-cache-next-dir }}"
273+
259274
build-release-packages:
260275
name: Build release artifacts for ${{ matrix.php-version }} / ${{ matrix.arch-label }}
261276
needs:
@@ -722,6 +737,13 @@ jobs:
722737
- name: Set up Docker Buildx
723738
uses: docker/setup-buildx-action@v4
724739

740+
- name: Resolve Docker Buildx cache
741+
id: dockerhub-buildx-cache
742+
run: |
743+
bash ./infra/scripts/resolve-docker-buildx-cache.sh \
744+
--scope "dockerhub-runtime-php8.5" \
745+
--github-output "${GITHUB_OUTPUT}"
746+
725747
- name: Log in to Docker Hub
726748
uses: docker/login-action@v4
727749
with:
@@ -744,14 +766,21 @@ jobs:
744766
push: true
745767
tags: ${{ steps.meta-dockerhub.outputs.tags }}
746768
labels: ${{ steps.meta-dockerhub.outputs.labels }}
747-
cache-from: type=gha
748-
cache-to: type=gha,mode=max
769+
cache-from: ${{ steps.dockerhub-buildx-cache.outputs.cache-from }}
770+
cache-to: ${{ steps.dockerhub-buildx-cache.outputs.cache-to }}
749771
build-args: |
750772
PHP_VERSION=8.5
751773
PHP_BASE_IMAGE=${{ steps.meta-dockerhub.outputs.php_base_image }}
752774
BUILD_DATE=${{ steps.meta-dockerhub.outputs.created_at }}
753775
VCS_REF=${{ needs.resolve-release-merge.outputs.release-commit }}
754776
777+
- name: Commit local Docker Buildx cache
778+
if: steps.dockerhub-buildx-cache.outputs.use-local-cache == 'true'
779+
run: |
780+
bash ./infra/scripts/commit-docker-buildx-cache.sh \
781+
--cache-dir "${{ steps.dockerhub-buildx-cache.outputs.local-cache-dir }}" \
782+
--next-dir "${{ steps.dockerhub-buildx-cache.outputs.local-cache-next-dir }}"
783+
755784
- name: Generate Docker Hub runtime CVE inventory
756785
id: dockerhub-cve-inventory
757786
run: |
@@ -867,6 +896,13 @@ jobs:
867896
- name: Set up Docker Buildx
868897
uses: docker/setup-buildx-action@v4
869898

899+
- name: Resolve Docker Buildx cache
900+
id: runtime-buildx-cache
901+
run: |
902+
bash ./infra/scripts/resolve-docker-buildx-cache.sh \
903+
--scope "runtime-php${{ matrix.php-version }}" \
904+
--github-output "${GITHUB_OUTPUT}"
905+
870906
- name: Log in to Container Registry
871907
uses: docker/login-action@v4
872908
with:
@@ -883,10 +919,17 @@ jobs:
883919
push: true
884920
tags: ${{ steps.meta.outputs.tags }}
885921
labels: ${{ steps.meta.outputs.labels }}
886-
cache-from: type=gha
887-
cache-to: type=gha,mode=max
922+
cache-from: ${{ steps.runtime-buildx-cache.outputs.cache-from }}
923+
cache-to: ${{ steps.runtime-buildx-cache.outputs.cache-to }}
888924
build-args: |
889925
PHP_VERSION=${{ matrix.php-version }}
890926
PHP_BASE_IMAGE=${{ steps.meta.outputs.php_base_image }}
891927
BUILD_DATE=${{ steps.meta.outputs.created_at }}
892928
VCS_REF=${{ needs.resolve-release-merge.outputs.release-commit }}
929+
930+
- name: Commit local Docker Buildx cache
931+
if: steps.runtime-buildx-cache.outputs.use-local-cache == 'true'
932+
run: |
933+
bash ./infra/scripts/commit-docker-buildx-cache.sh \
934+
--cache-dir "${{ steps.runtime-buildx-cache.outputs.local-cache-dir }}" \
935+
--next-dir "${{ steps.runtime-buildx-cache.outputs.local-cache-next-dir }}"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ libcurl
22
quiche
33
llama-fork/
44
node_modules
5+
.venv/
56
.cargo/
67

78
# Archived source snapshots
@@ -39,6 +40,7 @@ compat-artifacts/
3940
dist/
4041
!packages/iibin/dist/
4142
!packages/iibin/dist/**
43+
var/
4244
.cache/
4345
.vite/
4446
.codex
@@ -47,6 +49,9 @@ dist/
4749
.env.local
4850
*.env.local
4951

52+
# Local planning notes that are not part of the public docs set.
53+
docs/future-plan.md
54+
5055
# Model weights MUST NEVER be checked in (they are large and provenance
5156
# belongs on a model registry / object store, not in git). Catch-all
5257
# patterns repo-wide — if you actually need a tiny test fixture that

0 commit comments

Comments
 (0)