We’re trying to get the latest vs code working as an app (https://github.com/cdr/code-server) and hitting a bit of a snag. We have more or less the same setup as at https://github.com/OSC/bc_osc_codeserver but the code-server login redirects and gets a broken URL with duplicated server/port in it. Once the interactive app starts and we click launch we get a
VS Code works fine after that. Is there a way to get OnDemand to do the right thing here or is this something that needs to be addressed in code-server upstream?
Here’s the output from code-server, showing the redirect that takes place at login:
+ /home/jbh41678/code-server/code-server --log trace --disable-telemetry --host 0.0.0.0 --port 21505
debug spawned inner process 97580
debug parsed command line e[38;2;140;140;140m{"args":{"_":[],"log":"trace","disable-telemetry":true,"host":"0.0.0.0","port":21505}}e[0m
debug wrapper 97522 received message from 97580 e[38;2;140;140;140m{"message":{"type":"handshake"}}e[0m
debug inner process 97580 received message from 97522 e[38;2;140;140;140m{"message":{"type":"handshake"}}e[0m
info code-server 3.2.0 fd36a99a4c78669970ebc4eb05768293b657716f
info HTTP server listening on http://0.0.0.0:21505
info - Using custom password for authentication
info - Not serving HTTPS
info Automatic updates are enabled
Discovered VS Code Notebook server listening on port 21505!
TIMING - Wait ended at: Thu Apr 30 19:22:56 EDT 2020
Generating connection YAML file...
trace heartbeat
debug redirecting e[38;2;140;140;140m{"secure":false,"from":"/login","to":"./"}e[0m
debug Request error e[38;2;140;140;140m{"url":"/rnode/cpu-305.cm.storage/21505/","code":404}e[0m
debug forking vs code...
debug got message from vs code e[38;2;140;140;140m{"message":{"type":"ready"}}e[0m
debug setting up vs code...
@griznog I’ve been working on this and have a working branch available for testing. We have a few bugs to iron out but please try out what we have so far and let us know what you think! https://github.com/OSC/bc_osc_codeserver/pull/2
This bug happens because of the way reverse proxying is implemented currently in OOD, but we have a fix available in the pull request above.
Thanks for efforts on this, we’ve continued poking at it with mixed results. The latest release of code-server (3.3.1) hasn’t worked well at all in or out of ondemand. Will update if we suddenly find ourselves in possession of a stable code-server solution
Hello, Thank you for posting your singularity recipe. I am struggling to get code-server to run using singularity. May I know what is the content for file scl_source?
I am able to do this far:
with the following steps proceed ok :
I save the recipe file in my directory as vscode.recipt.
As a root user on a linux server, use commands
module load singularity/3.7.0
singularity build vscode.sif vscode.recipe
to build a vscode.sif;
However, I am not able to run vscode.sif? Missing scl_source is the first complain. May you please kindly provide me more details of building and running this singularity code-server container. Thanks in advance.
Hi. The purpose of SCL in that container is to support a newer version of git. However, if you don’t need git, you can remove those portions. Also, I should mention that we no longer use this container in production. We originally created it because our host OS (CentOS 6) did not support VSCode. However, we now use CentOS 7 and do not need the container. I’d suggest to not use container if your host OS is CentOS 7. If you will use the container, I’d suggest to remove these lines:
@mario Hi. I’m just looking at doing this now and have the same issue as originally reported with the 404 error. Are your changes merged in the latest release of bc_osc_codeserver? That’s the one I’m using and still have the issue.
I’m using OOD 2.0.13. It does look like the code-server is launching ok, and I can connect directly to it on the node that it’s running on, but the URL is malformed like was described here.
@mario Hi again. I wanted to post an update. It seems like the problems I’m seeing are specific (maybe) to 3.11.1. I tried code-server version 3.10.2 and do not have an issue. Seems like the code-server developers may have done some reverse proxy work that might be conflicting with OOD.