Comments (9)
Thanks for the update, but just to clarify do you mean:
Adding --ready-check-path=/healthz seems to work well for your dashboard starting OK. But that you no longer have the problem anyway, even if you drop --ready-check-path again.
?
Yes, that's it.
from jhsingle-native-proxy.
The bug is still happening even with --ready-check-path=/healthz
from jhsingle-native-proxy.
This idea probably makes sense, and I would like to add it as an option at some point.
However, it may be more efficient for you to use the --ready-check-path=/ready-check
argument instead. This allows you to specify an alternative URL (e.g. /ready-check) that will tell jhsingle-native-proxy if the web server is ready. It is inefficient to request the main Streamlit app to do this really - maybe you can choose the URL to a smaller static asset from Streamlit that at least would indicate the Streamlit web server is ready to receive requests. This should be able to respond much quicker, and ultimately means that JupyterHub can redirect users to the dashboard sooner, so their request for the main Streamlit app can begin sooner too.
Please let me know if that helps.
from jhsingle-native-proxy.
I'll try to set --ready-check-path=/healthz
for streamlit and what this what it gives
from jhsingle-native-proxy.
Unfortunately, I couldn't reproduce the bug again, even though --ready-check-path=/healthz
is working for streamlit dashboards, we can't be sure it fixes the bug until reproducing it.
I'll get back whenever the bug is reproduced.
from jhsingle-native-proxy.
Thanks for the update, but just to clarify do you mean:
Adding --ready-check-path=/healthz seems to work well for your dashboard starting OK. But that you no longer have the problem anyway, even if you drop --ready-check-path again.
?
from jhsingle-native-proxy.
I reproduced the bug with the following flask app:
from flask import Flask
from time import sleep
app = Flask(__name__)
@app.route('/')
def hello_world():
sleep(30)
return 'Hello, World!'
and theses configurations:
c.CDSDashboardsConfig.presentation_types = ['flask']
c.VariableMixin.extra_presentation_launchers = {
'flask': {
'args': [
'flask', 'run', '{--}port={port}'
],
'env': {'FLASK_APP': 'app.py'},
}
}
from jhsingle-native-proxy.
A better reproduction app:
from flask import Flask
from time import sleep, time
app = Flask(__name__)
started_at = time()
ready_after = 30
@app.route('/')
def hello_world():
now = time()
if now - started_at > ready_after:
return 'Appliation ready!'
else:
# sleep for more that 1 seconds to make the _ready_check call fail:
# https://github.com/yuvipanda/simpervisor/blob/master/simpervisor/process.py#L196
# Even status code 400 is considered as ready as per https://github.com/ideonate/jhsingle-native-proxy/blob/master/jhsingle_native_proxy/proxyhandlers.py#L707
# return 'Application not yet ready! Please try later', 400
sleep(5)
Why better?
The first app will always fail to start even if we increase the ready_timeout
, it fails because the ready_func
call is only waited for 1 second in https://github.com/yuvipanda/simpervisor/blob/master/simpervisor/process.py#L196
from jhsingle-native-proxy.
By the way, it would be great if you'd like to take a look at the experimental Flask framework:
https://cdsdashboards.readthedocs.io/en/stable/chapters/userguide/frameworks/flask.html
That should be more flexible for being able to specify a flask script to run, and it does it through gunicorn instead of the dev server. There may be some tweaks needed...
from jhsingle-native-proxy.
Related Issues (18)
- Depending on jupyter-server-proxy HOT 4
- Is --template is supported? HOT 7
- Integrating JupyterHub with Voila's progressive rendering HOT 8
- Websocket max_message_size is too low HOT 5
- Error: No such option: --SingleUserNotebookApp.default_url HOT 5
- jhsingle-native-proxy not showing running notebook while using voila until notebook finish its execution HOT 3
- Unable to setup with TLJH HOT 10
- [Feature Request] Binder Button HOT 2
- Getting 404 error while launching Streamlit dashboard HOT 3
- simpervisor update breaks jhsingle-native-proxy HOT 1
- idea : support for UNIX sockets HOT 1
- Jhsingle-native-proxy 0.8.1 logger not outputting log messages to the console HOT 1
- Intermittent 500 Internal Server Error due to Premature Child Process Termination in `ensure_process`
- timeouts HOT 2
- await None HOT 3
- Exposing some logs from the process being proxied HOT 2
- py39 compat HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jhsingle-native-proxy.