mirror of
https://github.com/perstarkse/minne.git
synced 2026-06-17 20:19:31 +02:00
chore: bump to 1.0.3 and harmonize onnx runtime version across nix, ci, and docker.
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
- name: Prepare lib dir
|
||||
run: mkdir -p lib
|
||||
|
||||
# Linux
|
||||
- name: Fetch ONNX Runtime (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
set -euo pipefail
|
||||
ARCH="$(uname -m)"
|
||||
case "$ARCH" in
|
||||
x86_64) URL="https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VER}/onnxruntime-linux-x64-${ORT_VER}.tgz" ;;
|
||||
aarch64) URL="https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VER}/onnxruntime-linux-aarch64-${ORT_VER}.tgz" ;;
|
||||
*) echo "Unsupported arch $ARCH"; exit 1 ;;
|
||||
esac
|
||||
curl -fsSL -o ort.tgz "$URL"
|
||||
tar -xzf ort.tgz
|
||||
cp -v onnxruntime-*/lib/libonnxruntime.so* lib/
|
||||
|
||||
# macOS
|
||||
- name: Fetch ONNX Runtime (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
set -euo pipefail
|
||||
curl -fsSL -o ort.tgz "https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VER}/onnxruntime-osx-universal2-${ORT_VER}.tgz"
|
||||
tar -xzf ort.tgz
|
||||
# copy the main dylib; rename to stable name if needed
|
||||
cp -v onnxruntime-*/lib/libonnxruntime*.dylib lib/
|
||||
# optional: ensure a stable name
|
||||
if [ ! -f lib/libonnxruntime.dylib ]; then
|
||||
cp -v lib/libonnxruntime*.dylib lib/libonnxruntime.dylib
|
||||
fi
|
||||
|
||||
# Windows
|
||||
- name: Fetch ONNX Runtime (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
$url = "https://github.com/microsoft/onnxruntime/releases/download/v$env:ORT_VER/onnxruntime-win-x64-$env:ORT_VER.zip"
|
||||
Invoke-WebRequest $url -OutFile ort.zip
|
||||
Expand-Archive ort.zip -DestinationPath ort
|
||||
$dll = Get-ChildItem -Recurse -Path ort -Filter onnxruntime.dll | Select-Object -First 1
|
||||
Copy-Item $dll.FullName lib\onnxruntime.dll
|
||||
|
||||
@@ -24,9 +24,18 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
|
||||
- name: Verify ort-version matches nixpkgs onnxruntime
|
||||
run: nix flake check --system x86_64-linux -L
|
||||
|
||||
- name: Install dist
|
||||
shell: bash
|
||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.0/cargo-dist-installer.sh | sh"
|
||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
|
||||
|
||||
- name: Cache dist
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -67,6 +76,9 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Load ONNX Runtime version
|
||||
run: echo "ORT_VER=$(tr -d '[:space:]' < ort-version)" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install Rust non-interactively if not already installed
|
||||
if: ${{ matrix.container }}
|
||||
run: |
|
||||
@@ -107,8 +119,6 @@ jobs:
|
||||
|
||||
- name: Fetch ONNX Runtime (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
set -euo pipefail
|
||||
ARCH="$(uname -m)"
|
||||
@@ -125,8 +135,6 @@ jobs:
|
||||
|
||||
- name: Fetch ONNX Runtime (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
set -euo pipefail
|
||||
curl -fsSL -o ort.tgz "https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VER}/onnxruntime-osx-universal2-${ORT_VER}.tgz"
|
||||
@@ -137,8 +145,6 @@ jobs:
|
||||
- name: Fetch ONNX Runtime (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
env:
|
||||
ORT_VER: 1.22.0
|
||||
run: |
|
||||
$url = "https://github.com/microsoft/onnxruntime/releases/download/v$env:ORT_VER/onnxruntime-win-x64-$env:ORT_VER.zip"
|
||||
Invoke-WebRequest $url -OutFile ort.zip
|
||||
|
||||
Generated
+1
-1
@@ -3832,7 +3832,7 @@ checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30"
|
||||
|
||||
[[package]]
|
||||
name = "main"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"api-router",
|
||||
|
||||
+5
-3
@@ -30,9 +30,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libgomp1 libstdc++6 curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ONNX Runtime (CPU). Keep in sync with ort crate requirements.
|
||||
ARG ORT_VERSION=1.23.2
|
||||
RUN mkdir -p /opt/onnxruntime && \
|
||||
# ONNX Runtime (CPU). Version is read from ort-version (override with --build-arg ORT_VERSION=...).
|
||||
COPY ort-version /tmp/ort-version
|
||||
ARG ORT_VERSION
|
||||
RUN ORT_VERSION="${ORT_VERSION:-$(tr -d '[:space:]' < /tmp/ort-version)}" && \
|
||||
mkdir -p /opt/onnxruntime && \
|
||||
curl -fsSL -o /tmp/ort.tgz \
|
||||
"https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-${ORT_VERSION}.tgz" && \
|
||||
tar -xzf /tmp/ort.tgz -C /opt/onnxruntime --strip-components=1 && rm /tmp/ort.tgz
|
||||
|
||||
+7
-1
@@ -4,7 +4,13 @@
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
let
|
||||
ortVersion = lib.removeSuffix "\n" (builtins.readFile "${toString ./.}/ort-version");
|
||||
in
|
||||
lib.assertMsg (pkgs.onnxruntime.version == ortVersion)
|
||||
"pkgs.onnxruntime.version (${pkgs.onnxruntime.version}) must match ort-version (${ortVersion})"
|
||||
{
|
||||
cachix.enable = false;
|
||||
|
||||
packages = [
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ members = ["cargo:."]
|
||||
# Config for 'dist'
|
||||
[dist]
|
||||
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
|
||||
cargo-dist-version = "0.30.0"
|
||||
cargo-dist-version = "0.30.3"
|
||||
# CI backends to support
|
||||
ci = "github"
|
||||
# Extra static files to include in each App (path relative to this Cargo.toml's dir)
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
crane,
|
||||
}:
|
||||
}: let
|
||||
inherit (nixpkgs.legacyPackages.x86_64-linux) lib;
|
||||
ortVersion = lib.removeSuffix "\n" (builtins.readFile "${self}/ort-version");
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
lib = pkgs.lib;
|
||||
@@ -21,7 +24,9 @@
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "dylib"
|
||||
else "so";
|
||||
minne-pkg = craneLib.buildPackage {
|
||||
minne-pkg =
|
||||
if pkgs.onnxruntime.version == ortVersion then
|
||||
craneLib.buildPackage {
|
||||
src = lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
filter = let
|
||||
@@ -40,7 +45,7 @@
|
||||
};
|
||||
|
||||
pname = "minne";
|
||||
version = "0.2.6";
|
||||
version = "1.0.3";
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = [pkgs.pkg-config pkgs.rustfmt pkgs.makeWrapper];
|
||||
@@ -58,7 +63,9 @@
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
else
|
||||
throw "pkgs.onnxruntime.version (${pkgs.onnxruntime.version}) must match ort-version (${ortVersion})";
|
||||
in {
|
||||
packages = {
|
||||
minne-pkg = minne-pkg;
|
||||
@@ -82,5 +89,17 @@
|
||||
name = "main";
|
||||
};
|
||||
};
|
||||
});
|
||||
checks = {
|
||||
ortVersion = pkgs.runCommand "ort-version-check" {} ''
|
||||
if [ "${pkgs.onnxruntime.version}" != "${ortVersion}" ]; then
|
||||
echo "pkgs.onnxruntime.version is ${pkgs.onnxruntime.version}, but ort-version pins ${ortVersion}" >&2
|
||||
echo "Update ort-version or wait for nixpkgs to catch up." >&2
|
||||
exit 1
|
||||
fi
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
}) // {
|
||||
ortVersion = ortVersion;
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "main"
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/perstarkse/minne"
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1.23.2
|
||||
Reference in New Issue
Block a user