Skip to content

Use Visual Studio Code to work with a Run:AI Job

Once you launch a workload using Run:AI, you will want to connect to it. You can do so via command-line or via other tools such as a Jupyter Notebook

This document is about accessing the remote container created by Run:AI, from Visual Studio Code.

Submit a Workload

You will need your image to run an ssh server (e.g OpenSSH). For the purposes of this document, we used a sample Docker Hub repository which runs sshd with root user and password:

runai submit build-remote -i rastasheep/ubuntu-sshd:14.04  -g 1 --interactive \
    --command "/usr/sbin/sshd" --args "-D" --service-type=nodeport --port 30022:22
  • The job starts an sshd server on port 22.
  • The job redirects the external port 30,022 to port 22 and uses a Node Port service type.
  • Run:

    runai list
  • Next to the job, under the "Service URL" column you will find the IP address and port.

Visual Studio Code

  • Under Visual Studio code install the Remote SSH extension.
  • Create an ssh entry to the service by editing .ssh/config file or use the command Remote-SSH: Connect to Host... from the Command Palette. Enter the IP address and port from above (e.g. ssh root@ -p 30022). User and password are root
  • Using VS Code, install the Python extension on the remote machine
  • Write your first python code and run it remotely.

Last update: August 30, 2020