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

The deployed version of awesome-panel.org very often places the header, sidebar and main Columns outside the template sections! #897

Closed
MarcSkovMadsen opened this issue Dec 20, 2019 · 7 comments
Labels
TRIAGE Default label for untriaged issues

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Dec 20, 2019

System Info

  • Panel: 0.7.0
  • Bokeh: 1.4.0
  • Tornado 5.1.11
  • Python: 3.7.4
  • OS: Windows 8.1
  • Browser: Chrome

Behaviour

My app deployed at awesome-panel.org often places my header, sidebar and main Columns at the bottom of the HTML document instead of in the sections of the template. It's difficult to explain the behaviour so I've inserted a small video of the behaviour.

I cannot reproduce the issue locally when running Panel in a terminal (localhost example below) or inside Docker container (192.168.99.100 below). The Docker container is the exact same container as deployed.

awesome-panel_org_layout

Additional info

I've attached the html code generated for one of the failed layouts. If you inspect the html file then you will see that my Columns have just been placed at the bottom of the html document outside my template.

awesome-panel-html.zip

image

The problem has not always been there in production. I have not recorded exactly when it started.

But for now my hypothesis is that it started when @philippjfr helped me improve the speed/ responsiveness of my app by changing my template to a css grid (?) based on sections. It's probably this commit awesome-panel/awesome-panel@965a66a

The docker container currently deployed to production is available via docker pull marcskovmadsen/awesome-panel:151.

@MarcSkovMadsen MarcSkovMadsen added the TRIAGE Default label for untriaged issues label Dec 20, 2019
@MarcSkovMadsen MarcSkovMadsen changed the title The deployed version of my app (awesome-panel.org) very often places my Columns outside the template! The deployed version of awesome-panel.org very often places the header, sidebar and main Columns outside the template sections! Dec 20, 2019
@MarcSkovMadsen
Copy link
Collaborator Author

I will try to find the problem my self. But right now this seems like finding a needle in a haystack so if anyone has any ideas of why this can happen then that info would be much appreciated.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Dec 20, 2019

I have seen the behaviour in Chrome and Firefox on my windows laptop and in Safari on my Iphone.

I've tried clearing my history in Firefox. But it does not change anything.

@MarcSkovMadsen
Copy link
Collaborator Author

I tried simplifying the template so that it does not use the css grid.

awesome-panel_org_layout_non_css_grid

But the problem is still there. So it's not a problem with the CSS grid.

<!-- This template is inspired by
- Bokeh Template. See https://panel.pyviz.org/user_guide/Templates.html
-->
{% extends base %}

<!-- goes in head -->
{% block postamble %}
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link
  href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA////AL12KgAWi/IAKrUoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiIiIiAAAAAAIiIiAAAAAAACIiAAAAAiIiIiIiIiACERERERERIAISITMUQREgAhIhMxRBESACEiEzFEERIAISITMUQREgAhERMxRBESACEREzFEERIAIREREUQREgAhERERRBESACERERERERIAIiIiIiIiIgAAAAAAAAAADwDwAA+B8AAPw/AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAD//wAA"
  rel="icon" type="image/x-icon" />
{% endblock %}

<!-- goes in body -->
{% block contents %}

<div style="background:blue;">
  {{ embed(roots.header) }}
  {{ embed(roots.sidebar) }}
  {{ embed(roots.main) }}
</div>

<!-- <section id="page">
  <header>

  </header>

  <nav>
    {{ embed(roots.sidebar) }}
  </nav>

  <main>

  </main>
</section> -->

{% endblock %}

@MarcSkovMadsen
Copy link
Collaborator Author

I've tried removing --num-procs 0 in my Dockerfile i.e. changing

ENTRYPOINT [ "panel", "serve", "app.py", "--address", "0.0.0.0", "--port", "80", "--num-procs", "0"]

to

ENTRYPOINT [ "panel", "serve", "app.py", "--address", "0.0.0.0", "--port", "80"]

and the problem goes away.

@MarcSkovMadsen
Copy link
Collaborator Author

I've got this response on the gitter channel

When you connect to a bokeh server with an HTTP(S) request Bokeh returns a template, and that template immediately turns arounds and makes a websocket connection back to the Bokeh server. But with --num-procs > 1 there is no guarantee that the websocket connection lands on the same original process. That's why e.g. the full HTTP request is not available in the app code— if the websocket lands on a new process, that new process never saw the HTTP request, knows nothing about, can't even in principle provide it.

@MarcSkovMadsen
Copy link
Collaborator Author

@philippjfr . I've closed this one. But I think there should be and issue/ feature request somewhere on the problem and solution you have discussed. But I just don't know where.

@philippjfr
Copy link
Member

There is a bokeh issue about it and it'll be fixed in bokeh/bokeh#9536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE Default label for untriaged issues
Projects
None yet
Development

No branches or pull requests

2 participants