.. index:: pair: class; docker_handle::NRPDockerHandle .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle: class docker_handle::NRPDockerHandle ==================================== .. toctree:: :hidden: Overview ~~~~~~~~ .. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block class NRPDockerHandle: public object { public: // fields static string :target:`DOCKER_HOME` = '/home/nrpuser'; // methods def :target:`__init__`( self self, str docker_daemon_ip, str image_name, str experiment_folder, str proc_cmd, list exec_env ); def :target:`__del__`(self self); bool :ref:`stop`(self self); None :ref:`remove`(self self); bool :ref:`get_experiment_archive`(self self, str archive_name); Optional[dict] :ref:`get_status`(self self); list :ref:`get_logs`(self self); str :ref:`get_container_id`(self self); }; .. _details-classdocker__handle_1_1_n_r_p_docker_handle: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: cpp 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 ------- .. index:: pair: function; stop .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1ace3d3080355132ecf1126af733f6c7a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool stop(self self) .. code-block:: cpp Stop container .. index:: pair: function; remove .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1ab0d64ead9d81ddf5afcb7f8307ea0469: .. ref-code-block:: cpp :class: doxyrest-title-code-block None remove(self self) .. code-block:: cpp Remove container .. index:: pair: function; get_experiment_archive .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1a8428a9c897981fb06c9e846d7de813e1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool get_experiment_archive(self self, str archive_name) .. code-block:: cpp 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 .. index:: pair: function; get_status .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1aab64c60f07e5aed845dacc30285e4480: .. ref-code-block:: cpp :class: doxyrest-title-code-block Optional[dict] get_status(self self) .. code-block:: cpp Returns the status of the process running in the container .. index:: pair: function; get_logs .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1a45f3acc055a9fc0f2ade7b8f5bbd133f: .. ref-code-block:: cpp :class: doxyrest-title-code-block list get_logs(self self) .. code-block:: cpp Return the container logs .. index:: pair: function; get_container_id .. _doxid-classdocker__handle_1_1_n_r_p_docker_handle_1aee0ee9170cd1716f3372d65fd4b8e7ff: .. ref-code-block:: cpp :class: doxyrest-title-code-block str get_container_id(self self) .. code-block:: cpp Returns the container id