-
Notifications
You must be signed in to change notification settings - Fork 0
Using VSCode over SSH
Some tasks are not a good fit for JupyterHub. Developers may require bare metal access to a GPU-accelerated machine. This is the case for work that involves building and running Docker containers (see iTELL API). For these tasks, we have set up a remote development workflow using VS Code over SSH.
NOTE: Please use JupyterHub unless there is a specific reason why JupyterHub does not work for your project.
- Make sure you can connect to Vanderbilt's VPN.
- Make sure your Vanderbilt account is authorized to login in to LEAR Lab Development Server 2 (10.33.2.13).
- Connect to the Vanderbilt VPN from your client machine.
- Verify that you can SSH into the server from your client, e.g., by running
ssh VUNETID@10.33.2.13
The only anticipated reason to use VSCode over SSH in lieu of JupyterHub is for development work on Docker images. To run Dockers you will need to perform the following setup:
- Make sure that your user is a member of the Docker group. Run the following commands on the server:
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world (to verify that you can run a docker image without using sudo)
- Install Remote SSH Extension in your client-side VS Code and connect
- On the server, the instructions for setting up your Github account are the same as they are inside JupyterHub. Instructions
Some repositories include a devcontainer.json configuration file that builds a Docker container with GPU access. This configuration file defines a specific GPU (gpu_device=0). After starting a devcontainer, you can verify that it has GPU access by running nvidia-smi from within the VSCode terminal. There are two main reasons this command might fail:
- Someone else is using the GPU.
- VSCode failed to terminate a previous devcontainer. As a result, that devcontainer may still be occupying the GPU.
To resolve the second issue, you can SSH into the server and run the following commands:
docker ps
docker stop [container_id]
Then, in VSCode, use the "Reload Window" command and test GPU availability again.
docker ps --format '{{.ID}}' | xargs docker inspect | jq '.[] | "Container ID: \(.Config.Hostname) -- GPU: \(.HostConfig.DeviceRequests | .[].DeviceIDs[0]) -- Directory: \(.Config.Labels."devcontainer.local_folder")"'