manager

class ns_docker_wrapper.manager.DockerManager(*args, **kwargs)[source]

Bases: object

A singleton class to manage the Docker container for Nerfstudio. This class handles the lifecycle of the Docker container, including pulling the image, starting the container, executing commands, and cleaning up resources.

cleanup()[source]

Cleans up the resources used by the DockerManager.

copy_to_ns_temp_data(local_path: str, copy_depth: int = 0) str[source]

Copies a local file or directory to the internal temporary data volume. :param local_path: The path to the local file or directory. :type local_path: str :param copy_depth: The number of parent directories to include in the copy. :type copy_depth: int

Returns:

The path of the file or directory inside the container.

Return type:

str

execute_command(command: list[str]) tuple[int, str][source]

Executes a command in the Docker container or on the host. :param command: The command to execute as a list of strings. :type command: list[str]

Returns:

A tuple containing the exit code and the command output.

Return type:

tuple[int, str]

ns_docker_wrapper.manager.init(output_base_path: str = './nerfstudio_output', image_name: str | None = 'jourdelune876/nerfstudio-full-dep:latest')[source]

Initializes the Docker wrapper. :param output_base_path: Local path where Nerfstudio will store its outputs

(mounted to /workspace).

Parameters:

image_name (Optional[str]) – The name of the Docker image to use. If None, commands are run on the host.