Skip to content

Commit

Permalink
Merge branch 'ci/micromamba' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
heilerich committed Nov 25, 2022
2 parents a7cdad4 + 9d42cd3 commit 8fbeaaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion conda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ARG MINIFORGE_VERSION=4.14.0-0
ARG PIP_VERSION=22.2
# renovate: datasource=conda depName=conda-forge/python
ARG PYTHON_VERSION=3.10.6
# renovate: datasource=conda depName=conda-forge/micromamba
ARG MICROMAMBA_VERSION=0.25.1

# setup environment for conda
ENV CONDA_DIR /opt/conda
Expand Down Expand Up @@ -39,10 +41,11 @@ RUN curl -sL "https://github.com/conda-forge/miniforge/releases/download/${MINIF
&& mkdir -p /opt/conda/shared_pkgs \
&& echo "conda ${MINIFORGE_VERSION:0:-2}" >> ${CONDA_DIR}/conda-meta/pinned \
&& echo "python ${PYTHON_VERSION}" >> ${CONDA_DIR}/conda-meta/pinned \
&& conda install -y -q \
&& mamba install -y -q \
python=${PYTHON_VERSION} \
conda=${MINIFORGE_VERSION:0:-2} \
pip=${PIP_VERSION} \
micromamba=${MICROMAMBA_VERSION} \
&& conda update -y -q --all \
&& conda clean -a -f -y \
&& chown -R ${NB_USER}:users ${CONDA_DIR} \
Expand Down
2 changes: 1 addition & 1 deletion python-job/exec-with-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi

if [ -f "${CONDA_ENV_PATH}" ]; then
cp "${CONDA_ENV_PATH}" /tmp/conda-environment.yml
mamba env create -f /tmp/conda-environment.yml
micromamba create --file /tmp/conda-environment.yml --always-softlink --offline --retry-clean-cache --root-prefix /opt/conda/
export ENV_NAME=`cat "${CONDA_ENV_PATH}" | grep 'name: ' | sed 's/name: \(.*\)/\1/'`
echo "${ENV_NAME}" >> /tmp/CONDA_ENV
conda activate "${ENV_NAME}"
Expand Down

0 comments on commit 8fbeaaf

Please sign in to comment.