Skip to content

phylotastic/datelifedocker

Repository files navigation

Welcome to DateLife’s Docker GitHub repository!

Docker Pulls

Docker Automated build NSF-1458603 NSF-0905606 NSF-1458572

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. Its functionalities can be accessed via the datelife R package, or through datelife’s website, which is constructed as an R shiny application 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 web app anywhere. There are a few alternative ways to do this. For all of them you require Docker Desktop installed.

Table of Contents:

1. Setting up a prebuilt datelife image

  • Docker image datelife v0.5.0 about

2. Building a local datelife image

3. Running multiple instances of the datelife shiny app

4. Using swarm

Resources



1. Using a prebuilt DateLife Docker image

Ideally, the latest 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). However, due to changes on Docker’s product subscriptions, automatic builds are not available for the moment (last updated on Oct 22, 2021). datelife v0.5.0 is the latest, locally built, manually uploaded Docker image, and is hosted 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 the docker pull command:


  •     # docker pull bomeara/datelife
        docker pull lunasare/datelife:v0.5.0
  • 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):


  •     # docker run -t -i -p 80:3838 bomeara/datelife sh -c '/bin/bash'
        docker run -t -i -p 80:3838 lunasare/datelife:v0.5.0 sh -c '/bin/bash'

    Once you’ve finished looking around, just type exit and you will be logged out.

  • 1.3. To start the image just in serve mode, do:


  •     # docker run -t -i -d -p 80:3838 bomeara/datelife
        docker run -t -i -d -p 80:3838 lunasare/datelife:v0.5.0

    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.

Docker image datelife v0.5.0 about

Information on R packages used

Obtained with R by running the following from the datelifeweb project in RStudio:

renv::init()
deps <- unique(renv::dependencies()[,"Package"])
vers <- structure(lapply(deps[order(deps)], packageVersion), names = deps[order(deps)])
vers
$ape
[1] ‘5.5’

$datelife
[1] ‘0.5.0’

$datelifeplot
[1] ‘0.1.0’

$devtools
[1] ‘2.4.2’

$future
[1] ‘1.22.1’

$phangorn
[1] ‘2.7.1’

$phyloch
[1] ‘1.5.5’

$promises
[1] ‘1.2.0.1’

$renv
[1] ‘0.14.0’

$shiny
[1] ‘1.6.0’

$shinycssloaders
[1] ‘1.0.0’

$strap
[1] ‘1.4’

$stringr
[1] ‘1.4.0’

$utils
[1] ‘4.1.0’
Information on Docker software

Obtained with docker version command from the terminal:

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



2. Building your own DateLife Docker image

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:


  •     git clone https://github.com/phylotastic/datelifedocker.git
  • 2.2. Change directories to your newly created datelifedocker directory using cd your_path/datelifedocker, and build the DateLife Docker image with:


  •     docker build -t datelife:[optional tag] .

    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.

  • 2.3 Now you can start the DateLife server from your newly created Docker image with:


  •     docker run -t -i -p 80:3838 datelife:[optional tag]

    Go to http://localhost on any browser to checkout your Datelife shiny app running.

    To stop serving, type Ctrl + c or exit

  • 2.4. To explore the contents of the DateLife Docker image on terminal, you can do:


  • docker run -t -i datelife:[optional tag] 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.

  • 2.5. After building and making changes, you can push (if you have permissions) the new datelife Docker image to Docker hub with:


  •     docker tag datelife:[version number] lunasare/datelife:[version number]
        docker login
        docker push lunasare/datelife:[version number]

    Note! If you make any important changes to the dockerfile, please bump its version and document the changes on the section Docker image DateLife of this README.



3. Running multiple instances

You can run multiple shiny app instances with:

    docker-compose up -d --scale datelife=10 # for ten instances



4. Swarm

  • 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.


  •     sudo docker stack deploy --compose-file docker-compose-swarm.yml datelife
  • 4.2. See how it’s doing with


  •     sudo docker stack services datelife
  • 4.3. And stop it with


  •     sudo docker stack rm datelife

    For domain, *, @, www all resolve to datelife19.campus.utk.edu. (yes, with a period after edu) using CNAME



Resources

About

Dockerfile to set up DateLife server. I hope.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published