VS Code

In general, follow instructions from https://code.visualstudio.com/docs/devcontainers/containers. The following steps are specific developing a Savant module starting from the module template that already contains the devcontainer configuration.

IDE Preparation

  1. Install the Remote Development extension pack.

(Optional) Connect to a remote host

  1. In case you want to develop on a remote host, you can connect to it using SSH. Follow the instructions from https://code.visualstudio.com/docs/remote/ssh to setup SSH host and connect to it. It is recommended to setup SSH keys to avoid entering password every time you connect to the host.

Project Preparation

  1. Clone the Savant repo:

    git clone https://github.com/insight-platform/Savant.git
    
  2. Copy and rename the template (let’s name the new project my-module):

    cp -r Savant/samples/template my-module
    
  3. Run the IDE and open the my-module folder.

Reopen in Container

  1. The following steps apply to both local and remote development (screenshots are made for remote development).

  2. Open the Command Palette with F1 or Ctrl+Shift+P.

  3. Type reopen and select Dev Containers: Reopen in Container:

    ../_images/13-reopen-in-container.png
  4. Select a devcontainer.json file according to your platform (.devcontainer/l4t/devcontainer.json for Jetson, .devcontainer/x86/devcontainer.json for x86):

    ../_images/14-select-devcontainer.png
  5. Wait until the container is built and the project is opened. The remote host in the Status Bar should indicate that you are working in the container:

    ../_images/15-remote-host-status-bar.png
  6. Launch the module by opening the run.py script and choosing Terminal > Run Active File or by clicking the Run and Debug icon in the Activity Bar. At the end you will see pipeline’s output with metadata:

    ../_images/16-run-python-file.png

That’s it, the environment is set up. Now you are ready to develop your own pipeline. See the next section to find out how.

Update Runtime On Container Change

If any changes to the base image, module Dockerfile or requirements.txt are made, the container must be rebuilt.

  1. Open the Command Palette with F1 or Ctrl+Shift+P.

  2. Type rebuild and select Dev Containers: Rebuild Container:

    ../_images/17-vsc-rebuild-container.png
  3. Wait until the container is rebuilt and the project is reopened.

In the following sections, you will find additional details on module development.