Skip to content

Commit

Permalink
feat: create flat runs view [ET-24] (#9023)
Browse files Browse the repository at this point in the history
Co-authored-by: AmanuelAaron <aaron.amanuel@hpe.com>
  • Loading branch information
EmilyBonar and AmanuelAaron authored Apr 11, 2024
1 parent 5854b8b commit 831df43
Show file tree
Hide file tree
Showing 26 changed files with 1,696 additions and 294 deletions.
16 changes: 10 additions & 6 deletions harness/determined/common/api/bindings.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions master/internal/api_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ func (a *apiServer) getProjectColumnsByID(
Location: projectv1.LocationType_LOCATION_TYPE_EXPERIMENT,
Type: projectv1.ColumnType_COLUMN_TYPE_TEXT,
},
{
Column: "externalRunId",
DisplayName: "External Run ID",
Location: projectv1.LocationType_LOCATION_TYPE_RUN,
Type: projectv1.ColumnType_COLUMN_TYPE_TEXT,
},
{
Column: "experimentName",
DisplayName: "Experiment Name",
Location: projectv1.LocationType_LOCATION_TYPE_RUN,
Type: projectv1.ColumnType_COLUMN_TYPE_TEXT,
},
}

hyperparameters := []struct {
Expand Down
21 changes: 11 additions & 10 deletions master/internal/api_runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ func getRunsColumns(q *bun.SelectQuery) *bun.SelectQuery {
Column("r.checkpoint_count").
Column("r.external_run_id").
Column("r.project_id").
Column("r.searcher_metric_value").
ColumnExpr("extract(epoch FROM coalesce(r.end_time, now()) - r.start_time)::int AS duration").
ColumnExpr("r.hparams AS hyperparameters").
ColumnExpr("CASE WHEN r.hparams='null' THEN NULL ELSE r.hparams END AS hyperparameters").
ColumnExpr("r.summary_metrics AS summary_metrics").
ColumnExpr("e.owner_id AS user_id").
ColumnExpr("e.config->>'labels' AS labels").
Expand All @@ -145,7 +146,7 @@ func getRunsColumns(q *bun.SelectQuery) *bun.SelectQuery {
ColumnExpr("p.name AS project_name").
ColumnExpr(`jsonb_build_object(
'searcher_type', e.config->'searcher'->>'name',
'searcher_metric', e.config->'metric'->>'name',
'searcher_metric', e.config->'searcher'->>'metric',
'resource_pool', e.config->'resources'->>'resource_pool',
'name', e.config->>'name',
'description', e.config->>'description',
Expand All @@ -171,17 +172,17 @@ func sortRuns(sortString *string, runQuery *bun.SelectQuery) error {
}
orderColMap := map[string]string{
"id": "id",
"experimentDescription": "experiment_description",
"experimentName": "experiment_name",
"searcherType": "searcher_type",
"searcherMetric": "searcher_metric",
"experimentDescription": "e.config->>'description'",
"experimentName": "e.config->>'name'",
"searcherType": "e.config->'searcher'->>'name'",
"searcherMetric": "e.config->'searcher'->>'metric'",
"startTime": "r.start_time",
"endTime": "r.end_time",
"state": "r.state",
"experimentProgress": "COALESCE(progress, 0)",
"user": "display_name",
"experimentProgress": "COALESCE(e.progress, 0)",
"user": "COALESCE(u.username, u.display_name)",
"forkedFrom": "e.parent_id",
"resourcePool": "resource_pool",
"resourcePool": "e.config->'resources'->>'resource_pool'",
"projectId": "r.project_id",
"checkpointSize": "checkpoint_size",
"checkpointCount": "checkpoint_count",
Expand All @@ -190,7 +191,7 @@ func sortRuns(sortString *string, runQuery *bun.SelectQuery) error {
"externalExperimentId": "e.external_experiment_id",
"externalRunId": "r.external_run_id",
"experimentId": "e.id",
"isExpMultitrial": "is_exp_multitrial",
"isExpMultitrial": "((SELECT COUNT(*) FROM runs r WHERE e.id = r.experiment_id) > 1)",
}
sortParams := strings.Split(*sortString, ",")
hasIDSort := false
Expand Down
Binary file modified proto/buf.image.bin
Binary file not shown.
Loading

0 comments on commit 831df43

Please sign in to comment.