mila-iqia / milatools

Tools to connect to and interact with the Mila cluster
MIT License
60 stars 11 forks source link

Add vscode on drac #86

Closed satyaog closed 7 months ago

satyaog commented 9 months ago

VS Code in web browser on DRAC cluster

satyaog commented 9 months ago

Adding the line module list | grep "StdEnv/2020" >/dev/null && module load code-server/3.5.0 to ~/.bash_profile allows to automatically open vscode after the allocation is given.

To test, run the following: mila cedar code --user {USER} --account rrg-bengioy-ad_cpu --time 1 --cpus 1 --mem 1000

lebrice commented 9 months ago

Does this open vscode in the browser? Or is it an app link that opens the vscode client?

satyaog commented 9 months ago

Currently opening vscode in a browser (the url built by the above command is https://jupyterhub.cedar.computecanada.ca/hub/spawn?gpus=gpu%3A0&next=%2Fhub%2Fuser%2Fsogagne%2Fcode-server&account=rrg-bengioy-ad_cpu&runtime=1.0&nprocs=1&memory=1000) as this was the simplest / fastest way to have proof of concept to use what is alrady implemented by DRAC. Once the server is running it should be possible to connect to it with a local client but I haven't looked into that. It might also be possible to only use the vscode module code-server/3.5.0 on a compute node to launch a server with internet extensions whitelisting.

This is very imperfect, but the web browser solution might cover most of the user needs.

lebrice commented 9 months ago

I'll check about the module load, if we can keep everything in the same command, with the same syntax, that would definitely be best.

satyaog commented 9 months ago

I'm in favour of any solution that is not time consuming for a first version, then build or take the time to rebuild properly afterwards. I don't think we have to see the web solution as a final version, discrediting other solutions. A different API for a plug and play solution might not be too bad a trade off. There's a possibility we failed a bit at communicating that DRAC already offered a solution for vs code. We could even aim at a first that could only be an advertisement for that solution, while we build something better in the meantime

lebrice commented 8 months ago

I don't seem to be able to sign in with my GitHub account in the web browser VsCode. Do you think that's intended or a bug? It's very useful to synchronize all the editor settings (extensions, keyboard shortcuts, etc).

I'm currently testing out if adding the code-server module could help with installing extensions on the compute node. So far, it doesn't look like it. I'm gonna try to understand what they do with jupyterlab to make this work.