TITLE: Run ReVisE from Docker 
AUTHORS: Alexey Kuzin, Stepan Orlov, Егор Усик, Alexey Zhuravlev

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block"><span>This protocol describes run of ReVisE server from Docker container on Ubuntu. It describes retrieving of the Docker and the container only. It refers to another our protocol </span><a href="http://dx.doi.org/10.17504/protocols.io.bruzm6x6" style = "text-decoration:underline;color:blue;cursor:pointer;"><span style = ":;">Prepare and run test on available dataset</span></a><span> in order to provide possible workflow of ReVisE usage. This protocol is tested on Ubuntu 20.04 but it is not restricted by this OS version only.</span></div></div>

[STEPS]
?. [Docker installation]
The machine where ReVisE server is to be run must have Docker Engine installed. One can install Docker Engine according to this reference. Or install Docker Community Edition (CE) according to the next sub-steps:
?. [Docker installation]
Remove old Docker packages, if they present:sudo apt remove docker docker-engine docker.io containerd runc
?. [Docker installation]
Install some necessary packages:sudo apt install apt-transport-https ca-certificates curl software-properties-common
?. [Docker installation]
Add Docker repository to apt and install Docker:curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"sudo apt updatesudo apt install -y docker-ce
?. [Docker installation]
Test installationsudo docker run hello-world
?. Install NVIDIA container runtime.curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -distribution=$(. /etc/os-release;echo $ID$VERSION_ID)curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list sudo apt updatesudo apt install nvidia-container-runtimeRestart docker after the installation:sudo systemctl stop dockersudo systemctl start docker
?. [ReVisE container loading and startup]
Load Docker image. This step should be done once on the first run of the container.  Now we provide Docker images for CUDA 11. 1 and CUDA >= 11.2CUDA 11.1:sudo docker pull deadmorous/revise:cuda11.1CUDA 11.2 and newer:sudo docker pull deadmorous/revise:v1
?. [ReVisE container loading and startup]
Open Linux terminal. This step is essential if ReVisE container is to be started on remote computer. In this case one needs to connect to remote computer via ssh with the next command:ssh -L 1234:hostname:1234 -L 3000:hostname:3000 username@hostnameTherefore ports 1234 and 3000 should be forwarded. Otherwise, if ReVisE server is used locally, use usual Linux terminal.
?. [ReVisE container loading and startup]
Docker image startup:sudo docker run --gpus all -ti --rm -v : -p 3000:3000 -p 1234:1234   /bin/bashWhere  is home directory, for example, /home/username. - the Docker image name used: deadmorous/revise:v1 or deadmorous/revise:cuda11.1In the case of successful startup you will be redirected to the image's console.
?. [ReVisE server startup]
By this time ReVisE server is ready to be run from Docker container. It is similar to startup of usual ReVisE installation. Therefore, the workflow of the protocol Prepare and run test on available dataset is applicable since the step 3. First of all set ReVisE environment:source scripts/env.sh
?. [ReVisE server startup]
Go to the directory where datasets are to be installed.cd data
?. [ReVisE server startup]
Now you can perform all measurements after step 4 from protocol Prepare and run test on available dataset. The Docker container has the same datasets that the usual ReVisE installation contains.