Exemple #1
0
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)
Exemple #2
0
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():
    """
    Starts a SiamCiReceiverService instance.
    """
    
    logging.info("Starting siamci_receiver service ...")
 
    services = [
        {'name':'siamci_receiver','module':'siamci.receiver_service','class':'SiamCiReceiverService'}
    ]
 
    yield bootstrap.spawn_processes(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)

    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)
Exemple #5
0
    def init(self):
        services = [{"name": "blob1", "module": "ion.play.rdf_store.blob_service", "class": "BlobService"}]
        sup = yield bootstrap.spawn_processes(services)
        print "blob sup", sup
        self.bsc = BlobServiceClient(proc=sup)
        print "blob service client", self.bsc

        services = [
            {"name": "association1", "module": "ion.play.rdf_store.association_service", "class": "AssociationService"}
        ]
        sup = yield bootstrap.spawn_processes(services)
        self.bsc = AssociationServiceClient(proc=sup)

        services = [
            {"name": "reference1", "module": "ion.play.rdf_store.reference_service", "class": "ReferenceService"}
        ]
        sup = yield bootstrap.spawn_processes(services)
        self.ssc_ref = ReferenceServiceClient(proc=sup)

        services = [
            {"name": "reference2", "module": "ion.play.rdf_store.reference_service", "class": "ReferenceService"}
        ]
        sup = yield bootstrap.spawn_processes(services)
        self.asc_ref = ReferenceServiceClient(proc=sup)
Exemple #6
0
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():
    from ion.resources import description_utility
    description_utility.load_descriptions()
    bootstrap._set_container_args("{'sys-name':'mysys'}")
    messaging = {'identity':{'name_type':'worker', 'args':{'scope':'system'}}}
    yield bootstrap.declare_messaging(messaging)
    services = [
            {
                'name':'identity', 
                'module':'ion.services.coi.identity_registry',
                'class':'IdentityRegistryService',
                'spawnargs':{
                    'sys-name':'mysys',
                    'servicename':'identity',
                    'scope':'system'
                    }
                }
            ]
    yield bootstrap.spawn_processes(services)
Exemple #8
0
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)
Exemple #9
0
def main():
    from ion.resources import description_utility
    description_utility.load_descriptions()
    bootstrap._set_container_args("{'sys-name':'mysys'}")
    messaging = {
        'identity': {
            'name_type': 'worker',
            'args': {
                'scope': 'system'
            }
        }
    }
    yield bootstrap.declare_messaging(messaging)
    services = [{
        'name': 'identity',
        'module': 'ion.services.coi.identity_registry',
        'class': 'IdentityRegistryService',
        'spawnargs': {
            'sys-name': 'mysys',
            'servicename': 'identity',
            'scope': 'system'
        }
    }]
    yield bootstrap.spawn_processes(services)
Exemple #10
0
 def _spawn_processes(self, procs, sup=None):
     sup = sup if sup else self.test_sup
     return bootstrap.spawn_processes(procs, sup)
Exemple #11
0
 def _start_core_services(self):
     sup = yield bootstrap.spawn_processes(bootstrap.ion_core_services,
                                           self.test_sup)
     logging.info("============Core ION services started============")
     defer.returnValue(sup)
Exemple #12
0
 def _spawn_processes(self, procs, sup=None):
     sup = sup if sup else self.test_sup
     return bootstrap.spawn_processes(procs, sup)
Exemple #13
0
 def _start_core_services(self):
     sup = yield bootstrap.spawn_processes(bootstrap.ion_core_services,
                                           self.test_sup)
     logging.info("============Core ION services started============")
     defer.returnValue(sup)
Exemple #14
0
 def _spawn_processes(self, procs):
     return bootstrap.spawn_processes(procs)