How to use SST with Docker

NOTE: SST With Docker is currently under development, these instructions are for the ALPHA release and will be changing in the future

Overview

Docker is a pseudo-virtual machine that allows applications to be embedded inside it and be called by a host machine. A Docker image of SST is available on Docker Hub to allow a basic pre-built image of SST to be run.

Installing Docker

To use SST with Docker:


Getting the SST Docker Container

$ docker login

follow the prompts for username and password

$ docker pull sstbuilder/sstcontainer

This should download the container to the host machine.


Usage Example #1

Simple running of SST from a shell running inside the Docker Container.

Here’s the docker run command (the basic command) to get you a Bash prompt in the container:

$ docker run -i -t -e LOCAL_USER_ID=`id -u $USER` sstbuilder/sstcontainer:latest /bin/bash

From the shell prompt (inside the container), you can run basic SST commands:

Note: At this point all the container supports is a binary image of SST, there are no input decks stored inside the container.


Usage Example #2

Running SST simulation from a shell running inside the Docker Container using an input deck located on the host computer

The slightly more advanced command to support IO with a User directory on the Docker host would be:

$ docker run -i -t -v <full host dir path>:/build/workspace -e LOCAL_USER_ID=`id -u $USER` sstbuilder/sstcontainer:latest /bin/bash

Example: For full host dir path /home/sstbuilder/DockerWorkspace, it would be:

$ docker run -i -t -v $HOME/DockerWorkspace:/build/workspace -e LOCAL_USER_ID=`id -u $USER` sstbuilder/sstcontainer:latest /bin/bash

This will mount host machine directory $HOME/DockerWorkspace (it may need to be created on host machine) to /build/workspace inside the container so that the container can read files on the host.

From the shell prompt (inside the container), you can run basic SST commands and run any input decks located in the DockerWorkspace directory:


Usage Example #3

Another Example (running any input deck from the sst-elements repository):

$ cd $HOME
$ git clone -b devel https://github.com/sstsimulator/sst-elements.git
$ docker run -i -t -v $HOME/sst-elements:/build/workspace -e LOCAL_USER_ID=`id -u $USER` sstbuilder/sstcontainer:latest /bin/bash

This will mount $HOME/sst-elements on the host to /build/workspace inside the container so that the container can read files on the host.

From the shell prompt (inside the container), you can run basic SST commands and run any input decks in the Docker Workspace:




NOTE: In the future, there will be a wrapper script that will significantly reduce the parameters required to run sst within the container.