Documentation ¶
Index ¶
- Constants
- func GenRemoteAddress(ip string, port int) string
- func GenRemoteAddresses(instances []Instance) ([]string, []string)
- func UpdateInstance(instances *Instance, nodes []*lib.NodeInfo, cons lib.Constructor)
- func UpdateInstances(inst []*Instance, allocations map[string][]*lib.NodeInfo, cons lib.Constructor)
- func WaitUntilAllInstancesRunning(a Manager, delay func()) (int, error)
- type Commands
- type Config
- type Instance
- type Manager
- type MasterCommands
- type NodeController
- type SlaveCommands
- func (c SlaveCommands) Configure() map[int]string
- func (c SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorage() map[int]string
- func (c SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorageQuitSSH() map[int]string
- func (c SlaveCommands) Kill() string
- func (c SlaveCommands) Start(masterAddr, monitorAddr string, inst Instance, run int) string
- func (c SlaveCommands) StartAndQuitSSH(masterAddr, monitorAddr string, inst Instance, run int) string
Constants ¶
const RnDMasterTag = "R&D_master"
RnDMasterTag is a filter for master instance
const RnDTag = "R&D"
RnDTag is a filter for slave instances
Variables ¶
This section is empty.
Functions ¶
func GenRemoteAddress ¶
GenRemoteAddress generates Node address
func GenRemoteAddresses ¶
GenRemoteAddresses generates n * 2 addresses: one for handel, one for the sync
func UpdateInstance ¶
func UpdateInstance(instances *Instance, nodes []*lib.NodeInfo, cons lib.Constructor)
UpdateInstance bla
func UpdateInstances ¶
func UpdateInstances(inst []*Instance, allocations map[string][]*lib.NodeInfo, cons lib.Constructor)
UpdateInstances updates the address of the instances
func WaitUntilAllInstancesRunning ¶
WaitUntilAllInstancesRunning blocks until all instances are in the "running" state
Types ¶
type Commands ¶
type Commands struct { MasterBinPath string SlaveBinPath string ConfPath string RegPath string S3 string // contains filtered or unexported fields }
Commands represents AWS platform specyfic commands.
func NewCommands ¶
func NewCommands(masterBinPath, slaveBinPath, confPath, regPath, s3 string, copyBinFiles bool) Commands
NewCommands creates an instance of Commands
type Config ¶
type Config struct { PemFile string Regions []string MasterTimeOut int SSHUser string TargetSystem string TargetArch string CopyBinFiles bool ConfTimeout int }
func LoadConfig ¶
type Instance ¶
type Instance struct { // EC2 ID ID *string // IP Visible to the outside world PublicIP *string // State: running, pending, stopped State *string //EC2 Instance region Region string // EC2 Instance TAG Tag string Nodes []*lib.Node }
Instance represents EC2 Amazon instance
type Manager ¶
type Manager interface { // Instances lists available instances in any state Instances() []Instance // RefreshInstances populates the instance list and updates instances status RefreshInstances() ([]Instance, error) // StartInstances starts all available instances and populates the instance list, // blocks until all instances are in "running" state StartInstances() error // StopInstances stops all available instances StopInstances() error }
Manager manages group of EC2 instances
func NewMultiRegionAWSManager ¶
NewMultiRegionAWSManager creates AWS manager for list of regions
type MasterCommands ¶
type MasterCommands struct {
Commands
}
MasterCommands commands invoked on a master node
func (MasterCommands) Configure ¶
func (c MasterCommands) Configure() map[int]string
type NodeController ¶
type NodeController interface { // CopyFiles copies files to equivalent location on a remote host // for example "/tmp/aws.csv" from localhost will be placed in // "/tmp/aws.csv" on the remote host CopyFiles(files ...string) error // Run runs command on a remote node, for example Run("ls -l") and blocks until completion Run(command string, pw *io.PipeWriter) error // Run starts command on a remote node Start(command string) error // Init inits connection to the remote node Init() error // Close Close() }
NodeController represents avaliable operations to perform on a remote node
func NewSSHNodeController ¶
func NewSSHNodeController(sshAddr string, pemBytes []byte, user string) (NodeController, error)
NewSSHNodeController creates ssh based NodeController
type SlaveCommands ¶
SlaveCommands commands invoked on a slave node
func (SlaveCommands) Configure ¶
func (c SlaveCommands) Configure() map[int]string
func (SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorage ¶
func (c SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorage() map[int]string
func (SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorageQuitSSH ¶
func (c SlaveCommands) CopyRegistryFileFromSharedDirToLocalStorageQuitSSH() map[int]string
func (SlaveCommands) Start ¶
func (c SlaveCommands) Start(masterAddr, monitorAddr string, inst Instance, run int) string
func (SlaveCommands) StartAndQuitSSH ¶
func (c SlaveCommands) StartAndQuitSSH(masterAddr, monitorAddr string, inst Instance, run int) string