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 ¶
- Variables
- func GetContainersFromImage(ctx context.Context, imageID string) ([]types.Container, error)
- func GetLogs(ctx context.Context, contName string) (io.ReadCloser, error)
- func HandleDeployment(ctx context.Context, depReq models.DeploymentRequest) (models.DeploymentResponse, error)
- func PullImage(ctx context.Context, imageName string) error
- func RemoveImage(ctx context.Context, imageID string) error
- func RunContainer(ctx context.Context, depReq models.DeploymentRequest, ...)
- func SearchContianersByImage(ctx context.Context, imageID string) ([]types.Container, error)
- func SearchImagesByRefrence(ctx context.Context, reference string) ([]types.ImageSummary, error)
- func StartCleanup()
- func StopAndRemoveContainer(ctx context.Context, containerID string) error
- type LogAppend
- type LogbinResponse
- type NewLog
Constants ¶
This section is empty.
Variables ¶
var (
DoneCleanup chan bool
)
Functions ¶
func GetContainersFromImage ¶ added in v0.4.159
func GetLogs ¶
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, error)
HandleDeployment does following docker based actions in the sequence: Pull image, run container, get logs, send log to the requester
func RunContainer ¶
func RunContainer(ctx context.Context, depReq models.DeploymentRequest, createdLog LogbinResponse, resCh chan<- models.DeploymentResponse, servicePK uint, chosenGPUVendor library.GPUVendor)
RunContainer goes through the process of setting constraints, specifying image name and cmd. It starts a container and posts log update every logUpdateDuration.
func SearchContianersByImage ¶ added in v0.4.159
SearchContianersByImage gets all containers given an imageID string.
func SearchImagesByRefrence ¶ added in v0.4.159
SearchImagesByRefrence gets all container images given a reference string. The refrence string should be a regex compilable pattern that will be searched against image name (RepoTags) and digests.
func StartCleanup ¶ added in v0.4.159
func StartCleanup()