Skip to content

McTavishLab/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. 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

4. Using swarm

1. Using a prebuilt DateLife Docker image

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 the docker pull command:

  •     # docker pull bomeara/datelife
        docker pull lunasare/datelife
  • 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 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

    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.

Prebuilt DateLife Docker images

Details

latest version

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

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 .

    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

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

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

Docker software info

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

About

Dockerfile to set up DateLife server. I hope.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%