|
5 | 5 | import subprocess
|
6 | 6 | from es_utils import send_payload, get_payload, resend_payload, get_payload_wscroll
|
7 | 7 | from cmsutils import epoch2week
|
8 |
| -import urllib.request |
9 |
| - |
10 |
| -from github_utils import ( |
11 |
| - api_rate_limits, |
12 |
| - mark_commit_status, |
13 |
| - get_combined_statuses, |
14 |
| - get_pr_latest_commit, |
15 |
| -) |
16 | 8 |
|
17 | 9 | JENKINS_PREFIX = "jenkins"
|
18 | 10 | try:
|
@@ -177,67 +169,6 @@ def grep(filename, pattern, verbose=False):
|
177 | 169 | payload["wait_time"] = current_time - queue_time
|
178 | 170 | payload["start_time"] = 0
|
179 | 171 |
|
180 |
| - kill_index = 0 |
181 |
| - |
182 |
| - # Abort stuck rocm jobs |
183 |
| - if ( |
184 |
| - job_name in ("ib-run-pr-unittests", "ib-run-pr-relvals", "ib-run-baseline") |
185 |
| - and reason.endswith("-offline") |
186 |
| - and (payload["wait_time"] / 1000 / 60 > 60) |
187 |
| - ): |
188 |
| - params = element["params"].strip().split("\n") |
189 |
| - main_params = "" |
190 |
| - other_params = [] |
191 |
| - context = "" |
192 |
| - upload_unique_id = "" |
193 |
| - pull_request = "" |
194 |
| - commit = "" |
195 |
| - |
196 |
| - for _ in params: |
197 |
| - k, v = _.split("=") |
198 |
| - if k == "PULL_REQUEST": |
199 |
| - main_params = _ |
200 |
| - pull_request = v |
201 |
| - else: |
202 |
| - if k == "CONTEXT_PREFIX": |
203 |
| - context = v |
204 |
| - if k == "UPLOAD_UNIQ_ID": |
205 |
| - upload_unique_id = v |
206 |
| - |
207 |
| - other_params.append(_) |
208 |
| - |
209 |
| - if "GPU_FLAVOR=rocm" in other_params or "TEST_FLAVOR=rocm" in other_params: |
210 |
| - with open("abort-{0}.prop".format(kill_index), "w") as f: |
211 |
| - f.write("JENKINS_PROJECT_TO_KILL={0}\n".format(job_name)) |
212 |
| - f.write("JENKINS_PROJECT_PARAMS={0}\n".format(main_params)) |
213 |
| - f.write("EXTRA_PARAMS={0}\n".format(";".join(other_params))) |
214 |
| - |
215 |
| - kill_index += 1 |
216 |
| - |
217 |
| - repository, pr = pull_request.split("#", 1) |
218 |
| - |
219 |
| - if context: |
220 |
| - with urllib.request.urlopen( |
221 |
| - "http://localhost/SDT/jenkins-artifacts/pull-request-integration/{0}/prs_commits.txt".format( |
222 |
| - upload_unique_id |
223 |
| - ) |
224 |
| - ) as f: |
225 |
| - commits = f.read().decode("ascii", "ignore").splitlines() |
226 |
| - |
227 |
| - for _ in commits: |
228 |
| - if _.startswith(pull_request): |
229 |
| - commit = _.split("='", 1)[1] |
230 |
| - break |
231 |
| - |
232 |
| - with open("commit-status-{0}.prop", "w") as f: |
233 |
| - f.write("REPOSITORY={0}\n".format(repository)) |
234 |
| - f.write("PULL_REQUEST={0}\n".format(commit)) |
235 |
| - f.write("CONTEXT={0}\n".format(context)) |
236 |
| - f.write("STATUS=error\n") |
237 |
| - f.write("STATUS_MESSAGE=Timed out waiting for ROCm node\n") |
238 |
| - |
239 |
| - continue |
240 |
| - |
241 | 172 | unique_id = (
|
242 | 173 | JENKINS_PREFIX + ":/build/builds/" + job_name + "/" + str(queue_id)
|
243 | 174 | ) # Not a real path
|
|
0 commit comments