Custom Docker
The best way to release your code along with the publication is through Docker. This will ensure the reproducibility of your paper's results, making your methods easily accessible to the readers and general public.
While you can write and handle Docker containers in any fashion you want, Sapsan includes a ready-to-go template to make this process easier. Here are the steps in the Docker template:
- Setup a virtual environment
- Install requirements (Sapsan)
- Launch a Jupyter notebook to reproduce the results
That's it! Now there won't be any struggle or emails to you, the author, about the setup and configuration of your methods!
In order to make this work, we will need to set up a Dockerfile, build a container, and run it. The latter steps are combined into a Makefile. When it comes to publishing your Docker, share the Docker setup files for the container to be built on-site. In this article, we will first discuss the Docker setup and then the release options.
Note
Make sure Docker is installed on your machine (Installation)
Docker Setup
Dockerfile
The template below is will be created when starting a project via sapsan create -n {name}
, where {name}
is your custom project name. Feel free to edit it to your liking, such as adding further packages to install outside of Sapsan, name of working directories and etc.
Makefile to build and run the container
The Makefile
is also created upon initializing a project. It makes it straightforward to build and run your Docker container, launching a Jupyter Notebook as a result.
Thus, the user will need to type the following to build and run the Docker container:
Here is a working Makefile for Sapsan's included CNN example.Release Your Docker
Provide the Setup Files
In order for someone to reproduce your results, you will need to provide:
- Dockerfile
- Makefile
- Jupyter Notebook
- Training Data
The virtual environment will be built from the ground up on the user's local machine. Besides the training data, the other files won't weigh anything. The only pre-requisite is to have the Docker installed, which can be done through pip
.