Documentation
¶
Overview ¶
Package bundler provides orchestration for generating deployment bundles from recipes.
The bundler package generates deployment-ready artifacts (Helm per-component bundles, Argo CD applications, Flux HelmRelease manifests, helmfile release graphs, or rendered local manifests) from recipe configurations. Component configuration is loaded from the declarative component registry (recipes/registry.yaml).
Architecture ¶
- DefaultBundler: Orchestrates bundle generation; the concrete output is produced by a deployer
- Component Registry: Declarative configuration in recipes/registry.yaml
- Deployers: helm (default), argocd, argocd-helm, flux, helmfile, localformat
- 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 declaratively in recipes/registry.yaml. The set evolves without Go changes; representative entries include gpu-operator, network-operator, nvidia-dra-driver-gpu, cert-manager, nfd, nvsentinel, nodewright-operator, kube-prometheus-stack, dynamo-platform, kueue, kubeflow-trainer, and the slinky slurm components. See recipes/registry.yaml for the current authoritative list.
Output Formats ¶
Helm (default):
- README.md: Root deployment guide with ordered steps
- deploy.sh: Automation script (0755)
- recipe.yaml: Copy of the input recipe
- NNN-<component>/install.sh: Per-folder install script
- NNN-<component>/values.yaml: Static Helm values
- NNN-<component>/cluster-values.yaml: Per-cluster dynamic values
- NNN-<component>/upstream.env: CHART/REPO/VERSION (upstream-helm folders)
- NNN-<component>/Chart.yaml + templates/: Local chart (local-helm folders)
Argo CD:
- app-of-apps.yaml: Parent Argo CD Application
- <component>/application.yaml: Argo CD 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBundleConfig ¶ added in v0.14.0
ParseBundleConfig parses the /v1/bundle query parameters from r and returns the bundler *config.Config they describe. It is the exported boundary the aicr.Client-backed REST handler (pkg/server) uses to build the bundle config from a request without reimplementing the query-param parsing or config-building.
The returned error carries an ErrCodeInvalidRequest structured code on a bad parameter, suitable for server.WriteErrorFromErr.
func StreamZipResponse ¶ added in v0.14.0
StreamZipResponse creates a zip archive from the output directory and streams it to the response. Exported so the aicr.Client-backed REST handler (pkg/server) emits a consistent zip stream — same headers, same entry layout, same compression.
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) Make ¶
func (b *DefaultBundler) Make(ctx context.Context, recipeResult *recipe.RecipeResult, 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 Argo CD 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 Argo CD output:
- app-of-apps.yaml: Parent Argo CD Application
- <component>/application.yaml: Argo CD 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 ¶
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. |
|
Package deployer defines the shared interface and types for bundle deployers.
|
Package deployer defines the shared interface and types for bundle deployers. |
|
argocd
Package argocd provides Argo CD Application generation for recipes.
|
Package argocd provides Argo CD Application generation for recipes. |
|
argocdhelm
Package argocdhelm generates a Helm chart app-of-apps for Argo CD with dynamic install-time values.
|
Package argocdhelm generates a Helm chart app-of-apps for Argo CD with dynamic install-time values. |
|
flux
Package flux provides Flux manifest generation for AICR recipes.
|
Package flux provides Flux manifest generation for AICR recipes. |
|
helm
Package helm generates per-component Helm bundles from recipe results.
|
Package helm generates per-component Helm bundles from recipe results. |
|
helmfile
Package helmfile generates a helmfile.yaml release graph from a configured recipe.
|
Package helmfile generates a helmfile.yaml release graph from a configured recipe. |
|
localformat
Package localformat writes the uniform numbered local-chart bundle layout.
|
Package localformat writes the uniform numbered local-chart bundle layout. |
|
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. |