Skip to content

Commit 9227457

Browse files
authored
Bug Fix: Update runs_data_source to request hparams data using FormData (#6334)
## Motivation for features / changes The dashboard will not load when `inColab` is true because the runs data cannot be fetched. Googlers see b/278706604 for why this is important ## Technical description of changes When `inColab` is true `POST` requests are automatically converted to `GET` requests see [tensorboard/webapp/webapp_data_source/tb_http_client.ts](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/webapp/webapp_data_source/tb_http_client.ts). This conversion assumes the provided body is of type `FormData`, however, when I open sourced `runs_data_source` in #6318 I was unaware of this conversion taking place and didn't modify the format of the post request body. ## Screenshots of UI changes Before: ![image](https://user-images.githubusercontent.com/78179109/232854635-c95e2047-0203-4677-ac1f-98962f034faf.png) After: ![image](https://user-images.githubusercontent.com/78179109/232854359-57c0b7e2-a1da-45c0-b948-a9139271b380.png) ## Detailed steps to verify changes work correctly (as executed by you) 1) Start tensorboard 2) Navigate to http://localhost:6006?tensorboardColab#timeseries 3) Assert that the dashboard loads ## Alternate designs / implementations considered I could have updated the conversion happening in [tensorboard/webapp/webapp_data_source/tb_http_client.ts](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/webapp/webapp_data_source/tb_http_client.ts) to accept JSON bodies
1 parent 1416f8b commit 9227457

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tensorboard/webapp/runs/data_source/runs_data_source.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ function transformBackendMetricSpec(
7474
};
7575
}
7676

77-
declare interface GetExperimentHparamRequestPayload {
78-
experimentName: string;
79-
}
80-
8177
@Injectable()
8278
export class TBRunsDataSource implements RunsDataSource {
8379
constructor(private readonly http: TBHttpClient) {}
@@ -98,13 +94,12 @@ export class TBRunsDataSource implements RunsDataSource {
9894
}
9995

10096
fetchHparamsMetadata(experimentId: string): Observable<HparamsAndMetadata> {
101-
const requestPayload: GetExperimentHparamRequestPayload = {
102-
experimentName: experimentId,
103-
};
97+
const formData = new FormData();
98+
formData.append('experimentName', experimentId);
10499
return this.http
105100
.post<backendTypes.BackendHparamsExperimentResponse>(
106101
`/experiment/${experimentId}/${HPARAMS_HTTP_PATH_PREFIX}/experiment`,
107-
requestPayload
102+
formData
108103
)
109104
.pipe(
110105
map((response) => {

0 commit comments

Comments
 (0)