Repository navigation
docs: reorganize use cases navigation #12410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
93d10f8
docs: reorganize use cases navigation
athreesh ce4756f
Merge branch 'main' into docs/use-cases-nav-reorg
athreesh 4501332
docs: refine reference and quickstart navigation
athreesh 68f5ab4
docs: keep routing topics in guide tabs
athreesh 0fab5fe
docs: address reference redirect comments
athreesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,215 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Kubernetes quickstart image selector. It keeps the quickstart's release, | ||
| * custom-build, and XPU paths in one copyable block. | ||
| */ | ||
| "use client"; | ||
|
|
||
| import { useState } from "react"; | ||
|
|
||
| import { CURRENT_TAG } from "./releases.data"; | ||
| import { LOCAL_SELECTOR_CSS } from "./local-selector-styles"; | ||
|
|
||
| type Hardware = "nvidia" | "intel"; | ||
| type Build = "release" | "custom"; | ||
|
|
||
| type Option<T extends string> = { | ||
| id: T; | ||
| label: string; | ||
| sub?: string; | ||
| }; | ||
|
|
||
| const HARDWARES: Option<Hardware>[] = [ | ||
| { id: "nvidia", label: "NVIDIA GPU", sub: "published images" }, | ||
| { id: "intel", label: "Intel XPU", sub: "source build" }, | ||
| ]; | ||
|
|
||
| const BUILDS: Option<Build>[] = [ | ||
| { id: "release", label: "Release image", sub: `Planner ${CURRENT_TAG}` }, | ||
| { id: "custom", label: "Custom XPU image", sub: "build and push" }, | ||
| ]; | ||
|
|
||
| function buildEnabled(hardware: Hardware, build: Build): boolean { | ||
| return hardware === "nvidia" ? build === "release" : build === "custom"; | ||
| } | ||
|
|
||
| function normalizeRegistry(registry: string): string { | ||
| return registry.trim().replace(/\/+$/, ""); | ||
| } | ||
|
|
||
| const REGISTRY_PATTERN = /^(?=.{1,255}$)(?:[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]+)?)(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/; | ||
|
|
||
| function registryIsValid(registry: string): boolean { | ||
| const normalized = normalizeRegistry(registry); | ||
| return REGISTRY_PATTERN.test(normalized); | ||
| } | ||
|
|
||
| function shellQuote(value: string): string { | ||
| return `'${value.replace(/'/g, "'\\''")}'`; | ||
| } | ||
|
|
||
| function commandFor(hardware: Hardware, registry: string): string { | ||
| if (hardware === "intel") { | ||
| const imageRegistry = normalizeRegistry(registry) || "<your-registry>/<namespace>"; | ||
| return [ | ||
| `export IMAGE_REGISTRY=${shellQuote(imageRegistry)}`, | ||
| 'export XPU_IMAGE="${IMAGE_REGISTRY}/vllm-runtime-xpu:quickstart"', | ||
| "", | ||
| "python3 container/render.py \\", | ||
| " --framework=vllm \\", | ||
| " --device=xpu \\", | ||
| " --target=runtime \\", | ||
| " --output-short-filename", | ||
| 'docker build --tag "$XPU_IMAGE" --file container/rendered.Dockerfile .', | ||
| 'docker push "$XPU_IMAGE"', | ||
| ].join("\n"); | ||
| } | ||
|
|
||
| return [ | ||
| `export DYNAMO_VERSION=${CURRENT_TAG}`, | ||
| 'export PLANNER_IMAGE="nvcr.io/nvidia/ai-dynamo/dynamo-planner:${DYNAMO_VERSION}"', | ||
| ].join("\n"); | ||
|
athreesh marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Planner image referenced but since it is a quickstart the 'Planner' hasn't been introduced and can be confusing why it's not just a dynamo container |
||
| } | ||
|
|
||
| function ChoiceRow<T extends string>({ | ||
| label, | ||
| options, | ||
| selected, | ||
| onSelect, | ||
| isDisabled = () => false, | ||
| disabledTitle, | ||
| }: { | ||
| label: string; | ||
| options: Option<T>[]; | ||
| selected: T; | ||
| onSelect: (value: T) => void; | ||
| isDisabled?: (value: T) => boolean; | ||
| disabledTitle?: (option: Option<T>) => string; | ||
| }) { | ||
| return ( | ||
| <div className="lqs-row"> | ||
| <span className="lqs-label">{label}</span> | ||
| <div className="lqs-options" role="group" aria-label={label}> | ||
| {options.map((option) => { | ||
| const disabled = isDisabled(option.id); | ||
| return ( | ||
| <button | ||
| key={option.id} | ||
| type="button" | ||
| className="lqs-chip" | ||
| aria-pressed={selected === option.id} | ||
| disabled={disabled} | ||
| title={disabled ? disabledTitle?.(option) : undefined} | ||
| onClick={() => onSelect(option.id)} | ||
| > | ||
| {option.label} | ||
| {option.sub && <span className="lqs-chip-sub">{option.sub}</span>} | ||
| </button> | ||
| ); | ||
| })} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function KubernetesContainerSelector() { | ||
| const [hardware, setHardware] = useState<Hardware>("nvidia"); | ||
| const [build, setBuild] = useState<Build>("release"); | ||
| const [registry, setRegistry] = useState(""); | ||
| const [copyLabel, setCopyLabel] = useState("Copy"); | ||
|
|
||
| const command = commandFor(hardware, registry); | ||
| const hardwareLabel = hardware === "nvidia" ? "NVIDIA GPU" : "Intel XPU"; | ||
| const buildLabel = hardware === "intel" | ||
| ? "Custom XPU runtime" | ||
| : "Published planner image"; | ||
| const registryNeeded = hardware === "intel"; | ||
| const canCopy = !registryNeeded || registryIsValid(registry); | ||
|
|
||
| function chooseHardware(next: Hardware) { | ||
| setHardware(next); | ||
| if (next === "intel") { | ||
| setBuild("custom"); | ||
| } else { | ||
| setBuild("release"); | ||
| } | ||
| } | ||
|
|
||
| function resetCopyLabel(label = "Copy") { | ||
| window.setTimeout(() => setCopyLabel(label), 1200); | ||
| } | ||
|
|
||
| async function copyCommand() { | ||
| if (!canCopy) return; | ||
| if (!navigator.clipboard?.writeText) { | ||
| setCopyLabel("Copy failed"); | ||
| resetCopyLabel(); | ||
| return; | ||
| } | ||
| try { | ||
| await navigator.clipboard.writeText(command); | ||
| setCopyLabel("Copied!"); | ||
| } catch { | ||
| setCopyLabel("Copy failed"); | ||
| } | ||
| resetCopyLabel(); | ||
| } | ||
|
athreesh marked this conversation as resolved.
Resolved
|
||
|
|
||
| return ( | ||
| <> | ||
| <style>{LOCAL_SELECTOR_CSS}</style> | ||
| <section className="lqs-panel" aria-label="Kubernetes container image selector"> | ||
| <div className="lqs-head"> | ||
| <h3>Choose your Kubernetes image path</h3> | ||
| <p>Use the variables from this block in the deployment steps below.</p> | ||
| </div> | ||
|
|
||
| <ChoiceRow label="Hardware" options={HARDWARES} selected={hardware} onSelect={chooseHardware} /> | ||
| <ChoiceRow | ||
| label="Container" | ||
| options={BUILDS} | ||
| selected={build} | ||
| onSelect={setBuild} | ||
| isDisabled={(value) => !buildEnabled(hardware, value)} | ||
| disabledTitle={(option) => `${option.label} is not used by this quickstart path.`} | ||
| /> | ||
| {registryNeeded && ( | ||
| <div className="lqs-row"> | ||
| <span className="lqs-label">Registry</span> | ||
| <div className="lqs-field"> | ||
| <input | ||
| className="lqs-input" | ||
| value={registry} | ||
| onChange={(event) => setRegistry(event.target.value)} | ||
| placeholder="registry.example.com/my-team" | ||
| aria-invalid={!canCopy} | ||
| /> | ||
| {!canCopy && <p className="lqs-hint lqs-hint--error">Enter a lowercase Docker registry/namespace before copying.</p>} | ||
| </div> | ||
| </div> | ||
| )} | ||
|
|
||
| <div className="lqs-output"> | ||
| <div className={`lqs-rec lqs-rec--${build === "release" ? "stable" : "source"}`}> | ||
| <div className="lqs-eyebrow">Kubernetes quickstart</div> | ||
| <div className="lqs-title"> | ||
| <span className="lqs-badge">{build === "release" ? "Use" : "Build"}</span> | ||
| {buildLabel} | ||
| </div> | ||
| <div className="lqs-support">{hardwareLabel} / {hardware === "intel" ? "vLLM XPU DGD image" : "DGDR planner image"}</div> | ||
| </div> | ||
| <div className="lqs-command"> | ||
| <button type="button" className="lqs-copy" onClick={copyCommand} disabled={!canCopy}> | ||
| {canCopy ? copyLabel : "Add registry"} | ||
| </button> | ||
| <pre>{command}</pre> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default KubernetesContainerSelector; | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contains a non-clickable 'add registry' button on the right side of the intel custom DGD image.
since there's a text box to input registry/namespace- can perhaps put 'How to add registry' for the custom docker build instructions