mirror of
https://github.com/Mesh-LLM/mesh-llm.git
synced 2026-08-08 22:23:19 -04:00
fix(ci): unblock prerelease SDK producers (#1124)
* fix(ci): unblock prerelease SDK producers * test(ci): pin SDK producer regression contracts
This commit is contained in:
parent
265afa90bb
commit
851888d0b0
6 changed files with 58 additions and 9 deletions
3
.github/workflows/native-sdk-artifact.yml
vendored
3
.github/workflows/native-sdk-artifact.yml
vendored
|
|
@ -187,6 +187,9 @@ jobs:
|
|||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Trust checkout directory
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- name: Validate release preparation inputs
|
||||
env:
|
||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ jobs:
|
|||
(cd "$smoke_root/consumer" && npm init --yes >/dev/null && npm install "$tarball")
|
||||
node - "$smoke_root/consumer" "$expected_version" <<'NODE'
|
||||
const [root, expected] = process.argv.slice(2)
|
||||
const sdk = require(root)
|
||||
const sdk = require(require.resolve("@mesh-llm/sdk", { paths: [root] }))
|
||||
const actual = sdk.currentMeshVersion()
|
||||
if (actual !== expected) {
|
||||
throw new Error(`native addon version mismatch: expected ${expected}, got ${actual}`)
|
||||
|
|
@ -244,7 +244,7 @@ jobs:
|
|||
(cd "$smoke_root/consumer" && npm init --yes >/dev/null && npm install "$tarball")
|
||||
node - "$smoke_root/consumer" "$expected_version" <<'NODE'
|
||||
const [root, expected] = process.argv.slice(2)
|
||||
const sdk = require(root)
|
||||
const sdk = require(require.resolve("@mesh-llm/sdk", { paths: [root] }))
|
||||
const actual = sdk.currentMeshVersion()
|
||||
if (actual !== expected) {
|
||||
throw new Error(`native addon version mismatch: expected ${expected}, got ${actual}`)
|
||||
|
|
@ -338,7 +338,7 @@ jobs:
|
|||
(cd "$smoke_root/consumer" && npm init --yes >/dev/null && npm install "$tarball")
|
||||
node - "$smoke_root/consumer" "$expected_version" <<'NODE'
|
||||
const [root, expected] = process.argv.slice(2)
|
||||
const sdk = require(root)
|
||||
const sdk = require(require.resolve("@mesh-llm/sdk", { paths: [root] }))
|
||||
const actual = sdk.currentMeshVersion()
|
||||
if (actual !== expected) {
|
||||
throw new Error(`native addon version mismatch: expected ${expected}, got ${actual}`)
|
||||
|
|
|
|||
|
|
@ -252,14 +252,17 @@ fi
|
|||
if [[ "$BUILD" == "1" ]]; then
|
||||
"$SCRIPT_DIR/prepare-llama.sh" "${MESH_LLM_LLAMA_PIN_SHA:-pinned}"
|
||||
llama_build_dir="$LLAMA_STAGE_BUILD_DIR"
|
||||
build_args=()
|
||||
if [[ "$REQUIRE_PREBUILT_LLAMA" == "1" ]]; then
|
||||
build_args+=(--require-existing)
|
||||
LLAMA_STAGE_BACKEND="$(build_backend)" \
|
||||
LLAMA_BUILD_DIR="$llama_build_dir" \
|
||||
LLAMA_STAGE_BUILD_DIR="$llama_build_dir" \
|
||||
"$SCRIPT_DIR/build-llama.sh" --require-existing
|
||||
else
|
||||
LLAMA_STAGE_BACKEND="$(build_backend)" \
|
||||
LLAMA_BUILD_DIR="$llama_build_dir" \
|
||||
LLAMA_STAGE_BUILD_DIR="$llama_build_dir" \
|
||||
"$SCRIPT_DIR/build-llama.sh"
|
||||
fi
|
||||
LLAMA_STAGE_BACKEND="$(build_backend)" \
|
||||
LLAMA_BUILD_DIR="$llama_build_dir" \
|
||||
LLAMA_STAGE_BUILD_DIR="$llama_build_dir" \
|
||||
"$SCRIPT_DIR/build-llama.sh" "${build_args[@]}"
|
||||
|
||||
cargo_args=(build -p mesh-llm-ffi --no-default-features --features "host,embedded-runtime")
|
||||
if [[ "$PROFILE" == "release" ]]; then
|
||||
|
|
|
|||
|
|
@ -777,6 +777,23 @@ class CiArtifactActionTests(unittest.TestCase):
|
|||
"${{ inputs.static_abi_artifact_name != '' }}",
|
||||
producer,
|
||||
)
|
||||
linux_start = producer.index(" linux_native_sdk_artifact:")
|
||||
linux_end = producer.index(" macos_native_sdk_artifact:")
|
||||
linux_producer = producer[linux_start:linux_end]
|
||||
trust_step = (
|
||||
'name: Trust checkout directory\n'
|
||||
' run: git config --global --add safe.directory '
|
||||
'"$GITHUB_WORKSPACE"'
|
||||
)
|
||||
self.assertIn(trust_step, linux_producer)
|
||||
self.assertLess(
|
||||
linux_producer.index("uses: actions/checkout@"),
|
||||
linux_producer.index(trust_step),
|
||||
)
|
||||
self.assertLess(
|
||||
linux_producer.index(trust_step),
|
||||
linux_producer.index("name: Prepare dispatched release version"),
|
||||
)
|
||||
self.assertIn("scripts/package-native-sdk.sh", producer_action)
|
||||
self.assertIn("--build", producer_action)
|
||||
self.assertIn("--require-prebuilt-llama", producer_action)
|
||||
|
|
|
|||
|
|
@ -595,6 +595,13 @@ class ReleaseNodeAddonArtifactTests(unittest.TestCase):
|
|||
)
|
||||
self.assertIn("currentMeshVersion()", self.producer)
|
||||
self.assertIn("npm pack", self.producer)
|
||||
self.assertEqual(
|
||||
self.producer.count(
|
||||
'require.resolve("@mesh-llm/sdk", { paths: [root] })'
|
||||
),
|
||||
3,
|
||||
)
|
||||
self.assertNotIn("const sdk = require(root)", self.producer)
|
||||
self.assertIn("$output_root/$archive.sha256", self.producer)
|
||||
self.assertIn(
|
||||
"ghcr.io/mesh-llm/mesh-llm-cuda-runner@sha256:",
|
||||
|
|
|
|||
|
|
@ -73,6 +73,25 @@ class StaticAbiArtifactTests(unittest.TestCase):
|
|||
):
|
||||
self.assertIn(archive, build_script)
|
||||
self.assertIn("--require-prebuilt-llama", package_script)
|
||||
self.assertNotIn("build_args=()", package_script)
|
||||
build_section = package_script.split(
|
||||
'if [[ "$BUILD" == "1" ]]; then',
|
||||
maxsplit=1,
|
||||
)[1].split(" cargo_args=", maxsplit=1)[0]
|
||||
prebuilt_branch, normal_branch = build_section.split(
|
||||
" else\n",
|
||||
maxsplit=1,
|
||||
)
|
||||
self.assertIn(
|
||||
'if [[ "$REQUIRE_PREBUILT_LLAMA" == "1" ]]; then',
|
||||
prebuilt_branch,
|
||||
)
|
||||
self.assertIn(
|
||||
'"$SCRIPT_DIR/build-llama.sh" --require-existing',
|
||||
prebuilt_branch,
|
||||
)
|
||||
self.assertIn('"$SCRIPT_DIR/build-llama.sh"', normal_branch)
|
||||
self.assertNotIn("--require-existing", normal_branch)
|
||||
self.assertIn("SKIPPY_LLAMA_AUTO_BUILD=0", package_script)
|
||||
self.assertIn("MESH_LLM_AUTO_BUILD_LLAMA=0", package_script)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue