Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nextchanges/air/mlflow-logs-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Route AIR log links to the MLflow Logs page instead of the hidden artifact path. ([#7491](https://github.com/databricks/cli/pull/7491))
2 changes: 1 addition & 1 deletion acceptance/air/get-ai-runtime/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MLflow URL: [DATABRICKS_URL]/ml/experiments/exp1/runs/run1
"attempt_number": 0,
"experiment_name": "my-exp",
"dashboard_url": "[DATABRICKS_URL]/jobs/runs/123?o=[WORKSPACE_ID]",
"mlflow_url": "[DATABRICKS_URL]/ml/experiments/exp1/runs/run1/artifacts/logs/node_0",
"mlflow_url": "[DATABRICKS_URL]/ml/experiments/exp1/runs/run1/logs",
"est_remaining_seconds": null,
"est_percent_complete": null
}
Expand Down
2 changes: 1 addition & 1 deletion acceptance/air/get/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MLflow URL: [DATABRICKS_URL]/ml/experiments/exp1/runs/run1
"attempt_number": 0,
"experiment_name": "my-exp",
"dashboard_url": "[DATABRICKS_URL]/jobs/runs/123?o=[WORKSPACE_ID]",
"mlflow_url": "[DATABRICKS_URL]/ml/experiments/exp1/runs/run1/artifacts/logs/node_0",
"mlflow_url": "[DATABRICKS_URL]/ml/experiments/exp1/runs/run1/logs",
"est_remaining_seconds": null,
"est_percent_complete": null
}
Expand Down
1 change: 1 addition & 0 deletions cmd/air/list_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func TestIndexStrategyCachesMLflowEnrichment(t *testing.T) {
require.NoError(t, err)
require.Len(t, rows, 1)
assert.Equal(t, "training-run", rows[0].MLflowLabel)
assert.Equal(t, srv.URL+"/ml/experiments/exp1/runs/mlflow1/logs", rows[0].MLflowURL)
}

assert.Equal(t, 1, getHits, "warm cache must skip runs/get")
Expand Down
18 changes: 17 additions & 1 deletion cmd/air/list_tui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

tea "github.com/charmbracelet/bubbletea"
"github.com/databricks/cli/libs/cmdio"
"github.com/databricks/cli/libs/env"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand All @@ -15,7 +16,7 @@ import (
// absent MLflow link, and a still-running (no end) row.
func testListRows() []listRow {
return []listRow{
{RunID: "1", Experiment: "qwen-train", User: "me@example.com", Status: "SUCCESS", StartedAt: new("2026-06-05T17:32:39.000000+00:00"), Duration: "1m 14s", MLflowURL: "https://h/ml/experiments/E/runs/04c41514fbb0/artifacts/logs/node_0", MLflowLabel: "qwen-run-001", Accelerators: "8x H100"},
{RunID: "1", Experiment: "qwen-train", User: "me@example.com", Status: "SUCCESS", StartedAt: new("2026-06-05T17:32:39.000000+00:00"), Duration: "1m 14s", MLflowURL: "https://h/ml/experiments/E/runs/04c41514fbb0/logs", MLflowLabel: "qwen-run-001", Accelerators: "8x H100"},
{RunID: "2", Experiment: "llama-train", User: "me@example.com", Status: "RUNNING", StartedAt: new("2026-06-05T18:43:24.000000+00:00"), Duration: "3m 32s", Progress: "81% · ~48m", MLflowURL: "-", MLflowLabel: "-", Accelerators: "1x A10"},
{RunID: "3", Experiment: "mixtral", User: "me@example.com", Status: "FAILED", StartedAt: nil, Duration: "-", MLflowURL: "-", MLflowLabel: "-", Accelerators: "-"},
}
Expand Down Expand Up @@ -152,6 +153,21 @@ func TestListModelQuit(t *testing.T) {
assert.Equal(t, tea.QuitMsg{}, cmd())
}

func TestListModelEnterOpensMLflowLogs(t *testing.T) {
ctx, stderr := cmdio.NewTestContextWithStderr(t.Context())
ctx = env.Set(ctx, "BROWSER", "none")
r, _ := cmdio.NewRenderer(ctx, io.Discard)
f := &runFetcher{ctx: ctx, w: newTestWorkspaceClient(t, "https://x.test")}
m := newListModel(r, f, testListRows(), false)

_, cmd := m.Update(tea.KeyMsg{Type: tea.KeyEnter})
require.NotNil(t, cmd)
cmd()

assert.Contains(t, stderr.String(), "https://h/ml/experiments/E/runs/04c41514fbb0/logs")
assert.NotContains(t, stderr.String(), "/artifacts/logs/node_0")
}

func TestListModelView(t *testing.T) {
next, _ := testListModel(t).Update(tea.WindowSizeMsg{Width: 200, Height: 24})
out := next.(listModel).View()
Expand Down
7 changes: 3 additions & 4 deletions cmd/air/mlflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ func mlflowIDsFromOutput(output *jobs.AiRuntimeTaskOutput) *mlflowIdentifiers {
return &mlflowIdentifiers{ExperimentID: output.MlflowExperimentId, RunID: output.MlflowRunId}
}

// mlflowLogsURL is the deep link to a run's node-0 logs. It is the value of the
// JSON `mlflow_url` field, matching the Python CLI.
// mlflowLogsURL links to a run's Logs tab. It is also the value of the JSON
// `mlflow_url` field.
func mlflowLogsURL(host string, ids *mlflowIdentifiers) string {
return fmt.Sprintf("%s/ml/experiments/%s/runs/%s/artifacts/logs/node_0",
strings.TrimRight(host, "/"), ids.ExperimentID, ids.RunID)
return mlflowRunURL(host, ids) + "/logs"
}

// mlflowRunURL links to the MLflow run page; it backs the MLflow Run hyperlink
Expand Down
2 changes: 1 addition & 1 deletion cmd/air/mlflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestMLflowIDsForTask(t *testing.T) {
func TestMLflowURLs(t *testing.T) {
ids := &mlflowIdentifiers{ExperimentID: "E1", RunID: "R1"}
// A trailing slash on the host must not produce a double slash in the link.
assert.Equal(t, "https://h.test/ml/experiments/E1/runs/R1/artifacts/logs/node_0", mlflowLogsURL("https://h.test/", ids))
assert.Equal(t, "https://h.test/ml/experiments/E1/runs/R1/logs", mlflowLogsURL("https://h.test/", ids))
assert.Equal(t, "https://h.test/ml/experiments/E1/runs/R1", mlflowRunURL("https://h.test", ids))
}

Expand Down
Loading