-
Notifications
You must be signed in to change notification settings - Fork 4
Add VSCode Remote SSH connection guide #402
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
base: main
Are you sure you want to change the base?
Changes from all commits
a07e1e8
2767dc1
9614a9f
784df98
d0a42cc
25e199e
bb9a339
68b0dfb
862f78e
1450610
4848bd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Connect VSCode to Torch | ||
| This page describes how to connect VSCode to the Torch login node. | ||
|
|
||
| ## Step 1: Configure the Torch SSH Host | ||
|
|
||
| Update your local `~/.ssh/config` to define a Torch SSH host for VSCode: | ||
|
|
||
| ```ssh-config | ||
| Host torch | ||
| HostName login.torch.hpc.nyu.edu | ||
| User NetID | ||
| StrictHostKeyChecking no | ||
| UserKnownHostsFile /dev/null | ||
| LogLevel ERROR | ||
| ServerAliveInterval 60 | ||
| ``` | ||
|
|
||
| Replace `NetID` with your NYU NetID. | ||
|
|
||
| ## Step 2: Connect | ||
| Install the VSCode Remote - SSH extension. | ||
|
|
||
| Configure Remote - SSH settings: | ||
| 1. Check off `Remote.SSH: Lockfiles In Tmp` | ||
| 2. Uncheck `Remote.SSH: Use Flock` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [vale] reported by reviewdog 🐶 |
||
|
|
||
| Because Torch requires Microsoft device authentication during SSH login, VSCode may time out before you finish entering the device code. If this happens, search for Remote.SSH: Connect Timeout and set it to 120. | ||
|
|
||
| Before connecting, open https://microsoft.com/devicelogin and keep it ready. In VSCode Remote Explorer, connect to the Torch login node: torch. When VSCode prompts for Microsoft device authentication, enter the code on the device login page. This may take a few attempts. VSCode may also prompt more than once during setup because it can open multiple SSH connections. | ||
|
|
||
| After authentication, VSCode may take a while to install or start the VSCode server on Torch. If the connection fails during this step, try connecting again. Once the server is installed successfully, future connections are usually more consistent. | ||
|
|
||
| Once connected, open a terminal in the VSCode remote session. The prompt should show that you are on a Torch login node, for example: | ||
| ```bash | ||
| [NetID@torch-login-... ~]$ | ||
| ``` | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Use Apptainer Jupyter Notebooks in VSCode on Torch | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [remark-lint] reported by reviewdog 🐶 |
||
|
|
||
| This page builds on the general VSCode access instructions in 09_vscode_remote_ssh_torch. Before following this workflow, complete that setup and connect VSCode to the Torch login node. | ||
|
|
||
| ## Step 1: Install VSCode Jupyter support | ||
|
|
||
| After connecting VSCode to the Torch login node, open the Extensions view in the VSCode remote window and search for Jupyter. | ||
|
|
||
| Install or enable the Microsoft Jupyter extension in the remote SSH environment. If the extension is not already installed remotely, VSCode should show an option such as: | ||
|
|
||
| `Install in SSH: torch` | ||
|
|
||
| ## Step 2: Start a dummy batch job and connect to the compute node | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| After the Jupyter extension is installed or enabled, open a terminal in the VSCode remote session on a Torch login node. | ||
|
|
||
| Interactive jobs on Torch may experience intermittent issues. Some compute nodes may work as expected, while others may not. As a workaround, submit a lightweight dummy batch job and then ssh to the allocated compute node after the job is running. | ||
|
|
||
| For example: | ||
|
|
||
| ```bash | ||
| sbatch -c4 -t2:00:00 --mem=4G --account=<account_name> --wrap "sleep infinity" | ||
| ``` | ||
|
|
||
| Replace `<account_name>` with the account for your project. After submitting the job, Slurm will print a job ID, for example: | ||
|
|
||
| ```bash | ||
| Submitted batch job <job_id> | ||
| ``` | ||
|
|
||
| Once the job is running, identify the assigned compute node and connect to it from the VSCode terminal using SSH. | ||
| Check the job status and assigned node: | ||
| ```bash | ||
| squeue -u $USER | ||
| ``` | ||
|
|
||
| ```bash | ||
| ssh csXXX | ||
| ``` | ||
|
|
||
| After connecting, the terminal prompt should show the compute node: | ||
| ```bash | ||
| [NetID@csXXX ~]$ | ||
| ``` | ||
|
|
||
| ## Step 3: Open the notebook | ||
|
|
||
| Open the target .ipynb notebook in VSCode. | ||
|
|
||
| ## Step 4: Select the Apptainer kernel | ||
|
|
||
| Use the notebook kernel picker to select the Apptainer kernel for the notebook. | ||
|
|
||
| If the Apptainer kernel does not appear, confirm that the kernel is installed and visible on Torch before retrying in VSCode. | ||
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.
🚫 [remark-lint] reported by reviewdog 🐶
Error: Could not find module
remark-lint-no-undefined-references