-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add docker file #594
Add docker file #594
Conversation
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴🏽♂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, thanks for the work!!
I suggested to use the standalone installers instead of installing via conda, and I still believe this is the best approach here. Could you try to adjust the Dockerfile accordingly, please?
After [installing docker](https://docs.docker.com/get-docker/), open a terminal in the `docker` folder and build the image: | ||
|
||
``` | ||
sudo docker build -t mne . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo shouldn't be necessary
A pipeline can be run from a configuration file on the current folder of the host machine (`./config.py`) as follows: | ||
|
||
``` | ||
sudo docker run --rm -v .:/work -v /host/data/:/data --name mne-pipeline mne run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sudo please.
|
||
To run an interactive session, you can add the flags `-it` and don't call the `run` parameter: | ||
``` | ||
sudo docker run --rm -it -v /host/work:/work -v /host/data/:/data --name mne-pipeline mne |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, no sudo please
@abcsds since mne-bids-pipeline is becoming a package, we'll soon put it up on |
At this point a docker container may be as simple as building off the official MNE-Docker repo build, then your image may be as simple as
|
Once we have a proper PyPI and conda-forge release, can we close this and make a PR to mne-docker to add it there? It would be nice to keep mne-installers and mne-docker in sync. Even better if mne-docker could use mne-installers to do this... |
I have been working on exactly this and will share results soon |
Closing in favor of mne-tools/mne-docker#24 and mne-tools/mne-installers#159 |
Hi,
This is related to #591. Back I talked with @hoechenberger about parallel distributed usage of the pipeline. He mentioned there were some attempts at dask, but we concluded it might be easier to just containerize the project and run it as docker swarm.
In #591 I suggested a dockerfile from the python image, with the config file and data are the only variables of the container.
@hoechenberger suggested:
Using the official installation of MNE:
I changed the base image to miniconda then, to be able to install MNE through conda, as suggested in the documentation.
Pulling the repo:
Since dockerfiles are commonly already inside a repository, it is uncommon to pull that same repository when building the image, but I have followed your suggestion. I think it might be a good example for someone trying to build their own images.
I documented basic usage in
docker/README.md
, but you can test the image like this:Also, I added these changes in a new folder:
docker
. This is because I consider these examples, rather than the one and only Dockerfile for the repo (generally stored in./Dockerfile
). One could be made with build and test targets, though: There is a tiny example comment on this Dockerfile. I don't really know how the test are run for this repo, so I didn't test it myself.The following points are missing:
docs/source/changes.md
):Should I just add a new line at the top with the date and a comment on what I did?
mne.sys_info()
.Output of
mne.sys_info()
:I think
mne_bids
should be installed, shouldn't it?Best,
Alberto