docker

package
v0.4.125 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Overview

Package docker is marked for deletion. See `service` module.

`docker` package is used to run docker containers for ML on GPU/CPU usecase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogs

func GetLogs(ctx context.Context, contName string) (io.ReadCloser, error)

GetLogs return logs from the container io.ReadCloser. It's the caller duty duty to do a stdcopy.StdCopy. Any other method might render unknown unicode character as log output has both stt ctx context.Context dc *client.Client gHealthy booldout and stderr. That starting has info if that line is stderr or stdout.

func HandleDeployment

func HandleDeployment(ctx context.Context, depReq models.DeploymentRequest) models.DeploymentResponse

HandleDeployment does following docker based actions in the sequence: Pull image, run container, get logs, delete container, send log to the requester

func PullImage

func PullImage(ctx context.Context, imageName string) error

PullImage is a wrapper around Docker SDK's function with same name.

func RunContainer

func RunContainer(ctx context.Context, depReq models.DeploymentRequest, createdLog LogbinResponse, resCh chan<- models.DeploymentResponse, servicePK uint, chosenGPUVendor gpuinfo.GPUVendor)

RunContainer goes through the process of setting constraints, specifying image name and cmd. It starts a container and posts log update every logUpdateDuration.

Types

type LogAppend added in v0.4.118

type LogAppend struct {
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
}

type LogbinResponse added in v0.4.118

type LogbinResponse struct {
	ID        string    `json:"id"`
	RawUrl    string    `json:"raw_url"`
	CreatedAt time.Time `json:"created_at"`
}

type NewLog added in v0.4.118

type NewLog struct {
	Title  string `json:"title"`
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
}

Jump to

Keyboard shortcuts

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