Пример #1
0
 def __init__(self, port, task_directory, course_factory, task_factory, ssh_manager_port=None, tmp_dir="./agent_tmp", sync_enabled=True):
     SimpleAgent.__init__(self, task_directory, course_factory, task_factory, ssh_manager_port, tmp_dir)
     self.sync_enabled = sync_enabled
     self.logger.debug("Starting RPyC server - inginious.backend connection")
     self._backend_server = ThreadedServer(self._get_agent_backend_service(), port=port,
                                           protocol_config={"allow_public_attrs": True, 'allow_pickle': True})
     self._backend_server.start()
Пример #2
0
    def __init__(self,
                 image_aliases,
                 task_directory,
                 course_factory,
                 task_factory,
                 tmp_dir="./agent_tmp"):
        # Start a logger specific to this agent
        logger = logging.getLogger("agent")
        logger.setLevel(logging.INFO)
        ch = logging.StreamHandler()
        ch.setLevel(logging.INFO)
        formatter = logging.Formatter(
            "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
        ch.setFormatter(formatter)
        logger.addHandler(ch)

        # Choose a socket
        tmp_socket_dir = tempfile.mkdtemp(
        )  # TODO: should be in tmp_dir, but it is deleted while we wait for Docker 1.9.0 and user namespaces
        self.ssh_sock_path = os.path.join(tmp_socket_dir, 'ssh.sock')

        SimpleAgent.__init__(self, task_directory, course_factory,
                             task_factory, self.ssh_sock_path, tmp_dir)

        # Setup some fields
        self.image_aliases = image_aliases
Пример #3
0
    def __init__(self, image_aliases, task_directory, course_factory, task_factory, tmp_dir="./agent_tmp"):
        # Start a logger specific to this agent
        logger = logging.getLogger("agent")
        logger.setLevel(logging.INFO)
        ch = logging.StreamHandler()
        ch.setLevel(logging.INFO)
        formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
        ch.setFormatter(formatter)
        logger.addHandler(ch)

        # Choose a socket
        tmp_socket_dir = tempfile.mkdtemp()  # TODO: should be in tmp_dir, but it is deleted while we wait for Docker 1.9.0 and user namespaces
        self.ssh_sock_path = os.path.join(tmp_socket_dir, 'ssh.sock')

        SimpleAgent.__init__(self, task_directory, course_factory, task_factory, self.ssh_sock_path, tmp_dir)

        # Setup some fields
        self.image_aliases = image_aliases
Пример #4
0
 def __init__(self,
              port,
              task_directory,
              course_factory,
              task_factory,
              ssh_manager_port=None,
              tmp_dir="./agent_tmp",
              sync_enabled=True):
     SimpleAgent.__init__(self, task_directory, course_factory,
                          task_factory, ssh_manager_port, tmp_dir)
     self.sync_enabled = sync_enabled
     self.logger.debug(
         "Starting RPyC server - inginious.backend connection")
     self._backend_server = ThreadedServer(
         self._get_agent_backend_service(),
         port=port,
         protocol_config={
             "allow_public_attrs": True,
             'allow_pickle': True
         })
     self._backend_server.start()