JS SDK: make the ORT / ORT-GenAI NuGet feed configurable, with authenticated private-feed support - #945
Open
baijumeswani wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable NuGet feeds and authenticated private-feed support to the JS SDK native runtime installer.
Changes:
- Adds HTTP,
dotnet restore, and NuGet CLI installation modes. - Adds configuration validation, URL redaction, and installer tests.
- Documents installation modes and environment variables.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
sdk_v2/js/script/install-native.cjs |
Implements configurable installation modes. |
sdk_v2/js/test/install-native.test.ts |
Tests installer configuration and helpers. |
sdk_v2/js/README.md |
Documents private-feed configuration. |
sdk_v2/js/docs/PortJsToSdkV2.md |
Updates the SDK architecture plan. |
Suppressed comments (5)
sdk_v2/js/README.md:214
- When
FOUNDRY_LOCAL_NUGET_CONFIGis set, the feed environment variable is ignored, so this example does not use the shown URL. Remove the assignment or put the source in the NuGet.config example.
export FOUNDRY_LOCAL_NUGET_MODE=dotnet
export FOUNDRY_LOCAL_NUGET_FEEDS="https://pkgs.dev.azure.com/my-org/_packaging/my-feed/nuget/v3/index.json"
export FOUNDRY_LOCAL_NUGET_CONFIG=/etc/secrets/NuGet.config
sdk_v2/js/script/install-native.cjs:418
- This added error-message line exceeds the JS SDK's 120-character limit.
`dotnet command not found: '${config.dotnetCommand}'. Install the .NET SDK or set FOUNDRY_LOCAL_DOTNET_COMMAND.`,
sdk_v2/js/script/install-native.cjs:507
- This added error-message line exceeds the JS SDK's 120-character limit.
`nuget command not found: '${config.nugetCommand}'. Install the NuGet CLI or set FOUNDRY_LOCAL_NUGET_COMMAND.`,
sdk_v2/js/script/install-native.cjs:515
- This added error-message line exceeds the JS SDK's 120-character limit.
`nuget install failed for ${artifact.name} ${artifact.version} (exit ${result.status}).\n${redactUrlsInText(output)}`.trim(),
sdk_v2/js/test/install-native.test.ts:390
- This test name exceeds the JS SDK's 120-character limit.
it("does not redact URLs in the args themselves (spawnSync needs the real feed) but redaction still strips them if logged", () => {
baijumeswani
force-pushed
the
baijumeswani/upgrade-packages
branch
2 times, most recently
from
August 4, 2026 15:06
11f6146 to
4d37878
Compare
baijumeswani
force-pushed
the
baijumeswani/configurable-feed
branch
from
August 4, 2026 16:51
d342bc8 to
c63b3e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The JavaScript SDK downloads the ONNX Runtime and ORT-GenAI native binaries from NuGet during
npm install(viasdk_v2/js/script/install-native.cjs). Until now those feeds were hard-coded to public NuGet endpoints. Partner teams with locked-down packaging pipelines cannot reach public feeds — they mirror everything through internal, authenticated feeds — so theirnpm installfailed at this step. This PR makes the feed configurable and adds first-class support for authenticated private feeds, without changing the default behavior for everyone else.What changed
The installer now supports three explicit modes, selected with
FOUNDRY_LOCAL_NUGET_MODE:http(default) — the original behavior: talk to the NuGet v3 HTTP protocol directly (service index ->PackageBaseAddress->.nupkg) using Node's built-inhttps, with no external tooling. Feeds are queried anonymously and redirects are followed. This is unchanged for existing users who don't set anything.dotnet— shell out todotnet restoreagainst a throwawaynet8.0project. This is the cross-platform path for a private feed whose authentication is wired through the .NET credential-provider ecosystem (for example the Azure Artifacts Credential Provider) or aNuGet.config. It needs only the .NET SDK.nuget— shell out tonuget.exe install(or anugeton PATH) once per package. This covers feeds whose authentication is supplied by a NuGet / Visual Studio credential provider thatdotnet restorecannot host — for example a netfx-only provider plugin.nuget.exeon Windows can invoke those plugins.Authentication is deliberately delegated to the NuGet tooling in
dotnetandnugetmode (aNuGet.configand/or an installed credential provider). No credentials pass through the install script itself. This keeps the install script small and moves the credential burden onto the standard, already-audited NuGet auth mechanisms the partner teams already operate.New environment variables (all optional; defaults preserve today's behavior):
FOUNDRY_LOCAL_NUGET_MODE—http(default),dotnet, ornuget.FOUNDRY_LOCAL_NUGET_FEEDS—;-separated NuGet v3 service index URLs; replaces the public defaults entirely.httpmode requires HTTPS.FOUNDRY_LOCAL_NUGET_CONFIG— path to aNuGet.config(used bydotnetandnugetmode; when set, the config owns the package sources).FOUNDRY_LOCAL_DOTNET_COMMAND— override thedotnetexecutable (dotnet mode).FOUNDRY_LOCAL_NUGET_COMMAND— override thenugetexecutable (nuget mode).FOUNDRY_LOCAL_SKIP_INSTALL=1— unchanged escape hatch to skip the download entirely (used by source builds that copy binaries separately).Cross-mode misuse (for example setting a nuget-only variable while in dotnet mode) is rejected early with a clear error, so misconfiguration fails fast instead of silently doing the wrong thing. URLs in logs and error messages have their query strings and fragments stripped so that SAS tokens or similar secrets embedded in redirect targets are never printed.