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

Rendering map_index_template even if the task fails #39065

Closed
2 tasks done
tomrutter opened this issue Apr 16, 2024 · 6 comments
Closed
2 tasks done

Rendering map_index_template even if the task fails #39065

tomrutter opened this issue Apr 16, 2024 · 6 comments
Labels
kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet pending-response

Comments

@tomrutter
Copy link
Contributor

Description

The map_index_template field on a task is used to render a custom name for each individual sub task in a mapped task. It is generated by rendering the task context on the jinja template provided. It is possible to add to this context during the task run and therefore control the mapped index based on the results of the task. As a result, the rendering happens after a task run completes and this has the side effect that it will only render the mapped task for tasks that succeed.

This isn't always the case though, and it would be useful to see the custom map index both during task runs, and for tasks that have failed. I propose that we render the map index twice - once before and once after the task runs. This would mean that the mapped index appears during the task run, and also persists for tasks that have failed.

Use case/motivation

It would be useful to be able to see the custom map index even for tasks that fail, when the context information to do so is available. This helps with tracking down which tasks have failed, as the mapped task index can be used to provide human readable information to distinguish the mapped tasks from one another.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@tomrutter tomrutter added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Apr 16, 2024
@pankajkoti
Copy link
Member

@tomrutter perhaps this PR fixes it already. Could you check once it's the same issue you're reporting?

@tomrutter
Copy link
Contributor Author

It's the same issue. I was suggesting something very similar but also with an additional attempt to render the map index before the task execution. I suspect that it's often the case that the map index could be rendered from the task inputs and it would be nice to see the human readable map index during the task run. Does this seem reasobable?

@pankajkoti
Copy link
Member

cc: @RNHTTR @TJaniF @uranusjr for your opinion on this one ☝🏽

@raphaelauv
Copy link
Contributor

related : #39092

@RNHTTR
Copy link
Contributor

RNHTTR commented Apr 17, 2024

Yes, #38902 will resolve the issue where named mapped instances don't render if the instance fails.

I couldn't figure out how to get the mapped instances to render during task execution, but I think it's worthy for there to be an issue open for that. @tomrutter would you be open to closing this one and opening a separate Issue for rendering named mapped instances during task execution?

@tomrutter
Copy link
Contributor Author

Sure. Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet pending-response
Projects
None yet
Development

No branches or pull requests

4 participants