-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distinct page for each Trial in the UI
- Loading branch information
Showing
22 changed files
with
679 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
pkg/new-ui/v1beta1/frontend/src/app/models/trial.k8s.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { K8sObject } from 'kubeflow'; | ||
import { V1Container } from '@kubernetes/client-node'; | ||
|
||
/* | ||
* K8s object definitions | ||
*/ | ||
export const TRIAL_KIND = 'Trial'; | ||
export const TRIAL_APIVERSION = 'kubeflow.org/v1beta1'; | ||
|
||
export interface TrialK8s extends K8sObject { | ||
spec?: TrialSpec; | ||
status?: TrialStatus; | ||
} | ||
|
||
export interface TrialSpec { | ||
metricsCollector: MetricsCollector; | ||
objective: Objective; | ||
parameterAssignments: { name: string; value: number }[]; | ||
primaryContainerName: string; | ||
successCondition: string; | ||
failureCondition: string; | ||
runSpec: K8sObject; | ||
} | ||
|
||
export interface MetricsCollector { | ||
collector?: CollectorSpec; | ||
} | ||
|
||
export interface CollectorSpec { | ||
kind: CollectorKind; | ||
customCollector: V1Container; | ||
} | ||
|
||
export type CollectorKind = | ||
| 'StdOut' | ||
| 'File' | ||
| 'TensorFlowEvent' | ||
| 'PrometheusMetric' | ||
| 'Custom' | ||
| 'None'; | ||
|
||
export interface Objective { | ||
type: ObjectiveType; | ||
goal: number; | ||
objectiveMetricName: string; | ||
additionalMetricNames: string[]; | ||
metricStrategies: MetricStrategy[]; | ||
} | ||
|
||
export type ObjectiveType = 'maximize' | 'minimize'; | ||
|
||
export interface MetricStrategy { | ||
name: string; | ||
value: string; | ||
} | ||
|
||
export interface RunSpec {} | ||
|
||
/* | ||
* status | ||
*/ | ||
|
||
interface TrialStatus { | ||
startTime: string; | ||
completionTime: string; | ||
conditions: TrialStatusCondition[]; | ||
observation: { | ||
metrics: { | ||
name: string; | ||
latest: string; | ||
min: string; | ||
max: string; | ||
}[]; | ||
}; | ||
} | ||
|
||
interface TrialStatusCondition { | ||
type: string; | ||
status: boolean; | ||
reason: string; | ||
message: string; | ||
lastUpdateTime: string; | ||
lastTransitionTime: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...pages/experiment-details/trials-table/trial-modal/overview/metrics/metrics.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<lib-details-list-item key="Latest"> | ||
{{ latest }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item key="Minimum"> | ||
{{ min }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item key="Maximum"> | ||
{{ max }} | ||
</lib-details-list-item> |
10 changes: 10 additions & 0 deletions
10
.../experiment-details/trials-table/trial-modal/overview/metrics/metrics.component.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { ConditionsTableModule, DetailsListModule } from 'kubeflow'; | ||
import { TrialModalMetricsComponent } from './metrics.component'; | ||
|
||
@NgModule({ | ||
declarations: [TrialModalMetricsComponent], | ||
imports: [ConditionsTableModule, DetailsListModule], | ||
exports: [TrialModalMetricsComponent], | ||
}) | ||
export class TrialModalMetricsModule {} |
24 changes: 24 additions & 0 deletions
24
...es/experiment-details/trials-table/trial-modal/overview/metrics/metrics.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TrialModalMetricsComponent } from './metrics.component'; | ||
|
||
describe('TrialModalMetricsComponent', () => { | ||
let component: TrialModalMetricsComponent; | ||
let fixture: ComponentFixture<TrialModalMetricsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [TrialModalMetricsComponent], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TrialModalMetricsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
...p/pages/experiment-details/trials-table/trial-modal/overview/metrics/metrics.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-metrics-overview', | ||
templateUrl: './metrics.component.html', | ||
}) | ||
export class TrialModalMetricsComponent { | ||
@Input() name: string; | ||
@Input() latest: string; | ||
@Input() max: string; | ||
@Input() min: string; | ||
} |
42 changes: 42 additions & 0 deletions
42
.../experiment-details/trials-table/trial-modal/overview/trial-modal-overview.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div> | ||
<lib-details-list-item key="Trial Name"> | ||
{{ trialName }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item key="Experiment Name"> | ||
{{ experimentName }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item key="Status" [icon]="statusIcon"> | ||
{{ status }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item key="Completion Time"> | ||
{{ completionTime }} | ||
</lib-details-list-item> | ||
|
||
<lib-details-list-item [chipsList]="performance" key="Performance"> | ||
</lib-details-list-item> | ||
|
||
<ng-container *ngIf="trial.status.observation?.metrics"> | ||
<div | ||
*ngFor="let metric of trial.status.observation?.metrics" | ||
[style.margin-top]="'16px'" | ||
> | ||
<lib-heading-row heading="Metric:" subHeading="{{ metric.name }}"> | ||
</lib-heading-row> | ||
<app-metrics-overview | ||
[name]="metric.name" | ||
[min]="metric.min" | ||
[max]="metric.max" | ||
[latest]="metric.latest" | ||
></app-metrics-overview> | ||
</div> | ||
</ng-container> | ||
|
||
<lib-conditions-table | ||
*ngIf="trial" | ||
[conditions]="trial.status.conditions" | ||
title="Trial Conditions" | ||
></lib-conditions-table> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
...periment-details/trials-table/trial-modal/overview/trial-modal-overview.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { TrialModalOverviewComponent } from './trial-modal-overview.component'; | ||
|
||
describe('TrialModalOverviewComponent', () => { | ||
let component: TrialModalOverviewComponent; | ||
let fixture: ComponentFixture<TrialModalOverviewComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [TrialModalOverviewComponent], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TrialModalOverviewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.