Skip to content

Commit 3c753e9

Browse files
authored
Merge pull request #985 from SyneRBI/startup-hooks
2 parents c22d7ea + 1633a75 commit 3c753e9

5 files changed

Lines changed: 24 additions & 61 deletions

File tree

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ COPY docker/requirements.yml /opt/scripts/
2727
# https://github.com/TomographicImaging/CIL/blob/master/Dockerfile
2828
RUN if test "$BUILD_GPU" != 0; then \
2929
sed -ri 's/^(\s*)#\s*(- \S+.*#.*GPU.*)$/\1\2/' /opt/scripts/requirements.yml; \
30+
echo 'cuda-version 12.9.*' >> "${CONDA_DIR}/conda-meta/pinned"; \
3031
fi \
3132
&& mamba env update -n base -f /opt/scripts/requirements.yml \
3233
&& mamba clean --all -f -y && fix-permissions "${CONDA_DIR}" /home/${NB_USER}
@@ -132,8 +133,6 @@ ENV RESTARTABLE="yes"
132133
EXPOSE 9002
133134
ENV GADGETRON_RELAY_HOST="0.0.0.0"
134135

135-
# run gadgetron in the background before start-notebook.py
136-
COPY --link --chown=${NB_USER} docker/start-gadgetron-notebook.sh /opt/scripts/
137136
# COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/lib /opt/conda/lib
138-
COPY --from=build --link --chown=${NB_USER} /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh /opt/conda/etc/conda/activate.d
139-
CMD ["/opt/scripts/start-gadgetron-notebook.sh"]
137+
COPY --link docker/15source-sirf.sh docker/25clone-work.sh docker/35gadgetron.sh /usr/local/bin/before-notebook.d/
138+
ENV NOTEBOOK_ARGS=--PasswordIdentityProvider.hashed_password='sha1:cbf03843d2bb:8729d2fbec60cacf6485758752789cd9989e756c'

docker/15source-sirf.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh

docker/25clone-work.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
if test $UID -eq 0; then
2+
sudo --preserve-env --set-home --user "$NB_USER" "$0" "$@"
3+
exit $?
4+
fi
5+
SB_PATH=$(dirname "$(dirname "$SIRF_PATH")")
6+
pushd ~/work
7+
for repo in SIRF-Exercises CIL-Demos; do
8+
test -d ${repo} || cp -dR "${SB_PATH}/../${repo}" .
9+
done
10+
./SIRF-Exercises/scripts/download_data.sh ${SIRF_DOWNLOAD_DATA_ARGS:-}
11+
12+
echo "link SIRF-Contrib into ~/work"
13+
if test ! -r SIRF-contrib; then
14+
echo "Creating link to SIRF-contrib"
15+
ln -s "${SIRF_INSTALL_PATH}/python/sirf/contrib" SIRF-contrib
16+
fi
17+
popd

docker/35gadgetron.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pushd /opt/SIRF-SuperBuild
2+
test -x ./INSTALL/bin/gadgetron && ./INSTALL/bin/gadgetron >& ~/gadgetron.log&
3+
popd

docker/start-gadgetron-notebook.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)