Skip to content

Commit

Permalink
Support macos labels (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic authored Nov 26, 2024
1 parent 7145eb4 commit d8b34f3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 21 deletions.
29 changes: 8 additions & 21 deletions .github/actions/collect_data/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ def get_pipeline_row_from_github_info(github_runner_environment, github_pipeline
}


def return_first_string_starts_with(starting_string, strings):
for string in strings:
if string.startswith(starting_string):
return string
raise Exception(f"{strings} do not have any that match {starting_string}")


def get_job_failure_signature_(github_job) -> Optional[Union[InfraErrorV1]]:
if github_job["conclusion"] == "success":
return None
Expand Down Expand Up @@ -122,23 +115,17 @@ def get_job_row_from_github_job(github_job):
else:
location = "tt_cloud"

os = None
if location == "github":
try:
ubuntu_version = return_first_string_starts_with("ubuntu-", labels)
except Exception as e:
logger.error(e)
logger.error(f"{labels} for a GitHub runner seem to not specify an ubuntu version")
raise e
if ubuntu_version == "ubuntu-latest":
os_variants = ["ubuntu", "windows", "macos"]
os = [label for label in labels if any(variant in label for variant in os_variants)][0]
if os == "ubuntu-latest":
logger.warning("Found ubuntu-latest, replacing with ubuntu-24.04 but may not be case for long")
ubuntu_version = "ubuntu-24.04"
elif location == "tt_cloud":
logger.warning("Assuming ubuntu-20.04 for tt cloud, but may not be the case soon")
ubuntu_version = "ubuntu-20.04"
else:
ubuntu_version = None
os = "ubuntu-24.04"

os = ubuntu_version
if location == "tt_cloud":
logger.warning("Assuming ubuntu-20.04 for tt cloud, but may not be the case soon")
os = "ubuntu-20.04"

name = github_job["name"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,42 @@
"runner_group_id": 2,
"runner_group_name": "GitHub Actions"
},
{
"id": 33467841415,
"run_id": 12007373278,
"workflow_name": "Run all tests",
"head_branch": "main",
"run_url": "https://api.github.com/repos/tenstorrent/tt-lens/actions/runs/12007373278",
"run_attempt": 1,
"node_id": "CR_kwDOMDRX4M8AAAAHyta7hw",
"head_sha": "2030b2421d8c444a8c1fe4b8f823e2bc094f5dd9",
"url": "https://api.github.com/repos/tenstorrent/tt-lens/actions/jobs/33467841415",
"html_url": "https://github.com/tenstorrent/tt-lens/actions/runs/12007373278/job/33467841415",
"status": "completed",
"conclusion": "success",
"created_at": "2024-11-25T09:48:50Z",
"started_at": "2024-11-25T09:48:55Z",
"completed_at": "2024-11-25T09:50:18Z",
"name": "build / Build TT-LENS.",
"steps": [
{
"name": "Set up job",
"status": "completed",
"conclusion": "success",
"number": 1,
"started_at": "2024-11-25T09:48:55Z",
"completed_at": "2024-11-25T09:48:56Z"
}
],
"check_run_url": "https://api.github.com/repos/tenstorrent/tt-lens/check-runs/33467841415",
"labels": [
"macos-latest"
],
"runner_id": 18,
"runner_name": "GitHub Actions 18",
"runner_group_id": 2,
"runner_group_name": "GitHub Actions"
},
{
"id": 33467915506,
"run_id": 12007373278,
Expand Down

0 comments on commit d8b34f3

Please sign in to comment.