Documentation ¶
Index ¶
- Constants
- Variables
- type DockerManager
- func (dockerMgr *DockerManager) CanSpawn() (bool, error)
- func (dockerMgr *DockerManager) Configure(settings *evergreen.Settings) error
- func (dockerMgr *DockerManager) GetDNSName(host *host.Host) (string, error)
- func (dockerMgr *DockerManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)
- func (dockerMgr *DockerManager) GetSSHOptions(host *host.Host, keyPath string) ([]string, error)
- func (_ *DockerManager) GetSettings() cloud.ProviderSettings
- func (dockerMgr *DockerManager) IsSSHReachable(host *host.Host, keyPath string) (bool, error)
- func (dockerMgr *DockerManager) IsUp(host *host.Host) (bool, error)
- func (dockerMgr *DockerManager) OnUp(host *host.Host) error
- func (dockerMgr *DockerManager) SpawnInstance(d *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)
- func (dockerMgr *DockerManager) TerminateInstance(host *host.Host) error
- func (dockerMgr *DockerManager) TimeTilNextPayment(host *host.Host) time.Duration
- type Settings
Constants ¶
const ( DockerStatusRunning = iota DockerStatusPaused DockerStatusRestarting DockerStatusKilled DockerStatusUnknown ProviderName = "docker" TimeoutSeconds = 5 )
Variables ¶
var ( // bson fields for the Settings struct HostIp = bsonutil.MustHaveTag(Settings{}, "HostIp") BindIp = bsonutil.MustHaveTag(Settings{}, "BindIp") ImageId = bsonutil.MustHaveTag(Settings{}, "ImageId") ClientPort = bsonutil.MustHaveTag(Settings{}, "ClientPort") PortRange = bsonutil.MustHaveTag(Settings{}, "PortRange") Auth = bsonutil.MustHaveTag(Settings{}, "Auth") // bson fields for the portRange struct MinPort = bsonutil.MustHaveTag(portRange{}, "MinPort") MaxPort = bsonutil.MustHaveTag(portRange{}, "MaxPort") // bson fields for the auth struct Cert = bsonutil.MustHaveTag(auth{}, "Cert") Key = bsonutil.MustHaveTag(auth{}, "Key") Ca = bsonutil.MustHaveTag(auth{}, "Ca") // exposed port (set to 22/tcp, default ssh port) SSHDPort docker.Port = "22/tcp" )
Functions ¶
This section is empty.
Types ¶
type DockerManager ¶
type DockerManager struct { }
func (*DockerManager) CanSpawn ¶
func (dockerMgr *DockerManager) CanSpawn() (bool, error)
CanSpawn returns if a given cloud provider supports spawning a new host dynamically. Always returns true for Docker.
func (*DockerManager) Configure ¶
func (dockerMgr *DockerManager) Configure(settings *evergreen.Settings) error
Configure populates a DockerManager by reading relevant settings from the config object.
func (*DockerManager) GetDNSName ¶
func (dockerMgr *DockerManager) GetDNSName(host *host.Host) (string, error)
GetDNSName gets the DNS hostname of a container by reading it directly from the Docker API
func (*DockerManager) GetInstanceStatus ¶
func (dockerMgr *DockerManager) GetInstanceStatus(host *host.Host) (cloud.CloudStatus, error)
GetInstanceStatus returns a universal status code representing the state of a container.
func (*DockerManager) GetSSHOptions ¶
GetSSHOptions returns an array of default SSH options for connecting to a container.
func (*DockerManager) GetSettings ¶
func (_ *DockerManager) GetSettings() cloud.ProviderSettings
func (*DockerManager) IsSSHReachable ¶
IsSSHReachable checks if a container appears to be reachable via SSH by attempting to contact the host directly.
func (*DockerManager) IsUp ¶
func (dockerMgr *DockerManager) IsUp(host *host.Host) (bool, error)
IsUp checks the container's state by querying the Docker API and returns true if the host should be available to connect with SSH.
func (*DockerManager) SpawnInstance ¶
func (dockerMgr *DockerManager) SpawnInstance(d *distro.Distro, hostOpts cloud.HostOptions) (*host.Host, error)
SpawnInstance creates and starts a new Docker container
func (*DockerManager) TerminateInstance ¶
func (dockerMgr *DockerManager) TerminateInstance(host *host.Host) error
TerminateInstance destroys a container.
func (*DockerManager) TimeTilNextPayment ¶
func (dockerMgr *DockerManager) TimeTilNextPayment(host *host.Host) time.Duration
TimeTilNextPayment returns the amount of time until the next payment is due for the host. For Docker this is not relevant.
type Settings ¶
type Settings struct { HostIp string `mapstructure:"host_ip" json:"host_ip" bson:"host_ip"` BindIp string `mapstructure:"bind_ip" json:"bind_ip" bson:"bind_ip"` ImageId string `mapstructure:"image_name" json:"image_name" bson:"image_name"` ClientPort int `mapstructure:"client_port" json:"client_port" bson:"client_port"` PortRange *portRange `mapstructure:"port_range" json:"port_range" bson:"port_range"` Auth *auth `mapstructure:"auth" json:"auth" bson:"auth"` }