From 68962a81723bf7cc2d00e89e027cedac64a99bed Mon Sep 17 00:00:00 2001 From: Carsten Kuenne Date: Tue, 26 Jun 2018 14:16:31 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bfb60b..76b4627 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The underlying WIlsON R package can be downloaded [here](https://github.molgen.m Please make sure to check our other projects at [loosolab](http://loosolab.mpi-bn.mpg.de/). ## How to use it? -A detailed manual on the WIlsON app can be found [here](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki). For a quick start without further reading, a set of step by step use cases are provided [here](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki#use_cases). +A detailed description of the WIlsON app can be found in the [manual](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki). For a quick start without further reading, a set of [tutorial use cases](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki#use_cases) are available. ## Data import and our data format CLARION From 97936d6c2486eb63b9edaa076b96fe34eb52eeaf Mon Sep 17 00:00:00 2001 From: Carsten Kuenne Date: Tue, 26 Jun 2018 15:44:40 +0200 Subject: [PATCH 2/3] Create Dockerfile --- docker/1.5.3/Dockerfile | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 docker/1.5.3/Dockerfile diff --git a/docker/1.5.3/Dockerfile b/docker/1.5.3/Dockerfile new file mode 100644 index 0000000..8fd10da --- /dev/null +++ b/docker/1.5.3/Dockerfile @@ -0,0 +1,72 @@ +# Pulls debian:latest from dockerhub +FROM debian + +# Dockerfile questions go to +MAINTAINER C. Kuenne / MPI-BN / Bioinformatics Core Unit / carsten.kuenne@mpi-bn.mpg.de + +#Some basic packages, updates and cleanup +RUN apt-get -y update && apt-get -y upgrade && \ +apt-get -y install \ +r-base \ +wget \ +libnlopt-dev \ +libssl-dev \ +libxml2-dev \ +libcurl4-openssl-dev \ +git \ +procps \ +gdebi-core && \ +apt-get clean + +#Installs DEVTOOLS +RUN Rscript -e "install.packages(c('devtools'), \ +repos='https://cran.rstudio.com/')" + +#Installs BIOCONDUCTOR/BiocInstaller +RUN Rscript -e 'source("https://bioconductor.org/biocLite.R")' + +#Install Shiny-Server +#RUN wget https://download3.rstudio.org/ubuntu-12.04/x86_64/shiny-server-1.5.6.875-amd64.deb && \ +#gdebi -n shiny-server-1.5.6.875-amd64.deb && \ +RUN wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.7.907-amd64.deb && \ +gdebi -n shiny-server-1.5.7.907-amd64.deb && \ +rm /srv/shiny-server/index.html && \ +rm -rf /srv/shiny-server/sample-apps + +#Install WILSON +RUN Rscript -e 'devtools::install_github(repo = "loosolab/wilson", host="github.molgen.mpg.de/api/v3")' + +#Install stackdump +#RUN Rscript -e 'devtools::install_github(repo = "jcheng5/stackdump")' + +#Install WILSON App +#RUN git clone -b stackdump https://github.molgen.mpg.de/loosolab/wilson-apps /srv/shiny-server/tmp && \ +RUN git clone https://github.molgen.mpg.de/loosolab/wilson-apps /srv/shiny-server/tmp && \ +cp -a /srv/shiny-server/tmp/wilson-basic/. /srv/shiny-server/ && \ +rm -rf /srv/shiny-server/tmp + +#Install webshot/phantomjs to permit download of interactive plots with plot.ly +RUN Rscript -e 'install.packages("webshot", repos="http://cran.wustl.edu")' +RUN Rscript -e 'webshot::install_phantomjs()' +RUN cp /root/bin/phantomjs /usr/local/bin + +EXPOSE 3838 + +RUN rm -rf /srv/shiny-server/data && \ +mkdir /srv/shiny-server/data + +#check current directory for the presence of clarion input files (*.se, *.clarion) -> include in container +#add pointless additional copy of entrypoint.sh because otherwise the building will fail if no clarion files exist (yuck!) +ADD entrypoint.sh *.se *.clarion /srv/shiny-server/data/ +RUN rm /srv/shiny-server/data/entrypoint.sh + +ADD entrypoint.sh /usr/bin/entrypoint.sh +RUN chmod +x /usr/bin/entrypoint.sh + +#switch shiny user uid to 1000 (previously docker user); set permissions +RUN usermod -u 1000 shiny && \ +chown -R shiny:shiny /srv/shiny-server/ && \ +mkdir -p /srv/shiny-server/logs && \ +chmod ugo+wrX /srv/shiny-server/logs + +CMD ["/usr/bin/entrypoint.sh"] From de2ebeb8e5de7bfec9d468cf0978ea9c178c480f Mon Sep 17 00:00:00 2001 From: Carsten Kuenne Date: Tue, 26 Jun 2018 15:45:38 +0200 Subject: [PATCH 3/3] Create entrypoint.sh --- docker/1.5.3/entrypoint.sh | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docker/1.5.3/entrypoint.sh diff --git a/docker/1.5.3/entrypoint.sh b/docker/1.5.3/entrypoint.sh new file mode 100644 index 0000000..5a9bf30 --- /dev/null +++ b/docker/1.5.3/entrypoint.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#this script is run when the container is started +#optionally adds $CONTAINERKEY to shiny server url by modifying shiny-server.conf +# +#example: +#http://: +#-> +#http://:/ +# +#to use this add the "-e" parameter when starting a container: +#docker run ... -e CONTAINERKEY=${container_key} ... +#example: +#docker run --name='sav1' -d -p 50000:3838 -v '/mnt/agnerds/docker/projects/sav1':'/srv/shiny-server/external_data' -e CONTAINERKEY=sav1 loosolab/wilson:1.2" +#-> http://:50000/sav1 + +conf="/etc/shiny-server/shiny-server.conf" + +#create backup of original shiny-server.conf +if [[ ! -f "${conf}.old" ]]; then + cp ${conf} ${conf}.old +else + cp ${conf}.old ${conf} +fi + +#add parameter(s) at top of .conf +param="preserve_logs true;" +sed -i "1i $param" ${conf} + +param="sanitize_errors off;" +sed -i "1i $param" ${conf} + +#if environment variable given -> add key to url +if [[ ! -z "$CONTAINERKEY" ]]; then + CONTAINERKEY=$(echo -e $CONTAINERKEY | sed 's/\//\\\//g') #to escape "/" + cat ${conf} | sed "s/location \//location \/$CONTAINERKEY/g" >${conf}.1 + mv ${conf}.1 ${conf} +fi + +#start shiny server +exec shiny-server 2>&1 >>/var/log/shiny-server.log