Documentation
¶
Index ¶
- Constants
- Variables
- type CommandRunner
- type RuncAdapter
- type RuncClient
- type RuncLifecycle
- func (j *RuncLifecycle) GetProcess(cfg *config.BPMConfig) (*models.Process, error)
- func (j *RuncLifecycle) ListProcesses() ([]*models.Process, error)
- func (j *RuncLifecycle) OpenShell(cfg *config.BPMConfig, stdin io.Reader, stdout, stderr io.Writer) error
- func (j *RuncLifecycle) RemoveProcess(cfg *config.BPMConfig) error
- func (j *RuncLifecycle) StartProcess(logger lager.Logger, bpmCfg *config.BPMConfig, procCfg *config.ProcessConfig) error
- func (j *RuncLifecycle) StopProcess(logger lager.Logger, cfg *config.BPMConfig, exitTimeout time.Duration) error
- type UserFinder
Constants ¶
View Source
const ( ContainerSigQuitGracePeriod = 5 * time.Second ContainerStatePollInterval = 1 * time.Second ContainerStateRunning = "running" ContainerStatePaused = "paused" ContainerStateStopped = "stopped" )
Variables ¶
View Source
var TimeoutError = errors.New("failed to stop job within timeout")
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
func NewCommandRunner ¶
func NewCommandRunner() CommandRunner
type RuncAdapter ¶
type RuncClient ¶
type RuncClient interface {
CreateBundle(bundlePath string, jobSpec specs.Spec, user specs.User) error
RunContainer(pidFilePath, bundlePath, containerID string, stdout, stderr io.Writer) error
Exec(containerID, command string, stdin io.Reader, stdout, stderr io.Writer) error
ContainerState(containerID string) (*specs.State, error)
ListContainers() ([]client.ContainerState, error)
SignalContainer(containerID string, signal client.Signal) error
DeleteContainer(containerID string) error
DestroyBundle(bundlePath string) error
}
type RuncLifecycle ¶
type RuncLifecycle struct {
// contains filtered or unexported fields
}
func NewRuncLifecycle ¶
func NewRuncLifecycle( runcClient RuncClient, runcAdapter RuncAdapter, userFinder UserFinder, commandRunner CommandRunner, clock clock.Clock, ) *RuncLifecycle
func (*RuncLifecycle) GetProcess ¶
GetProcess returns the following: - process, nil if the process is running (and no errors were encountered) - nil,nil if the process is not running and there is no other error - nil,error if there is any other error getting the process beyond it not running
func (*RuncLifecycle) ListProcesses ¶
func (j *RuncLifecycle) ListProcesses() ([]*models.Process, error)
func (*RuncLifecycle) RemoveProcess ¶
func (j *RuncLifecycle) RemoveProcess(cfg *config.BPMConfig) error
func (*RuncLifecycle) StartProcess ¶
func (j *RuncLifecycle) StartProcess(logger lager.Logger, bpmCfg *config.BPMConfig, procCfg *config.ProcessConfig) error
func (*RuncLifecycle) StopProcess ¶
Click to show internal directories.
Click to hide internal directories.