-
Notifications
You must be signed in to change notification settings - Fork 18
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
Jupyter server #230
Jupyter server #230
Conversation
* convert UIS to a jupter server extension application
* put extension behind cylc app * deal with namespace package issues * allow args to be passed through to jupyter_server
* this is for the workflow owner not the authenticated user
* logging -> self.log
* tighter integration with jupyter_server * less bespoke static logic
Codecov Report
@@ Coverage Diff @@
## master #230 +/- ##
==========================================
+ Coverage 73.32% 75.30% +1.98%
==========================================
Files 10 11 +1
Lines 776 729 -47
Branches 125 121 -4
==========================================
- Hits 569 549 -20
+ Misses 183 155 -28
- Partials 24 25 +1
Continue to review full report at Codecov.
|
* setup.py -> setup.cfg * pytest.ini -> pyproject.toml * pypi classifiers
* revert to decorator approach
* standardise flake8 setup with cylc flow * fix violations
c49c65b
to
e19717a
Compare
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.
Still having problems getting the config to load.
cylc-uiserver/cylc/uiserver/config.py
Line 51 in 47096f4
'hub/config.py' |
I think should be changed to
jupyter_config.py
.
I also unfortunately am getting the same _xsrf
error on graphiql with all your latest branches checked out.
Getting 404s on the auto pop-up loading |
Thanks both:
|
This issue has self-fixed for me with a re-checkout of all branches, cleaning cookies and re-install. 🤷♀️ Not sure what caused it but can't replicate fortunately! |
Bumped the Jupyter Server version.
I just cannot reproduce this.
This shouldn't be possible, though it could be caused by having missmatched branches, in the server log you should see two messages for the Cylc extension, one saying it's linked, one saying it's loaded. If either step fail there should be an error message. |
In case it helps with the replicating, I have found a reliableway to reproduce...
This runs as normal, with no _xsrf complaints..
|
* Closes cylc#231 * Provide our own static handler rather than using Jupyter Server because: * Our static files are contained in sub dirs, Jupyter Server does not support this for static files. * We are not using the same template/static resource approach. * We would have to edit URLs in the UI to point at `static/cylc/*`. * We are opening these static files to multiple users so need to push them through our authorisation code. * Adding authentication here provides login redirection and does all the cookie / token stuff.
* Add an endpoint that provides the equivalent to `cylc version --long` * This replaces the `hello` handler used during development. * As it doesn't engage any extra logic it may be useful for debugging UI/UIS issues. * It may also be useful for debugging environment issues. * Document handlers.
65be593
to
94b6ec3
Compare
Ok, the last few commits have:
Needs some heavy multi-user testing before sign off. |
94b6ec3
to
a02a702
Compare
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.
The problems that I was getting have settled with the last few commits.
The issue with the 403 after logging out and back in (with the _xsrf error) still occurs but self corrects. I think this is acceptable behaviour as it does not affect functionality.
The button for Cylc Hub on the ui should be disabled for jupyter-cylc
, on click it currently gives a 404 (I've opened up a follow up pr in the ui for this - cylc/cylc-ui#737).
There is a remaining typo where implanted should be implemented, I think but this should not affect merge, I can fix on the auth pr.
Bravo @oliver-sanders 🥇 - lovely functionality to have!
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.
Looks good to me! Couple comments but I think they are not blockers. Feel free to push the merge button @oliver-sanders (just so you can read the comments before 👍 )
a02a702
to
acc20b1
Compare
Two approvals, CI happy, @oliver-sanders resolved all feedback. LGTM 😬 |
closes #219, #218, #45
unblocks #137
addresses #171
siblings: cylc/cylc-flow#4331, cylc/cylc-ui#711
I think this also closes (testing required to confirm):
Summary & Highlights
CLI
Everything can be run using the
jupyter
commands:Existing jupyter server installations can be configured to run the Cylc UIS extensions, example config:
For tighter integration with Cylc, improved usability for those unfamiliar with the Jupyter ecosystem and command whitelisting purposes there are Cylc equivalents to these commands:
Caveats
jupyter_server: use server to serve static pages #231[edit] now resolved!
Issue to do with redirects from static endpoint (e.g. the UI) to the hub which are largely broken on this branch at the moment.
This has the side-effect that it makes it look like you can access UI Servers you are not authorised to simply because the web application loads without any login redirect or authorisation warning. However, the data endpoints are all protected.
Should get_secure_cookie set token_authenticated property? jupyter-server/jupyter_server#566[edit] now partially resolved, if the user is a string but not "anonymous" then it is a token.
We are pinned to
jupyter_server==1.10.1
until this issue is resolved as in order to determine when a connection is token authenticated we are currently relying on a bug which has since been fixed.Follow On
(required in order to release this package, high priority).
jupyter_server: use server to serve static pages #231(required for correct authentication redirection on Cylc endpoints, high priority).
(requires
jupyter_server>=1.10.2
, low priority).Misc
Ditch the
setup.py
file, we can do everything we need usingsetup.cfg
which is much nicer 🎉, no more arbitrary code execution! We should copy this change to our other repos in due course.Also adopted the new(ish) standard
pyproject.toml
file.Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.py
, seerecipe/meta.yaml
).