Skip to content
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

Add vscode on drac #86

Closed
wants to merge 1 commit into from
Closed

Conversation

satyaog
Copy link
Member

@satyaog satyaog commented Dec 13, 2023

VS Code in web browser on DRAC cluster

def code_drac(cluster:str, account:str, time:float, cpus:int, mem:int, gpu:str):
"""Open a remote VSCode session on a drac compute node."""
url = f"https://jupyterhub.{cluster}.computecanada.ca"
_user="sogagne"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line _user="sogagne" is only to test with my user

@satyaog
Copy link
Member Author

satyaog commented Dec 13, 2023

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
Copy link
Collaborator

lebrice commented Dec 13, 2023

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

@satyaog
Copy link
Member Author

satyaog commented Dec 14, 2023

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
Copy link
Collaborator

lebrice commented Dec 14, 2023

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
Copy link
Member Author

satyaog commented Dec 14, 2023

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

@satyaog satyaog marked this pull request as ready for review December 14, 2023 21:16
@lebrice
Copy link
Collaborator

lebrice commented Dec 18, 2023

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.

@satyaog satyaog closed this Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants