DockerRuntime
- image (str): The name of the Docker image to use for the runtime.
- port (int): The port number to use for the runtime API. (default: :obj:
8000) - remove (bool): Whether to remove the container after stopping it. ’ (default: :obj:
True) - kwargs (dict): Additional keyword arguments to pass to the Docker client.
init
mount
- path (str): The local path to mount.
- mount_path (str): The path to mount the local directory to in the container.
copy
- source (str): The local path to the file.
- dest (str): The path to copy the file to in the container.
add_task
docker exec.
Parameters:
- task (TaskConfig): The configuration for the task.
exec_run
docker exec.
Parameters:
- task (TaskConfig): The configuration for the task.
None if
either stream or socket is True.
output: (generator, bytes, or tuple):
If stream=True, a generator yielding response chunks.
If socket=True, a socket object for the connection.
If demux=True, a tuple of two bytes: stdout and stderr.
A bytestring containing response data otherwise.
build
- time_out (int): The number of seconds to wait for the container to start. (default: :obj:
15)
add
- funcs (Union[FunctionTool, List[FunctionTool]]): The function or list of functions to add.
- entrypoint (str): The entrypoint for the function.
- redirect_stdout (bool): Whether to return the stdout of the function. (default: :obj:
False) - arguments (Optional[Dict[str, Any]]): The arguments for the function. (default: :obj:
None)
reset
stop
- remove (Optional[bool]): Whether to remove the container after stopping it. (default: :obj:
None)
ok
wait
- timeout (int): The number of seconds to wait. (default: :obj:
10) (default: 10)