-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Make --setup
/--autoreload
/--warm
work with --num-procs
#6913
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6913 +/- ##
========================================
Coverage 82.22% 82.23%
========================================
Files 328 330 +2
Lines 49269 49379 +110
========================================
+ Hits 40513 40607 +94
- Misses 8756 8772 +16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes a lot sense to me. What's missing here, apart from tests?
Time 🙃 This does not fix the problem observed on older versions of Python. It could, therefore, be that the loading of the file should also be postponed. |
How old are we talking? |
Only working with Python 3.12, IIRC. |
ddd7acd
to
391fa75
Compare
Would this fix the --warm issue too? |
Yes, it should be the case after the changes I made yesterday. |
--setup
work with --num-procs
--setup
/--autoreload
/--warm
work with --num-procs
@MarcSkovMadsen @philippjfr - we relied on the setup script to be run before the server starts. This reduces some of the usefuleness of the setup script. It is also still mentioned in the wiki "--setup SETUP Path to a setup script to run before server starts.". Might want to update the documentation to reflect that this is not supported any longer. Link to the documentation: https://panel.holoviz.org/how_to/server/commandline.html I would consider this a minor breaking change and would appreciate mentioning it in the changelogs. |
Resolves #6891
Resolves #6816
The following
generate_session(app, initialize=True)
gave file errors on Python versions below 3.12, so I have set initialize to False for those versions. I'm not entirely sure why it works fine on Python 3.12, but it could be related to sub-interpreters.Postpone the setup script execution after the server starts. This means the setup script runs for each process; for example, it will run twice for the following example.
Command:
panel serve app.py --setup background_job.py --num-procs 2
screenrecord-2024-06-11_16.39.30.mp4
Also tested:
panel serve app.py --num-procs 2 --warm
panel serve app.py --num-procs 2 --autoreload