render

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

workflow_render implements the "nvcrectl workflow render" subcommand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEmbeddedNodes

func LoadEmbeddedNodes(platform, gpuArch string) ([]corev1.Node, error)

LoadEmbeddedNodes loads a mock node from the embedded YAML templates for the given platform and GPU architecture combination.

func NewK8sClient

func NewK8sClient(cf *kubeconfig.ConfigFlags) (client.Client, error)

NewK8sClient builds a controller-runtime client from the resolved ConfigFlags (kubeconfig, context, and every other kubectl-standard connection/auth flag).

func NewK8sWatchClient

func NewK8sWatchClient(cf *kubeconfig.ConfigFlags) (client.WithWatch, error)

NewK8sWatchClient builds a watch-capable controller-runtime client from the resolved ConfigFlags.

func NewWorkflowCommand

func NewWorkflowCommand() *cobra.Command

NewWorkflowCommand returns the "workflow" parent cobra command with the "render" subcommand attached. This was previously newWorkflowCommand in root.go.

func PrintDryRunSummary

func PrintDryRunSummary(header string, results []DryRunResult)

PrintDryRunSummary writes a human-readable summary table to stderr. Output goes to stderr so that YAML on stdout remains pipeable.

func ResolveWorkflow

func ResolveWorkflow(workflow *nvcrev1alpha1.Workflow, nodes []corev1.Node) (*renderMetadata, error)

ResolveWorkflow applies overrides to a Workflow in-place and returns detection metadata. The workflow's spec is mutated directly.

func ResolveWorkflowForPlatform added in v0.3.0

func ResolveWorkflowForPlatform(
	workflow *nvcrev1alpha1.Workflow, nodes []corev1.Node, platformName string,
) (*renderMetadata, error)

ResolveWorkflowForPlatform is ResolveWorkflow with the platform forced when platformName is non-empty: the dry-run paths pass --platform through here so override matching and the recorded metadata honor the flag instead of silently reverting to node-based detection. GPU architecture is always detected from the nodes. An empty platformName detects the platform too.

func SetRenderAnnotations

func SetRenderAnnotations(workflow *nvcrev1alpha1.Workflow, meta *renderMetadata)

SetRenderAnnotations stores detection metadata as annotations on the Workflow.

func SyntheticProviderID

func SyntheticProviderID(platform string) string

SyntheticProviderID returns a providerID prefix that detectPlatform maps back to the given platform string. Used for offline rendering.

Types

type DryRunResult

type DryRunResult struct {
	Resource string `json:"resource"`
	Valid    bool   `json:"valid"`
	Error    string `json:"error,omitempty"`
	Warning  string `json:"warning,omitempty"`
}

DryRunResult records the outcome of validating a single resource via server-side dry-run.

func DryRunCreate

func DryRunCreate(ctx context.Context, c client.Client, namespace string,
	spec *nvcrev1alpha1.WorkflowSpec, nodes []corev1.Node, synthesizedProducts []string) ([]DryRunResult, error)

DryRunCreate validates the resolved Job, workload, and dependencies via server-side dry-run without persisting anything.

Validation order: Dependencies → Job → Workload. Dependencies are validated first so that we can detect when a workload failure is caused by a missing dependency that would be created at runtime (e.g. a TrainingRuntime referenced by a TrainJob). Such failures are reported as warnings rather than errors.

synthesizedProducts comes from the same discovery call that produced nodes (controller.DiscoverTargetNodesWithSynthesized). It names the nodes whose nvidia.com/gpu.product label was filled in from gpu.nvidia.com ResourceSlices rather than read off the stored Node, which the affinity build below has to know about. Pass nil when the caller has no such list; the only cost is that a DRA-only fleet previews a term the reconcile will not emit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL