Skip to content

[nodejs] allow installing DLLs from Nuget feed#24418

Merged
fs-eire merged 2 commits intomicrosoft:mainfrom
fs-eire:fs-eire/nodejs-install
Apr 15, 2025
Merged

[nodejs] allow installing DLLs from Nuget feed#24418
fs-eire merged 2 commits intomicrosoft:mainfrom
fs-eire:fs-eire/nodejs-install

Conversation

@fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Apr 14, 2025

Description

This PR makes changes to the installation script of ONNX Runtime Node.js binding.

Background

Because of the max size limit of NPM registry, the Node.js binding NPM package does not include some of the binaries, eg. the CUDA EP binaries for Linux/x64.

To make it working smoothly for CUDA EP users on Linux/x64, we need a script to download the binaries from somewhere in the process of NPM installation.

Problems

Before this PR, the script downloads the binaries from GitHub Release. This is working well but have 2 problems:

  • There is a gap between the release of the binaries and the release of the NPM package. The GitHub release is always the final step of the release process. Usually there are a few hours to a few days delay between the release of the NPM package and the release of the binaries on GitHub release.
  • GitHub release does not work with dev/nightly.

Solution

We find that using Nuget feed perfectly resolves the above problems:

  • anonymous download is allowed
  • Nuget publish can be adjusted to be prior to NPM publish in the release process
  • ONNX Runtime has a nightly Nuget feed

The PR changes to use Nuget package for downloading the binaries.

@fs-eire fs-eire force-pushed the fs-eire/nodejs-install branch from 6b35fe5 to b6e3b97 Compare April 15, 2025 01:09
@fs-eire fs-eire merged commit cf99ca9 into microsoft:main Apr 15, 2025
70 of 84 checks passed
fs-eire added a commit that referenced this pull request Apr 16, 2025
### Description

Update N-API version to 6.

- NAPI v6 is required for `napi_set_instance_data` and
`napi_get_instance_data`, as used by #24366
- Adding the "binary" field in package.json for CMake-js to work
correctly. (was unintentially removed in #24418)

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
ashrit-ms pushed a commit that referenced this pull request Apr 24, 2025
### Description

This PR makes changes to the installation script of ONNX Runtime Node.js
binding.

#### Background

Because of the max size limit of NPM registry, the Node.js binding NPM
package does not include some of the binaries, eg. the CUDA EP binaries
for Linux/x64.

To make it working smoothly for CUDA EP users on Linux/x64, we need a
script to download the binaries from somewhere in the process of NPM
installation.

#### Problems

Before this PR, the script downloads the binaries from GitHub Release.
This is working well but have 2 problems:
- There is a gap between the release of the binaries and the release of
the NPM package. The GitHub release is always the final step of the
release process. Usually there are a few hours to a few days delay
between the release of the NPM package and the release of the binaries
on GitHub release.
- GitHub release does not work with dev/nightly.

#### Solution

We find that using Nuget feed perfectly resolves the above problems:
- anonymous download is allowed
- Nuget publish can be adjusted to be prior to NPM publish in the
release process
- ONNX Runtime has a nightly Nuget feed

The PR changes to use Nuget package for downloading the binaries.
ashrit-ms pushed a commit that referenced this pull request Apr 24, 2025
### Description

Update N-API version to 6.

- NAPI v6 is required for `napi_set_instance_data` and
`napi_get_instance_data`, as used by #24366
- Adding the "binary" field in package.json for CMake-js to work
correctly. (was unintentially removed in #24418)

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
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.

2 participants