Skip to content

Enable build job retry #1275

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/job_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ def __init__(self, configs, args):
def _setup(self, args):
return self._api_helper.subscribe_filters({
"state": "done",
"result": ("fail", "incomplete"),
"kind": "job"
# ToDo: Retry for build jobs
# "kind": ("kbuild", "job")
"result": "incomplete",
"kind": ("kbuild", "job"),
})

def _stop(self, sub_id):
Expand Down Expand Up @@ -63,18 +61,23 @@ def _run(self, sub_id):
continue

parent_kind = None
if node.get('kind') == 'job':
parent_kind = 'kbuild'
# ToDo: retry build jobs
# if node.get("kind") == "kbuild":
# parent_kind = "checkout"
if node.get("kind") == "job":
parent_kind = "kbuild"
if node.get("kind") == "kbuild":
parent_kind = "checkout"
if parent_kind:
event_data = self._find_parent_kind(node, self._api_helper, parent_kind)
if not event_data:
self.log.error(f"Not able to find parent node for {node['id']}")
continue
event_data["jobfilter"] = [node["name"]]
event_data["platform_filter"] = [node["data"].get("platform")]
if node["kind"] == "kbuild":
event_data["jobfilter"] = [f'{node["name"]}+']
else:
event_data["jobfilter"] = [node["name"]]
# Change event data state to available to trigger jobs based on scheduler configs
event_data["state"] = "available"
if node["kind"] == "job":
event_data["platform_filter"] = [node["data"].get("platform")]
event_data["retry_counter"] = retry_counter + 1
event_data["debug"] = {"retry_by": str(node["id"])}
self.log.debug(f"{node['id']}:Event data retry_counter: {event_data['retry_counter']}")
Expand Down