Skip to content

Commit

Permalink
docker: not download data automatically (#533)
Browse files Browse the repository at this point in the history
docker service container does not download data automatically.
User needs to use the /usr/local/bin/download_data.sh script
  • Loading branch information
paskino authored May 12, 2021
1 parent 66cc352 commit 870a860
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ COPY user_service-ubuntu.sh .
RUN bash user_service-ubuntu.sh
RUN rm user_service-ubuntu.sh requirements-service.txt

COPY download_data.sh /usr/local/bin/

COPY service.sh /usr/local/bin/
ENV DEBIAN_FRONTEND ''
CMD ["/usr/local/bin/service.sh"]

FROM service as multi
COPY service.multi.sh /usr/local/bin/

3 changes: 2 additions & 1 deletion docker/build_essential-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ apt-get install -yq --no-install-recommends \
man \
make \
ccache \
sudo
sudo \
unzip
apt-get clean

pushd $INSTALL_DIR
Expand Down
8 changes: 8 additions & 0 deletions docker/download_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

INSTALL_DIR=${1:-/devel}

# download the SIRF-Exercises data
cd $INSTALL_DIR
for i in SIRF-Exercises/scripts/download_*.sh; do ./$i $PWD; done

11 changes: 5 additions & 6 deletions docker/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# service.sh [<DEBUG_LEVEL> [<JUPYTER_PORT>]]
#
# Arguments:
# <DEBUG_LEVEL> : [default: 0]
# <DEBUG_LEVEL> : [default: 0]
# <JUPYTER_PORT> : [default: 8888]
##

Expand Down Expand Up @@ -36,18 +36,17 @@ GCONFIG=./INSTALL/share/gadgetron/config/gadgetron.xml
[ -f ./INSTALL/bin/gadgetron ] \
&& ./INSTALL/bin/gadgetron >& gadgetron.log&

# make sure the SIRF-Exercises are in the expected location
cd /devel
[ -d SIRF-Exercises ] || cp -a $SIRF_PATH/../../../SIRF-Exercises .

# start jupyter
if [ ! -f ~/.jupyter/jupyter_notebook_config.py ]; then
jupyter notebook --generate-config
echo "c.NotebookApp.password = u'sha1:cbf03843d2bb:8729d2fbec60cacf6485758752789cd9989e756c'" \
>> ~/.jupyter/jupyter_notebook_config.py
fi

pushd /devel
[ -d SIRF-Exercises ] || cp -a $SIRF_PATH/../../../SIRF-Exercises .
which unzip || sudo apt-get install -yqq unzip
for i in SIRF-Exercises/scripts/download_*.sh; do ./$i $PWD; done
popd

# serve a master notebook
jupyter notebook --ip 0.0.0.0 --port $JUPYTER_PORT --no-browser \
Expand Down

0 comments on commit 870a860

Please sign in to comment.