Commit ba69b679 authored by mmassaviol's avatar mmassaviol
Browse files

Update deploys

parent 8bdbf7aa
...@@ -42,8 +42,13 @@ RUN Rscript -e 'install.packages("calibrate",repos="https://cloud.r-project.org/ ...@@ -42,8 +42,13 @@ RUN Rscript -e 'install.packages("calibrate",repos="https://cloud.r-project.org/
RUN Rscript -e 'BiocManager::install("SNPRelate", version = "3.8",Ncpus=8, clean=TRUE)' RUN Rscript -e 'BiocManager::install("SNPRelate", version = "3.8",Ncpus=8, clean=TRUE)'
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
#This part is necessary to run on ISEM cluster #This part is necessary to run on ISEM cluster
RUN mkdir -p /share/apps/lib \ RUN mkdir -p /share/apps/bin \
&& mkdir -p /share/apps/lib \
&& mkdir -p /share/apps/gridengine \ && mkdir -p /share/apps/gridengine \
&& mkdir -p /share/bio \ && mkdir -p /share/bio \
&& mkdir -p /opt/gridengine \ && mkdir -p /opt/gridengine \
...@@ -53,6 +58,6 @@ RUN mkdir -p /share/apps/lib \ ...@@ -53,6 +58,6 @@ RUN mkdir -p /share/apps/lib \
&& ln -s /bin/bash /bin/isem_bash \ && ln -s /bin/bash /bin/isem_bash \
&& /usr/sbin/groupadd --system --gid 400 sge \ && /usr/sbin/groupadd --system --gid 400 sge \
&& /usr/sbin/useradd --system --uid 400 --gid 400 -c GridEngine --shell /bin/true --home /opt/gridengine sge && /usr/sbin/useradd --system --uid 400 --gid 400 -c GridEngine --shell /bin/true --home /opt/gridengine sge
EXPOSE 3838 EXPOSE 3838
CMD ["Rscript", "-e", "setwd('/sagApp/'); shiny::runApp('/sagApp/app.R',port=3838 , host='0.0.0.0')"] 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/radseqref:latest"
else
IMG_SRC=$5
case $IMG_SRC in
dockerHub )
APP_IMG="mbbteam/radseqref:latest" ;;
local)
docker build . -t radseqref:latest
APP_IMG="radseqref:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/radseqref: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 #!/bin/bash
#This script will help a deployment of a docker image on an MBB bigmem machine #This script will help a deployment of a docker image on an MBB bigmem machine
if [ $# -lt 1 ]
if [ $# -lt 2 ]
then then
APP_IMG="mbbteam/radseqref:latest" echo usage : $0 dataDir resultsDir '[dockerHub|local]'
else exit
IMG_SRC=$1
case $IMG_SRC in
docker )
APP_IMG="mbbteam/radseqref:latest" ;;
local)
docker build . -t radseqref:latest
APP_IMG="radseqref:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/radseqref:latest" ;;
esac
fi fi
#nginx #nginx
##### nginx install #####
#sudo apt-get install -y nginx
# HOST_NAME="192.168.100.49" # HOST_NAME="192.168.100.49"
...@@ -61,37 +52,46 @@ then ...@@ -61,37 +52,46 @@ then
fi fi
# Docker volumes # 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 # 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/radseqref:latest"
else
IMG_SRC=$3
case $IMG_SRC in
dockerHub )
APP_IMG="mbbteam/radseqref:latest" ;;
local)
docker build . -t radseqref:latest
APP_IMG="radseqref:latest" ;;
mbb)
#APP_IMG="X.X.X.X:5000/radseqref:latest" ;;
esac
fi
CONTAINER_ID=$( docker run --rm -d -p $APP_PORT:3838 $DOCK_VOL $APP_IMG ) CONTAINER_ID=$( docker run --rm -d -p $APP_PORT:3838 $DOCK_VOL $APP_IMG )
if [ $CONTAINER_ID ] if [ $CONTAINER_ID ]
then then
echo " " echo " "
echo You have to put your Data on : ${VOL_DEV}/Data echo You have to put your Data on : $1
echo " " echo " "
echo Results will be written to : ${VOL_DEV}/Results echo Results will be written to : $2
echo " " echo " "
hostname -I | awk -v port=$APP_PORT '{print "You can access the workflow interface at : http://"$1":"port}' hostname -I | awk -v port=$APP_PORT '{print "You can access the workflow interface at : http://"$1":"port}'
echo " " echo " "
echo To start a Bash session inside the container : docker exec -it $CONTAINER_ID /bin/bash 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 else
echo Failed to run the docker container !! echo Failed to run the docker container !!
fi fi
...@@ -590,7 +590,7 @@ rule prepare_report: ...@@ -590,7 +590,7 @@ rule prepare_report:
config_multiqc = config["results_dir"] + "/config_multiqc.yaml", config_multiqc = config["results_dir"] + "/config_multiqc.yaml",
params_tab = config["results_dir"] + "/params_tab_mqc.csv" params_tab = config["results_dir"] + "/params_tab_mqc.csv"
params: params:
params_file = config["results_dir"]+"/params.yml", params_file = workflow.overwrite_configfile,
results_dir = config["results_dir"] results_dir = config["results_dir"]
log: log:
config["results_dir"]+"/logs/prepare_report_log.txt" config["results_dir"]+"/logs/prepare_report_log.txt"
...@@ -665,7 +665,7 @@ rule all: ...@@ -665,7 +665,7 @@ rule all:
scripts = directory(config["results_dir"]+"/workflow/scripts"), scripts = directory(config["results_dir"]+"/workflow/scripts"),
params = config["results_dir"]+"/workflow/params.yml" params = config["results_dir"]+"/workflow/params.yml"
params: params:
params_file = config["results_dir"]+"/params.yml", params_file = workflow.overwrite_configfile,
shell: shell:
"cp /workflow/Snakefile {output.Snakefile} && " "cp /workflow/Snakefile {output.Snakefile} && "
"cp /workflow/get_samples.py {output.get_samples} && " "cp /workflow/get_samples.py {output.get_samples} && "
......
...@@ -5,8 +5,9 @@ From: ../base.sif ...@@ -5,8 +5,9 @@ From: ../base.sif
export PATH=/opt/biotools/bin:$PATH export PATH=/opt/biotools/bin:$PATH
export ROOTSYS=/opt/biotools/root export ROOTSYS=/opt/biotools/root
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$ROOTSYS/lib' export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:$ROOTSYS/lib'
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
%labels %labels
Author YourName Author YourName
...@@ -120,3 +121,14 @@ singularity run --app appName this_container.sif ...@@ -120,3 +121,14 @@ singularity run --app appName this_container.sif
Rscript -e 'BiocManager::install("SNPRelate", version = "3.8",Ncpus=8, clean=TRUE)' Rscript -e 'BiocManager::install("SNPRelate", version = "3.8",Ncpus=8, clean=TRUE)'
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
\ No newline at end of file
##### nginx install ##### #!/bin/bash
sudo apt-get install -y nginx
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
...@@ -19,10 +19,9 @@ resultsDir=$2 ...@@ -19,10 +19,9 @@ resultsDir=$2
#configfile must be set to /Data/config.yaml #configfile must be set to /Data/config.yaml
configFile=$3 configFile=$3
cores=$4 cores=$4
#if we must build the image from docker image #if we must build the image from docker image
singularity build radseqref.simg docker://mbbteam/radseqref:latest singularity build radseqref.simg docker://mbbteam/radseqref:latest
#Run the workflow in cmd line #Run the workflow in cmd line
singularity exec -B $dataDir:/Data -B $resultsDir:/Results radseqref.simg snakemake -s /workflow/Snakefile --configfile $configFile --cores $cores singularity exec -B $dataDir:/Data -B $resultsDir:/Results radseqref.simg snakemake -s /workflow/Snakefile --configfile $configFile --cores $cores
\ No newline at end of file
Supports Markdown
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