Skip to content

Developing inside a container (advanced)#

This repo provides a Devcontainer configuration for Visual Studio Code to use a Docker container as a pre-configured development environment. This avoids struggles setting up a development environment and makes them reproducible and consistent.

If that sounds useful to you, we recommend you first make yourself familiar with the container tutorials if you want to use them. The devcontainer.json file assumes that you have a GPU locally by default. If not, you can simply comment out the "--gpus" flag in the .devcontainer/devcontainer.json file.

  1. Setup Docker on your local machine

    On an Linux machine where you have root access, you can install Docker using the following commands:

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
    

    On Windows or Mac, follow these installation instructions

  2. (optional) Install the nvidia-container-toolkit to use your local machine's GPU(s).

  3. Install the Dev Containers extension for Visual Studio Code.

  4. When opening repository in Visual Studio Code, you should be prompted to reopen the repository in a container:

    VsCode popup image

    Alternatively, you can open the command palette (Ctrl+Shift+P) and select Dev Containers: Rebuild and Reopen in Container.

Launching container jobs on SLURM clusters#

This part is still a work in progress. In principle, developing inside a devcontainer should make it easier to ship the images to slurm clusters and run them as jobs.