KEMBAR78
Use GET instead of POST requests for hparams in colab environment. by bmd3k · Pull Request #4218 · tensorflow/tensorboard · GitHub
Skip to content

Conversation

@bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Oct 5, 2020

  • Motivation for features / changes

    Hparams dashboard does not work in Google-internal colab environments because they do not support POST requests.

  • Technical description of changes

    Reuse mechanism introduced in scalars: don’t multiplex fetches in Colab #4191 that provides a 'tensorboardColab' query parameter in the URL to indicate a colab environment. If the value for the parameter is true then the Hparams dashboard will send GET requests. Otherwise it sends POST requests.

    There already existed code that purported to determine if the hparams dashboard was running in a colab environment but this code has not worked for some time, possibly since colab: use proxyPort for dynamic plugin #2798. The code in this PR simply replaces that code. The plumbing to pipe this through other layers had already been implemented.

  • Tests

    I loaded a local tensorboard with the query parameter 'tensorboardColab=true' and inspected the network tab to confirm that hparams-related calls were GET requests.

    I loaded the local tensorboard without 'tensorboardColab' in the URL and inspected the network tab to confirm that hparams-related calls were POST requests.

Read the 'tensorboardColab' environment variable as an indicator of
whether tensorboard is running in a colab environment. If it is true
then send GET requests instead of POST requests.

This check replaces an old colab-related check that stopped functioning.
The new 'tensorboardColab' mechanism was introduced in tensorflow#4191.
@bmd3k bmd3k marked this pull request as ready for review October 5, 2020 15:55
@bmd3k bmd3k requested a review from wchargin October 5, 2020 15:55
Comment on lines +23 to +24
const inColab =
new URLSearchParams(window.location.search).get('tensorboardColab') ===
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you leave a comment here that this is deliberately a side-effect
at module import time to work around the bug in AppRouting, as #4213
did for the scalars dashboard?

/**
* Save the initial URL query params, before the AppRoutingEffects initialize.
*/
const initialURLSearchParams = new URLSearchParams(window.location.search);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I’ve gone ahead and done this.)

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Oct 6, 2020
@wchargin
Copy link
Contributor

wchargin commented Oct 6, 2020

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Oct 6, 2020
@bmd3k bmd3k merged commit 25e8cf9 into tensorflow:master Oct 6, 2020
@bmd3k bmd3k deleted the hparams-in-colab branch April 20, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants