View on GitHub

skelebot

Machine Learning Project Development Tool

Home > API


Skelebot API

Version 2


Docker Execution Module

The Docker Execution module allows for the building of Docker images based on the project config as well as the running of the project’s container with provided specifications and commands.


Import

from skelebot.systems.execution import docker

build(config)

return int (status)

PARAMETER TYPE DESCRIPTION
config Config The Config object representing the project configuration
The build function will construct (or reconstruct) the Dockerfile, the .dockerignore file, and the
Docker image itself based on the project config. It will then return the status of the build as an
int (0 = success) or throw an exception in the case of a failure.

run(config, command, mode, ports, mappings, task)

return int (status)

PARAMETER TYPE DESCRIPTION
config Config The Config object representing the project configuration
command String The Command that will be executed inside the container when it starts
mode String A String representing the mode in which Docker will run (i, it, d)
ports List A list of colon separated port mapping strings (e.x. [“88:8888”, “1127:1127”])
mappings List A list of colon separated volume mapping strings (e.x. [“local/dir:/app/dir”])
task name A string name for the task that is being executed to be appended to the image name to form a container name
The run function will execute a Docker run command for the project's image, assuming one has already
been built. This function accepts numerous parameters to customize the manner in which the
container will be run, and returns the status code from the command itself.