feat(nodes): accept undocumented --enable-infiniband flag on sf nodes create#263
Closed
sigmachirality wants to merge 1 commit into
Closed
Conversation
…s create` Surfaces the experimental InfiniBand opt-in (SYS-691) as a hidden flag, matching the Rust sf-cli's `hide = true` treatment. When set, the CLI passes `_preview_enable_infiniband: true` through to the node-api create call. The field is gated server-side by the IB whitelist (is_infiniband_whitelisted on the resolved cluster), so callers without access get a 403 — no client-side preflight needed. `Option.hideHelp()` keeps the flag fully functional but suppresses it from `sf nodes create --help`, parent help, and generated man pages, so the surface stays unadvertised while the preview field is in flux (sfcompute/sfcompute#5694). Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
Contributor
|
Contributor
|
Folding into #262 as a single PR per request. |
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
Adds a hidden
--enable-infinibandflag tosf nodes createthat pipes through to_preview_enable_infiniband: trueon the create call. The flag is fully functional but never shown in--helpoutput, parent help, or generated man pages — matching the Rustsf-cli'shide = truetreatment of the same flag.Stacked on #262 (depends on
@sfcompute/nodes-sdk-alpha@0.1.0-alpha.31which introduces_preview_enable_infinibandonNodeCreateParams).Motivation
SYS-691 wired the InfiniBand opt-in end-to-end through the API, gated server-side by an
(account, instance SKU)whitelist row. The Rustsf-clialready exposes it as a hidden flag; this PR brings the TypeScript CLI to parity so internal/whitelisted callers can usesf nodes create --enable-infinibandwithout going through the lower-level Rust binary. Non-whitelisted callers get a 403 from the server — no client-side preflight needed.The flag is kept hidden because the wire field is in the
_preview_namespace and the convention is to not advertise preview surfaces externally (per sfcompute/sfcompute#5694).Description of changes
src/lib/nodes/create.ts:Option("--enable-infiniband")with.hideHelp()so it doesn't appear in any rendered help text.createNodesAction, conditionally spread{ _preview_enable_infiniband: true }intocreateParamswhen the option is set.That's the entire diff (10 lines added).
Testing
bun run check— passes.bun run lint— passes (only the same 9 pre-existing warnings asmain).Option.hideHelp()actually hides the flag by parsing the command in isolation:--enable-infinibanddoes not appear inhelpInformation()output.Review Callouts
sf-cli(Rust)._preview_enable_infiniband(server-side aliased to the olderenable_infinibandfor one release per sfcompute/sfcompute#5694).handleNodesErrorsurfaces this to the user as a CLI error.Tag
@indentto continue the conversation here.