datelife
is a software that gets all available information on time of divergence of a group of lineages, and uses this information to date a phylogenetic tree.
datelife
functionalities can be accessed via its R package, or through its website application.
datelife
's webiste app is constructed with R shiny and is containerized with Docker, i.e. "dockerized", as explained here. This repository hosts the instructions for "dockerizing" datelife
, which we whipped up by following diverse valuable resources. The datelife
Docker allows anyone to set up their own server for the datelife
webb app anywhere.
There are a few alternative ways to do this. For all of them you require Docker Desktop installed. Next you can find instructions on:
1. Setting up a prebuilt datelife
image
2. Building a local datelife
image on your own
3. Running multiple instances of the datelife
shiny app
Ideally, the datelife
Docker image automatically builds and uploads to bomeara/datelife's Docker Hub (the Docker cloud) with pushes to this repository (the GitHub phylotastic/datelifedocker repo). Automatic Docker builds are not working for the moment (last updated Oct 5 2021), so the latest, locally built, manually uploaded datelife
Docker image is found at lunasare/datelife's Docker Hub.
- 1.1. To download the prebuilt
datelife
Docker image from Docker Hub you need Docker desktop installed. Then, from terminal use thedocker pull
command: - 1.2. Now, you can start the image using
docker run
. You can do this in "bash mode" so you can look around (i.e., in the /srv dir for the shiny app): - 1.3. To start the image just in serve mode, do:
# docker pull bomeara/datelife
docker pull lunasare/datelife
# docker run -t -i -p 80:3838 bomeara/datelife sh -c '/bin/bash'
docker run -t -i -p 80:3838 lunasare/datelife sh -c '/bin/bash'
Once you've finished looking around, just type exit
and you will be logged out.
# docker run -t -i -d -p 80:3838 bomeara/datelife
docker run -t -i -d -p 80:3838 lunasare/datelife
Go to http://localhost on any browser to checkout your Datelife website and shiny app running.
Argument -d
is optional, it stands for --detach
, allowing you to keep on using your terminal while the DateLife website is being served.
Details
- Was built with
datelifedocker V.0.5.0
- Automatic installation of package datelifeplot failed, so, it was manually installed into the local container with
devtools::install_github("phylotastic/datelifeplot")
before pushing to Docker Hub.
This is the option for developers, and local debugging. If you tried setting up a prebuilt Docker image and it fails, you should try this.
- 2.1. Make sure you have Docker desktop installed. Then, download the datelifedocker repository to your computer. One way is to type from the terminal:
- 2.2. Change directories to your newly created datelifedocker directory using
cd your_path/datelifedocker
, and build the DateLife Docker image with: - 2.3 Now you can start the DateLife server from your newly created Docker image with:
- 2.4. To explore the contents of the DateLife Docker image on terminal, you can do:
- 2.5. After building and making changes, you can push (if you have permissions) the new
datelife
Docker image to Docker hub with:
git clone https://github.com/phylotastic/datelifedocker.git
docker build -t datelife .
To build with no cache (that is, rebuilding the image from scratch)
type docker build -t datelife --no-cache .
Note! Building with no cache will take about 2hrs and 36 min to run.
docker run -t -i -p 80:3838 datelife
Go to http://localhost on any browser to checkout your Datelife shiny app running.
To stop serving, type Ctrl + c
or exit
docker run -t -i datelife sh -c '/bin/bash'
If you want to explore a particular container, first list them all with docker container ls
, and identify the container-name
of the one you are interested in.
Then restart your container and execute it with:
docker container restart <container-name>
docker exec -it <container-name> sh -c '/bin/bash'
For more tips see how-do-i-get-into-a-docker-containers-shell and 15-docker-commands-you-should-know.
# docker tag datelife bomeara/datelife
docker tag datelife lunasare/datelife
docker login
# docker push bomeara/datelife
docker push lunasare/datelife
Note! If you make any important changes to the dockerfile
, please bump its version and
document the changes on the section DateLife Docker images of this README.
You can run multiple shiny app instances with:
docker-compose up -d --scale datelife=10 # for ten instances
- 4.1. Go to node where swarm is being managed. You can change the number of workers in replicas in the
docker-compose-swarm.yml
file. - 4.2. See how it's doing with
- 4.3. And stop it with
sudo docker stack deploy --compose-file docker-compose-swarm.yml datelife
sudo docker stack services datelife
sudo docker stack rm datelife
For domain, *, @, www all resolve to datelife19.campus.utk.edu.
(yes, with a period after edu) using CNAME
- https://www.r-bloggers.com/2021/05/dockerizing-shiny-applications/
- https://github.com/flaviobarros/shiny-wordcloud/blob/master/Dockerfile
- https://www.statworx.com/at/blog/how-to-dockerize-shinyapps/
- https://www.youtube.com/watch?v=ARd5IldVFUs
- https://hub.docker.com/u/rocker
- https://www.dabbleofdevops.com/blog/deploy-rshiny-with-the-rocker-shiny-docker-image
- https://blog.sellorm.com/2021/04/25/shiny-app-in-docker/
- https://juanitorduz.github.io/dockerize-a-shinyapp/
- https://bhoom.wordpress.com/2020/06/18/using-multiple-r-versions-with-docker-rocker-rstudio-project/
- https://githubmemory.com/repo/rocker-org/shiny/issues/92
- https://stackoverflow.com/questions/30172605/how-do-i-get-into-a-docker-containers-shell
Docker software version info for locally built datelife
image.
Obtained with docker version
command.
Client: Docker Engine - Community
Cloud integration: 1.0.7
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:12:42 2020
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:28 2020
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0