Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to list operation's predecessors #246

Open
rpignolet opened this issue Nov 2, 2022 · 0 comments
Open

Add a command to list operation's predecessors #246

rpignolet opened this issue Nov 2, 2022 · 0 comments

Comments

@rpignolet
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant