Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Update NNIManager.getTrialJob to contain all hyper parameters #1288

Merged
merged 11 commits into from
Jul 18, 2019
1 change: 1 addition & 0 deletions src/nni_manager/core/nniDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class NNIDataStore implements DataStore {

public async getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
const trialJobs: TrialJobInfo[] = await this.queryTrialJobs(undefined, trialJobId);
assert(trialJobs.length <= 1);

return trialJobs[0];
}
Expand Down
6 changes: 2 additions & 4 deletions src/nni_manager/core/nnimanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@ class NNIManager implements Manager {
});
}

public getTrialJob(trialJobId: string): Promise<TrialJobDetail> {
return Promise.resolve(
this.trainingService.getTrialJob(trialJobId)
);
public getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
return this.dataStore.getTrialJob(trialJobId);
}

public async setClusterMetadata(key: string, value: string): Promise<void> {
Expand Down
7 changes: 6 additions & 1 deletion src/nni_manager/core/test/mockedDatastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ class MockedDataStore implements DataStore {
}

public getTrialJob(trialJobId: string): Promise<TrialJobInfo> {
throw new Error("Method not implemented.");
return Promise.resolve({
id: '1234',
status: 'SUCCEEDED',
startTime: Date.now(),
endTime: Date.now()
});
}

private async getFinalMetricData(trialJobId: string): Promise<any> {
Expand Down