Skip to content

Commit eb63e28

Browse files
committed
Kill stuck pr testing jobs
1 parent 21d30fe commit eb63e28

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

parse_jenkins_builds.py

+21
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ def grep(filename, pattern, verbose=False):
169169
payload["wait_time"] = current_time - queue_time
170170
payload["start_time"] = 0
171171

172+
kill_index = 0
173+
174+
# Abort stuck rocm jobs
175+
if job_name in ("ib-run-pr-unittests", "ib-run-pr-relvals") and reason.endswith("-offline") and (payload["wait_time"] / 1000 / 60 > 60):
176+
params = element["params"].strip().split("\n")
177+
main_params = ""
178+
other_params = []
179+
for _ in params:
180+
k, v = _.split("=")
181+
if k == "PULL_REQUEST":
182+
main_params = _
183+
else:
184+
other_params.append(_)
185+
186+
with open("abort-{0}.prop".format(kill_index), "w") as f:
187+
f.write("JENKINS_PROJECT_TO_KILL={0}\n".format(job_name))
188+
f.write("JENKINS_PROJECT_PARAMS={0}\n".format(main_params))
189+
f.write("EXTRA_PARAMS={0}\n".format(";".join(other_params)))
190+
191+
kill_index += 1
192+
172193
unique_id = (
173194
JENKINS_PREFIX + ":/build/builds/" + job_name + "/" + str(queue_id)
174195
) # Not a real path

0 commit comments

Comments
 (0)