bundler

package
v0.11.1 Latest Latest
Warning

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

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

Documentation

Overview

Package bundler provides orchestration for generating deployment bundles from recipes.

The bundler package generates deployment-ready artifacts (Helm per-component bundles or ArgoCD applications) from recipe configurations. Component configuration is loaded from the declarative component registry (recipes/registry.yaml).

Architecture

  • DefaultBundler: Generates Helm per-component bundles or ArgoCD applications
  • Component Registry: Declarative configuration in recipes/registry.yaml
  • Deployers: Helm (default) and ArgoCD output formats
  • result.Output: Aggregated generation results

Quick Start

b, err := bundler.New()
output, err := b.Make(ctx, recipeResult, "./bundle")
fmt.Printf("Generated: %d files\n", output.TotalFiles)

With options:

cfg := config.NewConfig(
    config.WithDeployer(config.DeployerHelm),
    config.WithIncludeChecksums(true),
)
b, err := bundler.New(bundler.WithConfig(cfg))

Supported Components

Components are defined in recipes/registry.yaml:

  • gpu-operator: NVIDIA GPU Operator
  • network-operator: NVIDIA Network Operator
  • nvidia-dra-driver-gpu: NVIDIA DRA Driver
  • cert-manager: Certificate Manager
  • nvsentinel: NVSentinel
  • skyhook-operator: Skyhook node optimization

Output Formats

Helm (default):

  • README.md: Root deployment guide with ordered steps
  • deploy.sh: Automation script (0755)
  • recipe.yaml: Copy of the input recipe
  • <component>/values.yaml: Helm values per component
  • <component>/README.md: Component install/upgrade/uninstall
  • <component>/manifests/: Optional manifest files

ArgoCD:

  • app-of-apps.yaml: Parent ArgoCD Application
  • <component>/application.yaml: ArgoCD Application per component
  • <component>/values.yaml: Values for each component

Configuration

cfg := config.NewConfig(
    config.WithDeployer(config.DeployerHelm),
    config.WithIncludeReadme(true),
    config.WithSystemNodeSelector(map[string]string{"node-role": "system"}),
)
b, err := bundler.New(bundler.WithConfig(cfg))

Adding New Components

To add a new component, add an entry to recipes/registry.yaml. No Go code is required.

Helm Component Example:

  • name: my-component displayName: My Component valueOverrideKeys: [mycomponent] helm: defaultRepository: https://charts.example.com defaultChart: example/my-component nodeScheduling: system: nodeSelectorPaths: [operator.nodeSelector]

Kustomize Component Example:

  • name: my-kustomize-app displayName: My Kustomize App valueOverrideKeys: [mykustomize] kustomize: defaultSource: https://github.com/example/my-app defaultPath: deploy/production defaultTag: v1.0.0

Note: A component must have either 'helm' OR 'kustomize' configuration, not both.

See https://github.com/NVIDIA/aicr for more information.

Index

Constants

View Source
const DefaultBundleTimeout = defaults.BundleHandlerTimeout

DefaultBundleTimeout is the timeout for bundle generation. Exported for backwards compatibility; prefer using defaults.BundleHandlerTimeout.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultBundler

type DefaultBundler struct {
	// Config provides bundler-specific configuration including value overrides.
	Config *config.Config

	// AllowLists defines which criteria values are permitted for bundle requests.
	// When set, the bundler validates that the recipe's criteria are within the allowed values.
	AllowLists *recipe.AllowLists

	// Attester signs bundle content. NoOpAttester is used when --attest is not set.
	Attester attestation.Attester
	// contains filtered or unexported fields
}

DefaultBundler generates Helm per-component bundles from recipes.

The per-component approach produces a directory per component, each with its own values.yaml, README, and optional manifests. A root deploy.sh orchestrates installation in order:

chmod +x deploy.sh
./deploy.sh

Thread-safety: DefaultBundler is safe for concurrent use.

func New

func New(opts ...Option) (*DefaultBundler, error)

New creates a new DefaultBundler with the given options.

Example:

b, err := bundler.New(
    bundler.WithConfig(config.NewConfig(
        config.WithValueOverrides(overrides),
    )),
)

func NewWithConfig

func NewWithConfig(cfg *config.Config) (*DefaultBundler, error)

NewWithConfig creates a new DefaultBundler with the given config. This is a convenience function equivalent to New(WithConfig(cfg)).

func (*DefaultBundler) HandleBundles

func (b *DefaultBundler) HandleBundles(w http.ResponseWriter, r *http.Request)

HandleBundles processes bundle generation requests. It accepts a POST request with a JSON body containing the recipe (RecipeResult). Supports query parameters:

  • set: Value overrides in format "bundler:path.to.field=value" (can be repeated)
  • system-node-selector: Node selectors for system components in format "key=value" (can be repeated)
  • system-node-toleration: Tolerations for system components in format "key=value:effect" (can be repeated)
  • accelerated-node-selector: Node selectors for GPU nodes in format "key=value" (can be repeated)
  • accelerated-node-toleration: Tolerations for GPU nodes in format "key=value:effect" (can be repeated)
  • workload-gate: Taint for skyhook-operator runtime required in format "key=value:effect" or "key:effect"
  • workload-selector: Label selector for skyhook-customizations in format "key=value" (can be repeated)
  • nodes: Estimated number of GPU nodes (sets estimatedNodeCount in skyhook-operator; 0 = unset)

The response is a zip archive containing the Helm per-component bundle:

  • README.md: Root deployment guide
  • deploy.sh: Automation script
  • recipe.yaml: Copy of the input recipe
  • <component>/values.yaml: Helm values per component
  • <component>/README.md: Component install/upgrade/uninstall
  • checksums.txt: SHA256 checksums of generated files

Example:

POST /v1/bundle?set=gpuoperator:gds.enabled=true
Content-Type: application/json
Body: { "apiVersion": "aicr.nvidia.com/v1alpha1", "kind": "Recipe", ... }

func (*DefaultBundler) Make

func (b *DefaultBundler) Make(ctx context.Context, input recipe.RecipeInput, dir string) (*result.Output, error)

Make generates a deployment bundle from the given recipe. By default, generates a Helm per-component bundle. If deployer is set to "argocd", generates ArgoCD Application manifests.

For Helm per-component output:

  • README.md: Root deployment guide with ordered steps
  • deploy.sh: Automation script (0755)
  • recipe.yaml: Copy of the input recipe
  • <component>/values.yaml: Helm values per component
  • <component>/README.md: Component install/upgrade/uninstall
  • <component>/manifests/: Optional manifest files
  • checksums.txt: SHA256 checksums of generated files

For ArgoCD output:

  • app-of-apps.yaml: Parent ArgoCD Application
  • <component>/application.yaml: ArgoCD Application per component
  • <component>/values.yaml: Values for each component
  • README.md: Deployment instructions

Returns a result.Output summarizing the generation results.

type Option

type Option func(*DefaultBundler)

Option defines a functional option for configuring DefaultBundler.

func WithAllowLists

func WithAllowLists(al *recipe.AllowLists) Option

WithAllowLists sets the criteria allowlists for the bundler. When configured, the bundler validates that recipe criteria are within allowed values.

func WithAttester added in v0.8.0

func WithAttester(a attestation.Attester) Option

WithAttester sets the attestation provider for bundle signing.

func WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig sets the bundler configuration. The config contains value overrides, node selectors, tolerations, etc.

Directories

Path Synopsis
Package attestation provides bundle attestation using Sigstore keyless signing.
Package attestation provides bundle attestation using Sigstore keyless signing.
Package checksum provides SHA256 checksum generation for bundle verification.
Package checksum provides SHA256 checksum generation for bundle verification.
Package config provides configuration options for bundler implementations.
Package config provides configuration options for bundler implementations.
deployer
argocd
Package argocd provides ArgoCD Application generation for recipes.
Package argocd provides ArgoCD Application generation for recipes.
helm
Package helm generates per-component Helm bundles from recipe results.
Package helm generates per-component Helm bundles from recipe results.
Package registry provides thread-safe registration and retrieval of bundler implementations.
Package registry provides thread-safe registration and retrieval of bundler implementations.
Package result provides types for tracking bundle generation results.
Package result provides types for tracking bundle generation results.
Package types defines the type system for bundler implementations.
Package types defines the type system for bundler implementations.
Package verifier implements offline bundle verification with a four-level trust model.
Package verifier implements offline bundle verification with a four-level trust model.

Jump to

Keyboard shortcuts

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