singularity

package
v1.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

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

func (d *Driver) ConfigSchema() (*hclspec.Spec, error)

ConfigSchema return a hclspec.Spec struct

func (*Driver) DestroyTask

func (d *Driver) DestroyTask(taskID string, force bool) error

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

func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

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) SetConfig

func (d *Driver) SetConfig(cfg *base.Config) error

SetConfig set the nomad agent config based on base.Config

func (*Driver) Shutdown

func (d *Driver) Shutdown(ctx context.Context) error

Shutdown the plugin

func (*Driver) SignalTask

func (d *Driver) SignalTask(taskID string, signal string) error

SignalTask send a specific signal to a taskID

func (*Driver) StartTask

StartTask setup the task exec and calls the container excecutor

func (*Driver) StopTask

func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error

StopTask shutdown a tasked based on its taskID

func (*Driver) TaskConfigSchema

func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)

TaskConfigSchema returns a hclspec.Spec struct

func (*Driver) TaskEvents

func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

TaskEvents return a chan *drivers.TaskEvent

func (*Driver) TaskStats

func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)

TaskStats get task stats

func (*Driver) WaitTask

func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

WaitTask watis for task completion

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

type TaskState

type TaskState struct {
	TaskConfig    *drivers.TaskConfig
	ContainerName string
	StartedAt     time.Time
	PID           int
}

TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the task state and handler during recovery.

Jump to

Keyboard shortcuts

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