예제 #1
0
def main(args):
    context = Context.singleton()
    executor = ExampleExecutor()
    driver = PesosExecutorDriver(executor, context=context)

    print('Starting driver')
    driver.start()

    print('Joining driver')
    driver.join()

    context.stop()
예제 #2
0
def main(args):
  context = Context.singleton()
  executor = ExampleExecutor()
  driver = PesosExecutorDriver(executor, context=context)

  print('Starting driver')
  driver.start()

  print('Joining driver')
  driver.join()

  context.stop()
예제 #3
0
    def test_mesos_executor_driver_init(self):
        os.environ['MESOS_SLAVE_PID'] = str(self.slave.pid)

        executor = Executor()
        driver = PesosExecutorDriver(executor, context=self.context)
        assert driver.start() == mesos_pb2.DRIVER_RUNNING
        assert driver.stop() == mesos_pb2.DRIVER_STOPPED
        assert driver.join() == mesos_pb2.DRIVER_STOPPED
예제 #4
0
  def test_mesos_executor_driver_init(self):
    os.environ['MESOS_SLAVE_PID'] = str(self.slave.pid)

    executor = Executor()
    driver = PesosExecutorDriver(executor, context=self.context)
    assert driver.start() == mesos_pb2.DRIVER_RUNNING
    assert driver.stop() == mesos_pb2.DRIVER_STOPPED
    assert driver.join() == mesos_pb2.DRIVER_STOPPED
예제 #5
0
    def test_mesos_executor_driver_abort(self):
        os.environ['MESOS_SLAVE_PID'] = str(self.slave.pid)

        executor = Executor()
        driver = PesosExecutorDriver(executor, context=self.context)
        assert driver.start() == mesos_pb2.DRIVER_RUNNING
        assert driver.abort() == mesos_pb2.DRIVER_ABORTED
        driver.executor_process.aborted.wait(timeout=MAX_TIMEOUT)
        assert driver.executor_process.aborted.is_set()
        assert driver.join() == mesos_pb2.DRIVER_ABORTED
예제 #6
0
  def test_mesos_executor_driver_abort(self):
    os.environ['MESOS_SLAVE_PID'] = str(self.slave.pid)

    executor = Executor()
    driver = PesosExecutorDriver(executor, context=self.context)
    assert driver.start() == mesos_pb2.DRIVER_RUNNING
    assert driver.abort() == mesos_pb2.DRIVER_ABORTED
    driver.executor_process.aborted.wait(timeout=MAX_TIMEOUT)
    assert driver.executor_process.aborted.is_set()
    assert driver.join() == mesos_pb2.DRIVER_ABORTED
예제 #7
0
def test_mesos_executor_driver_init():
  context = Context()
  context.start()

  # spawn slave
  slave = MockSlave()
  context.spawn(slave)

  os.environ['MESOS_SLAVE_PID'] = str(slave.pid)

  executor = Executor()
  driver = PesosExecutorDriver(executor, context=context)
  assert driver.start() == mesos.DRIVER_RUNNING
  assert driver.stop() == mesos.DRIVER_STOPPED
  assert driver.join() == mesos.DRIVER_STOPPED

  context.stop()