Documentation
¶
Index ¶
- func ExpandPath(path string) string
- func GenerateCloudInit(redisURL, sshPublicKey string, setupCommands []string) string
- func InfrastructureExists(infraID, statePath string) bool
- func LoadCloudConfig(configPath string) (*config.CloudConfigs, error)
- func RemoveInfrastructureState(infraID, statePath string) error
- func ResolveTemplatePaths(cfg *config.CloudConfigs, baseFolder string)
- func SaveCloudConfig(cfg *config.CloudConfigs, configPath string) error
- func SaveInfrastructureState(infra *Infrastructure, statePath string) error
- func ValidateCloudConfig(cfg *config.CloudConfigs) error
- func WaitForWorkers(ctx context.Context, client *distributed.Client, expectedCount int, ...) ([]string, error)
- func WaitForWorkersWithStatus(ctx context.Context, client *distributed.Client, expectedCount int, ...) ([]string, error)
- type AWSProvider
- func (p *AWSProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *AWSProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *AWSProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *AWSProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *AWSProvider) Type() ProviderType
- func (p *AWSProvider) Validate(ctx context.Context) error
- type AzureProvider
- func (p *AzureProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *AzureProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *AzureProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *AzureProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *AzureProvider) Type() ProviderType
- func (p *AzureProvider) Validate(ctx context.Context) error
- type CloudSSHClient
- func (c *CloudSSHClient) Close()
- func (c *CloudSSHClient) DownloadDir(remotePath, localPath string) error
- func (c *CloudSSHClient) DownloadFile(remotePath, localPath string) error
- func (c *CloudSSHClient) RunCommand(ctx context.Context, command string) (string, int, error)
- func (c *CloudSSHClient) RunCommandStreaming(ctx context.Context, command string, prefix string) error
- func (c *CloudSSHClient) RunCommandStreamingWithCallback(ctx context.Context, command string, prefix string, onLine LineCallback) error
- func (c *CloudSSHClient) UploadFile(localPath, remotePath string) error
- type CostEstimate
- type CostTracker
- func (ct *CostTracker) CheckLimits() error
- func (ct *CostTracker) GetCostSummary() string
- func (ct *CostTracker) GetCurrentCost() float64
- func (ct *CostTracker) GetElapsedTime() time.Duration
- func (ct *CostTracker) GetEstimatedFinalCost(duration time.Duration) float64
- func (ct *CostTracker) UpdateCost() float64
- type CreateOptions
- type DigitalOceanProvider
- func (p *DigitalOceanProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *DigitalOceanProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *DigitalOceanProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *DigitalOceanProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *DigitalOceanProvider) Type() ProviderType
- func (p *DigitalOceanProvider) Validate(ctx context.Context) error
- type ExecutionMode
- type GCPProvider
- func (p *GCPProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *GCPProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *GCPProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *GCPProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *GCPProvider) Type() ProviderType
- func (p *GCPProvider) Validate(ctx context.Context) error
- type HetznerProvider
- func (p *HetznerProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *HetznerProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *HetznerProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *HetznerProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *HetznerProvider) Type() ProviderType
- func (p *HetznerProvider) Validate(ctx context.Context) error
- type InfraStatus
- type Infrastructure
- type LifecycleManager
- func (lm *LifecycleManager) CreateAndRun(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (lm *LifecycleManager) Destroy(ctx context.Context, infra *Infrastructure) error
- func (lm *LifecycleManager) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (lm *LifecycleManager) MonitorCost(ctx context.Context, interval time.Duration) error
- type LineCallback
- type LinodeProvider
- func (p *LinodeProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
- func (p *LinodeProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
- func (p *LinodeProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
- func (p *LinodeProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
- func (p *LinodeProvider) Type() ProviderType
- func (p *LinodeProvider) Validate(ctx context.Context) error
- type Provider
- type ProviderRegistry
- type ProviderType
- type PulumiManager
- func (pm *PulumiManager) Destroy(ctx context.Context) error
- func (pm *PulumiManager) GetOutputs(ctx context.Context) (map[string]auto.OutputValue, error)
- func (pm *PulumiManager) GetStackName() string
- func (pm *PulumiManager) SetConfig(ctx context.Context, key, value string, secret bool) error
- func (pm *PulumiManager) Up(ctx context.Context, program pulumi.RunFunc) error
- type PulumiWriter
- type Resource
- type ResourceStatus
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶ added in v5.0.2
ExpandPath expands ~ to the user's home directory
func GenerateCloudInit ¶ added in v5.0.2
GenerateCloudInit generates the cloud-init user data script for worker VMs. The script installs osmedeus, sets up SSH access, and joins the worker to the master.
func InfrastructureExists ¶
InfrastructureExists checks if an infrastructure state exists
func LoadCloudConfig ¶
func LoadCloudConfig(configPath string) (*config.CloudConfigs, error)
LoadCloudConfig loads and parses the cloud configuration from the specified path
func RemoveInfrastructureState ¶
RemoveInfrastructureState removes infrastructure state from disk
func ResolveTemplatePaths ¶ added in v5.0.2
func ResolveTemplatePaths(cfg *config.CloudConfigs, baseFolder string)
ResolveTemplatePaths expands {{base_folder}} in path fields of the cloud config. Call this after LoadCloudConfig with the actual base folder path.
func SaveCloudConfig ¶
func SaveCloudConfig(cfg *config.CloudConfigs, configPath string) error
SaveCloudConfig saves the cloud configuration to the specified path
func SaveInfrastructureState ¶
func SaveInfrastructureState(infra *Infrastructure, statePath string) error
SaveInfrastructureState persists infrastructure state to disk
func ValidateCloudConfig ¶
func ValidateCloudConfig(cfg *config.CloudConfigs) error
ValidateCloudConfig validates the cloud configuration
Types ¶
type AWSProvider ¶ added in v5.0.2
type AWSProvider struct {
// contains filtered or unexported fields
}
AWSProvider implements the Provider interface for AWS
func NewAWSProvider ¶ added in v5.0.2
func NewAWSProvider(accessKeyID, secretAccessKey, region, instanceType, ami, amiFilter string, useSpot bool) (*AWSProvider, error)
NewAWSProvider creates a new AWS provider
func (*AWSProvider) CreateInfrastructure ¶ added in v5.0.2
func (p *AWSProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions AWS EC2 instances
func (*AWSProvider) DestroyInfrastructure ¶ added in v5.0.2
func (p *AWSProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down AWS resources
func (*AWSProvider) EstimateCost ¶ added in v5.0.2
func (p *AWSProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*AWSProvider) GetStatus ¶ added in v5.0.2
func (p *AWSProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*AWSProvider) Type ¶ added in v5.0.2
func (p *AWSProvider) Type() ProviderType
Type returns the provider type
type AzureProvider ¶ added in v5.0.2
type AzureProvider struct {
// contains filtered or unexported fields
}
AzureProvider implements the Provider interface for Azure
func NewAzureProvider ¶ added in v5.0.2
func NewAzureProvider(subscriptionID, tenantID, clientID, clientSecret, location, vmSize, imageReference string) (*AzureProvider, error)
NewAzureProvider creates a new Azure provider
func (*AzureProvider) CreateInfrastructure ¶ added in v5.0.2
func (p *AzureProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions Azure VMs
func (*AzureProvider) DestroyInfrastructure ¶ added in v5.0.2
func (p *AzureProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down Azure resources
func (*AzureProvider) EstimateCost ¶ added in v5.0.2
func (p *AzureProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*AzureProvider) GetStatus ¶ added in v5.0.2
func (p *AzureProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*AzureProvider) Type ¶ added in v5.0.2
func (p *AzureProvider) Type() ProviderType
Type returns the provider type
type CloudSSHClient ¶ added in v5.0.2
type CloudSSHClient struct {
// contains filtered or unexported fields
}
CloudSSHClient wraps a pooled SSH connection for cloud operations. It provides command execution (blocking and streaming) plus SFTP file transfers.
func NewCloudSSHClient ¶ added in v5.0.2
func NewCloudSSHClient(ctx context.Context, cfg SSHConfig) (*CloudSSHClient, error)
NewCloudSSHClient creates a new SSH client using the global connection pool.
func (*CloudSSHClient) Close ¶ added in v5.0.2
func (c *CloudSSHClient) Close()
Close releases the connection back to the pool.
func (*CloudSSHClient) DownloadDir ¶ added in v5.0.2
func (c *CloudSSHClient) DownloadDir(remotePath, localPath string) error
DownloadDir recursively downloads a remote directory to local via SFTP.
func (*CloudSSHClient) DownloadFile ¶ added in v5.0.2
func (c *CloudSSHClient) DownloadFile(remotePath, localPath string) error
DownloadFile copies a remote file to the local filesystem via SFTP.
func (*CloudSSHClient) RunCommand ¶ added in v5.0.2
RunCommand executes a command on the remote host and returns the output.
func (*CloudSSHClient) RunCommandStreaming ¶ added in v5.0.2
func (c *CloudSSHClient) RunCommandStreaming(ctx context.Context, command string, prefix string) error
RunCommandStreaming executes a command, streaming stdout/stderr line-by-line with a prefix. Blocks until the command completes.
func (*CloudSSHClient) RunCommandStreamingWithCallback ¶ added in v5.0.2
func (c *CloudSSHClient) RunCommandStreamingWithCallback(ctx context.Context, command string, prefix string, onLine LineCallback) error
RunCommandStreamingWithCallback is like RunCommandStreaming but calls onLine for each ANSI-stripped output line, allowing the caller to observe progress without parsing stdout.
func (*CloudSSHClient) UploadFile ¶ added in v5.0.2
func (c *CloudSSHClient) UploadFile(localPath, remotePath string) error
UploadFile copies a local file to the remote host via SFTP.
type CostEstimate ¶
type CostEstimate struct {
// HourlyCost is the estimated hourly cost
HourlyCost float64
// DailyCost is the estimated daily cost
DailyCost float64
// Currency is the currency code (default: USD)
Currency string
// Breakdown provides cost breakdown by resource type
Breakdown map[string]float64
// Notes contains additional cost information
Notes []string
}
CostEstimate represents estimated costs
type CostTracker ¶
type CostTracker struct {
// contains filtered or unexported fields
}
CostTracker tracks ongoing infrastructure costs
func NewCostTracker ¶
func NewCostTracker(hourlyRate, maxTotalSpend float64) *CostTracker
NewCostTracker creates a new cost tracker
func (*CostTracker) CheckLimits ¶
func (ct *CostTracker) CheckLimits() error
CheckLimits validates that current cost is within limits
func (*CostTracker) GetCostSummary ¶
func (ct *CostTracker) GetCostSummary() string
GetCostSummary returns a formatted cost summary
func (*CostTracker) GetCurrentCost ¶
func (ct *CostTracker) GetCurrentCost() float64
GetCurrentCost returns the current accumulated cost
func (*CostTracker) GetElapsedTime ¶
func (ct *CostTracker) GetElapsedTime() time.Duration
GetElapsedTime returns the elapsed time since tracking started
func (*CostTracker) GetEstimatedFinalCost ¶
func (ct *CostTracker) GetEstimatedFinalCost(duration time.Duration) float64
GetEstimatedFinalCost estimates final cost for a given duration
func (*CostTracker) UpdateCost ¶
func (ct *CostTracker) UpdateCost() float64
UpdateCost calculates the current cost based on elapsed time
type CreateOptions ¶
type CreateOptions struct {
// Mode is the execution mode (vm or serverless)
Mode ExecutionMode
// InstanceCount is the number of instances to create
InstanceCount int
// InstanceType is the instance size/type (e.g., "s-2vcpu-4gb" for DigitalOcean)
InstanceType string
// UseSpot indicates whether to use spot/preemptible instances
UseSpot bool
// ImageID is the cloud image/snapshot to use
ImageID string
// RedisURL is the master Redis URL for worker registration
RedisURL string
// SSHPublicKey is the SSH public key for authentication
SSHPublicKey string
// SSHPrivateKey is the SSH private key for result collection
SSHPrivateKey string
// SSHUser is the SSH username
SSHUser string
// SetupCommands are additional commands to run on boot
SetupCommands []string
// Tags are resource tags/labels
Tags map[string]string
// Timeout is the maximum time to wait for infrastructure creation
Timeout time.Duration
// StatePath is the resolved path for Pulumi state storage.
// Set by LifecycleManager from the cloud config's State.Path.
StatePath string
}
CreateOptions contains options for creating infrastructure
type DigitalOceanProvider ¶
type DigitalOceanProvider struct {
// contains filtered or unexported fields
}
DigitalOceanProvider implements the Provider interface for DigitalOcean
func NewDigitalOceanProvider ¶
func NewDigitalOceanProvider(token, region, size, snapshotID, sshKeyFingerprint string) (*DigitalOceanProvider, error)
NewDigitalOceanProvider creates a new DigitalOcean provider
func (*DigitalOceanProvider) CreateInfrastructure ¶
func (p *DigitalOceanProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions DigitalOcean droplets
func (*DigitalOceanProvider) DestroyInfrastructure ¶
func (p *DigitalOceanProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down DigitalOcean resources
func (*DigitalOceanProvider) EstimateCost ¶
func (p *DigitalOceanProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*DigitalOceanProvider) GetStatus ¶
func (p *DigitalOceanProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*DigitalOceanProvider) Type ¶
func (p *DigitalOceanProvider) Type() ProviderType
Type returns the provider type
type ExecutionMode ¶
type ExecutionMode string
ExecutionMode represents the execution mode (VM or serverless)
const ( ModeVM ExecutionMode = "vm" ModeServerless ExecutionMode = "serverless" )
type GCPProvider ¶ added in v5.0.2
type GCPProvider struct {
// contains filtered or unexported fields
}
GCPProvider implements the Provider interface for Google Cloud Platform
func NewGCPProvider ¶ added in v5.0.2
func NewGCPProvider(projectID, credentialsFile, region, zone, machineType, imageFamily string, usePreemptible bool) (*GCPProvider, error)
NewGCPProvider creates a new GCP provider
func (*GCPProvider) CreateInfrastructure ¶ added in v5.0.2
func (p *GCPProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions GCP compute instances
func (*GCPProvider) DestroyInfrastructure ¶ added in v5.0.2
func (p *GCPProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down GCP resources
func (*GCPProvider) EstimateCost ¶ added in v5.0.2
func (p *GCPProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*GCPProvider) GetStatus ¶ added in v5.0.2
func (p *GCPProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*GCPProvider) Type ¶ added in v5.0.2
func (p *GCPProvider) Type() ProviderType
Type returns the provider type
type HetznerProvider ¶ added in v5.0.2
type HetznerProvider struct {
// contains filtered or unexported fields
}
HetznerProvider implements the Provider interface for Hetzner Cloud
func NewHetznerProvider ¶ added in v5.0.2
func NewHetznerProvider(token, location, serverType, image, sshKeyName string) (*HetznerProvider, error)
NewHetznerProvider creates a new Hetzner Cloud provider
func (*HetznerProvider) CreateInfrastructure ¶ added in v5.0.2
func (p *HetznerProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions Hetzner Cloud servers
func (*HetznerProvider) DestroyInfrastructure ¶ added in v5.0.2
func (p *HetznerProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down Hetzner Cloud resources
func (*HetznerProvider) EstimateCost ¶ added in v5.0.2
func (p *HetznerProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*HetznerProvider) GetStatus ¶ added in v5.0.2
func (p *HetznerProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*HetznerProvider) Type ¶ added in v5.0.2
func (p *HetznerProvider) Type() ProviderType
Type returns the provider type
type InfraStatus ¶
type InfraStatus struct {
// Status is the overall status (running, stopped, error, etc.)
Status string
// ReadyCount is the number of ready resources
ReadyCount int
// TotalCount is the total number of resources
TotalCount int
// WorkersRegistered is the number of workers that have registered
WorkersRegistered int
// Details contains status details for each resource
Details []ResourceStatus
}
InfraStatus represents the status of infrastructure
type Infrastructure ¶
type Infrastructure struct {
// ID is a unique identifier for this infrastructure
ID string
// Provider is the cloud provider type
Provider ProviderType
// Mode is the execution mode
Mode ExecutionMode
// CreatedAt is when the infrastructure was created
CreatedAt time.Time
// PulumiStackID is the Pulumi stack identifier
PulumiStackID string
// StatePath is the resolved Pulumi state directory used during creation.
// Persisted so that Destroy can locate the correct state.
StatePath string `json:"state_path,omitempty"`
// Resources are the created resources (VMs, functions, etc.)
Resources []Resource
// Metadata contains additional provider-specific data
Metadata map[string]interface{}
}
Infrastructure represents created cloud infrastructure
func ListInfrastructures ¶
func ListInfrastructures(statePath string) ([]*Infrastructure, error)
ListInfrastructures lists all saved infrastructure states
func LoadInfrastructureState ¶
func LoadInfrastructureState(infraID, statePath string) (*Infrastructure, error)
LoadInfrastructureState loads infrastructure state from disk
type LifecycleManager ¶
type LifecycleManager struct {
// contains filtered or unexported fields
}
LifecycleManager orchestrates the complete lifecycle of cloud infrastructure
func NewLifecycleManager ¶
func NewLifecycleManager(cfg *config.CloudConfigs, provider Provider, client *distributed.Client) *LifecycleManager
NewLifecycleManager creates a new lifecycle manager
func (*LifecycleManager) CreateAndRun ¶
func (lm *LifecycleManager) CreateAndRun(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateAndRun provisions infrastructure, waits for workers, runs workflow, and cleans up
func (*LifecycleManager) Destroy ¶
func (lm *LifecycleManager) Destroy(ctx context.Context, infra *Infrastructure) error
Destroy tears down infrastructure
func (*LifecycleManager) GetStatus ¶
func (lm *LifecycleManager) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves infrastructure status
func (*LifecycleManager) MonitorCost ¶
MonitorCost monitors ongoing costs during execution
type LineCallback ¶ added in v5.0.2
type LineCallback func(line string)
LineCallback is called for each ANSI-stripped output line during streaming.
type LinodeProvider ¶ added in v5.0.2
type LinodeProvider struct {
// contains filtered or unexported fields
}
LinodeProvider implements the Provider interface for Linode
func NewLinodeProvider ¶ added in v5.0.2
func NewLinodeProvider(token, region, linodeType, image string) (*LinodeProvider, error)
NewLinodeProvider creates a new Linode provider
func (*LinodeProvider) CreateInfrastructure ¶ added in v5.0.2
func (p *LinodeProvider) CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
CreateInfrastructure provisions Linode instances
func (*LinodeProvider) DestroyInfrastructure ¶ added in v5.0.2
func (p *LinodeProvider) DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
DestroyInfrastructure tears down Linode resources
func (*LinodeProvider) EstimateCost ¶ added in v5.0.2
func (p *LinodeProvider) EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
EstimateCost estimates the cost for the given configuration
func (*LinodeProvider) GetStatus ¶ added in v5.0.2
func (p *LinodeProvider) GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
GetStatus retrieves the current status of infrastructure
func (*LinodeProvider) Type ¶ added in v5.0.2
func (p *LinodeProvider) Type() ProviderType
Type returns the provider type
type Provider ¶
type Provider interface {
// Validate checks if the provider configuration is valid
Validate(ctx context.Context) error
// EstimateCost estimates the cost for the given configuration
EstimateCost(mode ExecutionMode, instanceCount int) (*CostEstimate, error)
// CreateInfrastructure provisions the cloud resources
CreateInfrastructure(ctx context.Context, opts *CreateOptions) (*Infrastructure, error)
// DestroyInfrastructure tears down the cloud resources
DestroyInfrastructure(ctx context.Context, infra *Infrastructure) error
// GetStatus retrieves the current status of infrastructure
GetStatus(ctx context.Context, infra *Infrastructure) (*InfraStatus, error)
// Type returns the provider type
Type() ProviderType
}
Provider is the interface that all cloud providers must implement
func CreateProvider ¶
func CreateProvider(cfg *config.CloudConfigs, providerType ProviderType) (Provider, error)
CreateProvider creates a provider instance based on cloud configuration
type ProviderRegistry ¶
type ProviderRegistry struct {
// contains filtered or unexported fields
}
ProviderRegistry manages provider instances
func NewProviderRegistry ¶
func NewProviderRegistry() *ProviderRegistry
NewProviderRegistry creates a new provider registry
func (*ProviderRegistry) Get ¶
func (r *ProviderRegistry) Get(providerType ProviderType) (Provider, error)
Get retrieves a provider by type
func (*ProviderRegistry) List ¶
func (r *ProviderRegistry) List() []ProviderType
List returns all registered provider types
func (*ProviderRegistry) Register ¶
func (r *ProviderRegistry) Register(provider Provider)
Register registers a provider
type ProviderType ¶
type ProviderType string
ProviderType represents the cloud provider type
const ( ProviderAWS ProviderType = "aws" ProviderGCP ProviderType = "gcp" ProviderDigitalOcean ProviderType = "digitalocean" ProviderLinode ProviderType = "linode" ProviderAzure ProviderType = "azure" ProviderHetzner ProviderType = "hetzner" )
type PulumiManager ¶
type PulumiManager struct {
// contains filtered or unexported fields
}
PulumiManager manages Pulumi stacks for infrastructure provisioning
func NewPulumiManager ¶
func NewPulumiManager(projectName, stackName, statePath string) (*PulumiManager, error)
NewPulumiManager creates a new Pulumi manager with local backend
func (*PulumiManager) Destroy ¶
func (pm *PulumiManager) Destroy(ctx context.Context) error
Destroy tears down the infrastructure and removes the stack and its state
func (*PulumiManager) GetOutputs ¶
func (pm *PulumiManager) GetOutputs(ctx context.Context) (map[string]auto.OutputValue, error)
GetOutputs retrieves the stack outputs (IPs, IDs, etc.)
func (*PulumiManager) GetStackName ¶
func (pm *PulumiManager) GetStackName() string
GetStackName returns the stack name
type PulumiWriter ¶ added in v5.0.2
type PulumiWriter struct {
// contains filtered or unexported fields
}
PulumiWriter is an io.Writer that colorizes Pulumi progress output
func NewPulumiWriter ¶ added in v5.0.2
func NewPulumiWriter() *PulumiWriter
NewPulumiWriter creates a writer that colorizes Pulumi output lines
func (*PulumiWriter) Flush ¶ added in v5.0.2
func (w *PulumiWriter) Flush()
Flush writes any remaining buffered content
type Resource ¶
type Resource struct {
// Type is the resource type (e.g., "vm", "function")
Type string
// ID is the cloud provider's resource ID
ID string
// Name is a human-readable name
Name string
// PublicIP is the public IP address (if applicable)
PublicIP string
// PrivateIP is the private IP address (if applicable)
PrivateIP string
// SSHEnabled indicates if SSH access is available
SSHEnabled bool
// WorkerID is the Osmedeus worker ID after registration
WorkerID string
// Status is the current resource status
Status string
// Metadata contains additional resource-specific data
Metadata map[string]interface{}
}
Resource represents a single cloud resource
type ResourceStatus ¶
type ResourceStatus struct {
// ResourceID is the resource identifier
ResourceID string
// Status is the resource status
Status string
// Message provides additional status information
Message string
// WorkerRegistered indicates if the worker has registered
WorkerRegistered bool
}
ResourceStatus represents the status of a single resource