Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/bin/write-dockerfile.sh: Add commands to activate conda env
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jan 27, 2020
1 parent 3d9565f commit 7e59a6f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build/bin/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ done
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh"
echo "# the :comments: separate the generated file into sections"
echo "# to simplify writing scripts that customize this file"
RUN=RUN
case $SYSTEM in
debian*|ubuntu*)
cat <<EOF
Expand Down Expand Up @@ -69,11 +70,13 @@ ARG USE_CONDARC=condarc.yml
ADD *condarc*.yml /tmp/
RUN echo \${CONDARC}; cd /tmp && conda config --stdin < \${USE_CONDARC}
RUN conda update -n base conda
RUN ln -sf /bin/bash /bin/sh
EOF
INSTALL="conda install --update-all --quiet --yes"
EXISTS="2>/dev/null >/dev/null conda search -f"
#EXISTS="conda search -f"
CLEAN="&& conda info; conda list"
RUN="RUN . /opt/conda/etc/profile.d/conda.sh; conda activate base; " # to activate the conda env
;;
*)
echo "Not implemented: package installation for SYSTEM=$SYSTEM" >&2
Expand Down Expand Up @@ -126,7 +129,7 @@ ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./
ADD m4 ./m4
ADD build ./build
ADD src/bin/sage-version.sh src/bin/sage-version.sh
RUN ./bootstrap
$RUN ./bootstrap
#:configuring:
ADD src/ext src/ext
ADD src/bin src/bin
Expand All @@ -135,11 +138,11 @@ ARG EXTRA_CONFIGURE_ARGS=""
EOF
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
cat <<EOF
RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (echo "********** configuring without forcing ***********"; cat config.log; ./configure --enable-build-as-root; cat config.log; exit 1)
$RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (echo "********** configuring without forcing ***********"; cat config.log; ./configure --enable-build-as-root; cat config.log; exit 1)
EOF
else
cat <<EOF
RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (cat config.log; exit 1)
$RUN echo "****** Configuring: ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} *******"; ./configure --enable-build-as-root $CONFIGURE_ARGS \${EXTRA_CONFIGURE_ARGS} || (cat config.log; exit 1)
EOF
fi
cat <<EOF
Expand All @@ -148,12 +151,12 @@ ARG NUMPROC=8
ENV MAKE="make -j\${NUMPROC}"
ARG USE_MAKEFLAGS="-k"
#:toolchain:
RUN make \${USE_MAKEFLAGS} base-toolchain
$RUN make \${USE_MAKEFLAGS} base-toolchain
#:make:
# Avoid running the lengthy testsuite of the following.
RUN make \${USE_MAKEFLAGS} cython
$RUN make \${USE_MAKEFLAGS} cython
# By default, compile something tricky but that does not take too long. scipy uses BLAS.
ARG TARGETS="scipy"
RUN SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!r,!python3,!python2,!nose" make \${USE_MAKEFLAGS} \${TARGETS}
$RUN SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!r,!python3,!python2,!nose" make \${USE_MAKEFLAGS} \${TARGETS}
#:end:
EOF

0 comments on commit 7e59a6f

Please sign in to comment.