Skip to content

Commit 7c482fc

Browse files
authored
Nightly & Package Build Bug Fixes (#2897)
* Fix bug that causes failure summary text to be grouped incorrectly in GitHub CI logs. * Fix MPIIGaze download timeout by uploading a mirror to our private S3 bucket. * Fix build_and_test.py getting confused by multiple wheels in the same directory when trying to set up test environments
1 parent bc43dec commit 7c482fc

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

qai_hub_models/datasets/mpiigaze.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"MPIIGaze",
2525
MPII_GAZE_VERSION,
2626
"MPIIGaze.tar.gz",
27+
ci_private_s3_key="qai-hub-models/datasets/mpiigaze/MPIIGaze.tar.gz",
2728
)
2829

2930

scripts/tasks/release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(
6262
venv=venv,
6363
env=env,
6464
commands=[
65+
f"rm -f {os.path.join(wheel_dir, 'qai_hub_models-*.whl')}",
6566
f"python -m build --wheel --outdir {wheel_dir}"
6667
+ (" > /dev/null" if on_ci() else ""),
6768
f"echo 'Wheel can be found at {wheel_dir}'",

scripts/tasks/task.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ def __init__(
2626
junit_name: str = "",
2727
junit_classname: str = "",
2828
prereqs: list[Task] | None = None,
29+
group_logs_on_ci: bool = True,
2930
) -> None:
3031
self.group_name = group_name
32+
self.group_logs_on_ci = group_logs_on_ci
3133
self.raise_on_failure = raise_on_failure
3234
self.last_result: bool | None = None
3335
self.last_result_exception: Exception | None = None
@@ -70,7 +72,7 @@ def run(self) -> bool:
7072
"""Entry point for callers: perform any startup/teardown tasks and call run_task."""
7173
self.last_result_exception = None
7274

73-
if self.group_name:
75+
if self.group_name and self.group_logs_on_ci:
7476
start_group(self.group_name)
7577

7678
failed = self._failed_prereqs()
@@ -82,30 +84,26 @@ def run(self) -> bool:
8284
message=f"Skipped: prerequisite(s) failed ({names})",
8385
)
8486
self.last_result = False
85-
if self.group_name:
87+
if self.group_name and self.group_logs_on_ci:
8688
end_group()
8789
return False
8890

8991
try:
9092
result = self.run_task()
9193
except Exception as err:
94+
self.last_result_exception = err
95+
result = False
96+
97+
if self.group_name and self.group_logs_on_ci:
98+
end_group()
99+
100+
if not result:
92101
self._write_junit(
93102
TestStatus.FAILED,
94103
message=f"{self.group_name} failed. Check the logs for details.",
95104
)
96-
self.last_result_exception = err
97-
result = False
98105
else:
99-
if not result:
100-
self._write_junit(
101-
TestStatus.FAILED,
102-
message=f"{self.group_name} failed. Check the logs for details.",
103-
)
104-
else:
105-
self._write_junit(TestStatus.PASSED)
106-
107-
if self.group_name:
108-
end_group()
106+
self._write_junit(TestStatus.PASSED)
109107

110108
self.last_result = result
111109
if not result and self.raise_on_failure:
@@ -360,7 +358,12 @@ def __init__(
360358
raise_on_failure: bool = True,
361359
show_subtasks_in_failure_message: bool = True,
362360
) -> None:
363-
super().__init__(group_name, raise_on_failure)
361+
super().__init__(
362+
group_name,
363+
raise_on_failure,
364+
# Don't group logs if subtasks use groups. GH can't handle nested groups.
365+
group_logs_on_ci=not any(t.group_logs_on_ci for t in tasks),
366+
)
364367
self.tasks = tasks
365368
self.continue_after_single_task_failure = continue_after_single_task_failure
366369
self.show_subtasks_in_failure_message = show_subtasks_in_failure_message

0 commit comments

Comments
 (0)