Documentation ¶
Index ¶
- Constants
- Variables
- func CreateStateMessage(resource ResourceType, resourceState MachineResourceState, resourceName string) string
- func CreateStateMessageWithText(resource ResourceType, resourceState MachineResourceState, resourceName string, ...) string
- func GetLocationFromResourceName(id string) string
- func GetMachineNameFromResourceName(id string) string
- func GetMachinesInLocation(resourceName string, machines map[string]Machiner) ([]string, error)
- func GetProviderAbbreviation(provider string) string
- func IsValidAzureResource(resource string) bool
- func IsValidGCPResource(resource string) bool
- func IsValidLocation(deploymentType DeploymentType, location string) bool
- func MachineConfigToWrite(machine Machiner) map[string]interface{}
- type AzureConfig
- type AzureEvent
- type BacalhauSettings
- type CloudSpecificInfo
- type ClusterDetails
- type Deployment
- func (d *Deployment) CreateMachine(name string, machine Machiner)
- func (d *Deployment) GetCloudConfig(cloudType DeploymentType) interface{}
- func (d *Deployment) GetCloudResources(cloudType DeploymentType) interface{}
- func (d *Deployment) GetMachine(name string) Machiner
- func (d *Deployment) GetMachines() map[string]Machiner
- func (d *Deployment) GetProjectID() string
- func (d *Deployment) SetLocations(locations map[string]bool)
- func (d *Deployment) SetMachine(name string, machine Machiner)
- func (d *Deployment) SetMachines(machines map[string]Machiner)
- func (d *Deployment) SetProjectID(projectID string)
- func (d *Deployment) ToMap() map[string]interface{}
- func (d *Deployment) UpdateMachine(name string, updater func(Machiner)) error
- func (d *Deployment) UpdateViperConfig() error
- type DeploymentStatus
- type DeploymentType
- type Disk
- type DisplayStatus
- func ConvertFromRawResourceToStatus(resourceMap map[string]interface{}, deployment *Deployment) ([]DisplayStatus, error)
- func NewDisplayStatus(machineName string, resourceID string, resourceType ResourceType, ...) *DisplayStatus
- func NewDisplayStatusWithText(resourceID string, resourceType ResourceType, state MachineResourceState, ...) *DisplayStatus
- func NewDisplayVMStatus(machineName string, state MachineResourceState) *DisplayStatus
- func UpdateOnlyChangedStatus(status *DisplayStatus, newStatus *DisplayStatus) *DisplayStatus
- type GCPConfig
- type GCPResourceState
- type Machine
- func (mach *Machine) BacalhauEnabled() bool
- func (mach *Machine) CloudType() DeploymentType
- func (mach *Machine) Complete() bool
- func (mach *Machine) CustomScriptEnabled() bool
- func (mach *Machine) DockerEnabled() bool
- func (mach *Machine) EnsureMachineServices() error
- func (mach *Machine) GetDeploymentEndTime() time.Time
- func (mach *Machine) GetDiskImageFamily() string
- func (mach *Machine) GetDiskImageURL() string
- func (mach *Machine) GetDiskSizeGB() int
- func (mach *Machine) GetElapsedTime() time.Duration
- func (mach *Machine) GetID() string
- func (mach *Machine) GetLocation() string
- func (mach *Machine) GetMachineResource(resourceType string) MachineResource
- func (mach *Machine) GetMachineResourceState(resourceName string) MachineResourceState
- func (mach *Machine) GetMachineResources() map[string]MachineResource
- func (mach *Machine) GetMachineServices() map[string]ServiceType
- func (mach *Machine) GetName() string
- func (mach *Machine) GetNodeType() string
- func (mach *Machine) GetOrchestratorIP() string
- func (mach *Machine) GetPrivateIP() string
- func (mach *Machine) GetPublicIP() string
- func (mach *Machine) GetRegion() string
- func (mach *Machine) GetSSHPort() int
- func (mach *Machine) GetSSHPrivateKeyMaterial() []byte
- func (mach *Machine) GetSSHPrivateKeyPath() string
- func (mach *Machine) GetSSHPublicKeyMaterial() []byte
- func (mach *Machine) GetSSHPublicKeyPath() string
- func (mach *Machine) GetSSHUser() string
- func (mach *Machine) GetServiceState(serviceName string) ServiceState
- func (mach *Machine) GetServices() map[string]ServiceType
- func (mach *Machine) GetStartTime() time.Time
- func (mach *Machine) GetStatusMessage() string
- func (mach *Machine) GetType() ResourceType
- func (mach *Machine) GetVMCount() int
- func (mach *Machine) GetVMSize() string
- func (mach *Machine) GetZone() string
- func (mach *Machine) InstallDockerAndCorePackages(ctx context.Context) error
- func (mach *Machine) IsComplete() bool
- func (mach *Machine) IsCustomScriptExecuted() bool
- func (mach *Machine) IsOrchestrator() bool
- func (mach *Machine) LogTimingInfo(logger logger.Logger)
- func (mach *Machine) ResourcesComplete() (int, int)
- func (mach *Machine) SSHEnabled() bool
- func (mach *Machine) ServicesComplete() (int, int)
- func (mach *Machine) SetComplete()
- func (mach *Machine) SetCustomScriptExecuted(executed bool)
- func (mach *Machine) SetDeploymentEndTime(endTime time.Time)
- func (mach *Machine) SetDiskImageFamily(family string)
- func (mach *Machine) SetDiskImageURL(url string)
- func (mach *Machine) SetDiskSizeGB(size int)
- func (mach *Machine) SetElapsedTime(elapsedTime time.Duration)
- func (mach *Machine) SetLocation(location string) error
- func (mach *Machine) SetMachineResource(resourceType string, resourceState MachineResourceState)
- func (mach *Machine) SetMachineResourceState(resourceName string, state MachineResourceState)
- func (mach *Machine) SetMachineServices(services map[string]ServiceType)
- func (mach *Machine) SetName(name string)
- func (mach *Machine) SetNodeType(nodeType string)
- func (mach *Machine) SetOrchestrator(orchestrator bool)
- func (mach *Machine) SetOrchestratorIP(ip string)
- func (mach *Machine) SetPrivateIP(ip string)
- func (mach *Machine) SetPublicIP(ip string)
- func (mach *Machine) SetSSHPort(port int)
- func (mach *Machine) SetSSHPrivateKeyMaterial(key []byte)
- func (mach *Machine) SetSSHPrivateKeyPath(path string)
- func (mach *Machine) SetSSHPublicKeyMaterial(key []byte)
- func (mach *Machine) SetSSHPublicKeyPath(path string)
- func (mach *Machine) SetSSHUser(user string)
- func (mach *Machine) SetServiceState(serviceName string, state ServiceState)
- func (mach *Machine) SetStartTime(startTime time.Time)
- func (mach *Machine) SetStatusMessage(message string)
- type MachineResource
- type MachineResourceState
- type Machiner
- type Parameters
- type ProviderAbbreviation
- type ResourceType
- type ServiceAccountInfo
- type ServiceState
- type ServiceType
- type StatusCode
- type StatusUpdateMsg
- type TimeUpdateMsg
Constants ¶
const ( BacalhauNodeTypeCompute = "compute" BacalhauNodeTypeOrchestrator = "requester" )
const ( DisplayTextSuccess = "✔" DisplayTextFailed = "✘" DisplayTextInProgress = "↻" DisplayTextWaiting = "↻" DisplayTextCreating = "⌃" DisplayTextUnknown = "?" DisplayTextNotStarted = "┅" DisplayEmojiSuccess = "✅" DisplayEmojiWaiting = "⏳" DisplayEmojiCreating = "⬆️" DisplayEmojiFailed = "❌" DisplayEmojiQuestion = "❓" DisplayEmojiNotStarted = "⬛️" DisplayEmojiOrchestratorNode = "🌕" DisplayEmojiWorkerNode = "⚫️" DisplayTextOrchestratorNode = "⏼" DisplayTextWorkerNode = " " DisplayEmojiOrchestrator = "🤖" DisplayEmojiSSH = "🔑" DisplayEmojiDocker = "🐳" DisplayEmojiBacalhau = "🐟" DisplayTextOrchestrator = "O" DisplayTextSSH = "S" DisplayTextDocker = "D" DisplayTextBacalhau = "B" DisplayTextCustomScript = "X" )
const (
MachineResourceTypeComputeInstance = "compute_instance"
)
const MaximumGCPProjectIDLength = 18
GCP constants
const MaximumGCPUniqueProjectIDLength = 26
const NumberOfSimultaneousProvisionings = 5
Variables ¶
var ( ServiceTypeSSH = ServiceType{Name: "SSH", State: ServiceStateNotStarted} ServiceTypeDocker = ServiceType{Name: "Docker", State: ServiceStateNotStarted} ServiceTypeBacalhau = ServiceType{Name: "Bacalhau", State: ServiceStateNotStarted} ServiceTypeCorePackages = ServiceType{Name: "CorePackages", State: ServiceStateNotStarted} ServiceTypeScript = ServiceType{Name: "Script", State: ServiceStateNotStarted} )
var AzureResourceTypeDISK = ResourceType{
ResourceString: "Microsoft.Compute/disks",
ShortResourceName: "DISK",
}
var AzureResourceTypeGuestAttestation = ResourceType{
ResourceString: "Microsoft.Compute/virtualMachines/extensions/GuestAttestation",
ShortResourceName: "GATT",
}
var AzureResourceTypeIP = ResourceType{
ResourceString: "Microsoft.Network/publicIPAddresses",
ShortResourceName: "IP ",
}
var AzureResourceTypeNIC = ResourceType{
ResourceString: "Microsoft.Network/networkInterfaces",
ShortResourceName: "NIC ",
}
var AzureResourceTypeNSG = ResourceType{
ResourceString: "Microsoft.Network/networkSecurityGroups",
ShortResourceName: "NSG ",
}
var AzureResourceTypeSNET = ResourceType{
ResourceString: "Microsoft.Network/subnets",
ShortResourceName: "SNET",
}
var AzureResourceTypeVM = ResourceType{
ResourceString: "Microsoft.Compute/virtualMachines",
ShortResourceName: "VM ",
}
var AzureResourceTypeVNET = ResourceType{
ResourceString: "Microsoft.Network/virtualNetworks",
ShortResourceName: "VNET",
}
var AzureSkippedResourceTypes = []string{
"Microsoft.Compute/virtualMachines/extensions",
}
var GCPResourceTypeDisk = ResourceType{
ResourceString: "compute.googleapis.com/Disk",
ShortResourceName: "DISK",
}
var GCPResourceTypeFirewall = ResourceType{
ResourceString: "compute.googleapis.com/Firewall",
ShortResourceName: "FW ",
}
var GCPResourceTypeInstance = ResourceType{
ResourceString: "compute.googleapis.com/Instance",
ShortResourceName: "VM ",
}
var GCPResourceTypeProject = ResourceType{
ResourceString: "cloudresourcemanager.googleapis.com/Project",
ShortResourceName: "PRJ ",
}
var GCPResourceTypeVPC = ResourceType{
ResourceString: "compute.googleapis.com/Network",
ShortResourceName: "VPC ",
}
var RequiredAzureResources = []ResourceType{ AzureResourceTypeVNET, AzureResourceTypeNIC, AzureResourceTypeNSG, AzureResourceTypeIP, AzureResourceTypeDISK, AzureResourceTypeVM, }
var RequiredGCPResources = []ResourceType{ GCPResourceTypeProject, GCPResourceTypeVPC, GCPResourceTypeFirewall, GCPResourceTypeInstance, GCPResourceTypeDisk, }
var RequiredServices = []ServiceType{ ServiceTypeSSH, ServiceTypeDocker, ServiceTypeBacalhau, ServiceTypeScript, }
var SkippedResourceTypes = []string{
"microsoft.compute/virtualmachines/extensions",
"compute.v1.instanceGroupManager",
}
Functions ¶
func CreateStateMessage ¶
func CreateStateMessage( resource ResourceType, resourceState MachineResourceState, resourceName string, ) string
func CreateStateMessageWithText ¶
func CreateStateMessageWithText( resource ResourceType, resourceState MachineResourceState, resourceName string, text string, ) string
func GetMachineNameFromResourceName ¶
Tests to see if the resource name is a machine ID. Returns the machine ID if it is.
func GetMachinesInLocation ¶
func GetProviderAbbreviation ¶
GetProviderAbbreviation returns the abbreviation for a given provider
func IsValidAzureResource ¶
func IsValidGCPResource ¶
func IsValidLocation ¶
func IsValidLocation(deploymentType DeploymentType, location string) bool
Add this new function
func MachineConfigToWrite ¶
Types ¶
type AzureConfig ¶
type AzureEvent ¶
type BacalhauSettings ¶
type BacalhauSettings struct { Key string `json:"key"` Value interface{} `json:"value"` }
func ReadBacalhauSettingsFromViper ¶
func ReadBacalhauSettingsFromViper() ([]BacalhauSettings, error)
type CloudSpecificInfo ¶
type ClusterDetails ¶
type ClusterDetails struct { Name string DeploymentType DeploymentType KubernetesVersion string NodeCount int NodeTypes []string }
ClusterDetails represents the details of a cluster
type Deployment ¶
type Deployment struct { Name string ViperPath string DeploymentType DeploymentType Azure *AzureConfig GCP *GCPConfig Machines map[string]Machiner UniqueID string StartTime time.Time EndTime time.Time Locations []string AllowedPorts []int SSHUser string SSHPort int SSHPublicKeyPath string SSHPublicKeyMaterial string SSHPrivateKeyPath string SSHPrivateKeyMaterial string OrchestratorIP string Tags map[string]string ProjectServiceAccounts map[string]ServiceAccountInfo BacalhauSettings []BacalhauSettings CustomScriptPath string // contains filtered or unexported fields }
func NewDeployment ¶
func NewDeployment() (*Deployment, error)
func (*Deployment) CreateMachine ¶
func (d *Deployment) CreateMachine(name string, machine Machiner)
func (*Deployment) GetCloudConfig ¶
func (d *Deployment) GetCloudConfig(cloudType DeploymentType) interface{}
func (*Deployment) GetCloudResources ¶
func (d *Deployment) GetCloudResources(cloudType DeploymentType) interface{}
func (*Deployment) GetMachine ¶
func (d *Deployment) GetMachine(name string) Machiner
func (*Deployment) GetMachines ¶
func (d *Deployment) GetMachines() map[string]Machiner
func (*Deployment) GetProjectID ¶
func (d *Deployment) GetProjectID() string
func (*Deployment) SetLocations ¶
func (d *Deployment) SetLocations(locations map[string]bool)
func (*Deployment) SetMachine ¶
func (d *Deployment) SetMachine(name string, machine Machiner)
func (*Deployment) SetMachines ¶
func (d *Deployment) SetMachines(machines map[string]Machiner)
func (*Deployment) SetProjectID ¶
func (d *Deployment) SetProjectID(projectID string)
func (*Deployment) ToMap ¶
func (d *Deployment) ToMap() map[string]interface{}
func (*Deployment) UpdateMachine ¶
func (d *Deployment) UpdateMachine(name string, updater func(Machiner)) error
func (*Deployment) UpdateViperConfig ¶
func (d *Deployment) UpdateViperConfig() error
type DeploymentStatus ¶
type DeploymentStatus string
const ( DeploymentStatusUnknown DeploymentStatus = "Unknown" DeploymentStatusNotStarted DeploymentStatus = "NotStarted" DeploymentStatusInProgress DeploymentStatus = "InProgress" DeploymentStatusSucceeded DeploymentStatus = "Succeeded" DeploymentStatusFailed DeploymentStatus = "Failed" )
type DeploymentType ¶
type DeploymentType string
const ( DeploymentTypeUnknown DeploymentType = "Unknown" DeploymentTypeAzure DeploymentType = "Azure" DeploymentTypeAWS DeploymentType = "AWS" DeploymentTypeGCP DeploymentType = "GCP" )
type DisplayStatus ¶
type DisplayStatus struct { ID string Type ResourceType Location string StatusMessage string DetailedStatus string ElapsedTime time.Duration StartTime time.Time InstanceID string PublicIP string PrivateIP string HighlightCycles int Name string Progress int Orchestrator bool SSH ServiceState Docker ServiceState CorePackages ServiceState Bacalhau ServiceState }
func ConvertFromRawResourceToStatus ¶
func ConvertFromRawResourceToStatus( resourceMap map[string]interface{}, deployment *Deployment, ) ([]DisplayStatus, error)
func NewDisplayStatus ¶
func NewDisplayStatus( machineName string, resourceID string, resourceType ResourceType, state MachineResourceState, ) *DisplayStatus
NewDisplayStatus creates a new DisplayStatus - machineName is the name of the machine (the start of the row - should be unique, something like ABCDEF-vm) - resourceID is the name of the resource (the end of the row - should be unique, something like ABCDEF-vm-nic or centralus-vnet) - resourceType is the type of the resource (e.g. AzureResourceTypeNIC) - state is the state of the resource (e.g. AzureResourceStateSucceeded)
func NewDisplayStatusWithText ¶
func NewDisplayStatusWithText( resourceID string, resourceType ResourceType, state MachineResourceState, text string, ) *DisplayStatus
func NewDisplayVMStatus ¶
func NewDisplayVMStatus( machineName string, state MachineResourceState, ) *DisplayStatus
NewDisplayVMStatus creates a new DisplayStatus for a VM - machineName is the name of the machine (the start of the row - should be unique, something like ABCDEF-vm) - resourceType is the type of the resource (e.g. AzureResourceTypeNIC) - state is the state of the resource (e.g. AzureResourceStateSucceeded)
func UpdateOnlyChangedStatus ¶
func UpdateOnlyChangedStatus( status *DisplayStatus, newStatus *DisplayStatus, ) *DisplayStatus
type GCPConfig ¶
type GCPConfig struct { ProjectID string OrganizationID string DefaultRegion string DefaultZone string DefaultMachineType string DefaultDiskSizeGB int32 BillingAccountID string ServiceAccountEmail string ProjectServiceAccounts map[string]ServiceAccountInfo Tags map[string]string DefaultCountPerZone int }
type GCPResourceState ¶
type GCPResourceState int
const ( GCPResourceStateUnknown GCPResourceState = iota GCPResourceStateProvisioning GCPResourceStateRunning GCPResourceStateStopping GCPResourceStateRepairing GCPResourceStateTerminated GCPResourceStateSuspended )
func ConvertFromStringToGCPResourceState ¶
func ConvertFromStringToGCPResourceState(s string) GCPResourceState
type Machine ¶
type Machine struct { ID string Name string Type ResourceType Location string Region string Zone string NodeType string StatusMessage string Parameters Parameters PublicIP string PrivateIP string StartTime time.Time VMSize string DiskSizeGB int DiskImageFamily string DiskImageURL string ElapsedTime time.Duration Orchestrator bool OrchestratorIP string SSHUser string SSHPrivateKeyMaterial []byte SSHPrivateKeyPath string SSHPublicKeyMaterial []byte SSHPublicKeyPath string SSHPort int CreationStartTime time.Time CreationEndTime time.Time SSHStartTime time.Time SSHEndTime time.Time DockerStartTime time.Time DockerEndTime time.Time BacalhauStartTime time.Time BacalhauEndTime time.Time DeploymentEndTime time.Time CustomScriptExecuted bool DeploymentType DeploymentType CloudProvider DeploymentType CloudSpecific CloudSpecificInfo // contains filtered or unexported fields }
func (*Machine) BacalhauEnabled ¶
func (*Machine) CloudType ¶
func (mach *Machine) CloudType() DeploymentType
CloudType returns the cloud provider type for this machine
func (*Machine) CustomScriptEnabled ¶
func (*Machine) DockerEnabled ¶
func (*Machine) EnsureMachineServices ¶
func (*Machine) GetDeploymentEndTime ¶
func (*Machine) GetDiskImageFamily ¶
func (*Machine) GetDiskImageURL ¶
func (*Machine) GetDiskSizeGB ¶
func (*Machine) GetElapsedTime ¶
func (*Machine) GetLocation ¶
func (*Machine) GetMachineResource ¶
func (mach *Machine) GetMachineResource(resourceType string) MachineResource
func (*Machine) GetMachineResourceState ¶
func (mach *Machine) GetMachineResourceState(resourceName string) MachineResourceState
func (*Machine) GetMachineResources ¶
func (mach *Machine) GetMachineResources() map[string]MachineResource
func (*Machine) GetMachineServices ¶
func (mach *Machine) GetMachineServices() map[string]ServiceType
Machine Services
func (*Machine) GetNodeType ¶ added in v0.0.5
func (*Machine) GetOrchestratorIP ¶
func (*Machine) GetPrivateIP ¶
func (*Machine) GetPublicIP ¶
func (*Machine) GetSSHPort ¶
func (*Machine) GetSSHPrivateKeyMaterial ¶
func (*Machine) GetSSHPrivateKeyPath ¶
func (*Machine) GetSSHPublicKeyMaterial ¶
func (*Machine) GetSSHPublicKeyPath ¶
func (*Machine) GetSSHUser ¶
func (*Machine) GetServiceState ¶
func (mach *Machine) GetServiceState(serviceName string) ServiceState
func (*Machine) GetServices ¶
func (mach *Machine) GetServices() map[string]ServiceType
Service management methods
func (*Machine) GetStartTime ¶
func (*Machine) GetStatusMessage ¶
func (*Machine) GetType ¶
func (mach *Machine) GetType() ResourceType
func (*Machine) GetVMCount ¶
func (*Machine) InstallDockerAndCorePackages ¶
func (*Machine) IsComplete ¶
func (*Machine) IsCustomScriptExecuted ¶
func (*Machine) IsOrchestrator ¶
func (*Machine) LogTimingInfo ¶
func (*Machine) ResourcesComplete ¶
func (*Machine) SSHEnabled ¶
func (*Machine) ServicesComplete ¶
func (*Machine) SetComplete ¶
func (mach *Machine) SetComplete()
func (*Machine) SetCustomScriptExecuted ¶
func (*Machine) SetDeploymentEndTime ¶
func (*Machine) SetDiskImageFamily ¶
func (*Machine) SetDiskImageURL ¶
func (*Machine) SetDiskSizeGB ¶
func (*Machine) SetElapsedTime ¶
func (*Machine) SetLocation ¶
func (*Machine) SetMachineResource ¶
func (mach *Machine) SetMachineResource(resourceType string, resourceState MachineResourceState)
func (*Machine) SetMachineResourceState ¶
func (mach *Machine) SetMachineResourceState(resourceName string, state MachineResourceState)
func (*Machine) SetMachineServices ¶
func (mach *Machine) SetMachineServices(services map[string]ServiceType)
func (*Machine) SetNodeType ¶ added in v0.0.5
func (*Machine) SetOrchestrator ¶
func (*Machine) SetOrchestratorIP ¶
func (*Machine) SetPrivateIP ¶
func (*Machine) SetPublicIP ¶
func (*Machine) SetSSHPort ¶
func (*Machine) SetSSHPrivateKeyMaterial ¶
func (*Machine) SetSSHPrivateKeyPath ¶
func (*Machine) SetSSHPublicKeyMaterial ¶
func (*Machine) SetSSHPublicKeyPath ¶
func (*Machine) SetSSHUser ¶
func (*Machine) SetServiceState ¶
func (mach *Machine) SetServiceState(serviceName string, state ServiceState)
func (*Machine) SetStartTime ¶
func (*Machine) SetStatusMessage ¶
type MachineResource ¶
type MachineResource struct { ResourceName string ResourceType ResourceType ResourceState MachineResourceState ResourceValue string }
type MachineResourceState ¶
type MachineResourceState int
const ( ResourceStateUnknown MachineResourceState = iota ResourceStateNotStarted ResourceStatePending ResourceStateRunning ResourceStateSucceeded ResourceStateStopping ResourceStateFailed ResourceStateTerminated )
func ConvertFromAzureStringToResourceState ¶
func ConvertFromAzureStringToResourceState(s string) MachineResourceState
type Machiner ¶
type Machiner interface { // Basic information GetID() string GetName() string SetName(string) GetType() ResourceType GetVMSize() string GetDiskSizeGB() int SetDiskSizeGB(size int) GetDiskImageFamily() string SetDiskImageFamily(family string) GetDiskImageURL() string SetDiskImageURL(url string) GetLocation() string SetLocation(location string) error GetRegion() string GetZone() string GetPublicIP() string SetPublicIP(ip string) GetPrivateIP() string SetPrivateIP(ip string) // SSH related GetSSHUser() string SetSSHUser(user string) GetSSHPublicKeyMaterial() []byte SetSSHPublicKeyMaterial([]byte) GetSSHPublicKeyPath() string SetSSHPublicKeyPath(path string) GetSSHPrivateKeyMaterial() []byte SetSSHPrivateKeyMaterial([]byte) GetSSHPrivateKeyPath() string SetSSHPrivateKeyPath(path string) GetSSHPort() int SetSSHPort(port int) // Status and state GetNodeType() string SetNodeType(nodeType string) IsOrchestrator() bool SetOrchestrator(orchestrator bool) IsComplete() bool SetComplete() GetOrchestratorIP() string SetOrchestratorIP(ip string) GetStatusMessage() string SetStatusMessage(message string) // Resource management GetMachineResource(resourceType string) MachineResource SetMachineResource(resourceType string, resourceState MachineResourceState) GetMachineResources() map[string]MachineResource GetMachineResourceState(resourceName string) MachineResourceState SetMachineResourceState(resourceName string, state MachineResourceState) ResourcesComplete() (int, int) // Service management GetServices() map[string]ServiceType GetServiceState(serviceName string) ServiceState SetServiceState(serviceName string, state ServiceState) EnsureMachineServices() error ServicesComplete() (int, int) // Installation methods InstallDockerAndCorePackages(ctx context.Context) error // Cloud provider CloudType() DeploymentType // Timing information GetStartTime() time.Time SetStartTime(startTime time.Time) GetDeploymentEndTime() time.Time SetDeploymentEndTime(endTime time.Time) GetElapsedTime() time.Duration SetElapsedTime(elapsedTime time.Duration) // Logging LogTimingInfo(logger logger.Logger) }
func NewMachine ¶
func NewMachine( cloudProvider DeploymentType, location string, vmSize string, diskSizeGB int, cloudSpecificInfo CloudSpecificInfo, ) (Machiner, error)
type Parameters ¶
type ProviderAbbreviation ¶
type ProviderAbbreviation string
const ( ProviderAbbreviationAzure ProviderAbbreviation = "AZU" ProviderAbbreviationAWS ProviderAbbreviation = "AWS" ProviderAbbreviationGCP ProviderAbbreviation = "GCP" ProviderAbbreviationVirtual ProviderAbbreviation = "VIR" ProviderAbbreviationUnknown ProviderAbbreviation = "UNK" )
type ResourceType ¶
func GetAllAzureResources ¶
func GetAllAzureResources() []ResourceType
func GetAllGCPResources ¶
func GetAllGCPResources() []ResourceType
func GetAzureResourceType ¶
func GetAzureResourceType(resource string) ResourceType
func GetGCPResourceType ¶
func GetGCPResourceType(resource string) ResourceType
func (*ResourceType) GetResourceLowerString ¶
func (a *ResourceType) GetResourceLowerString() string
func (*ResourceType) GetResourceString ¶
func (a *ResourceType) GetResourceString() string
func (*ResourceType) GetShortResourceName ¶
func (a *ResourceType) GetShortResourceName() string
type ServiceAccountInfo ¶
type ServiceState ¶
type ServiceState int
const ( ServiceStateNotStarted ServiceState = iota ServiceStateCreated ServiceStateUpdating ServiceStateSucceeded ServiceStateFailed ServiceStateUnknown )
type ServiceType ¶
type ServiceType struct { Name string State ServiceState }
type StatusCode ¶
type StatusCode string
StatusCode represents the possible status codes
const ( StatusSucceeded StatusCode = "✅" StatusFailed StatusCode = "❌" StatusCreating StatusCode = "🕕" StatusUpdating StatusCode = "🆙" StatusDeleting StatusCode = "␡" StatusUnknown StatusCode = "❓" )
Constants for each status code
const ( StatusCodeNotStarted StatusCode = "NotStarted" StatusCodeSucceeded StatusCode = "Succeeded" StatusCodeFailed StatusCode = "Failed" StatusCodeInProgress StatusCode = "InProgress" StatusCodeUnknown StatusCode = "Unknown" )
type StatusUpdateMsg ¶
type StatusUpdateMsg struct {
Status *DisplayStatus
}
type TimeUpdateMsg ¶
type TimeUpdateMsg struct{}