Skip to content

Commit fb2a04f

Browse files
authored
Use micromamba (#32)
1 parent 7677614 commit fb2a04f

4 files changed

Lines changed: 38 additions & 23 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on: # yamllint disable-line rule:truthy
1616

1717
jobs:
1818
docker:
19+
timeout-minutes: 30
1920
runs-on: ubuntu-latest
2021
steps:
2122
- uses: actions/checkout@v4
@@ -37,6 +38,7 @@ jobs:
3738
echo "Got MNE_VERSION=${MNE_VERSION}"
3839
echo "Got DOCKER_TAG=${DOCKER_TAG}"
3940
- run: docker compose build base --build-arg mne_v="$MNE_VERSION"
41+
timeout-minutes: 15
4042
- run: docker tag mnetools/mne-python ghcr.io/mne-tools/mne-python:${DOCKER_TAG}
4143
- name: System info - base image
4244
run: docker run mnetools/mne-python python -c "import mne; mne.sys_info()"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
***.idea
2+
.DS_Store

base/Dockerfile

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ARG HOME_DIR="/home/${MNE_USER}"
1010
ENV MNE_USER=${MNE_USER}
1111
ENV HOME_DIR=${HOME_DIR}
1212

13-
ARG CONDA_DIR="/opt/conda/"
13+
ARG MAMBA_ROOT_PREFIX="/opt/conda"
14+
ENV MAMBA_ROOT_PREFIX=${MAMBA_ROOT_PREFIX}
1415

1516
# install xvfb
1617
RUN apt-get update && \
@@ -30,20 +31,25 @@ RUN useradd -ms /bin/bash -d ${HOME_DIR} ${MNE_USER}
3031
USER $MNE_USER
3132
WORKDIR $HOME_DIR
3233

33-
# setup conda
34-
ENV PATH="${CONDA_DIR}/bin:${PATH}"
35-
ARG PATH="${CONDA_DIR}/bin:${PATH}"
36-
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
37-
sh ./Miniconda3-latest-Linux-x86_64.sh -b -p ${CONDA_DIR} && \
38-
rm -f ./Miniconda3-latest-Linux-x86_64.sh && \
39-
conda init
34+
# setup conda via micromamba
35+
# https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html#automatic-install
36+
ENV PATH="${MAMBA_ROOT_PREFIX}/bin:${PATH}"
37+
ARG PATH="${MAMBA_ROOT_PREFIX}/bin:${PATH}"
38+
ENV SHELL="/bin/bash"
39+
RUN wget https://micro.mamba.pm/install.sh && \
40+
sh ./install.sh && \
41+
rm -f ./install.sh
4042
SHELL ["/bin/bash", "--login", "-c"]
41-
RUN conda config --add channels conda-forge && \
42-
conda config --remove channels defaults && \
43-
conda config --set channel_priority strict && \
44-
conda config --get channels
45-
RUN conda install --yes \
46-
python==3.12 \
43+
RUN micromamba shell init -s bash -r ${MAMBA_ROOT_PREFIX}
44+
RUN echo "micromamba activate" | tee -a ~/.bashrc
45+
RUN cat ~/.bashrc
46+
RUN echo "PATH=$PATH"
47+
RUN which micromamba && \
48+
micromamba config append channels conda-forge && \
49+
micromamba config set channel_priority strict && \
50+
micromamba config list --sources
51+
RUN micromamba install -y \
52+
python=3.13 \
4753
python-blosc \
4854
cytoolz \
4955
dask \
@@ -64,17 +70,25 @@ RUN conda install --yes \
6470
nilearn \
6571
dipy \
6672
h5io \
73+
conda \
6774
mamba \
6875
conda-libmamba-solver \
6976
mne-bids-pipeline \
7077
statsmodels \
71-
fooof \
72-
&& conda clean -tipy \
73-
&& find /opt/conda/ -type f,l -name '*.a' -delete \
74-
&& find /opt/conda/ -type f,l -name '*.pyc' -delete \
75-
&& find /opt/conda/ -type f,l -name '*.js.map' -delete \
76-
&& find /opt/conda/lib/python*/site-packages/bokeh/server/static -type f,l -name '*.js' -not -name '*.min.js' -delete \
77-
&& rm -rf /opt/conda/pkgs
78+
fooof
79+
80+
RUN which conda && \
81+
conda --version && \
82+
which mamba && \
83+
mamba --version
84+
85+
RUN conda clean -tipy
86+
RUN find /opt/conda/ -type f,l -name '*.a' -delete
87+
RUN find /opt/conda/ -type f,l -name '*.pyc' -delete
88+
RUN find /opt/conda/ -type f,l -name '*.js.map' -delete
89+
RUN rm -rf /opt/conda/pkgs
90+
91+
RUN conda list
7892

7993
RUN pip install https://github.com/mne-tools/mne-python/archive/${mne_v}.zip
8094

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.1"
2-
31
services:
42

53
# Images

0 commit comments

Comments
 (0)