Documentation
¶
Index ¶
- func NewSingularityDriver(logger hclog.Logger) drivers.DriverPlugin
- type Config
- type Driver
- func (d *Driver) Capabilities() (*drivers.Capabilities, error)
- func (d *Driver) ConfigSchema() (*hclspec.Spec, 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) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
- func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
- func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
- func (d *Driver) SetConfig(cfg *base.Config) error
- func (d *Driver) Shutdown(ctx context.Context) error
- 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 TaskConfig
- type TaskState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSingularityDriver ¶
func NewSingularityDriver(logger hclog.Logger) drivers.DriverPlugin
NewSingularityDriver returns a new DriverPlugin implementation
Types ¶
type Config ¶
type Config struct {
// Enabled is set to true to enable the Singularity driver
Enabled bool `codec:"enabled"`
AllowVolumes bool `codec:"volumes_enabled"`
SingularityPath string `codec:"singularity_path"`
}
Config is the driver configuration set by the SetConfig RPC call
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a driver for running Singularity containers https://github.com/sylabs/singularity
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() (*drivers.Capabilities, error)
Capabilities a drivers.Capabilities struct
func (*Driver) ConfigSchema ¶
ConfigSchema return a hclspec.Spec struct
func (*Driver) DestroyTask ¶
DestroyTask delete task
func (*Driver) ExecTask ¶
func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
ExecTask calls a exec cmd over a running task
func (*Driver) Fingerprint ¶
Fingerprint return the plugin fingerprint
func (*Driver) InspectTask ¶
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
InspectTask retrieves task info
func (*Driver) PluginInfo ¶
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo return a base.PluginInfoResponse struct
func (*Driver) RecoverTask ¶
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
RecoverTask try to recover a failed task, if not return error
func (*Driver) SignalTask ¶
SignalTask send a specific signal to a taskID
func (*Driver) StartTask ¶
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
StartTask setup the task exec and calls the container excecutor
func (*Driver) TaskConfigSchema ¶
TaskConfigSchema returns a hclspec.Spec struct
func (*Driver) TaskEvents ¶
TaskEvents return a chan *drivers.TaskEvent
type TaskConfig ¶
type TaskConfig struct {
Image string `codec:"image"`
Args []string `codec:"args"`
// Command can be run or exec , shell is not supported via plugin
Command string `codec:"command"`
// Enable debug-verbose global options
Debug bool `codec:"debug"`
Verbose bool `codec:"verbose"`
Binds []string `codec:"binds"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container
Security []string `codec:"security"`
KeepPrivs bool `codec:"keepprivs"`
DropCaps string `codec:"dropcaps"`
Contain bool `codec:"contain"`
NoHome bool `codec:"nohome"`
Home string `codec:"home"`
Workdir string `codec:"workdir"`
Pwd string `codec:"pwd"`
App string `codec:"app"`
Overlay []string `codec:"overlay"`
}
TaskConfig is the driver configuration of a task within a job