Commit 4f9bd1f3 authored by mmassaviol's avatar mmassaviol
Browse files

Update Interop_report deploys

parent 624fc38e
......@@ -15,17 +15,18 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN mkdir -p /share/apps/bin \
&& mkdir /share/apps/lib \
&& mkdir /share/apps/gridengine \
&& mkdir /share/bio \
&& mkdir -p /opt/gridengine \
&& mkdir -p /export/scrach \
&& mkdir -p /usr/lib64 \
&& ln -s /bin/bash /bin/mbb_bash \
&& ln -s /bin/bash /bin/isem_bash \
&& /usr/sbin/groupadd --system --gid 400 sge \
&& /usr/sbin/useradd --system --uid 400 --gid 400 -c GridEngine --shell /bin/true --home /opt/gridengine sge
#This part is necessary to run on ISEM cluster
RUN mkdir -p /share/apps/bin \
&& mkdir -p /share/apps/lib \
&& mkdir -p /share/apps/gridengine \
&& mkdir -p /share/bio \
&& mkdir -p /opt/gridengine \
&& mkdir -p /export/scrach \
&& mkdir -p /usr/lib64 \
&& ln -s /bin/bash /bin/mbb_bash \
&& ln -s /bin/bash /bin/isem_bash \
&& /usr/sbin/groupadd --system --gid 400 sge \
&& /usr/sbin/useradd --system --uid 400 --gid 400 -c GridEngine --shell /bin/true --home /opt/gridengine sge
EXPOSE 3838
CMD ["Rscript", "-e", "setwd('/sagApp/'); shiny::runApp('/sagApp/app.R',port=3838 , host='0.0.0.0')"]
#!/bin/bash
#This script will help to run a workflow in a docker image.
if [ $# -lt 4 ]
then
echo usage : $0 dataDir resultsDir configFile nbCores '[dockerHub|local]'
exit
fi
# Docker volumes
# MBB Workflows reads data from /Data and write results to /Results
Data=$1
Results=$2
if [ ! -d "$Data" ]; then
echo "can't find $Data directory !"
exit;
fi
mkdir -p $Results
DOCK_VOL+=" --mount type=bind,src=$Data,dst=/Data"
DOCK_VOL+=" --mount type=bind,src=$Results,dst=/Results"
# config file must be in /Data or /Results !
config=$3
cores=$4
if [ $# -lt 5 ]
then
APP_IMG="mbbteam/interopreport:latest"
else
IMG_SRC=$5
case $IMG_SRC in
dockerHub )
APP_IMG="mbbteam/interopreport:latest" ;;
local)
docker build . -t interopreport:latest
APP_IMG="interopreport:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/interopreport:latest" ;;
esac
fi
docker run --rm $DOCK_VOL --cidfile="CID.txt" $APP_IMG snakemake -s /workflow/Snakefile all --configfile $config --cores $cores
CONTAINER_ID=$(cat CID.txt)
if [ $CONTAINER_ID ]
then
echo " "
echo Results were written to : $2
echo " "
else
echo Failed to run the docker container !!
fi
#!/bin/bash
#This script will help a deployment of a docker image on an MBB bigmem machine
if [ $# -lt 1 ]
if [ $# -lt 2 ]
then
APP_IMG="mbbteam/interop_report:latest"
else
IMG_SRC=$1
case $IMG_SRC in
docker )
APP_IMG="mbbteam/interop_report:latest" ;;
local)
docker build . -t interop_report:latest
APP_IMG="interop_report:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/interop_report:latest" ;;
esac
echo usage : $0 dataDir resultsDir '[dockerHub|local]'
exit
fi
#nginx
##### nginx install #####
#sudo apt-get install -y nginx
# HOST_NAME="192.168.100.49"
# HTTP_ENDP="https://$HOST_NAME"
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=FR/ST=LR/L=Montpellier/O=CNRS/OU=CNRS-ISEM/CN=mbb.univ-montp2.fr"
# openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
# mkdir -p /etc/nginx/snippets
# echo "ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;" > /etc/nginx/snippets/self-signed.conf
# echo "ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;" >> /etc/nginx/snippets/self-signed.conf
# cp system/nginx_snippets_ssl-params.conf /etc/nginx/snippets/ssl-params.conf
# cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
# cp system/nginx_sites-available_default /etc/nginx/sites-available/default
# sed -i "s|server_domain_or_IP|$HOST_NAME|" /etc/nginx/sites-available/default
# useradd nginx
# cp system/nginx_nginx.conf /etc/nginx/nginx.conf
# cp system/nginx_conf.d_10-rstudio.conf /etc/nginx/conf.d/10-rstudio.conf
# sed -i "s|example.com|$HOST_NAME|" /etc/nginx/conf.d/10-rstudio.conf
# systemctl restart nginx
# systemctl enable nginx
#essayer une plage de ports entre 8787 et 8800
#APP_PORT=$2
......@@ -31,37 +52,46 @@ then
fi
# Docker volumes
#realUSER=$(who am i | awk '{print $1}')
if [ $SUDO_USER ]; then realUSER=$SUDO_USER; else realUSER=`whoami`; fi
VOL_DEV=/media/bigvol/$realUSER
# MBB Workflows reads data from /Data and write results to /Results
mkdir -p ${VOL_DEV}/Data
mkdir -p ${VOL_DEV}/Results
DOCK_VOL+=" --mount type=bind,src=$VOL_DEV/Data,dst=/Data"
DOCK_VOL+=" --mount type=bind,src=$VOL_DEV/Results,dst=/Results"
if [ $SUDO_USER ]; then realUSER=$SUDO_USER; else realUSER=`whoami`; fi
Data=$1
Results=$2
mkdir -p $Data
mkdir -p $Results
DOCK_VOL+=" --mount type=bind,src=$Data,dst=/Data"
DOCK_VOL+=" --mount type=bind,src=$Results,dst=/Results"
if [ $# -lt 3 ]
then
APP_IMG="mbbteam/interopreport:latest"
else
IMG_SRC=$3
case $IMG_SRC in
dockerHub )
APP_IMG="mbbteam/interopreport:latest" ;;
local)
docker build . -t interopreport:latest
APP_IMG="interopreport:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/interopreport:latest" ;;
esac
fi
CONTAINER_ID=$( docker run --rm -d -p $APP_PORT:3838 $DOCK_VOL $APP_IMG )
if [ $CONTAINER_ID ]
then
echo " "
echo You have to put your Data on : ${VOL_DEV}/Data
echo You have to put your Data on : $1
echo " "
echo Results will be written to : ${VOL_DEV}/Results
echo Results will be written to : $2
echo " "
hostname -I | awk -v port=$APP_PORT '{print "You can access the workflow interface at : http://"$1":"port}'
echo " "
echo To start a Bash session inside the container : docker exec -it $CONTAINER_ID /bin/bash
echo " "
echo To run the workflow without the interface : docker exec -it $CONTAINER_ID snakemake -s /workflow/Snakefile all --configfile config --cores XX
echo " "
echo config est un fichier de configuration qui doit être dans un sous dossier de ${VOL_DEV}/Data ou ${VOL_DEV}/Results
echo " "
echo ex. si fichier dans ${VOL_DEV}/Data/run1/maconfig1.yml : docker exec -it $CONTAINER_ID snakemake -s /workflow/Snakefile all --configfile /Data/run1/maconfig1.yml --cores XX
echo " "
echo Vous pouvez utiliser l''interface graphique pour générer un fichier de configuration.
echo " "
echo XX étant le nombre de coeurs qui seront utilisés par le workflow.
else
echo Failed to run the docker container !!
fi
\ No newline at end of file
fi
......@@ -5,19 +5,19 @@
# It is executed secondly during a cloud deployement in IFB-Biosphere, after the *Installation* phase.
if [ $# -lt 1 ]
then
APP_IMG="mbbteam/interop_report:latest"
APP_IMG="mbbteam/interopreport:latest"
else
IMG_SRC=$1
case $IMG_SRC in
ifb)
APP_IMG="gitlab-registry.in2p3.fr/ifb-biosphere/apps/interop_report:master" ;;
APP_IMG="gitlab-registry.in2p3.fr/ifb-biosphere/apps/interopreport:master" ;;
docker )
APP_IMG="mbbteam/interop_report:latest" ;;
APP_IMG="mbbteam/interopreport:latest" ;;
local)
docker build . -t interop_report:latest
APP_IMG="interop_report:latest" ;;
docker build . -t interopreport:latest
APP_IMG="interopreport:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/interop_report:latest" ;;
#APP_IMG="X.X.X.X:5000/interopreport:latest" ;;
esac
fi
......@@ -115,4 +115,4 @@ then
echo XX étant le nombre de coeurs qui seront utilisés par le workflow.
else
echo Failed to run the docker container !!
fi
\ No newline at end of file
fi
......@@ -112,7 +112,7 @@ rule prepare_report:
config_multiqc = config["results_dir"] + "/config_multiqc.yaml",
params_tab = config["results_dir"] + "/params_tab_mqc.csv"
params:
params_file = config["results_dir"]+"/params.yml",
params_file = workflow.overwrite_configfile,
results_dir = config["results_dir"]
log:
config["results_dir"]+"/logs/prepare_report_log.txt"
......@@ -187,7 +187,7 @@ rule all:
scripts = directory(config["results_dir"]+"/workflow/scripts"),
params = config["results_dir"]+"/workflow/params.yml"
params:
params_file = config["results_dir"]+"/params.yml",
params_file = workflow.overwrite_configfile,
shell:
"cp /workflow/Snakefile {output.Snakefile} && "
"cp /workflow/get_samples.py {output.get_samples} && "
......
......@@ -91,9 +91,9 @@ singularity run --app appName this_container.sif
apt install -y gnuplot
mkdir -p /share/apps/bin
mkdir /share/apps/lib
mkdir /share/apps/gridengine
mkdir /share/bio
mkdir -p /share/apps/lib
mkdir -p /share/apps/gridengine
mkdir -p /share/bio
mkdir -p /opt/gridengine
mkdir -p /export/scrach
mkdir -p /usr/lib64
......
#!/bin/bash
sudo apt-get update
##### Docker install #####
sudo apt-get install -y docker.io
##### nginx install #####
sudo apt-get install -y nginx
\ No newline at end of file
......@@ -20,8 +20,8 @@ resultsDir=$2
configFile=$3
cores=$4
#if we must build the image from docker image
singularity build interop_report.simg docker://mbbteam/interop_report:latest
singularity build interopreport.simg docker://mbbteam/interopreport:latest
#Run the workflow in cmd line
singularity exec -B $dataDir:/Data -B $resultsDir:/Results interop_report.simg snakemake -s /workflow/Snakefile --configfile $configFile --cores $cores
singularity exec -B $dataDir:/Data -B $resultsDir:/Results interopreport.simg snakemake -s /workflow/Snakefile --configfile $configFile --cores $cores
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment