recommendation

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSpecImageCompatibility added in v0.3.11

func CheckSpecImageCompatibility(csp string, spec cloudmodel.SpecInfo, image cloudmodel.ImageInfo) bool

CheckSpecImageCompatibility validates compatibility between a single VM spec and VM image

func FindAndSortVmOsImageInfoListBySimilarity added in v0.3.1

func FindAndSortVmOsImageInfoListBySimilarity(keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) []cloudmodel.ImageInfo

FindAndSortVmOsImageInfoListBySimilarity finds VM OS images that match the keywords and sorts them by similarity score

func FindBestVmOsImage added in v0.1.1

func FindBestVmOsImage(keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) cloudmodel.ImageInfo

FindBestVmOsImage finds the best matching image based on the similarity scores

func FindBestVmOsImageNameUsedInCsp added in v0.3.3

func FindBestVmOsImageNameUsedInCsp(keywords string, kwDelimiters []string, vmImages []cloudmodel.ImageInfo, imgDelimiters []string) string

FindBestVmOsImageNameUsedInCsp finds the best matching image based on the similarity scores

func FindCompatibleSpecAndImage added in v0.3.4

func FindCompatibleSpecAndImage(specs []cloudmodel.SpecInfo, images []cloudmodel.ImageInfo, csp string) (cloudmodel.SpecInfo, cloudmodel.ImageInfo, error)

FindCompatibleSpecAndImage finds a compatible VM spec and image pair by performing CSP-specific compatibility checks

func GetDefaultImagesLimit added in v0.3.6

func GetDefaultImagesLimit() int

GetDefaultImagesLimit returns the default VM images recommendation limit

func GetDefaultSpecsLimit added in v0.3.6

func GetDefaultSpecsLimit() int

GetDefaultSpecsLimit returns the default VM specs recommendation limit

func IsValidCspAndRegion added in v0.3.1

func IsValidCspAndRegion(csp string, region string) (bool, error)

func MBtoGiB added in v0.1.1

func MBtoGiB(mb float64) uint32

MBtoGiB converts megabytes to gibibytes

func RecommendK8sControlPlane added in v0.4.2

func RecommendK8sControlPlane(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sClusterDynamicReq, error)

RecommendK8sControlPlane recommends K8s control plane configuration based on honeybee source cluster data

func RecommendK8sNodeGroup added in v0.4.2

func RecommendK8sNodeGroup(provider, region string, k8sInfoList KubernetesInfoList) (tbmodel.K8sNodeGroupReq, error)

RecommendK8sNodeGroup recommends K8s worker node group configuration based on honeybee source cluster data

func RecommendSecurityGroup added in v0.3.1

func RecommendSecurityGroup(csp string, region string, server onpremmodel.ServerProperty) (cloudmodel.SecurityGroupReq, error)

func RecommendSecurityGroups added in v0.3.1

func RecommendSecurityGroups(csp string, region string, servers []onpremmodel.ServerProperty) (cloudmodel.RecommendedSecurityGroupList, error)

func RecommendVNet added in v0.3.1

func RecommendVNet(csp string, region string, srcInfra onpremmodel.OnpremInfra) ([]cloudmodel.VNetReq, error)

RecommendVNet recommends virtual network configurations based on source infrastructure

func RecommendVmInfra added in v0.3.1

func RecommendVmInfra(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedVmInfra, error)

RecommendVmInfra an appropriate multi-cloud infrastructure (MCI) for cloud migration

func RecommendVmInfraCandidates added in v0.4.6

func RecommendVmInfraCandidates(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra, limit int, minMatchRate float64) ([]cloudmodel.RecommendedVmInfra, error)

RecommendVmInfraCandidates an appropriate multi-cloud infrastructure (MCI) for cloud migration

func RecommendVmInfraWithDefaults added in v0.3.1

func RecommendVmInfraWithDefaults(desiredCsp string, desiredRegion string, srcInfra onpremmodel.OnpremInfra) (cloudmodel.RecommendedVmInfraDynamicList, error)

RecommendVmInfraWithDefaults an appropriate multi-cloud infrastructure (MCI) for cloud migration

func RecommendVmOsImage added in v0.3.1

func RecommendVmOsImage(csp string, region string, server onpremmodel.ServerProperty) (cloudmodel.ImageInfo, error)

RecommendVmOsImage recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec

func RecommendVmOsImageId added in v0.3.1

func RecommendVmOsImageId(csp string, region string, server onpremmodel.ServerProperty) (string, error)

RecommendVmOsImageId recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec

func RecommendVmOsImages added in v0.3.1

func RecommendVmOsImages(csp string, region string, server onpremmodel.ServerProperty, limit int) ([]cloudmodel.ImageInfo, error)

RecommendVmOsImages recommends an appropriate VM OS image (e.g., Ubuntu 22.04) for the given VM spec

func RecommendVmOsImagesForSpec added in v0.3.10

func RecommendVmOsImagesForSpec(csp string, region string, server onpremmodel.ServerProperty, limit int, spec cloudmodel.SpecInfo) ([]cloudmodel.ImageInfo, error)

RecommendVmOsImagesForSpec recommends an appropriate VM OS images (e.g., Ubuntu 22.04) for the given VM spec

func RecommendVmSpecs added in v0.3.1

func RecommendVmSpecs(csp string, region string, server onpremmodel.ServerProperty, limit int) (vmSpecList []cloudmodel.SpecInfo, length int, err error)

RecommendVmSpecs recommends appropriate VM specs for the given server

func RecommendVmSpecsForImage added in v0.3.3

func RecommendVmSpecsForImage(csp string, region string, server onpremmodel.ServerProperty, limit int, image cloudmodel.ImageInfo) (vmSpecList []cloudmodel.SpecInfo, length int, err error)

RecommendVmSpecsForImage recommends appropriate VM specs for the server and image

func SetKeywordsAndDelimeters added in v0.4.6

func SetKeywordsAndDelimeters(server onpremmodel.ServerProperty) (string, []string, []string)

Types

type CompatibleSpecImagePair added in v0.3.9

type CompatibleSpecImagePair struct {
	Spec  cloudmodel.SpecInfo  `json:"spec"`
	Image cloudmodel.ImageInfo `json:"image"`
}

func FindCompatibleVmSpecAndImagePairs added in v0.4.6

func FindCompatibleVmSpecAndImagePairs(specs []cloudmodel.SpecInfo, images []cloudmodel.ImageInfo, csp string) ([]CompatibleSpecImagePair, error)

FindCompatibleVmSpecAndImagePairs finds all compatible VM spec and image pairs by performing CSP-specific compatibility checks

type Helm added in v0.4.2

type Helm struct {
	Repo    []Repo    `json:"repo"`
	Release []Release `json:"release"`
}

type InfraMatchRateSummary added in v0.4.6

type InfraMatchRateSummary struct {
	MinMatchRate   float64 // Minimum match rate across all VMs (weakest link)
	MaxMatchRate   float64 // Maximum match rate across all VMs (best match)
	AvgMatchRate   float64 // Average match rate across all VMs
	BestEffortRate float64 // Percentage of VMs meeting best-effort threshold
	TotalVMs       int     // Total number of VMs evaluated
}

InfraMatchRateSummary represents overall infrastructure match rate metrics

type Kubernetes added in v0.4.2

type Kubernetes struct {
	NodeCount NodeCount              `json:"node_count"`
	Nodes     []Node                 `json:"nodes"`
	Workloads map[string]interface{} `json:"workloads"`
}

type KubernetesInfoList added in v0.4.2

type KubernetesInfoList struct {
	Servers []Kubernetes `json:"servers" validate:"required"`
}

Honeybee v0.4.0 Kubernetes models

type MatchRateVector added in v0.4.6

type MatchRateVector struct {
	CPU    float64 // CPU resource match rate (0-100%)
	Memory float64 // Memory resource match rate (0-100%)
	Image  float64 // OS image similarity match rate (0-100%)

}

MatchRateVector represents multi-dimensional match rate scores for infrastructure recommendation Each dimension is independently evaluated (0-100%), making the system extensible without weight tuning

func (MatchRateVector) AverageMatchRate added in v0.4.6

func (q MatchRateVector) AverageMatchRate() float64

AverageMatchRate returns the average match rate across all dimensions

func (MatchRateVector) IsMatched added in v0.4.6

func (q MatchRateVector) IsMatched(threshold float64) bool

IsMatched checks if all dimensions meet the match rate threshold Rationale: "Best effort" requires ALL resources to be sufficiently matched

func (MatchRateVector) MaxMatchRate added in v0.4.6

func (q MatchRateVector) MaxMatchRate() float64

MaxMatchRate returns the maximum match rate score across all dimensions Rationale: Represents the strongest dimension match

func (MatchRateVector) MinMatchRate added in v0.4.6

func (q MatchRateVector) MinMatchRate() float64

MinMatchRate returns the minimum match rate score across all dimensions Rationale: Overall match rate is limited by the weakest dimension

type Node added in v0.4.2

type Node struct {
	Type      NodeType    `json:"type"`
	Name      interface{} `json:"name,omitempty"`
	Labels    interface{} `json:"labels,omitempty"`
	Addresses interface{} `json:"addresses,omitempty"`
	NodeSpec  NodeSpec    `json:"node_spec,omitempty"`
	NodeInfo  interface{} `json:"node_info,omitempty"`
}

type NodeCount added in v0.4.2

type NodeCount struct {
	Total        int `json:"total"`
	ControlPlane int `json:"control_plane"`
	Worker       int `json:"worker"`
}

type NodeGroupInfo added in v0.4.2

type NodeGroupInfo struct {
	Count       int
	TotalCPU    int
	TotalMemory int // in MiB
}

NodeGroupInfo holds aggregated information for a node group

type NodeSpec added in v0.4.2

type NodeSpec struct {
	CPU              int `json:"cpu"`               // cores
	Memory           int `json:"memory"`            // MiB
	EphemeralStorage int `json:"ephemeral_storage"` // MiB
}

type NodeType added in v0.4.2

type NodeType string
const (
	NodeTypeControlPlane NodeType = "control-plane"
	NodeTypeWorker       NodeType = "worker"
)

type RecommendationStatus added in v0.2.1

type RecommendationStatus string

RecommendationStatus represents the status of a recommendation.

const (
	NothingRecommended   RecommendationStatus = "none"
	PartiallyRecommended RecommendationStatus = "partial"
	FullyRecommended     RecommendationStatus = "ok"
)

type RecommendedInfraInfo added in v0.2.1

type RecommendedInfraInfo struct {
	Status      string                `json:"status"`
	Description string                `json:"description"`
	TargetInfra tbmodel.MciDynamicReq `json:"targetInfra"`
}

* Models for Container Infrastructure (i.e., an infrastructure for Kubernetes)

type Release added in v0.4.2

type Release struct {
	Name             string    `json:"name"`
	Namespace        string    `json:"namespace"`
	Revision         int       `json:"revision"`
	Updated          time.Time `json:"updated"`
	Status           string    `json:"status"`
	ChartNameVersion string    `json:"chart"`
	AppVersion       string    `json:"app_version"`
}

type Repo added in v0.4.2

type Repo struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type VmOsImageInfoWithScore added in v0.3.1

type VmOsImageInfoWithScore struct {
	VmOsImageInfo   cloudmodel.ImageInfo
	SimilarityScore float64
}

Jump to

Keyboard shortcuts

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