Documentation ¶
Index ¶
- func AddCloudProvider(name string, cloud CloudProvider)
- func DefaultToEnv(field *string, env, fallback string)
- func GetBestFitInstanceType(sortedInstanceTypeSpecList []InstanceTypeSpec, vcpus int64, memory int64) (string, error)
- func GetBestFitInstanceTypeWithGPU(sortedInstanceTypeSpecList []InstanceTypeSpec, gpus, vcpus, memory int64) (string, error)
- func List() []string
- func LoadCloudProvider(name string)
- func SelectInstanceTypeToUse(spec InstanceTypeSpec, specList []InstanceTypeSpec, ...) (string, error)
- func VerifyCloudInstanceType(instanceType string, validInstanceTypes []string, defaultInstanceType string) (string, error)
- func VerifySSHKeyFile(sshKeyFile string) error
- func WriteUserData(instanceName string, userData string, dataDir string) (string, error)
- type CloudProvider
- type Instance
- type InstanceTypeSpec
- type KeyValueFlag
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCloudProvider ¶
func AddCloudProvider(name string, cloud CloudProvider)
func DefaultToEnv ¶
func GetBestFitInstanceType ¶
func GetBestFitInstanceType(sortedInstanceTypeSpecList []InstanceTypeSpec, vcpus int64, memory int64) (string, error)
Method to find the best fit instance type for the given memory and vcpus The sortedInstanceTypeSpecList slice is a sorted list of instance types based on ascending order of supported memory
func GetBestFitInstanceTypeWithGPU ¶ added in v0.11.0
func GetBestFitInstanceTypeWithGPU(sortedInstanceTypeSpecList []InstanceTypeSpec, gpus, vcpus, memory int64) (string, error)
Implement the GetBestFitInstanceTypeWithGPU function TBD: Incorporate GPU model based selection as well
func LoadCloudProvider ¶ added in v0.9.0
func LoadCloudProvider(name string)
LoadCloudProvider loads cloud provider external plugin from the given path CLOUD_PROVIDER_EXTERNAL_PLUGIN_PATH The values of 1) ${CLOUD_PROVIDER}, 2) the filename of the cloud provider external plugin and 3) the provider defined within the external plugin must all match
func SelectInstanceTypeToUse ¶
func SelectInstanceTypeToUse(spec InstanceTypeSpec, specList []InstanceTypeSpec, validInstanceTypes []string, defaultInstanceType string) (string, error)
func VerifyCloudInstanceType ¶
func VerifyCloudInstanceType(instanceType string, validInstanceTypes []string, defaultInstanceType string) (string, error)
Method to verify the correct instanceType to be used for Pod VM
func VerifySSHKeyFile ¶ added in v0.11.0
Verify SSH public key file Check the permissions and the content of the file to ensure it is a valid SSH public key
Types ¶
type CloudProvider ¶
type CloudProvider interface { ParseCmd(flags *flag.FlagSet) LoadEnv() NewProvider() (Provider, error) }
func Get ¶
func Get(name string) CloudProvider
type InstanceTypeSpec ¶
type InstanceTypeSpec struct { InstanceType string VCPUs int64 Memory int64 Arch string GPUs int64 Image string }
func FilterOutGPUInstances ¶ added in v0.11.0
func FilterOutGPUInstances(instanceTypeSpecList []InstanceTypeSpec) []InstanceTypeSpec
Filter out GPU instances from the instance type spec list
func SortInstanceTypesOnResources ¶ added in v0.11.0
func SortInstanceTypesOnResources(instanceTypeSpecList []InstanceTypeSpec) []InstanceTypeSpec
Method to sort InstanceTypeSpec into ascending order based on gpu, then memory, followed by cpu
type KeyValueFlag ¶
keyValueFlag represents a flag of key-value pairs
func (*KeyValueFlag) Set ¶
func (k *KeyValueFlag) Set(value string) error
Set parses the input string and sets the keyValueFlag value
func (*KeyValueFlag) String ¶
func (k *KeyValueFlag) String() string
String returns the string representation of the keyValueFlag