Exemplo n.º 1
0
def start():
    """
    Start the bcl2fastq-ws app
    """

    app_svc = AppService.create(__package__)
    app_svc.start(routes(config=app_svc.config_svc))
Exemplo n.º 2
0
def start():
    """
    Start the bcl2fastq-ws app
    """

    app_svc = AppService.create(__package__)
    app_svc.start(routes(config=app_svc.config_svc))
Exemplo n.º 3
0
def start():
    app_svc = AppService.create(__package__)
    process_svc = ProcessService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will
    # be based on the doc strings of the get/post/put/delete methods
    app_svc.start(routes(process_svc=process_svc, config_svc=app_svc.config_svc))
 def test_can_load_configuration(self):
     app_svc = AppService.create("arteria-test", None, True)
     self.assertIsNotNone(app_svc.config_svc)
     app_config = app_svc.config_svc.get_app_config()
     logger_config = app_svc.config_svc.get_logger_config()
     self.assertTrue(app_config["port"] == 10000)
     self.assertTrue(logger_config["version"] == 1)
Exemplo n.º 5
0
 def test_can_load_configuration(self):
     app_svc = AppService.create("arteria-test", None, True)
     self.assertIsNotNone(app_svc.config_svc)
     app_config = app_svc.config_svc.get_app_config()
     logger_config = app_svc.config_svc.get_logger_config()
     self.assertTrue(app_config["port"] == 10000)
     self.assertTrue(logger_config["version"] == 1)
 def test_can_load_configuration(self):
     app_svc = AppService.create("arteria-test", "{}/../templates/".format(self.this_file_path))
     self.assertIsNotNone(app_svc.config_svc)
     app_config = app_svc.config_svc.get_app_config()
     logger_config = app_svc.config_svc.get_logger_config()
     self.assertTrue(app_config["port"] == 10000)
     self.assertTrue(logger_config["version"] == 1)
Exemplo n.º 7
0
def start():
    app_svc = AppService.create(__package__)
    process_svc = ProcessService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will
    # be based on the doc strings of the get/post/put/delete methods
    app_svc.start(
        routes(process_svc=process_svc, config_svc=app_svc.config_svc))
 def test_can_load_configuration(self):
     app_svc = AppService.create(
         "arteria-test", "{}/../templates/".format(self.this_file_path))
     self.assertIsNotNone(app_svc.config_svc)
     app_config = app_svc.config_svc.get_app_config()
     logger_config = app_svc.config_svc.get_logger_config()
     self.assertTrue(app_config["port"] == 10000)
     self.assertTrue(logger_config["version"] == 1)
Exemplo n.º 9
0
def start():
    app_svc = AppService.create(__package__)
    process_svc = ProcessService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will
    # be based on the doc strings of the get/post/put/delete methods
    args = dict(process_svc=process_svc, config_svc=app_svc.config_svc)
    routes = [(r"/api/1.0/(?:qc|report)/run/([\w_-]+)", RunHandler, args),
              (r"/api/1.0/(?:qc|report)/status/(\d*)", StatusHandler, args)]
    app_svc.start(routes)
Exemplo n.º 10
0
def start():
    """
    Start the delivery-ws app
    """
    app_svc = AppService.create(__package__)
    config = app_svc.config_svc

    composed_service = compose_application(config)

    app_svc.start(routes(**composed_service))
Exemplo n.º 11
0
def start():
    app_svc = AppService.create(__package__)

    # Setup the routing. Help will be automatically available at /api, and will
    # be based on the doc strings of the get/post/put/delete methods
    args = dict(config_svc=app_svc.config_svc)
    routes = [
        (r"/api/1.0/echo/([\w_-]+)", EchoHandler, args)
    ]
    app_svc.start(routes)
Exemplo n.º 12
0
def start():
    """
    Start the checksum-ws app
    """

    app_svc = AppService.create(__package__)

    number_of_cores_to_use = app_svc.config_svc["number_of_cores"]
    runner_service = LocalQAdapter(nbr_of_cores=number_of_cores_to_use, interval = 2, priority_method = "fifo")

    app_svc.start(routes(config=app_svc.config_svc, runner_service = runner_service))
Exemplo n.º 13
0
def start():
    app_svc = AppService.create(__package__)
    process_svc = ProcessService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will
    # be based on the doc strings of the get/post/put/delete methods
    args = dict(process_svc=process_svc, config_svc=app_svc.config_svc)
    routes = [
        (r"/api/1.0/(?:qc|report)/run/([\w_-]+)", RunHandler, args),
        (r"/api/1.0/(?:qc|report)/status/(\d*)", StatusHandler, args)
    ]
    app_svc.start(routes)
Exemplo n.º 14
0
def start():
    app_svc = AppService.create(__package__)
    runfolder_svc = RunfolderService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will be based on
    # the doc strings of the get/post/put/delete methods
    args = dict(runfolder_svc=runfolder_svc, config_svc=app_svc.config_svc)
    routes = [
        (r"/api/1.0/runfolders", ListAvailableRunfoldersHandler, args),
        (r"/api/1.0/runfolders/next", NextAvailableRunfolderHandler, args),
        (r"/api/1.0/runfolders/path(/.*)", RunfolderHandler, args),
        (r"/api/1.0/runfolders/test/markasready/path(/.*)", TestFakeSequencerReadyHandler, args)
    ]
    app_svc.start(routes)
Exemplo n.º 15
0
    def get_app(self):

        # Get an as similar app as possible, tough note that we don't use the
        #  app service start method to start up the the application
        path_to_this_file = os.path.abspath(
            os.path.dirname(os.path.realpath(__file__)))
        app_svc = AppService.create(
            product_name="test_delivery_service",
            config_root="{}/../../config/".format(path_to_this_file))

        config = app_svc.config_svc
        composed_application = compose_application(config)
        routes = app_routes(**composed_application)

        if self.mock_delivery:

            def mock_delivery(cmd):
                project_id = f"snpseq{random.randint(0, 10**10):010d}"
                dds_output = f"""Current user: bio
    Project created with id: {project_id}
    User forskare was associated with Project {project_id} as Owner=True. An e-mail notification has not been sent.
    Invitation sent to [email protected]. The user should have a valid account to be added to a
    project"""
                log.debug(f"Mock is called with {cmd}")
                shell = False
                if any(cmd[0].endswith(delivery_prgm)
                       for delivery_prgm in ['dds', 'moverinfo', 'to_outbox']):
                    new_cmd = ['sleep', str(self.mock_duration)]

                    if cmd[0].endswith('dds') and 'project' in cmd:
                        new_cmd += ['&&', 'echo', f'"{dds_output}"']
                        new_cmd = " ".join(new_cmd)
                        shell = True
                else:
                    new_cmd = cmd

                log.debug(f"Running mocked {new_cmd}")
                p = Subprocess(new_cmd,
                               stdout=PIPE,
                               stderr=PIPE,
                               stdin=PIPE,
                               shell=shell)
                return Execution(pid=p.pid, process_obj=p)

            self.patcher = mock.patch(
                'delivery.services.external_program_service'
                '.ExternalProgramService.run',
                wraps=mock_delivery)

        return Application(routes)
Exemplo n.º 16
0
def start():
    app_svc = AppService.create(__package__)
    runfolder_svc = RunfolderService(app_svc.config_svc)

    # Setup the routing. Help will be automatically available at /api, and will be based on
    # the doc strings of the get/post/put/delete methods
    args = dict(runfolder_svc=runfolder_svc, config_svc=app_svc.config_svc)
    routes = [(r"/api/1.0/runfolders", ListAvailableRunfoldersHandler, args),
              (r"/api/1.0/runfolders/next",
               NextAvailableRunfolderHandler, args),
              (r"/api/1.0/runfolders/path(/.*)", RunfolderHandler, args),
              (r"/api/1.0/runfolders/test/markasready/path(/.*)",
               TestFakeSequencerReadyHandler, args)]
    app_svc.start(routes)
Exemplo n.º 17
0
def start():
    """
    Start the checksum-ws app
    """

    app_svc = AppService.create(__package__)

    number_of_cores_to_use = app_svc.config_svc["number_of_cores"]
    runner_service = LocalQAdapter(nbr_of_cores=number_of_cores_to_use,
                                   interval=2,
                                   priority_method="fifo")

    app_svc.start(
        routes(config=app_svc.config_svc, runner_service=runner_service))
Exemplo n.º 18
0
def start():
    """
    Start the archive-upload-ws app
    """

    app_svc = AppService.create(__package__)

    number_of_cores_to_use = app_svc.config_svc["number_of_cores"]
    whitelist = app_svc.config_svc["whitelisted_warnings"]
    runner_service = LocalQAdapter(nbr_of_cores=number_of_cores_to_use,
                                   whitelisted_warnings=whitelist,
                                   interval=2,
                                   priority_method="fifo")

    app_svc.start(
        routes(config=app_svc.config_svc, runner_service=runner_service))
Exemplo n.º 19
0
    def get_app(self):

        # Get an as similar app as possible, tough note that we don't use the
        #  app service start method to start up the the application
        path_to_this_file = os.path.abspath(
            os.path.dirname(os.path.realpath(__file__)))
        app_svc = AppService.create(
            product_name="test_delivery_service",
            config_root="{}/../../config/".format(path_to_this_file))

        config = app_svc.config_svc

        composed_application = compose_application(config)
        # TODO Later swap the "real" delivery service here for mock one.

        return Application(app_routes(**composed_application))