Documentation ¶
Index ¶
- Constants
- Variables
- func GetTitusInitsPath(taskID string, cName string) string
- func GetTitusTaskRunTimeDir(taskID string) string
- func MountTmpfs(path string, size string) error
- func NewDockerRuntime(ctx context.Context, m metrics.Reporter, dockerCfg Config, cfg config.Config, ...) (runtimeTypes.ContainerRuntimeProvider, error)
- func UnmountLazily(path string) error
- type Config
- type DockerRuntime
- func (r *DockerRuntime) Cleanup(parentCtx context.Context) error
- func (r *DockerRuntime) DockerImageRemove(ctx context.Context, imgName string) error
- func (r *DockerRuntime) DockerPull(ctx context.Context, c runtimeTypes.Container) (*types.ImageInspect, error)
- func (r *DockerRuntime) GetFullCommandForDebug(cName string) (string, string)
- func (r *DockerRuntime) Kill(ctx context.Context, wasKilled bool) error
- func (r *DockerRuntime) Prepare(ctx context.Context) (err error)
- func (r *DockerRuntime) SetFullCommandForDebug(cName string, fullCommand []string)
- func (r *DockerRuntime) Start(parentCtx context.Context) (string, *runtimeTypes.Details, <-chan runtimeTypes.StatusMessage, error)
- type Opt
Constants ¶
const ( SYS_ADMIN = "SYS_ADMIN" // nolint: golint NET_ADMIN = "NET_ADMIN" // nolint: golint )
const ( KiB = 1024 MiB = 1024 * KiB GiB = 1024 * MiB KB = 1000 MB = 1000 * KB GB = 1000 * MB )
units
const ( SCHED_OTHER = 0 // nolint: golint SCHED_FIFO = 1 // nolint: golint SCHED_RR = 2 // nolint: golint SCHED_BATCH = 3 // nolint: golint SCHED_IDLE = 5 // nolint: golint SCHED_RESET_ON_FORK = 0x40000000 // nolint: golint )
Variables ¶
var NoEntrypointError = &runtimeTypes.BadEntryPointError{Reason: errors.New("Image, and job have no entrypoint, or command")}
NoEntrypointError indicates that the Titus job does not have an entrypoint, or command
Functions ¶
func GetTitusInitsPath ¶
func GetTitusTaskRunTimeDir ¶
func MountTmpfs ¶
func NewDockerRuntime ¶
func NewDockerRuntime(ctx context.Context, m metrics.Reporter, dockerCfg Config, cfg config.Config, dockerOpts ...Opt) (runtimeTypes.ContainerRuntimeProvider, error)
NewDockerRuntime provides a Runtime implementation on Docker.
func UnmountLazily ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the configuration for the Docker titus runtime
func GenerateConfiguration ¶
GenerateConfiguration is only meant to validate the behaviour of parsing command line arguments
type DockerRuntime ¶
type DockerRuntime struct {
// contains filtered or unexported fields
}
DockerRuntime implements the Runtime interface calling Docker Engine APIs
func (*DockerRuntime) Cleanup ¶
func (r *DockerRuntime) Cleanup(parentCtx context.Context) error
Cleanup runs the registered callbacks for a container
func (*DockerRuntime) DockerImageRemove ¶
func (r *DockerRuntime) DockerImageRemove(ctx context.Context, imgName string) error
DockerImageRemove removes an image from the docker host
func (*DockerRuntime) DockerPull ¶
func (r *DockerRuntime) DockerPull(ctx context.Context, c runtimeTypes.Container) (*types.ImageInspect, error)
DockerPull returns an ImageInspect pointer if the image was cached, and we didn't need to pull, nil otherwise
func (*DockerRuntime) GetFullCommandForDebug ¶
func (r *DockerRuntime) GetFullCommandForDebug(cName string) (string, string)
GetFullCommandForDebug returns a human readable string in "json" form of the array used to exec for a container (the "full command"). This function is useful for debug purposes to know exactly what is being run for a pod. It returns two strings: The first command, and the full command.
func (*DockerRuntime) Kill ¶
func (r *DockerRuntime) Kill(ctx context.Context, wasKilled bool) error
Kill uses the Docker API to terminate a container and notifies the VPC driver to tear down its networking
func (*DockerRuntime) Prepare ¶
func (r *DockerRuntime) Prepare(ctx context.Context) (err error)
Prepare host state (pull images, create fs, create container, etc...)
func (*DockerRuntime) SetFullCommandForDebug ¶
func (r *DockerRuntime) SetFullCommandForDebug(cName string, fullCommand []string)
SetFullCommandForDebug stores the full command that will be run by a container. This is extremely helpful when debugging entrypoint/command problems, where the exact thing that was run is a composition of the entryPoint/Command of the job + the image + all sorts of other stuff
func (*DockerRuntime) Start ¶
func (r *DockerRuntime) Start(parentCtx context.Context) (string, *runtimeTypes.Details, <-chan runtimeTypes.StatusMessage, error)
Start runs an already created container. A watcher is created that monitors container state. The Status Message Channel is ONLY valid if err == nil, otherwise it will block indefinitely.
type Opt ¶
type Opt func(ctx context.Context, runtime *DockerRuntime) error
func WithGPUManager ¶
func WithGPUManager(gpuManager runtimeTypes.GPUManager) Opt