Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a Dockerfile #591

Closed
5 tasks done
abcsds opened this issue Aug 19, 2022 · 4 comments
Closed
5 tasks done

Define a Dockerfile #591

abcsds opened this issue Aug 19, 2022 · 4 comments

Comments

@abcsds
Copy link

abcsds commented Aug 19, 2022

Idea as follows:

  • Choose a a small linux docker image (chose python3.9)
  • [.] Install mne via official installation medium (installed directly from pip instead)
  • Install missing requirements for mn-bids-pipeline, if any (installed)
  • Mount the bids_root and work folder as volumes. (mounting is done on running, but volumes are declared)
  • Load config.py. Maybe through loading a workspace volume? (missing)
  • Iun command: python run.py --config=./work/config.py(missing)

The black box model would suppose the config.py and the data volume as entry points. The output is writen to the bids_root mounted volume.

Here's an initial sugestion for a dockerfile:

FROM python:3.9

USER root

RUN apt-get -y update && apt-get install python3-pip -y
RUN groupadd -r user && useradd -r -g user mne-user

RUN mkdir -p /home/mne-user/work
RUN mkdir -p /home/mne-user/data
RUN chown mne-user /home/mne-user
RUN chown mne-user /home/mne-user/work
RUN chown mne-user /home/mne-user/data
VOLUME ["/home/mne-user/work", "/home/mne-user/data"]

USER mne-user
WORKDIR ~/work
RUN pip install mne
RUN pip install -r https://raw.githubusercontent.com/mne-tools/mne-bids-pipeline/main/requirements.txt
ENTRYPOINT python -c "import mne; mne.sys_info()" && /bin/bash

This is not the insallation suggested in the documentation, but I couldn't get conda working its environments while building docker images. This installation should be cleaner anyway. I chose python's container, which is 916 MB. After this installation the MNE container is 2.59GB. MNE's install is large anyway.

@welcome
Copy link

welcome bot commented Aug 19, 2022

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@hoechenberger
Copy link
Member

Hello @abcsds, this is a good start, thanks!

  • I'd suggest to use the official MNE installers instead, on a Debian or Ububtu base image.
  • You forgot to actually fetch the pipeline repository :)

@abcsds abcsds mentioned this issue Sep 2, 2022
4 tasks
@abcsds
Copy link
Author

abcsds commented Sep 2, 2022

Hi @hoechenberger,
Thanks for picking it up. I sent the PR.

@larsoner
Copy link
Member

larsoner commented Dec 2, 2022

Closing for mne-tools/mne-docker#24

@larsoner larsoner closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants