Documentation ¶
Index ¶
- Constants
- Variables
- func NewDockerDriver(logger hclog.Logger) drivers.DriverPlugin
- func PluginLoader(opts map[string]string) (map[string]interface{}, error)
- type AuthConfig
- type ContainerGCConfig
- type DockerAuth
- type DockerBindOptions
- type DockerDevice
- type DockerImageClient
- type DockerLogging
- type DockerMount
- type DockerTmpfsOptions
- type DockerVolumeDriverConfig
- type DockerVolumeOptions
- type Driver
- func (d *Driver) Capabilities() (*drivers.Capabilities, error)
- func (d *Driver) ConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) CreateNetwork(allocID string) (*drivers.NetworkIsolationSpec, bool, error)
- func (d *Driver) DestroyNetwork(allocID string, spec *drivers.NetworkIsolationSpec) error
- func (d *Driver) DestroyTask(taskID string, force bool) error
- func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
- func (d *Driver) ExecTaskStreaming(ctx context.Context, taskID string, opts *drivers.ExecOptions) (*drivers.ExitResult, error)
- func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
- func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
- func (d *Driver) InternalCapabilities() drivers.InternalCapabilities
- func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
- func (d *Driver) SetConfig(c *base.Config) error
- func (d *Driver) Shutdown()
- func (d *Driver) SignalTask(taskID string, signal string) error
- func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
- func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error
- func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)
- func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)
- func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
- type DriverConfig
- type GCConfig
- type LogEventFn
- type TLSConfig
- type TaskConfig
- type VolumeConfig
Constants ¶
View Source
const ( // NoSuchContainerError is returned by the docker daemon if the container // does not exist. NoSuchContainerError = "No such container" // ContainerNotRunningError is returned by the docker daemon if the container // is not running, yet we requested it to stop ContainerNotRunningError = "Container not running" )
Variables ¶
View Source
var ( // PluginID is the rawexec plugin metadata registered in the plugin // catalog. PluginID = loader.PluginID{ Name: pluginName, PluginType: base.PluginTypeDriver, } // PluginConfig is the rawexec factory function registered in the // plugin catalog. PluginConfig = &loader.InternalPluginConfig{ Config: map[string]interface{}{}, Factory: func(l hclog.Logger) interface{} { return NewDockerDriver(l) }, } )
Functions ¶
func NewDockerDriver ¶
func NewDockerDriver(logger hclog.Logger) drivers.DriverPlugin
NewDockerDriver returns a docker implementation of a driver plugin
Types ¶
type AuthConfig ¶
type ContainerGCConfig ¶ added in v0.9.5
type ContainerGCConfig struct { // Enabled controls whether container reconciler is enabled Enabled bool `codec:"enabled"` // DryRun indicates that reconciler should log unexpectedly running containers // if found without actually killing them DryRun bool `codec:"dry_run"` // PeriodStr controls the frequency of scanning containers PeriodStr string `codec:"period"` // CreationGraceStr is the duration allowed for a newly created container // to live without being registered as a running task in nomad. // A container is treated as leaked if it lived more than grace duration // and haven't been registered in tasks. CreationGraceStr string `codec:"creation_grace"` CreationGrace time.Duration `codec:"-"` // contains filtered or unexported fields }
ContainerGCConfig controls the behavior of the GC reconciler to detects dangling nomad containers that aren't tracked due to docker/nomad bugs
type DockerAuth ¶
type DockerBindOptions ¶
type DockerBindOptions struct {
Propagation string `codec:"propagation"`
}
type DockerDevice ¶
type DockerImageClient ¶
type DockerImageClient interface { PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error InspectImage(id string) (*docker.Image, error) RemoveImage(id string) error }
DockerImageClient provides the methods required to do CRUD operations on the Docker images
type DockerLogging ¶
type DockerMount ¶
type DockerMount struct { Type string `codec:"type"` Target string `codec:"target"` Source string `codec:"source"` ReadOnly bool `codec:"readonly"` BindOptions DockerBindOptions `codec:"bind_options"` VolumeOptions DockerVolumeOptions `codec:"volume_options"` TmpfsOptions DockerTmpfsOptions `codec:"tmpfs_options"` }
type DockerTmpfsOptions ¶
type DockerVolumeDriverConfig ¶
type DockerVolumeDriverConfig struct { Name string `codec:"name"` Options hclutils.MapStrStr `codec:"options"` }
DockerVolumeDriverConfig holds a map of volume driver specific options
type DockerVolumeOptions ¶
type DockerVolumeOptions struct { NoCopy bool `codec:"no_copy"` Labels hclutils.MapStrStr `codec:"labels"` DriverConfig DockerVolumeDriverConfig `codec:"driver_config"` }
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() (*drivers.Capabilities, error)
func (*Driver) CreateNetwork ¶ added in v0.9.5
func (*Driver) DestroyNetwork ¶ added in v0.9.5
func (d *Driver) DestroyNetwork(allocID string, spec *drivers.NetworkIsolationSpec) error
func (*Driver) ExecTaskStreaming ¶ added in v0.9.2
func (d *Driver) ExecTaskStreaming(ctx context.Context, taskID string, opts *drivers.ExecOptions) (*drivers.ExitResult, error)
func (*Driver) Fingerprint ¶
func (*Driver) InspectTask ¶
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
func (*Driver) InternalCapabilities ¶ added in v0.9.5
func (d *Driver) InternalCapabilities() drivers.InternalCapabilities
func (*Driver) PluginInfo ¶
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
func (*Driver) RecoverTask ¶
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
func (*Driver) StartTask ¶
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
func (*Driver) TaskEvents ¶
type DriverConfig ¶
type DriverConfig struct { Endpoint string `codec:"endpoint"` Auth AuthConfig `codec:"auth"` TLS TLSConfig `codec:"tls"` GC GCConfig `codec:"gc"` Volumes VolumeConfig `codec:"volumes"` AllowPrivileged bool `codec:"allow_privileged"` AllowCaps []string `codec:"allow_caps"` GPURuntimeName string `codec:"nvidia_runtime"` InfraImage string `codec:"infra_image"` DisableLogCollection bool `codec:"disable_log_collection"` PullActivityTimeout string `codec:"pull_activity_timeout"` // contains filtered or unexported fields }
type GCConfig ¶
type GCConfig struct { Image bool `codec:"image"` ImageDelay string `codec:"image_delay"` Container bool `codec:"container"` DanglingContainers ContainerGCConfig `codec:"dangling_containers"` // contains filtered or unexported fields }
type LogEventFn ¶
LogEventFn is a callback which allows Drivers to emit task events.
type TaskConfig ¶
type TaskConfig struct { Image string `codec:"image"` AdvertiseIPv6Addr bool `codec:"advertise_ipv6_address"` Args []string `codec:"args"` Auth DockerAuth `codec:"auth"` AuthSoftFail bool `codec:"auth_soft_fail"` CapAdd []string `codec:"cap_add"` CapDrop []string `codec:"cap_drop"` Command string `codec:"command"` CPUCFSPeriod int64 `codec:"cpu_cfs_period"` CPUHardLimit bool `codec:"cpu_hard_limit"` Devices []DockerDevice `codec:"devices"` DNSSearchDomains []string `codec:"dns_search_domains"` DNSOptions []string `codec:"dns_options"` DNSServers []string `codec:"dns_servers"` Entrypoint []string `codec:"entrypoint"` ExtraHosts []string `codec:"extra_hosts"` ForcePull bool `codec:"force_pull"` Hostname string `codec:"hostname"` Interactive bool `codec:"interactive"` IPCMode string `codec:"ipc_mode"` IPv4Address string `codec:"ipv4_address"` IPv6Address string `codec:"ipv6_address"` Labels hclutils.MapStrStr `codec:"labels"` LoadImage string `codec:"load"` Logging DockerLogging `codec:"logging"` MacAddress string `codec:"mac_address"` Mounts []DockerMount `codec:"mounts"` NetworkAliases []string `codec:"network_aliases"` NetworkMode string `codec:"network_mode"` PidsLimit int64 `codec:"pids_limit"` PidMode string `codec:"pid_mode"` PortMap hclutils.MapStrInt `codec:"port_map"` Privileged bool `codec:"privileged"` ReadonlyRootfs bool `codec:"readonly_rootfs"` SecurityOpt []string `codec:"security_opt"` ShmSize int64 `codec:"shm_size"` StorageOpt map[string]string `codec:"storage_opt"` Sysctl hclutils.MapStrStr `codec:"sysctl"` TTY bool `codec:"tty"` Ulimit hclutils.MapStrStr `codec:"ulimit"` UTSMode string `codec:"uts_mode"` UsernsMode string `codec:"userns_mode"` Volumes []string `codec:"volumes"` VolumeDriver string `codec:"volume_driver"` WorkDir string `codec:"work_dir"` }
type VolumeConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.