#NEWLINE# def main( master ) : #NEWLINE# #INDENT# executor = mesos_pb2 . ExecutorInfo ( ) #NEWLINE# executor . executor_id . value = 'MinimalExecutor' #NEWLINE# executor . name = executor . executor_id . value #NEWLINE# executor . command . value = os . path . abspath ( './executor-minimal.py' ) #NEWLINE# framework = mesos_pb2 . FrameworkInfo ( ) #NEWLINE# framework . user = '' #NEWLINE# framework . name = 'MinimalFramework' #NEWLINE# framework . checkpoint = True #NEWLINE# framework . principal = framework . name #NEWLINE# implicitAcknowledgements = 1 #NEWLINE# driver = MesosSchedulerDriver ( MinimalScheduler ( executor ) , driver_thread , master , implicitAcknowledgements ) #NEWLINE# def signal_handler( signal , frame ) : #NEWLINE# #INDENT# driver . stop ( ) #NEWLINE# #UNINDENT# def run_driver_thread( ) : #NEWLINE# #INDENT# status = ( 0 if ( driver . run ( ) == mesos_pb2 . DRIVER_STOPPED ) else 1 ) #NEWLINE# driver . stop ( ) #NEWLINE# sys . exit ( status ) #NEWLINE# #UNINDENT# driver_thread = Thread ( target = run_driver_thread , args = ( ) ) #NEWLINE# driver_thread . start ( ) #NEWLINE# print ( 'Scheduler running, Ctrl-C to quit.' ) #NEWLINE# signal . signal ( signal . SIGINT , signal_handler ) #NEWLINE# while driver_thread . is_alive ( ) : #NEWLINE# #INDENT# time . sleep ( 1 ) #NEWLINE# #UNINDENT# sys . exit ( 0 )