runtime

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBaseRunDir is the default location for running pods and containers.
	DefaultBaseRunDir = "/var/run/singularity"

	// DefaultStreamingURL is the default streaming server address.
	DefaultStreamingURL = "127.0.0.1:12345"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(r *SingularityRuntime)

Option is run during SingularityRuntime initialization. Predefined options may be used to add streaming and network support.

func WithBaseRunDir

func WithBaseRunDir(dir string) Option

WithBaseRunDir sets base directory where all running pods and containers are stored. Overrides DefaultBaseRunDir.

func WithNetwork

func WithNetwork(cniBin, cniConf string) Option

WithNetwork accepts CNI paths and enables networking support. If cniBin or cniConf is an empty string corresponding default value from network package will be used.

func WithStreaming

func WithStreaming(url string) Option

WithStreaming sets enables streaming endpoints by setting streaming server URL. If url is empty DefaultStreamingURL will be used.

func WithTrashDir

func WithTrashDir(dir string) Option

WithTrashDir sets trash directory for containers where all logs and configs may be found even after contaienr removal.

type SingularityRuntime

type SingularityRuntime struct {
	// contains filtered or unexported fields
}

SingularityRuntime implements k8s RuntimeService interface.

func NewSingularityRuntime

func NewSingularityRuntime(imgIndex *index.ImageIndex, opts ...Option) (*SingularityRuntime, error)

NewSingularityRuntime initializes and returns SingularityRuntime. Singularity must be installed on the host otherwise it will return an error. SingularityRuntime depends on SingularityRegistry so it must not be nil.

func (*SingularityRuntime) Attach

Attach prepares a streaming endpoint to attach to a running container.

func (*SingularityRuntime) ContainerStats

ContainerStats returns stats of the container. If the container does not exist, the call returns an error.

func (*SingularityRuntime) ContainerStatus

ContainerStatus returns status of the container. If the container is not present, returns an error.

func (*SingularityRuntime) CreateContainer

CreateContainer creates a new container in specified PodSandbox.

func (*SingularityRuntime) Exec

Exec prepares a streaming endpoint to execute a command in the container.

func (*SingularityRuntime) ExecSync

ExecSync runs a command in a container synchronously.

func (*SingularityRuntime) ListContainerStats

ListContainerStats returns stats of all running containers.

func (*SingularityRuntime) ListContainers

ListContainers lists all containers by filters.

func (*SingularityRuntime) ListPodSandbox

ListPodSandbox returns a list of PodSandboxes.

func (*SingularityRuntime) PodSandboxStatus

PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not present, returns an error.

func (*SingularityRuntime) PortForward

PortForward prepares a streaming endpoint to forward ports from a PodSandbox.

func (*SingularityRuntime) RemoveContainer

RemoveContainer removes the container. If the container is running, the container must be forcibly removed. This call is idempotent, and must not return an error if the container has already been removed.

func (*SingularityRuntime) RemovePodSandbox

RemovePodSandbox removes the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated and removed. This call is idempotent, and must not return an error if the sandbox has already been removed.

func (*SingularityRuntime) ReopenContainerLog

ReopenContainerLog asks runtime to reopen the stdout/stderr log file for the container. This is often called after the log file has been rotated. If the container is not running, container runtime can choose to either create a new log file and return nil, or return an error. Once it returns error, new container log file MUST NOT be created.

func (*SingularityRuntime) RunPodSandbox

RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure the sandbox is in the ready state on success.

func (*SingularityRuntime) Shutdown

func (s *SingularityRuntime) Shutdown() error

Shutdown shuts down any running background tasks created by SingularityRuntime. This methods should be called when SingularityRuntime will no longer be used.

func (*SingularityRuntime) StartContainer

StartContainer starts the container.

func (*SingularityRuntime) Status

Status returns the status of the runtime.

func (*SingularityRuntime) StopContainer

StopContainer stops a running container with a grace period (i.e., timeout). This call is idempotent, and must not return an error if the container has already been stopped. If a grace period is reached runtime will be asked to kill container.

func (*SingularityRuntime) StopPodSandbox

StopPodSandbox stops any running process that is part of the sandbox and reclaims network resources (e.g., IP addresses) allocated to the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated. This call is idempotent, and must not return an error if all relevant resources have already been reclaimed. kubelet will call StopPodSandbox at least once before calling RemovePodSandbox. It will also attempt to reclaim resources eagerly, as soon as a sandbox is not needed. Hence, multiple StopPodSandbox calls are expected.

func (*SingularityRuntime) UpdateContainerResources

UpdateContainerResources updates ContainerConfig of the container.

func (*SingularityRuntime) UpdateRuntimeConfig

UpdateRuntimeConfig updates the runtime configuration based on the given request.

func (*SingularityRuntime) Version

Version returns the runtime name, runtime version and runtime API version.

Jump to

Keyboard shortcuts

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