driver

package
v2.1.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2020 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayContainsString

func ArrayContainsString(array []string, str string) bool

ArrayContainsString check if the given string array contains the given string

func CheckSSHConnection

func CheckSSHConnection(hostname string) error

CheckSSHConnection will try a SSH connection to the given hostname

func GenerateSSHAuthorizedKeys

func GenerateSSHAuthorizedKeys(driverKey string, externalKeys []string) string

GenerateSSHAuthorizedKeys generate the SSH AuthorizedKeys composed of the driver and external user defined key(s)

Types

type Driver

type Driver struct {
	*drivers.BaseDriver

	// Persistent fields
	G5kJobID                           int
	G5kUsername                        string
	G5kPassword                        string
	G5kSite                            string
	G5kWalltime                        string
	G5kImage                           string
	G5kResourceProperties              string
	G5kReuseRefEnvironment             bool
	G5kJobQueue                        string
	G5kJobStartTime                    string
	DriverSSHPublicKey                 string
	ExternalSSHPublicKeys              []string
	G5kKeepAllocatedResourceAtDeletion bool
	G5kNodeHostname                    string
	// contains filtered or unexported fields
}

Driver parameters

func NewDriver

func NewDriver() *Driver

NewDriver creates and returns a new instance of the driver

func (*Driver) Create

func (d *Driver) Create() error

Create wait for the job to be running, deploy the OS image and copy the ssh keys

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags add command line flags to configure the driver

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns an IP or hostname that this host is available at

func (*Driver) GetMachineName

func (d *Driver) GetMachineName() string

GetMachineName returns the machine name

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

GetSSHHostname returns hostname for use with ssh

func (*Driver) GetSSHKeyPath

func (d *Driver) GetSSHKeyPath() string

GetSSHKeyPath returns key path for use with ssh

func (*Driver) GetSSHPort

func (d *Driver) GetSSHPort() (int, error)

GetSSHPort returns port for use with ssh

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

GetSSHUsername returns username for use with ssh

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a Docker compatible host URL for connecting to this host

func (*Driver) Kill

func (d *Driver) Kill() error

Kill perform a hard power-off on the node

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck check parameters and submit the job to Grid5000

func (*Driver) Remove

func (d *Driver) Remove() error

Remove delete the resources reservation

func (*Driver) Restart

func (d *Driver) Restart() error

Restart perform a soft reboot on the node

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(opts drivers.DriverOptions) error

SetConfigFromFlags configure the driver from the command line arguments

func (*Driver) Start

func (d *Driver) Start() error

Start perform a soft power-on on the node

func (*Driver) Stop

func (d *Driver) Stop() error

Stop perform a soft power-off on the node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL