Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile plugin in blank when redirected with juypter_server_proxy #3748

Closed
rsarm opened this issue Jun 19, 2020 · 4 comments
Closed

Profile plugin in blank when redirected with juypter_server_proxy #3748

rsarm opened this issue Jun 19, 2020 · 4 comments

Comments

@rsarm
Copy link

rsarm commented Jun 19, 2020

Hi. I use tensorboard within a jupyter notebook that runs remotely and it's accessible through juypterhub. Since on the remote host, tensorboard will be running on localhost:6006, I use juypter_server_proxy to redirect it through the notebook's server. I do that through monkey-patching tensorboard.notebook._display_ipython as follows

import tensorboard
from IPython import get_ipython


def _display_ipython(port, height, display_handle):
    import os
    import IPython.display
    iframe = IPython.display.IFrame(
        src="https://<jupyter-url>/hub/user-redirect/proxy/%d/#scalars" % (os.environ['USER'], port),
        height=height,
        width="100%",
    )
    if display_handle:
        display_handle.update(iframe)
    else:
        IPython.display.display(iframe)


ipy = get_ipython()
tensorboard.notebook._load_ipython_extension(ipy)

tensorboard.notebook._display_ipython = _display_ipython

That works fine. The scalars, histograms, etc, show up fine, but the profile tab shows a blank page. Both within the notebook or directly on the browser. Using ssh tunnels from the host to my laptop, I checked that the profiler shows up fine. The problem seems to be with the redirecting.

I see that the blank page has an iframe <iframe id="dashboard" src="http://<jupyter-url>/hub/user-redirect/proxy/6006/data/plugin_entry.html?name=profile"></iframe>. I tried pasting that url directly to the browser, and it does some redirects which ends up in a blank page http://<jupyter-url>/hub/user-redirect/proxy/6006/data/profile/index.html. Doing the same, with a tensorboard running un my laptop, these last redirects end up on a working profiler with a longer url http://localhost:6006/data/plugin/profile/overview_page@;ea=20200615-211507%2Ftrain%2F2020_06_15_21_15_10;tag=overview_page@;host=nid06882. I think with the way I'm doing the proxying through jupyter, I'm messing up with tensorboard's redirects.

Do you have some workaround for the case of JuypterHub? Otherwise could you please, point me to where I could add a fix for my use case.

@psybuzz
Copy link
Contributor

psybuzz commented Jun 26, 2020

Thank you for the report. I haven't gotten around to investigation of this yet. Could you please share your version #s for tensorboard and jupyter hub?

@rsarm
Copy link
Author

rsarm commented Jun 27, 2020

Thanks a lot for looking into this! We have tensorboard-2.2.1 and juypterhub-1.0.0.

@rsarm
Copy link
Author

rsarm commented Aug 17, 2020

I just tested again with tensorboard-plugin-profile-2.3.0/tensorboard-2.3.0 and the profiler shows up fine. Thanks!

@psybuzz
Copy link
Contributor

psybuzz commented Aug 17, 2020

Thanks for verifying that it works in 2.3.0. I wasn't able to deeply investigate the problem, but since it's solved with a version bump, I suspect it might be due to the fix that landed in 2.3 - #3674.

Closing this issue.

@psybuzz psybuzz closed this as completed Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants