-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
RFE: Using set_stats module to pass a variable value from nested WT to JT #4481
Comments
This enhancement would also be highly beneficial for our usage where we're trying to combine and nest WT created by different teams. |
Since #6806 is considered a dupe of this issue, I'll add on our requests from that one. ISSUE TYPE
SUMMARYAnsible Tower API RFE Background: Problem: Desired Solution: Possible implementation: Because workflows in general have arbitrary number of leaf nodes and we can not anticipate what will be the leaf nodes (for example, some paths may not be taken depending on what happens at run time), and it would be impossible to guess the preference of how to merge the different sets of artifacts and with what preference, as a first approach we propose setting the artifacts set by a job of a workflow node on the workflow node itself. E.g. if a child job of a workflow job node has the As a second step, on the workflow, if workflow nodes in the workflow have the One possible configuration option would be to set the behavior for merging multiple branches. Options could include:
Possible example: {
"id": 20,
"type": "workflow_job",
"url": "/api/v2/workflow_jobs/20/",
"related": {
"created_by": "/api/v2/users/1/",
"modified_by": "/api/v2/users/1/",
"unified_job_template": "/api/v2/workflow_job_templates/7/",
"workflow_job_template": "/api/v2/workflow_job_templates/7/",
"notifications": "/api/v2/workflow_jobs/20/notifications/",
"workflow_nodes": "/api/v2/workflow_jobs/20/workflow_nodes/",
"labels": "/api/v2/workflow_jobs/20/labels/",
"activity_stream": "/api/v2/workflow_jobs/20/activity_stream/",
"relaunch": "/api/v2/workflow_jobs/20/relaunch/",
"cancel": "/api/v2/workflow_jobs/20/cancel/"
},
"summary_fields": {
"workflow_job_template": {
"id": 7,
"name": "baz",
"description": ""
},
"unified_job_template": {
"id": 7,
"name": "baz",
"description": "",
"unified_job_type": "workflow_job"
},
"created_by": {
"id": 1,
"username": "foobar",
"first_name": "",
"last_name": ""
},
"modified_by": {
"id": 1,
"username": "foobar",
"first_name": "",
"last_name": ""
},
"user_capabilities": {
"delete": true,
"start": true
},
"labels": {
"count": 0,
"results": []
}
"artifacts": { <SOME KEY THAT LETS ME KNOW WHAT NODE IT CAME FROM>: {"string": "abc",
"integer": 123,
"float": 1.0,
"unicode": "竳䙭韽",
"boolean": true,
"none": null},
<SOME KEY THAT LETS ME KNOW WHAT NODE IT CAME FROM>: {"string": "abc",
"integer": 123,
"float": 1.0,
"unicode": "竳䙭韽",
"boolean": true,
"none": null},
}
},
"created": "2020-04-22T16:11:49.120399Z",
"modified": "2020-04-22T16:11:49.633559Z",
"name": "grandma",
"description": "",
"unified_job_template": 7,
"launch_type": "manual",
"status": "running",
"failed": false,
"started": "2020-04-22T16:11:49.623267Z",
"finished": null,
"canceled_on": null,
"elapsed": 11.223614,
"job_args": "",
"job_cwd": "",
"job_env": {},
"job_explanation": "",
"result_traceback": "",
"workflow_job_template": 7,
"extra_vars": "{}",
"allow_simultaneous": false,
"job_template": null,
"is_sliced_job": false,
"inventory": null,
"limit": null,
"scm_branch": null,
"webhook_service": "",
"webhook_credential": null,
"webhook_guid": ""
} |
Another potential solution(adding to what @JacobCallahan said)Someone on the tower team's slack suggested me that they could think about using checkboxes * [ ] to select which workflow nodes do we need to gather artifacts from. That may give us control over what artifacts are gathered. I think original comment by the person opening this issue is in line with what Jake and I am looking for. This will be something we will be using internally in Red Hat QE @wenottingham Having set_stats from WF bubble up and be able to use it in following JTs/WFs is great feature and deserves attention. We are also enabling API users to integrate Tower with other things. Example of that would be, my team trying to integrate Tower with Jenkins and also with PyTest (testing) Sat QE. |
@theansibler your need is interesting. The workflow becomes a function call where the return is based on
Feature 2 -
|
@chrismeyersfsu so you think this is a feature that can be implemented in Tower? What would be the next steps for us(as issue reporter) to know if its going to be implemented? Thanks for your comment. |
If it's implemented downstream in Red Hat Ansible Tower, you'd see the work done in AWX first. The way to track the work is to watch this ticket (if there's no pull request or commentary here, then nobody has started on it). |
I would like to get a little more real world with the above scenario, if I may. For your execution graph, please consider the following additions and consideration:
Dealing with convergent data structures in Specifically for failures described above, the calling workflow that drives the execution being in a In the cases where failure paths that are handled, I would still think it would be up to the workflow designer to specify what does and does not get passed. Auto-resolving issues like this seems problematic at best. Where we are currently where the workflow designer has no way to specify any Thanks for hearing my input. |
@wenottingham is this a near-term priority that we should track more closely as an enhancement in the next major release? |
@ryanpetrello pretty please 🥺 |
This would be an amazing enhancement for AT as-well. Even tho I understand the problematics of this. |
https://github.com/ansible/awx/compare/devel...AlanCoding:wj_artifacts?expand=1 This is a completely careless implementation, but it passes a basic functionality integration test. I need to think about the variable precedence issues raised in this issue... but I'm not convinced any of them will matter in the real world. |
ISSUE TYPE
SUMMARY
On creating a Workflow template like below, we can able to pass the variable value from JT to WT:
Job Template(passes the value of var1) >>On Success>> Nested Workflow(can use the value of var1)
But currently we cannot pass the variable value from WT to JT:
Nested Workflow(passes the value of var1) >>On Success>> Job Template(can use the value of var1)
The purpose of this RFE is to pass variable value from a nested WT to JT/WT.
The text was updated successfully, but these errors were encountered: