Skip to content

Avoid flaky ort downloads in Linux CI#490

Merged
AnthonyRonning merged 1 commit intomasterfrom
fix/linux-onnxruntime-ci
Apr 24, 2026
Merged

Avoid flaky ort downloads in Linux CI#490
AnthonyRonning merged 1 commit intomasterfrom
fix/linux-onnxruntime-ci

Conversation

@AnthonyRonning
Copy link
Copy Markdown
Contributor

@AnthonyRonning AnthonyRonning commented Apr 24, 2026

Summary

  • preload official ONNX Runtime 1.22.0 in Linux desktop CI, release, and rust test workflows
  • export ORT_LIB_LOCATION and ORT_SKIP_DOWNLOAD so ort-sys does not fall back to the flaky Pyke CDN
  • cover PR, master, and release Linux build paths consistently

Validation

  • parsed edited workflow YAML successfully
  • git diff --check
  • pre-commit hook: Prettier check, frontend build, and bun test

Open in Devin Review

Summary by CodeRabbit

  • Chores
    • CI now provisions a pinned ONNX Runtime (v1.22.0) so builds and tests use a consistent runtime artifact.
    • CI jobs are configured to use the provided runtime and avoid redundant runtime downloads, and update the library path accordingly.
    • Linux Tauri builds run in verbose mode, force AppImage extraction/execution, and disable automatic stripping to preserve debug symbols.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f46c0ef8-4c89-4298-bd99-42bff98050d1

📥 Commits

Reviewing files that changed from the base of the PR and between 63c83be and 984a206.

📒 Files selected for processing (3)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
  • .github/workflows/rust-tests.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/rust-tests.yml
  • .github/workflows/release.yml
  • .github/workflows/desktop-build.yml

📝 Walkthrough

Walkthrough

Adds Linux-specific CI steps across three GitHub Actions workflows to download/extract ONNX Runtime v1.22.0, export ORT_LIB_LOCATION, set ORT_SKIP_DOWNLOAD=true, prepend its lib to LD_LIBRARY_PATH, switch Tauri builds to --verbose, and set APPIMAGE_EXTRACT_AND_RUN=1 and NO_STRIP=true for the Ubuntu matrix entry.

Changes

Cohort / File(s) Summary
Workflows: ONNX Runtime setup
\.github/workflows/desktop-build.yml, \.github/workflows/release.yml, \.github/workflows/rust-tests.yml
Add Linux-only steps to download & extract onnxruntime-linux-x64-1.22.0, set ORT_LIB_LOCATION to the extracted lib path, set ORT_SKIP_DOWNLOAD=true, and prepend the runtime lib to LD_LIBRARY_PATH.
Tauri build adjustments
\.github/workflows/desktop-build.yml, \.github/workflows/release.yml
Change Tauri invocation to pass --verbose; for the targeted Ubuntu matrix entry set APPIMAGE_EXTRACT_AND_RUN=1 and NO_STRIP=true in the build environment.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibbled at CI, fetched a runtime with glee,

unpacked the libs so builds run worry-free,
set ORT flags and paths, made logs sing verbose,
AppImage snug, no stripping—oh what a dose! 🎋

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Avoid flaky ort downloads in Linux CI' clearly and concisely describes the main change: preventing unreliable ONNX Runtime downloads by preloading a specific version in Linux CI workflows.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/linux-onnxruntime-ci

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 100-110: Replace the direct curl | tar extraction for
ORT_VERSION/ORT_ROOT with a two-step verified download: first download the
tarball to a local file (using the ORT_VERSION and ORT_ROOT variables), then
verify its SHA256 digest either by running `gh release verify-asset` for the tag
v${ORT_VERSION} or by calling the GitHub Releases API GET
/repos/microsoft/onnxruntime/releases/tags/v{ORT_VERSION} and comparing
assets[].digest to a computed local sha256; only after the digest matches should
you extract into ORT_ROOT and export ORT_LIB_LOCATION and ORT_SKIP_DOWNLOAD into
GITHUB_ENV.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 616ae8f8-cce9-42af-8c93-6f7161c4e9f9

📥 Commits

Reviewing files that changed from the base of the PR and between 04fbc3f and d45ca7b.

📒 Files selected for processing (3)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
  • .github/workflows/rust-tests.yml

Comment on lines +100 to +110
- name: Provide ONNX Runtime (Linux)
if: matrix.platform == 'ubuntu-latest-8-cores'
run: |
ORT_VERSION=1.22.0
ORT_ROOT="$RUNNER_TEMP/onnxruntime"
mkdir -p "$ORT_ROOT"
curl -fL --retry 5 --retry-delay 2 --retry-all-errors \
"https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-${ORT_VERSION}.tgz" \
| tar -xz -C "$ORT_ROOT"
echo "ORT_LIB_LOCATION=$ORT_ROOT/onnxruntime-linux-x64-${ORT_VERSION}" >> "$GITHUB_ENV"
echo "ORT_SKIP_DOWNLOAD=true" >> "$GITHUB_ENV"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether ONNX Runtime download steps currently have checksum validation.
rg -n --iglob '.github/workflows/*.yml' 'Provide ONNX Runtime|onnxruntime-linux-x64-|ORT_SHA256|sha256sum|shasum'

Repository: OpenSecretCloud/Maple

Length of output: 214


🏁 Script executed:

#!/bin/bash
# First, find workflow files in .github/workflows/
fd -e yml -e yaml . .github/workflows/ 2>/dev/null || fd -e yml -e yaml . .github/ 2>/dev/null || find .github -name "*release*" -type f 2>/dev/null

Repository: OpenSecretCloud/Maple

Length of output: 384


🏁 Script executed:

#!/bin/bash
# Read the file to check its size and content around lines 100-110
wc -l .github/workflows/release.yml
echo "---"
# Read lines 95-115 to see context around the specified lines
sed -n '95,115p' .github/workflows/release.yml

Repository: OpenSecretCloud/Maple

Length of output: 950


🏁 Script executed:

#!/bin/bash
# Search the entire release.yml file for checksum/hash/integrity verification
echo "=== Searching for checksum validation in release.yml ==="
rg -i 'sha256|checksum|sha1|integrity|verify.*hash' .github/workflows/release.yml

echo "=== Searching for 'ORT_SHA256' or similar patterns ==="
rg 'ORT_SHA256|ORT.*HASH' .github/workflows/release.yml

echo "=== Count of tar invocations with piped curl ==="
rg 'curl.*\|.*tar' .github/workflows/release.yml -A 2

Repository: OpenSecretCloud/Maple

Length of output: 589


🌐 Web query:

ONNX Runtime v1.22.0 release checksums github

💡 Result:

No official checksums (SHA256 or otherwise) for ONNX Runtime v1.22.0 release assets are published on the GitHub releases page or in related official documentation. The release page at https://github.com/microsoft/onnxruntime/releases/tag/v1.22.0 lists the binary assets (e.g., onnxruntime-linux-x64-1.22.0.tgz, onnxruntime-win-x64-1.22.0.zip) with file sizes and download counts, but does not provide checksums. This is consistent across other ONNX Runtime releases, such as v1.24.2, where only assets and sizes are listed without hashes. Users should verify downloads using GitHub's built-in checksum verification if available or compute their own SHA256 sums after downloading from the official source.

Citations:


🌐 Web query:

GitHub Actions verify release asset integrity download without checksum

💡 Result:

To verify the integrity of a GitHub release asset downloaded in GitHub Actions without relying on a separate checksum file, use GitHub's built-in features: asset digests (SHA-256 hashes exposed via the Releases API since June 2025) and GitHub CLI's gh release verify-asset command, which validates against cryptographically signed attestations. ## Step 1: Download the Asset Use a third-party action like dsaltares/fetch-gh-release-asset (widely used, supports private repos): yaml - name: Download asset uses: dsaltares/fetch-gh-release-asset@v2 with: version: 'v1.0.0' # or 'latest' file: 'my-asset.zip' token: ${{ secrets.GITHUB_TOKEN }} This downloads to the current directory (e.g., ./my-asset.zip). ## Step 2: Verify Integrity Install gh CLI (pre-installed on GitHub-hosted runners) and run: yaml - name: Verify asset integrity run: gh release verify-asset v1.0.0 ./my-asset.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} This command: - Fetches the release's signed attestation. - Computes the local file's digest. - Matches it against the expected digest and validates the signature/provenance. - Fails the workflow if tampered or mismatched. For latest release: gh release verify-asset ./my-asset.zip. ## Alternative: Manual Digest Check (No CLI) Fetch the expected SHA-256 digest from the API and compare: yaml - name: Get expected digest id: digest run: | curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ github.repository }}/releases/tags/v1.0.0 | \ jq -r '.assets[] | select(.name == "my-asset.zip") | .digest' | \ cut -d: -f2 > expected.sha256 shell: bash - name: Compute local digest and verify run: | sha256sum --check expected.sha256 <<< $(sha256sum ./my-asset.zip | cut -d' ' -f1) shell: bash Note: Digest format is sha256:. ## Key Benefits (No Separate Checksum File Needed) - Automatic Digests: GitHub computes SHA-256 for every asset at upload (immutable). - Attestations: gh release verify-asset provides end-to-end integrity + provenance. - API Access: asset.digest in Releases REST/GraphQL APIs. - Works for immutable releases (marked on GitHub UI). For official docs, see GitHub's "Verifying the integrity of a release" and Releases API (asset.digest field).

Citations:


Use GitHub API digests to verify ONNX Runtime tarball integrity instead of piping through tar.

The current download at lines 102–113 extracts the tarball without verification. While ONNX Runtime v1.22.0 does not publish official checksums, GitHub computes and exposes SHA-256 digests for all release assets via the Releases API (available since June 2025). Use either:

  1. GitHub CLI verification (simpler):

    • Download the file separately (not piped)
    • Run gh release verify-asset with the release tag and file
  2. Manual API digest check (if CLI unavailable):

    • Fetch the expected digest from GET /repos/microsoft/onnxruntime/releases/tags/v{ORT_VERSION}assets[].digest
    • Compute local SHA256 and compare

This eliminates the supply-chain risk without relying on externally-pinned checksums that ONNX Runtime doesn't provide.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 100 - 110, Replace the direct
curl | tar extraction for ORT_VERSION/ORT_ROOT with a two-step verified
download: first download the tarball to a local file (using the ORT_VERSION and
ORT_ROOT variables), then verify its SHA256 digest either by running `gh release
verify-asset` for the tag v${ORT_VERSION} or by calling the GitHub Releases API
GET /repos/microsoft/onnxruntime/releases/tags/v{ORT_VERSION} and comparing
assets[].digest to a computed local sha256; only after the digest matches should
you extract into ORT_ROOT and export ORT_LIB_LOCATION and ORT_SKIP_DOWNLOAD into
GITHUB_ENV.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 24, 2026

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: 984a206
Status: ✅  Deploy successful!
Preview URL: https://571eeacb.maple-ca8.pages.dev
Branch Preview URL: https://fix-linux-onnxruntime-ci.maple-ca8.pages.dev

View logs

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/desktop-build.yml:
- Around line 175-177: The workflow downloads and extracts onnxruntime using
curl | tar without verifying integrity; change the steps around the curl + tar
pipeline to first download the artifact to a temporary file (using the
ORT_VERSION to form the filename), then verify its SHA-256 against a pinned
value (e.g. an environment variable ORT_TGZ_SHA256 or a lookup table keyed by
ORT_VERSION), and only call tar -xz -C "$ORT_ROOT" after the checksum matches;
alternatively support verifying a detached signature if provided. Ensure the
pipeline fails the job on checksum mismatch and remove the direct curl | tar
streaming to prevent extracting unverified bytes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2324233-3a30-474b-ad78-3d83471288b4

📥 Commits

Reviewing files that changed from the base of the PR and between c298043 and 40be370.

📒 Files selected for processing (2)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

Comment on lines +175 to +177
curl -fL --retry 5 --retry-delay 2 --retry-all-errors \
"https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-${ORT_VERSION}.tgz" \
| tar -xz -C "$ORT_ROOT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add integrity verification for downloaded ONNX Runtime archive.

This downloads and extracts unverified bytes directly into the build pipeline. Please pin and verify SHA-256 (or signature) before extraction to prevent artifact poisoning in CI.

🔒 Suggested hardening
       - name: Provide ONNX Runtime (Linux)
         run: |
           ORT_VERSION=1.22.0
           ORT_ROOT="$RUNNER_TEMP/onnxruntime"
+          ORT_ARCHIVE="$RUNNER_TEMP/onnxruntime-linux-x64-${ORT_VERSION}.tgz"
+          ORT_SHA256="<pin_official_sha256_here>"
           mkdir -p "$ORT_ROOT"
           curl -fL --retry 5 --retry-delay 2 --retry-all-errors \
             "https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/onnxruntime-linux-x64-${ORT_VERSION}.tgz" \
-            | tar -xz -C "$ORT_ROOT"
+            -o "$ORT_ARCHIVE"
+          echo "${ORT_SHA256}  ${ORT_ARCHIVE}" | sha256sum -c -
+          tar -xzf "$ORT_ARCHIVE" -C "$ORT_ROOT"
           echo "ORT_LIB_LOCATION=$ORT_ROOT/onnxruntime-linux-x64-${ORT_VERSION}" >> "$GITHUB_ENV"
           echo "ORT_SKIP_DOWNLOAD=true" >> "$GITHUB_ENV"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/desktop-build.yml around lines 175 - 177, The workflow
downloads and extracts onnxruntime using curl | tar without verifying integrity;
change the steps around the curl + tar pipeline to first download the artifact
to a temporary file (using the ORT_VERSION to form the filename), then verify
its SHA-256 against a pinned value (e.g. an environment variable ORT_TGZ_SHA256
or a lookup table keyed by ORT_VERSION), and only call tar -xz -C "$ORT_ROOT"
after the checksum matches; alternatively support verifying a detached signature
if provided. Ensure the pipeline fails the job on checksum mismatch and remove
the direct curl | tar streaming to prevent extracting unverified bytes.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/rust-tests.yml (1)

50-60: Consider extracting this ONNX setup into a shared reusable workflow/action.

This block now appears in multiple workflows with near-identical logic, which increases version/env drift risk.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/rust-tests.yml around lines 50 - 60, The ONNX setup block
(step named "Provide ONNX Runtime (Linux)" that defines ORT_VERSION, ORT_ROOT,
sets ORT_LIB_LOCATION, ORT_SKIP_DOWNLOAD and LD_LIBRARY_PATH) is duplicated
across workflows—extract it into a reusable GitHub Actions component (either a
reusable workflow or a composite action) that accepts ORT_VERSION (and
optionally platform/arch) as inputs and performs the curl+tar and environment
exports; then replace each duplicated block with a single call to that
reusable_workflow/action, passing ORT_VERSION and any platform-specific inputs
to keep behavior identical and centralize version/env management.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/rust-tests.yml:
- Around line 50-60: The ONNX setup block (step named "Provide ONNX Runtime
(Linux)" that defines ORT_VERSION, ORT_ROOT, sets ORT_LIB_LOCATION,
ORT_SKIP_DOWNLOAD and LD_LIBRARY_PATH) is duplicated across workflows—extract it
into a reusable GitHub Actions component (either a reusable workflow or a
composite action) that accepts ORT_VERSION (and optionally platform/arch) as
inputs and performs the curl+tar and environment exports; then replace each
duplicated block with a single call to that reusable_workflow/action, passing
ORT_VERSION and any platform-specific inputs to keep behavior identical and
centralize version/env management.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9187bbd-8f07-4d3c-a683-a80b6e4351bd

📥 Commits

Reviewing files that changed from the base of the PR and between 40be370 and 63c83be.

📒 Files selected for processing (3)
  • .github/workflows/desktop-build.yml
  • .github/workflows/release.yml
  • .github/workflows/rust-tests.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/desktop-build.yml

Preload official ONNX Runtime in Linux workflows so ort-sys stops relying on flaky Pyke CDN downloads.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

Work around Linux AppImage strip failures

Set NO_STRIP for Linux desktop bundling so linuxdeploy stops choking on newer bundled system libraries.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

Improve Linux AppImage CI diagnostics

Set APPIMAGE_EXTRACT_AND_RUN and enable verbose Linux bundling so linuxdeploy failures surface clearly in CI.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

Expose ONNX Runtime libs to Linux bundlers

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@AnthonyRonning AnthonyRonning force-pushed the fix/linux-onnxruntime-ci branch from 63c83be to 984a206 Compare April 24, 2026 06:31
@AnthonyRonning AnthonyRonning merged commit 04f6f34 into master Apr 24, 2026
12 checks passed
@AnthonyRonning AnthonyRonning deleted the fix/linux-onnxruntime-ci branch April 24, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant