-
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
Test Cylc UI Server with SSH Spawner #46
Comments
I will be using Docker for the tests, but won't create new containers, as they current images need to be updated for Cylc 8. Instead, I will savage the distributed images, but just for the SSH part. Once Bad practice, but I just want to get two containers with everything that I need, and some mapped volumes. Then copy files where they need to be according to the ssh spawner by NERSC. |
Started container with Logged in to both with Then As the images are using Ubuntu 16.xx, I had to install Python 3 through Anaconda to both boxes too. Cloned Then for And for the
Oh, also installed nvm on the jump box, to install Had some issues with PAM on Docker, and had forgotten to map a port (and had to hack my way through |
The Docker images would need a few more kicks until they were ready to be used. But having issues with PAM is no fun. So this morning tried something different. I believe this can be used to validate the NERSC sshspawner.
Unfortunately there are a few issues with that spawner, but that we can work around or fix later.
Finally, once it's up and running, I can confirm it spawned the remote UI Server, but the configuration is still missing something. The spawner logging is extremely useful. It displays what is the local Shell script created in the temporary folder, that is executed via SSH to spawn the UI server. e.g.
And what's even nicer, is that if you pay attention to how it's running the Finally, once everything was fixed, it started to redirect to invalid addresses: At the top is the browser, with a redirect loop. Below, the terminal in the remote SSH box, displaying the |
Also had to change in the sshspawner and add the following to
As otherwise it would use 127.0.0.1 to try and connect to the hub |
Reporting issues back (and thanking them for the spawner as well). |
So this afternoon I tried the whole setup again from home in the morning, with the same issue. Then in the afternoon tried to set it up at work in the afternoon. Same issue. Found an issue with a similar description (jupyterhub/jupyterhub#1657) but no clear fix for this one. Then tried something else just now. Tried to set up a virtual machine, as I thought perhaps it was a problem with the Docker images. Created an Alpine VM, added python3, nodejs-npm and other apk packages. Everything ready, then started the One curious thing is that here at home I am - by accident - using a branch with the GraphQL work from @dwsutherland . Because of this, I had one endpoint without security to test, the And this endpoint works fine. This means that the endpoints protected by I am not seeing any useful logs or exceptions on the |
The routes in the {
"/":{
"hub":true,
"target":"http://192.168.20.2:8081",
"jupyterhub":true,
"last_activity":"2019-05-28T09:27:48.270Z"
}
} And after spawned {
"/":{
"hub":true,
"target":"http://192.168.20.2:8081",
"jupyterhub":true,
"last_activity":"2019-05-28T09:29:21.457Z"
},
"/user/kinow":{
"user":"kinow",
"server_name":"",
"target":"http://192.168.20.11:39411",
"jupyterhub":true,
"last_activity":"2019-05-28T09:29:21.857Z"
}
} Note: To request the proxy table, you need to auth the requests. The easiest way is through:
|
Added a remote Python debugger (is that possible with vim @hjoliver? I thought it wouldn't be possible at all in Python) with Then loaded the old config, and recorded the normal application redirects, and then the bad ones, with the infinite loop. Good:
Bad:
The last URL above was wrong. The default value is Took me a while, but found why. I had added |
Progress after the last changes, and now got:
This last URL instead of returning the last 302 HTTP response, it is returning a 403, with the following traceback:
|
Alright. So this happens because I logged in to http://localhost:8000, which redirected to the "correct" URL http://192.168.20.2 (that's the URL of my notebook, which SSH node can see). When I log in the second time it appears to have an incorrect cookie that fails to authenticate with the current state (state is a concept in the jupyterhub auth process). Fixed by logging in to http://192.168.20.2 directly with an incognito window. But the battle is not over yet! Now got a response 500 (sighs), with the traceback:
|
Phew. This one was easy. Had to add one more entry to
My
(Sorry, not in a git folder, so no diff, but might be useful later) Aaaaand. Success @hjoliver & @MartinRyan . Started this final tests after our meeting. Took me only a few hours and miss the gym today. But it became personal 😠 Here's a screen shot of our UI server running on And this screen and the main screen are available only when authenticated. And I could confirm in the browser the HTTP 302 for Oauth authentication process happening. I also disabled the |
hahaha, I know how you feel! (but sorry you missed the gym) |
All good. I wouldn't be able to focus on the work out anyway 😁 |
This kind of issue would demand serious weights and a lot of angry straining 🏋️♂️ |
I believe this testing is done, and we could successfully spawn via SSH. Closing 🎉 |
(In due course we'll need to document how to do this though ... just need to remember this Issue exists I guess.) |
👍 good point, and as I don't trust my memory, and could end up re-doing everything from scratch... cylc/cylc-doc#36 |
The current set up used by Python UI Server and JS Vue.js UI uses the LocalProcessSpawner.
We also tested the PBS Batch Spawner. But we have not concluded the SSH Spawner tests yet.
@MartinRyan has a work-in-progress SSH spawner (private repository), and had forked the uiserver too.
As the requirement here seems to be simply validating spawning the UI Server via SSH, I think an alternative could be the existing sshspawner by NERSC (National Energy Research Scientific Computing Center, US), which appears to be an implementation that has not been deprecated (the zonca one is not being maintained).
Martin's implementation used paramiko, which is an excellent tool (I had to use it some time ago, can't remember why, but remember it worked well). While NERSC's uses asyncssh, which also implements SSHv2, but tailored for Python 3.4. I think both are OK.
Other posts seem to suggest using the BatchSpawner as replacement for SSH spawning, but that's actually as a replacement for users who were triggering HPC batch schedulers like PBS. So not exactly what we are looking for.
The text was updated successfully, but these errors were encountered: