Пример #1
0
def execute(blueprint_id,
            workflow_id,
            parameters,
            allow_custom_parameters,
            task_retries,
            task_retry_interval):
    print("Staring blueprint deployment execution.")
    aria_api = api.AriaCoreAPI()
    try:
        aria_api.blueprints.load_blueprint_storage(blueprint_id)
    except Exception:
        e = exceptions.AriaError(
            "Blueprint was not initialized.")
        e.possible_solutions = [
            "Run 'aria init -b [blueprint-id] "
            "-p [path-to-blueprint]' "
            "in this directory"
        ]
        raise e
    parameters = utils.inputs_to_dict(parameters, 'parameters')
    aria_api.executions.execute_custom(
        blueprint_id,
        workflow_id,
        parameters=parameters,
        allow_custom_parameters=allow_custom_parameters,
        task_retries=task_retries,
        task_retry_interval=task_retry_interval)

    print("Done. Blueprint deployment is finished.")
Пример #2
0
def initialize_blueprint(blueprint_path, blueprint_id, storage, install_plugins=False, inputs=None, storage_path=None):

    venv_path = install_blueprint_plugins(
        blueprint_id, blueprint_path, install_plugins=install_plugins, storage_path=storage_path
    )
    provider_context = logger_config.AriaConfig().local_provider_context
    inputs = utils.inputs_to_dict(inputs, "inputs")
    sys.path.append(venv_path)
    env = futures.aria_local.init_env(
        blueprint_path=blueprint_path,
        name=blueprint_id,
        inputs=inputs,
        storage=storage,
        ignored_modules=constants.IGNORED_LOCAL_WORKFLOW_MODULES,
        provider_context=provider_context,
        resolver=utils.get_import_resolver(),
    )
    del sys.path[sys.path.index(venv_path)]
    return env
Пример #3
0
def initialize_blueprint(blueprint_path,
                         blueprint_id,
                         storage,
                         install_plugins=False,
                         inputs=None,
                         storage_path=None):

    venv_path = install_blueprint_plugins(blueprint_id,
                                          blueprint_path,
                                          install_plugins=install_plugins,
                                          storage_path=storage_path)
    provider_context = (logger_config.AriaConfig().local_provider_context)
    inputs = utils.inputs_to_dict(inputs, 'inputs')
    sys.path.append(venv_path)
    env = futures.aria_local.init_env(
        blueprint_path=blueprint_path,
        name=blueprint_id,
        inputs=inputs,
        storage=storage,
        ignored_modules=constants.IGNORED_LOCAL_WORKFLOW_MODULES,
        provider_context=provider_context,
        resolver=utils.get_import_resolver())
    del sys.path[sys.path.index(venv_path)]
    return env