Documentation ¶
Overview ¶
pkg/providers/common/update.go
Index ¶
- Constants
- Variables
- func CreateNewMachine(deploymentType models.DeploymentType, location string, diskSizeGB int, ...) (models.Machiner, error)
- func GenerateTags(projectID, uniqueID string) map[string]string
- func IsValidResourceGroupName(name string) bool
- func PrepareDeployment(ctx context.Context, provider models.DeploymentType) (*models.Deployment, error)
- func ProcessMachinesConfig(providerType models.DeploymentType, ...) (map[string]models.Machiner, map[string]bool, error)
- func SetDefaultConfigurations(provider models.DeploymentType)
- type ClusterDeployer
- func (cd *ClusterDeployer) ApplyBacalhauConfigs(ctx context.Context, sshConfig sshutils.SSHConfiger, ...) error
- func (cd *ClusterDeployer) ExecuteCustomScript(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error
- func (cd *ClusterDeployer) FindOrchestratorMachine() (models.Machiner, error)
- func (cd *ClusterDeployer) HandleDeploymentError(_ context.Context, machine models.Machiner, err error) error
- func (cd *ClusterDeployer) InstallBacalhau(ctx context.Context, sshConfig sshutils.SSHConfiger) error
- func (cd *ClusterDeployer) InstallBacalhauRunScript(ctx context.Context, sshConfig sshutils.SSHConfiger) error
- func (cd *ClusterDeployer) ProvisionBacalhauCluster(ctx context.Context) error
- func (cd *ClusterDeployer) ProvisionBacalhauNode(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner, ...) error
- func (cd *ClusterDeployer) ProvisionMachine(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error
- func (cd *ClusterDeployer) ProvisionOrchestrator(ctx context.Context, machineName string) error
- func (cd *ClusterDeployer) ProvisionWorker(ctx context.Context, machineName string) error
- func (cd *ClusterDeployer) SetSSHClient(client sshutils.SSHClienter)
- func (cd *ClusterDeployer) SetupBacalhauService(ctx context.Context, sshConfig sshutils.SSHConfiger) error
- func (cd *ClusterDeployer) SetupNodeConfigMetadata(ctx context.Context, machine models.Machiner, sshConfig sshutils.SSHConfiger) error
- func (cd *ClusterDeployer) VerifyBacalhauDeployment(ctx context.Context, sshConfig sshutils.SSHConfiger, orchestratorIP string) error
- func (cd *ClusterDeployer) WaitForAllMachinesToReachState(ctx context.Context, resourceType string, state models.MachineResourceState) error
- type RawMachine
- type RawMachineParams
Constants ¶
View Source
const ( UpdateQueueSize = 100 ResourcePollingInterval = 2 * time.Second DebugFilePath = "/tmp/andaime-debug.log" DefaultSSHUser = "andaimeuser" DebugFilePermissions = 0644 WaitingForMachinesTime = 1 * time.Minute )
Variables ¶
View Source
var ( ErrNoRegionsSpecified = fmt.Errorf("no regions specified") ErrNoImagesFound = fmt.Errorf("no images found") )
Provide a list of errors that can be used by any provider
Functions ¶
func CreateNewMachine ¶
func GenerateTags ¶
GenerateTags creates a map of tags for cloud resources
func PrepareDeployment ¶
func PrepareDeployment( ctx context.Context, provider models.DeploymentType, ) (*models.Deployment, error)
func ProcessMachinesConfig ¶
func SetDefaultConfigurations ¶
func SetDefaultConfigurations(provider models.DeploymentType)
Types ¶
type ClusterDeployer ¶
type ClusterDeployer struct {
// contains filtered or unexported fields
}
ClusterDeployer struct that implements ClusterDeployerInterface
func NewClusterDeployer ¶
func NewClusterDeployer(provider models.DeploymentType) *ClusterDeployer
func (*ClusterDeployer) ApplyBacalhauConfigs ¶
func (cd *ClusterDeployer) ApplyBacalhauConfigs( ctx context.Context, sshConfig sshutils.SSHConfiger, combinedSettings []models.BacalhauSettings, ) error
func (*ClusterDeployer) ExecuteCustomScript ¶
func (cd *ClusterDeployer) ExecuteCustomScript( ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner, ) error
func (*ClusterDeployer) FindOrchestratorMachine ¶
func (cd *ClusterDeployer) FindOrchestratorMachine() (models.Machiner, error)
func (*ClusterDeployer) HandleDeploymentError ¶
func (*ClusterDeployer) InstallBacalhau ¶
func (cd *ClusterDeployer) InstallBacalhau( ctx context.Context, sshConfig sshutils.SSHConfiger, ) error
func (*ClusterDeployer) InstallBacalhauRunScript ¶
func (cd *ClusterDeployer) InstallBacalhauRunScript( ctx context.Context, sshConfig sshutils.SSHConfiger, ) error
func (*ClusterDeployer) ProvisionBacalhauCluster ¶
func (cd *ClusterDeployer) ProvisionBacalhauCluster(ctx context.Context) error
func (*ClusterDeployer) ProvisionBacalhauNode ¶ added in v0.0.3
func (cd *ClusterDeployer) ProvisionBacalhauNode( ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner, bacalhauSettings []models.BacalhauSettings, ) error
ProvisionBacalhauNode provisions a Bacalhau node on the specified machine. It performs a series of steps to configure, install, and verify the Bacalhau service.
Parameters:
- ctx: The context for controlling the function's lifecycle.
- machine: The machine on which the Bacalhau node will be provisioned.
- nodeType: The type of the node, e.g., "compute".
- orchestratorIP: The IP address of the orchestrator, required if nodeType is "compute".
Returns:
- error: An error if any step in the provisioning process fails.
The function performs the following steps:
- Creates an SSH configuration for the machine.
- Sets the service state to updating.
- Validates the orchestrator IP if the node type is "compute".
- Sets up node configuration metadata.
- Installs the Bacalhau service.
- Installs the Bacalhau run script.
- Sets up the Bacalhau service.
- Verifies the Bacalhau deployment.
- Applies Bacalhau configurations.
- Executes any custom scripts.
- Restarts the Bacalhau service to ensure everything is functioning correctly.
If any step fails, the function handles the deployment error and returns the error. Upon successful completion, it logs the success, updates the service state to succeeded, and marks the machine as complete.
func (*ClusterDeployer) ProvisionMachine ¶ added in v0.0.9
func (cd *ClusterDeployer) ProvisionMachine( ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner, ) error
func (*ClusterDeployer) ProvisionOrchestrator ¶
func (cd *ClusterDeployer) ProvisionOrchestrator(ctx context.Context, machineName string) error
func (*ClusterDeployer) ProvisionWorker ¶
func (cd *ClusterDeployer) ProvisionWorker( ctx context.Context, machineName string, ) error
func (*ClusterDeployer) SetSSHClient ¶
func (cd *ClusterDeployer) SetSSHClient(client sshutils.SSHClienter)
func (*ClusterDeployer) SetupBacalhauService ¶
func (cd *ClusterDeployer) SetupBacalhauService( ctx context.Context, sshConfig sshutils.SSHConfiger, ) error
func (*ClusterDeployer) SetupNodeConfigMetadata ¶
func (cd *ClusterDeployer) SetupNodeConfigMetadata( ctx context.Context, machine models.Machiner, sshConfig sshutils.SSHConfiger, ) error
func (*ClusterDeployer) VerifyBacalhauDeployment ¶
func (cd *ClusterDeployer) VerifyBacalhauDeployment( ctx context.Context, sshConfig sshutils.SSHConfiger, orchestratorIP string, ) error
func (*ClusterDeployer) WaitForAllMachinesToReachState ¶
func (cd *ClusterDeployer) WaitForAllMachinesToReachState( ctx context.Context, resourceType string, state models.MachineResourceState, ) error
type RawMachine ¶
type RawMachine struct { Location string `yaml:"location"` Parameters RawMachineParams `yaml:"parameters,omitempty"` }
type RawMachineParams ¶
type RawMachineParams struct { Count int `yaml:"count,omitempty"` Type string `yaml:"type,omitempty"` Orchestrator bool `yaml:"orchestrator,omitempty"` DiskSizeGB int `yaml:"disk_size_gb,omitempty"` DiskImageURL string `yaml:"disk_image_url,omitempty"` DiskImageFamily string `yaml:"disk_image_family,omitempty"` }
Click to show internal directories.
Click to hide internal directories.