aimclustermodelsource

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerRegistry = "docker.io"

	GHCRRegistry = "ghcr.io"
)
View Source
const (
	// LabelKeyModelSource is the label key used to identify the model source that created a cluster model.
	LabelKeyModelSource = "aim.eai.amd.com/model-source"
)

Variables

This section is empty.

Functions

func FilterHasWildcard

func FilterHasWildcard(filter aimv1alpha1.ModelSourceFilter) bool

FilterHasWildcard checks if a filter contains wildcard patterns.

func MatchesFilters

func MatchesFilters(
	img RegistryImage,
	filters []aimv1alpha1.ModelSourceFilter,
	globalVersions []string,
) bool

MatchesFilters checks if an image matches any of the provided filters. Filters are combined with OR logic - if any filter matches, the image is included.

Types

type ClusterModelSourceFetch

type ClusterModelSourceFetch struct {
	// contains filtered or unexported fields
}

func (ClusterModelSourceFetch) GetComponentHealth

func (fetch ClusterModelSourceFetch) GetComponentHealth() []controllerutils.ComponentHealth

GetComponentHealth implements ComponentHealthProvider on FetchResult. This follows the aimmodel pattern where fetch results provide health directly.

type ClusterModelSourceObservation

type ClusterModelSourceObservation struct {
	ClusterModelSourceFetch
	// contains filtered or unexported fields
}

ClusterModelSourceObservation embeds the fetch result. Additional computed fields are added for PlanResources and DecorateStatus.

type ClusterModelSourceReconciler

type ClusterModelSourceReconciler struct {
	Clientset         kubernetes.Interface
	Scheme            *runtime.Scheme
	OperatorNamespace string
}

ClusterModelSourceReconciler implements domain reconciliation for AIMClusterModelSource.

type FilterResult

type FilterResult struct {
	Filter aimv1alpha1.ModelSourceFilter
	Images []RegistryImage // Images discovered (may be partial)
	Error  error           // Error encountered (nil = full success)
}

FilterResult captures the result of processing a single filter.

type RegistryClient

type RegistryClient struct {
	// contains filtered or unexported fields
}

RegistryClient handles image discovery from container registries.

func NewRegistryClient

func NewRegistryClient(clientset kubernetes.Interface, operatorNamespace string) *RegistryClient

NewRegistryClient creates a new RegistryClient.

func (*RegistryClient) FetchFilter

FetchFilter processes a single filter and returns discovered images. It uses the appropriate strategy based on the filter type: 1. Static images (exact versions, no registry query) 2. Tags list API (exact repos with version ranges) 3. Catalog API (wildcards on Docker Hub/Harbor/etc)

type RegistryImage

type RegistryImage struct {
	Registry   string
	Repository string
	Tag        string
}

RegistryImage represents a discovered image from a registry.

func ExtractStaticImages

func ExtractStaticImages(spec aimv1alpha1.AIMClusterModelSourceSpec) []RegistryImage

ExtractStaticImages converts filters that are exact image references (no wildcards, with tag) into RegistryImage objects. This allows bypassing registry queries for static image lists. When a filter has no explicit tag but spec.versions are specified, it generates static images for each version. This is especially useful for registries like ghcr.io that don't support catalog API. Returns only the filters that can be converted to static references.

func (RegistryImage) ToImageURI

func (img RegistryImage) ToImageURI() string

ToImageURI returns the full image URI in registry/repository:tag format. Special handling for docker.io which doesn't require the registry prefix.

Jump to

Keyboard shortcuts

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