karbor.services.protection.flows package

Submodules

karbor.services.protection.flows.copy module

class karbor.services.protection.flows.copy.CompleteCopyTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, checkpoint_copy, operation_log)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

class karbor.services.protection.flows.copy.InitiateCopyTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, checkpoint_copy, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, checkpoint, checkpoint_copy, operation_log, *args, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

karbor.services.protection.flows.copy.create_flows(context, protectable_registry, workflow_engine, plan, provider, checkpoints_protect_copy, checkpoint_collection)
karbor.services.protection.flows.copy.get_flow(context, protectable_registry, workflow_engine, plan, provider, checkpoint, checkpoint_copy)
karbor.services.protection.flows.copy.get_flows(context, protectable_registry, workflow_engine, plan, provider, checkpoints, checkpoint_collection)
karbor.services.protection.flows.copy.prepare_create_flows(context, plan, checkpoints, checkpoint_collection)

karbor.services.protection.flows.delete module

class karbor.services.protection.flows.delete.CompleteDeleteTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, operation_log)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

class karbor.services.protection.flows.delete.InitiateDeleteTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, checkpoint, operation_log, *args, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

karbor.services.protection.flows.delete.get_flow(context, workflow_engine, checkpoint, provider)

karbor.services.protection.flows.protect module

class karbor.services.protection.flows.protect.CompleteProtectTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, operation_log)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

class karbor.services.protection.flows.protect.InitiateProtectTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, checkpoint, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, checkpoint, operation_log, *args, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

karbor.services.protection.flows.protect.get_flow(context, protectable_registry, workflow_engine, plan, provider, checkpoint)

karbor.services.protection.flows.restore module

class karbor.services.protection.flows.restore.CompleteRestoreTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, restore, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

class karbor.services.protection.flows.restore.InitiateRestoreTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, restore, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, restore, operation_log, *args, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

karbor.services.protection.flows.restore.get_flow(context, workflow_engine, checkpoint, provider, restore, restore_auth)

karbor.services.protection.flows.utils module

karbor.services.protection.flows.utils.create_operation_log(context, checkpoint, operation_type=None)
karbor.services.protection.flows.utils.create_operation_log_restore(context, restore)
karbor.services.protection.flows.utils.create_operation_log_verify(context, verify)
karbor.services.protection.flows.utils.update_operation_log(context, operation_log, fields)

karbor.services.protection.flows.verify module

class karbor.services.protection.flows.verify.CompleteVerifyTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, verify, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

class karbor.services.protection.flows.verify.InitiateVerifyTask(name=None, provides=None, requires=None, auto_extract=True, rebind=None, inject=None, ignore_list=None, revert_rebind=None, revert_requires=None)

Bases: taskflow.task.Task

execute(context, verify, operation_log, *args, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, verify, operation_log, *args, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

karbor.services.protection.flows.verify.get_flow(context, workflow_engine, checkpoint, provider, verify)

karbor.services.protection.flows.worker module

class karbor.services.protection.flows.worker.Worker(engine_path=None)

Bases: object

flow_outputs(flow_engine, target=None)
get_flow(context, operation_type, checkpoint, provider, **kwargs)
run_flow(flow_engine)

karbor.services.protection.flows.workflow module

class karbor.services.protection.flows.workflow.TaskFlowEngine

Bases: karbor.services.protection.flows.workflow.WorkFlowEngine

add_tasks(flow, *nodes, **kwargs)
build_flow(flow_name, flow_type='graph')

build flow

Parameters
  • flow_name – the flow name

  • flow_type – ‘linear’ or ‘graph’, default:’graph’

Returns

linear flow or graph flow

create_task(function, requires=None, provides=None, inject=None, **kwargs)

create a task

Parameters
  • function – make a task from this callable

  • requires – A OrderedSet of inputs this task requires to function.

  • provides – A set, string or list of items that this will be providing (or could provide) to others

  • inject – An immutable input_name => value dictionary which specifies any initial inputs that should be automatically injected into the task scope before the task execution commences

get_engine(flow, **kwargs)
karbor_atom_watch(state, details)
karbor_flow_watch(state, details)

Link existing node as a runtime dependency of existing node v

Parameters
  • u – task or flow to create a link from (must exist already)

  • v – task or flow to create a link to (must exist already)

  • flow – graph flow

output(flow_engine, target=None)
run_engine(flow_engine)
search_task(flow, task_id)
class karbor.services.protection.flows.workflow.WorkFlowEngine

Bases: object

abstract add_tasks(flow, *nodes, **kwargs)
abstract build_flow(flow_name, flow_type='graph')

build flow

Parameters
  • flow_name – the flow name

  • flow_type – ‘linear’ or ‘graph’, default:’graph’

Returns

linear flow or graph flow

abstract create_task(function, requires=None, provides=None, inject=None, **kwargs)

create a task

Parameters
  • function – make a task from this callable

  • requires – A OrderedSet of inputs this task requires to function.

  • provides – A set, string or list of items that this will be providing (or could provide) to others

  • inject – An immutable input_name => value dictionary which specifies any initial inputs that should be automatically injected into the task scope before the task execution commences

abstract get_engine(flow, **kwargs)

Link existing node as a runtime dependency of existing node v

Parameters
  • u – task or flow to create a link from (must exist already)

  • v – task or flow to create a link to (must exist already)

  • flow – graph flow

abstract output(flow_engine, target=None)
abstract run_engine(flow_engine)
abstract search_task(flow, task_id)

Module contents