def main(): """ Initializes container """ logging.info("ION CONTAINER initializing... [Start an Instrument Agent]") processes = [] processes.extend(agent_procs) processes.extend(service_procs) # Start the processes sup = yield bootstrap.bootstrap(None, processes) eval_start_arguments() simulator = Simulator(INSTRUMENT_ID, 9000) simulator.start() ia_procs = [ {'name':'SBE49IA','module':'ion.agents.instrumentagents.SBE49_IA','class':'SBE49InstrumentAgent','spawnargs':{'instrument-id':INSTRUMENT_ID}}, ] yield bootstrap.spawn_processes(ia_procs, sup=sup) ia_pid = sup.get_child_id('SBE49IA') iaclient = InstrumentAgentClient(proc=sup, target=ia_pid) yield iaclient.register_resource(INSTRUMENT_ID)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing...") yield bootstrap.bootstrap(None, agent_procs)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing... [LCA Java Integration Demo]") processes = [] processes.extend(agent_procs) processes.extend(demo_procs) # Start the processes sup = yield bootstrap.bootstrap(None, processes) simulator = Simulator(INSTRUMENT_ID, 9000) simulator.start() irc = InstrumentRegistryClient(proc=sup) ir1 = InstrumentResource.create_new_resource() ir1.name = "Demo_CTD_1" ir1.model = "SBE49" ir1.serial_num = "12345" ir1.fw_version = "1.334" ir1.manufactorer = "SeaBird" ir1 = yield irc.register_instrument_instance(ir1) ir1_ref = ir1.reference(head=True) ir2 = InstrumentResource.create_new_resource() ir2.name = "Demo_CTD_2" ir2.model = "SBE49" ir2.serial_num = "12399" ir2.fw_version = "1.335" ir2.manufactorer = "SeaBird" ir2 = yield irc.register_instrument_instance(ir2) dprc = DataProductRegistryClient(proc=sup) dp1 = DataProductResource.create_new_resource() dp1.instrument_ref = ir1_ref dp1.name = "Demo_Data_Product_1" dp1.dataformat = "binary" dp1 = yield dprc.register_data_product(dp1) ia_procs = [ { 'name': 'SBE49IA', 'module': 'ion.agents.instrumentagents.SBE49_IA', 'class': 'SBE49InstrumentAgent', 'spawnargs': { 'instrument-id': INSTRUMENT_ID } }, ] yield bootstrap.spawn_processes(ia_procs, sup=sup) ia_pid = sup.get_child_id('SBE49IA') iaclient = InstrumentAgentClient(proc=sup, target=ia_pid) yield iaclient.register_resource(INSTRUMENT_ID)
def start(): """ Main function of bootstrap. Starts DX system with static config """ logging.info("ION/DX bootstrapping now...") startsvcs = [] startsvcs.extend(dx_services) yield bootstrap.bootstrap(ion_messaging, startsvcs)
def main(): """Main function of bootstrap. Starts system with static config """ logging.info("ION SYSTEM bootstrapping now...") startsvcs = [] #startsvcs.extend(ion_core_services) startsvcs.extend(ion_services) yield bootstrap.bootstrap(ion_messaging, startsvcs)
def main(): """Main function of bootstrap. Starts system with static config """ logging.info("ION SYSTEM bootstrapping web service now...") startsvcs = [] startsvcs.extend(web_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) wc = web_service.WebServiceClient(proc=sup) yield wc.set_string(line_gviz())
def start(): """ Main function of bootstrap. Starts DM pubsub... """ logging.info("ION DM PubSub bootstrapping now...") startsvcs = [] startsvcs.extend(dm_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) print 'STARTSVCS',startsvcs print 'ION_MESSAGING',ion_messaging print 'CONT_ARGS',ioninit.cont_args
def start(): """ Main function of bootstrap. Starts DM pubsub... """ logging.info("ION DM PubSub bootstrapping now...") startsvcs = [] #startsvcs.extend(dm_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) print 'STARTSVCS',startsvcs print 'ION_MESSAGING',ion_messaging print 'CONT_ARGS',ioninit.cont_args #yield create_producer(sup) dpsc = pubsub_service.DataPubsubClient(proc=sup) subscription = SubscriptionResource() subscription.topic1 = PubSubTopicResource.create('Inst/RAW','') # Use the example consumer to create events... graph the number of events ''' subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':'topic1'} } ''' subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.instrument_timeseries_consumer', 'consumerclass':'InstrumentTimeseriesConsumer',\ 'attach':'topic1'}, 'consumer3': {'module':'ion.services.dm.presentation.web_viz_consumer', 'consumerclass':'WebVizConsumer',\ 'attach':[['consumer1','queue']], 'process parameters':{'port':8180} } } subscription = yield dpsc.define_subscription(subscription) linfo = '\n================================================\n' linfo+= 'Open your web browser and look at: http://127.0.0.1:8180/ \n' linfo+= '================================================\n' logging.info(linfo)
def start(): """ Main function of bootstrap. Starts DM pubsub... """ logging.info("ION DM PubSub bootstrapping now...") startsvcs = [] #startsvcs.extend(dm_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) print 'STARTSVCS', startsvcs print 'ION_MESSAGING', ion_messaging print 'CONT_ARGS', ioninit.cont_args #yield create_producer(sup) dpsc = pubsub_service.DataPubsubClient(proc=sup) subscription = SubscriptionResource() subscription.topic1 = PubSubTopicResource.create('Inst/RAW', '') # Use the example consumer to create events... graph the number of events ''' subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':'topic1'} } ''' subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.instrument_timeseries_consumer', 'consumerclass':'InstrumentTimeseriesConsumer',\ 'attach':'topic1'}, 'consumer3': {'module':'ion.services.dm.presentation.web_viz_consumer', 'consumerclass':'WebVizConsumer',\ 'attach':[['consumer1','queue']], 'process parameters':{'port':8180} } } subscription = yield dpsc.define_subscription(subscription) linfo = '\n================================================\n' linfo += 'Open your web browser and look at: http://127.0.0.1:8180/ \n' linfo += '================================================\n' logging.info(linfo)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing... [LCA Java Integration Demo]") processes = [] processes.extend(agent_procs) processes.extend(demo_procs) # Start the processes sup = yield bootstrap.bootstrap(None, processes) simulator = Simulator(INSTRUMENT_ID, 9000) simulator.start() irc = InstrumentRegistryClient(proc=sup) ir1 = InstrumentResource.create_new_resource() ir1.name = "Demo_CTD_1" ir1.model = "SBE49" ir1.serial_num = "12345" ir1.fw_version = "1.334" ir1.manufactorer = "SeaBird" ir1 = yield irc.register_instrument_instance(ir1) ir1_ref = ir1.reference(head=True) ir2 = InstrumentResource.create_new_resource() ir2.name = "Demo_CTD_2" ir2.model = "SBE49" ir2.serial_num = "12399" ir2.fw_version = "1.335" ir2.manufactorer = "SeaBird" ir2 = yield irc.register_instrument_instance(ir2) dprc = DataProductRegistryClient(proc=sup) dp1 = DataProductResource.create_new_resource() dp1.instrument_ref = ir1_ref dp1.name = "Demo_Data_Product_1" dp1.dataformat = "binary" dp1 = yield dprc.register_data_product(dp1) ia_procs = [ {'name':'SBE49IA','module':'ion.agents.instrumentagents.SBE49_IA','class':'SBE49InstrumentAgent','spawnargs':{'instrument-id':INSTRUMENT_ID}}, ] yield bootstrap.spawn_processes(ia_procs, sup=sup) ia_pid = sup.get_child_id('SBE49IA') iaclient = InstrumentAgentClient(proc=sup,target=ia_pid) yield iaclient.register_resource(INSTRUMENT_ID)
def main(): bootstrap._set_container_args("{'sys-name':'mysys'}") messaging = {'registry':{'name_type':'worker', 'args':{'scope':'system'}}} services = [ { 'name':'registry', 'module':'ion.data.datastore.registry', 'class':'RegistryService', 'spawnargs':{ 'sys-name':'mysys', 'servicename':'registry', 'scope':'system' } } ] yield bootstrap.bootstrap(messaging, services)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing...") processes = [] processes.extend(agent_procs) processes.extend(svc_procs) # Start the cc-agent and processes from config file sup = yield bootstrap.bootstrap(None, processes) # Start processes from config file given in arguments procsfile = ioninit.cont_args.get('processes', None) if procsfile: procs = Config(procsfile).getObject() logging.info("Starting local process list: "+str(procs)) yield bootstrap.spawn_processes(procs, sup=sup)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing...") processes = [] processes.extend(agent_procs) processes.extend(svc_procs) # Start the cc-agent and processes from config file sup = yield bootstrap.bootstrap(None, processes) # Start processes from config file given in arguments procsfile = ioninit.cont_args.get('processes', None) if procsfile: procs = Config(procsfile).getObject() logging.info("Starting local process list: " + str(procs)) yield bootstrap.spawn_processes(procs, sup=sup)
def main(): bootstrap._set_container_args("{'sys-name':'mysys'}") messaging = { 'registry': { 'name_type': 'worker', 'args': { 'scope': 'system' } } } services = [{ 'name': 'registry', 'module': 'ion.data.datastore.registry', 'class': 'RegistryService', 'spawnargs': { 'sys-name': 'mysys', 'servicename': 'registry', 'scope': 'system' } }] yield bootstrap.bootstrap(messaging, services)
def main(): """ Initializes container """ logging.info("ION CONTAINER initializing... [LCA Java Integration Demo]") processes = [] processes.extend(agent_procs) processes.extend(demo_procs) # Start the processes sup = yield bootstrap.bootstrap(None, processes) irc = InstrumentRegistryClient(proc=sup) ir1 = InstrumentResource.create_new_resource() ir1.name = "Demo_CTD_1" ir1.model = "SBE49" ir1.serial_num = "12345" ir1.fw_version = "1.334" ir1.manufactorer = "SeaBird" ir1 = yield irc.register_instrument_instance(ir1) ir1_ref = ir1.reference(head=True) ir2 = InstrumentResource.create_new_resource() ir2.name = "Demo_CTD_2" ir2.model = "SBE49" ir2.serial_num = "12399" ir2.fw_version = "1.335" ir2.manufactorer = "SeaBird" ir2 = yield irc.register_instrument_instance(ir2) dprc = DataProductRegistryClient(proc=sup) dp1 = DataProductResource.create_new_resource() dp1.instrument_ref = ir1_ref dp1.name = "Demo_Data_Product_1" dp1.dataformat = "binary" dp1 = yield dprc.register_data_product(dp1)
def start(): """ Main function of bootstrap. Starts DM pubsub... """ logging.info("ION DM PubSub bootstrapping now...") startsvcs = [] startsvcs.extend(dm_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) print 'STARTSVCS',startsvcs print 'ION_MESSAGING',ion_messaging print 'CONT_ARGS',ioninit.cont_args nproducers = int(ioninit.cont_args.get('nproducers',5)) print 'NPRODUCERS',nproducers yield create_producers(sup, nproducers) dpsc = pubsub_service.DataPubsubClient(proc=sup) subscription = SubscriptionResource() subscription.topic1 = PubSubTopicResource.create('topic','') """ # Use the example consumer to create events... log the events subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.example_consumer', 'consumerclass':'ExampleConsumer',\ 'attach':'topic1'}, 'consumer2': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':[['consumer1','event_queue']]} } # Log all the messages created subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':'topic1'} } """ # Use the example consumer to create events... graph the number of events subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.example_consumer', 'consumerclass':'ExampleConsumer',\ 'attach':'topic1'}, 'consumer2': {'module':'ion.services.dm.distribution.consumers.message_count_consumer', 'consumerclass':'MessageCountConsumer',\ 'attach':[['consumer1','event_queue']],\ 'delivery interval':5, 'process parameters':{'max_points':5} }, 'consumer3': {'module':'ion.services.dm.presentation.web_viz_consumer', 'consumerclass':'WebVizConsumer',\ 'attach':[['consumer2','queue']], 'process parameters':{'port':8180} } } subscription = yield dpsc.define_subscription(subscription) linfo = '\n================================================\n' linfo+= 'Open your web browser and look at: http://127.0.0.1:8180/ \n' linfo+= '================================================\n' logging.info(linfo)
def _start_core_services(self): sup = yield bootstrap.bootstrap(None, bootstrap.ion_core_services) logging.info("============Core ION services started============") defer.returnValue(sup)
def start(): """ Main function of bootstrap. Starts DM pubsub... """ logging.info("ION DM PubSub bootstrapping now...") startsvcs = [] startsvcs.extend(dm_services) sup = yield bootstrap.bootstrap(ion_messaging, startsvcs) print 'STARTSVCS', startsvcs print 'ION_MESSAGING', ion_messaging print 'CONT_ARGS', ioninit.cont_args nproducers = int(ioninit.cont_args.get('nproducers', 5)) print 'NPRODUCERS', nproducers yield create_producers(sup, nproducers) dpsc = pubsub_service.DataPubsubClient(proc=sup) subscription = SubscriptionResource() subscription.topic1 = PubSubTopicResource.create('topic', '') """ # Use the example consumer to create events... log the events subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.example_consumer', 'consumerclass':'ExampleConsumer',\ 'attach':'topic1'}, 'consumer2': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':[['consumer1','event_queue']]} } # Log all the messages created subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.logging_consumer', 'consumerclass':'LoggingConsumer',\ 'attach':'topic1'} } """ # Use the example consumer to create events... graph the number of events subscription.workflow = { 'consumer1': {'module':'ion.services.dm.distribution.consumers.example_consumer', 'consumerclass':'ExampleConsumer',\ 'attach':'topic1'}, 'consumer2': {'module':'ion.services.dm.distribution.consumers.message_count_consumer', 'consumerclass':'MessageCountConsumer',\ 'attach':[['consumer1','event_queue']],\ 'delivery interval':5, 'process parameters':{'max_points':5} }, 'consumer3': {'module':'ion.services.dm.presentation.web_viz_consumer', 'consumerclass':'WebVizConsumer',\ 'attach':[['consumer2','queue']], 'process parameters':{'port':8180} } } subscription = yield dpsc.define_subscription(subscription) linfo = '\n================================================\n' linfo += 'Open your web browser and look at: http://127.0.0.1:8180/ \n' linfo += '================================================\n' logging.info(linfo)