class docker_handle::NRPDockerHandle

Overview

class NRPDockerHandle: public object {
public:
    // fields

    static string DOCKER_HOME =  '/home/nrpuser';

    // methods

    def __init__(
        self self,
        str docker_daemon_ip,
        str image_name,
        str experiment_folder,
        str proc_cmd,
        list exec_env
    );

    def __del__(self self);
    bool stop(self self);
    None remove(self self);
    bool get_experiment_archive(self self, str archive_name);
    Optional[dict] get_status(self self);
    list get_logs(self self);
    str get_container_id(self self);
};

Detailed Documentation

This class runs an NRPCore process (NRPCoreSim or Engine process) in a docker container. It provides methods
for monitoring the process status or stopping it. The container will always be stopped and removed after the
related NRPDockerHandle object is deleted.

Args:
    docker_daemon_ip: IP of the docker daemon which will create and run the container
    image_name: name of the docker image from which the container will be created
    experiment_folder: path to the folder containing the necessary files to run the NRPCore process. It will be
        put in the container and set as work directory when running the NRPCore process.
    proc_cmd: command used to run in the NRPCore process
    exec_env: list of strings containing environment variables to be used for running the NRPCore process

Methods

bool stop(self self)
Stop container
None remove(self self)
Remove container
bool get_experiment_archive(self self, str archive_name)
Get an archive (file or folder) from the experiment folder in the container and place it in the experiment
    folder in the host

    :param archive_name: name of the archive to be fetched
Optional[dict] get_status(self self)
Returns the status of the process running in the container
list get_logs(self self)
Return the container logs
str get_container_id(self self)
Returns the container id