mirror of
https://github.com/perstarkse/minne.git
synced 2026-07-06 04:45:18 +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:
|
with:
|
||||||
submodules: recursive
|
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
|
- name: Install dist
|
||||||
shell: bash
|
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
|
- name: Cache dist
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -67,6 +76,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
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
|
- name: Install Rust non-interactively if not already installed
|
||||||
if: ${{ matrix.container }}
|
if: ${{ matrix.container }}
|
||||||
run: |
|
run: |
|
||||||
@@ -107,8 +119,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Fetch ONNX Runtime (Linux)
|
- name: Fetch ONNX Runtime (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
env:
|
|
||||||
ORT_VER: 1.22.0
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
@@ -125,8 +135,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Fetch ONNX Runtime (macOS)
|
- name: Fetch ONNX Runtime (macOS)
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
env:
|
|
||||||
ORT_VER: 1.22.0
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
curl -fsSL -o ort.tgz "https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VER}/onnxruntime-osx-universal2-${ORT_VER}.tgz"
|
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)
|
- name: Fetch ONNX Runtime (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
|
||||||
ORT_VER: 1.22.0
|
|
||||||
run: |
|
run: |
|
||||||
$url = "https://github.com/microsoft/onnxruntime/releases/download/v$env:ORT_VER/onnxruntime-win-x64-$env:ORT_VER.zip"
|
$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
|
Invoke-WebRequest $url -OutFile ort.zip
|
||||||
|
|||||||
Generated
+1
-1
@@ -3832,7 +3832,7 @@ checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "main"
|
name = "main"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"api-router",
|
"api-router",
|
||||||
|
|||||||
+5
-3
@@ -30,9 +30,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
libgomp1 libstdc++6 curl \
|
libgomp1 libstdc++6 curl \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# ONNX Runtime (CPU). Keep in sync with ort crate requirements.
|
# ONNX Runtime (CPU). Version is read from ort-version (override with --build-arg ORT_VERSION=...).
|
||||||
ARG ORT_VERSION=1.23.2
|
COPY ort-version /tmp/ort-version
|
||||||
RUN mkdir -p /opt/onnxruntime && \
|
ARG ORT_VERSION
|
||||||
|
RUN ORT_VERSION="${ORT_VERSION:-$(tr -d '[:space:]' < /tmp/ort-version)}" && \
|
||||||
|
mkdir -p /opt/onnxruntime && \
|
||||||
curl -fsSL -o /tmp/ort.tgz \
|
curl -fsSL -o /tmp/ort.tgz \
|
||||||
"https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-${ORT_VERSION}.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
|
tar -xzf /tmp/ort.tgz -C /opt/onnxruntime --strip-components=1 && rm /tmp/ort.tgz
|
||||||
|
|||||||
+7
-1
@@ -4,7 +4,13 @@
|
|||||||
config,
|
config,
|
||||||
inputs,
|
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;
|
cachix.enable = false;
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ members = ["cargo:."]
|
|||||||
# Config for 'dist'
|
# Config for 'dist'
|
||||||
[dist]
|
[dist]
|
||||||
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
|
# 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 backends to support
|
||||||
ci = "github"
|
ci = "github"
|
||||||
# Extra static files to include in each App (path relative to this Cargo.toml's dir)
|
# Extra static files to include in each App (path relative to this Cargo.toml's dir)
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
crane,
|
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
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
@@ -21,7 +24,9 @@
|
|||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin
|
||||||
then "dylib"
|
then "dylib"
|
||||||
else "so";
|
else "so";
|
||||||
minne-pkg = craneLib.buildPackage {
|
minne-pkg =
|
||||||
|
if pkgs.onnxruntime.version == ortVersion then
|
||||||
|
craneLib.buildPackage {
|
||||||
src = lib.cleanSourceWith {
|
src = lib.cleanSourceWith {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
filter = let
|
filter = let
|
||||||
@@ -40,7 +45,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
pname = "minne";
|
pname = "minne";
|
||||||
version = "0.2.6";
|
version = "1.0.3";
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
nativeBuildInputs = [pkgs.pkg-config pkgs.rustfmt pkgs.makeWrapper];
|
nativeBuildInputs = [pkgs.pkg-config pkgs.rustfmt pkgs.makeWrapper];
|
||||||
@@ -58,7 +63,9 @@
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
else
|
||||||
|
throw "pkgs.onnxruntime.version (${pkgs.onnxruntime.version}) must match ort-version (${ortVersion})";
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
minne-pkg = minne-pkg;
|
minne-pkg = minne-pkg;
|
||||||
@@ -82,5 +89,17 @@
|
|||||||
name = "main";
|
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]
|
[package]
|
||||||
name = "main"
|
name = "main"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://github.com/perstarkse/minne"
|
repository = "https://github.com/perstarkse/minne"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
1.23.2
|
||||||
Reference in New Issue
Block a user