Repository navigation
air: add existing run metadata to list JSON output - #7568
Conversation
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/air/list: branch ✅ | main (1131d79) ❌ | latest (v1.26.0) ❌main (1131d79): latest (v1.26.0): same output as main (1131d79) |
✅ Integration test reportCommit: 6778962
Top 2 slowest tests (at least 2 minutes):
|
| @@ -25,27 +28,42 @@ func buildListRow(run *jobs.Run, host string, workspaceID int64) listRow { | |||
| // Still running: measure against the current time. | |||
| end = time.Now().UnixMilli() | |||
| } | |||
| duration = formatDuration(roundMillisToSeconds(end - start)) | |||
| seconds := roundMillisToSeconds(end - start) | |||
| durationSeconds = &seconds | |||
| duration = formatDuration(seconds) | |||
There was a problem hiding this comment.
duration_seconds here has a different meaning than the same field in air get --output json:
air listtakes timing fromjobTiming, which readsTasks[0], the first attempt (joblist.go:98-107).air getusesdurationSeconds(run)→reportedTiming, which readsTasks[n-1], the latest attempt (format.go:183,format.go:236).
For a retried run, air list -o json and air get -o json will report different duration_seconds for the same run, even though the field name and type are identical. started_at already had this mismatch, but it becomes more visible now that list JSON exposes duration too.
Could we compute these from reportedTiming here, or reuse durationSeconds(run) / startedAt(run) directly, so both commands agree? A test with a retried run (two task attempts with different start/end times) would cover it.
pardis-beikzadeh-db
left a comment
There was a problem hiding this comment.
Approving so this isn't blocked on me, but please fix these three before merging: the duration_seconds mismatch with air get (Maggie's comment) and the broken dashboard_url when the workspace ID is unknown (both inline), plus a missing .nextchanges/air/ fragment (.agents/rules/changelog.md).
| var startedAt *string | ||
| var durationSeconds *int64 | ||
| duration := "-" | ||
| if start, end := jobTiming(run); start > 0 { |
There was a problem hiding this comment.
+1 to Maggie's comment on line 33: air get reads the latest attempt here, so the two disagree on retried runs.
| MLflowURL string `json:"-"` | ||
| MLflowLabel string `json:"-"` | ||
| RunURL string `json:"-"` | ||
| RunURL string `json:"dashboard_url"` |
There was a problem hiding this comment.
If the workspace ID lookup fails (line 148), this writes a broken link ending in ?o=0, and for finished runs the cache keeps that broken link for 60 days. (air get returns an error in that case instead of a bad link.) Could dashboard_url be null when the workspace ID is unknown?
| ExperimentName *string `json:"experiment_name"` | ||
| DurationSeconds *int64 `json:"duration_seconds"` | ||
| AcceleratorType *string `json:"accelerator_type"` | ||
| AcceleratorCount *int `json:"accelerator_count"` |
There was a problem hiding this comment.
nit: the --filter key and the run YAML both call this num_accelerators. Use the same name here?
| AcceleratorType *string `json:"accelerator_type"` | ||
| AcceleratorCount *int `json:"accelerator_count"` | ||
|
|
||
| // The fields below are pre-rendered table cells or text-only enrichment. |
There was a problem hiding this comment.
nit: this comment now sits above RunURL, which is emitted as dashboard_url. Move RunURL up with the JSON fields.
| } | ||
|
|
||
| acceleratorType, acceleratorCount := jobCompute(run) | ||
| var acceleratorTypeJSON *string |
There was a problem hiding this comment.
nit: nilIfEmpty (snapshot_git.go:301) does this; it works for experimentName too.
maggiewang-db
left a comment
There was a problem hiding this comment.
LGTM, thanks for addressing the feedback.
|
Heads-up from #7573, which merged to That removes the broken-link case the
Suggestion: drop the guard, call Not blocking, and the two PRs don't conflict textually. This branch doesn't include #7573 yet, and I haven't run it with the change. |
974f9da to
ef0bc6f
Compare
Co-authored-by: Maggie Wang <141875985+maggiewang-db@users.noreply.github.com>
ef0bc6f to
6778962
Compare
❌ Integration test reportCommit: c327854
48 interesting tests: 31 FAIL, 9 RECOVERED, 5 flaky, 3 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
What did you change, and why?
experiment_name,duration_seconds,accelerator_type,num_accelerators, anddashboard_urltoair list --output jsonusing metadata already available while building each row.nullwhen unavailable, align timing with the latest attempt used byair get, and keep text output unchanged.How do you know it works?
go test -count=1 ./cmd/air, the targeted AIR list acceptance test, scoped lint, formatting, andgit diff --check.CNXT-2585