Skip to content

Commit

Permalink
fix: put back code for getting bind paths from config
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Jun 5, 2024
1 parent 9e2a442 commit f51e7a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion charlie
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,16 @@ function unlock() {
function set_singularity_binds(){
# this functions tries find what folders to bind
# TODO parse config file with pyyaml to determine singularity bind paths
SINGULARITY_BINDS="-B $EXTRA_SINGULARITY_BINDS,$PIPELINE_HOME,$WORKDIR"
echo "$PIPELINE_HOME" > ${WORKDIR}/tmp1
echo "$WORKDIR" >> ${WORKDIR}/tmp1
grep -o '\/.*' <(cat ${WORKDIR}/config.yaml ${WORKDIR}/samples.tsv)|dos2unix|tr '\t' '\n'|grep -v ' \|\/\/'|sort|uniq >> ${WORKDIR}/tmp1
grep gpfs ${WORKDIR}/tmp1|awk -F'/' -v OFS='/' '{print $1,$2,$3,$4,$5}'| grep "[a-zA-Z0-9]" |sort|uniq > ${WORKDIR}/tmp2
grep -v gpfs ${WORKDIR}/tmp1|awk -F'/' -v OFS='/' '{print $1,$2,$3}'| grep "[a-zA-Z0-9]"|sort|uniq > ${WORKDIR}/tmp3
while read a;do readlink -f $a;done < ${WORKDIR}/tmp3 | grep "[a-zA-Z0-9]"> ${WORKDIR}/tmp4
binds=$(cat ${WORKDIR}/tmp2 ${WORKDIR}/tmp3 ${WORKDIR}/tmp4|sort|uniq |tr '\n' ',')
rm -f ${WORKDIR}/tmp?
binds=$(echo $binds|awk '{print substr($1,1,length($1)-1)}')
SINGULARITY_BINDS="-B $EXTRA_SINGULARITY_BINDS,$binds"
}

##########################################################################################
Expand Down

0 comments on commit f51e7a9

Please sign in to comment.