Documentation
¶
Index ¶
- Variables
- func GetSupportedProviders(abstractType string) []string
- func IsAbstractType(typeName string) bool
- func ResolveInstanceType(abstractType, providerName string) string
- type AbstractType
- type InstanceType
- type InstanceTypeLister
- type Node
- type Provider
- type ProvisionRequest
- type SelfBootstrapping
Constants ¶
This section is empty.
Variables ¶
var InstanceTypeMappings = map[string]map[string]string{
"h100-8x": {
"lambda": "gpu_8x_h100_sxm5",
"gcp": "a3-highgpu-8g",
"aws": "p5.48xlarge",
},
"h100-1x": {
"lambda": "gpu_1x_h100_pcie",
"gcp": "a3-highgpu-1g",
"aws": "p5.xlarge",
},
"a100-8x": {
"lambda": "gpu_8x_a100",
"gcp": "a2-highgpu-8g",
"aws": "p4d.24xlarge",
},
"a100-4x": {
"lambda": "gpu_4x_a100",
"gcp": "a2-highgpu-4g",
"aws": "p4de.24xlarge",
},
"a100-1x": {
"lambda": "gpu_1x_a100",
"gcp": "a2-highgpu-1g",
},
"a10-1x": {
"lambda": "gpu_1x_a10",
"gcp": "g2-standard-4",
"aws": "g5.xlarge",
},
"l4-1x": {
"gcp": "g2-standard-4",
"aws": "g6.xlarge",
},
}
InstanceTypeMappings maps abstract instance types to provider-specific type names. Key is the abstract type (e.g., "h100-8x"), value is a map of provider to concrete type.
Functions ¶
func GetSupportedProviders ¶
GetSupportedProviders returns which providers support an abstract type.
func IsAbstractType ¶
IsAbstractType checks if a type name is an abstract type with mappings.
func ResolveInstanceType ¶
ResolveInstanceType maps an abstract type to a provider-specific type. If the type is already provider-specific or not found in mappings, returns as-is.
Types ¶
type AbstractType ¶
AbstractType represents a hardware specification independent of provider. Users can request "h100-8x" and Navarch maps it to provider-specific types.
type InstanceType ¶
type InstanceType struct {
Name string // Instance type name (e.g., "gpu_8x_h100_sxm5")
GPUCount int // Number of GPUs
GPUType string // GPU model description
MemoryGB int // System memory in gigabytes
VCPUs int // Virtual CPU count
PricePerHr float64 // Price per hour in USD
Regions []string // Regions where this type is offered
Available bool // True if capacity is currently available
}
InstanceType describes an available instance type from a provider.
type InstanceTypeLister ¶
type InstanceTypeLister interface {
ListInstanceTypes(ctx context.Context) ([]InstanceType, error)
}
InstanceTypeLister is an optional interface for providers that can list available types.
type Node ¶
type Node struct {
ID string // Provider-assigned instance ID
Provider string // Provider name (e.g., "lambda", "gcp")
Region string // Cloud region
Zone string // Availability zone
InstanceType string // Instance type name
Status string // Instance state: provisioning, running, terminating, terminated
IPAddress string // Public or private IP address
SSHPort int // SSH port (default: 22). Used by docker provider for port mapping.
GPUCount int // Number of GPUs attached
GPUType string // GPU model description (e.g., "NVIDIA H100 80GB")
Labels map[string]string // User-defined key-value labels
}
Node represents a provisioned GPU instance.
type Provider ¶
type Provider interface {
Name() string
Provision(ctx context.Context, req ProvisionRequest) (*Node, error)
Terminate(ctx context.Context, nodeID string) error
List(ctx context.Context) ([]*Node, error)
}
Provider abstracts cloud-specific provisioning operations.
type ProvisionRequest ¶
type ProvisionRequest struct {
Name string // Instance name (may be used as hostname)
InstanceType string // Instance type to launch
Region string // Target region
Zone string // Target availability zone (optional)
SSHKeyNames []string // SSH key names to authorize
Labels map[string]string // Labels to apply to the instance
UserData string // Startup script (cloud-init format)
}
ProvisionRequest contains parameters for provisioning a node.
type SelfBootstrapping ¶
type SelfBootstrapping interface {
// SelfBootstraps returns true if the provider handles node agent installation.
SelfBootstraps() bool
}
SelfBootstrapping is an optional interface for providers that manage node setup internally. When a provider implements this and returns true, the pool skips SSH bootstrap. Examples: fake provider (spawns agents directly), Kubernetes (uses init containers).