Skip to content

Add a command to list operation's predecessors #246

@rpignolet

Description

@rpignolet

This use case is for debug. For example I want to run manually an operation (a.k.a. Ansible playbook). In order to run this operation I must run all DAG operation predecessors.

With the tdp deploy --targets ... command we can run a deployment to a list of targets so we only need direct operation's predecessors, not all, only direct ones. To get them we can use the pred property of networkx.

Here an example snippet to print a tdp deploy command with all ranger_admin_config direct operation's predecessors:

dag = Dag(...)
tdp_deploy_command = "tdp deploy --targets "
pred_operations = dag.graph.pred["ranger_admin_config"]
print(tdp_deploy_command + ','.join(pred_operations))

Outputs:

tdp deploy --targets tdp-cluster_config,hadoop_client_config,ranger_kerberos_install,ranger_ssl-tls_install

After running this tdp deploy command we can run manually, with ansible-playbook command, the ranger_admin_config playbook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions