FMRIPREP Development Environment: Lowering the bar for new contributors?


Hi all,

I heard on a recent talkpythontome about a new extension on VS Code for “remote development”, that can be used to attach VS Code to running containers. Since FMRIPREP has a lot of dependencies that can only be reasonably installed in a container, being able to interactively debug the code in a graphical editor has remained a pipe dream, UNTIL TODAY.

I have a quick writeup and video (may want to play on double speed, I talk slow) for setting up your environment.

A similar setup could be used for whatever programming project you are working on with a container. I think this could make contributing to fmriprep and other open source projects easier, but I do not know all the barriers, so feedback is welcome.

I’m going to fiddle with this configuration periodically to improve it, but VS Code has now given me the best development experience so far with this new remote-development extension.

Also if you have other ways of testing/debugging your code locally, please let me know!



This is amazing @jdkent great work! Just ran through the blog post and was able to get it working without too much trouble. The inevitable march of visual studio continues…


I wonder how hard it would be to take this to another level and installing browser version of vscode ( inside the FMRIPREP container.

1 Like

Thanks @ChrisGorgolewski!

Could give this a spin:


FROM poldracklab/fmriprep:latest

RUN pip uninstall -y fmriprep &&\
    cd /src/fmriprep &&\
    python develop

RUN curl -o /tmp/code-server.tar.gz -SL

RUN mkdir /src/codeserver &&\
    tar -xvf /tmp/code-server.tar.gz -C /src/codeserver --strip-components=1

RUN /src/codeserver/code-server --install-extension eamodio.gitlens &&\
    /src/codeserver/code-server --install-extension ms-python.python

ENTRYPOINT ["/src/codeserver/code-server", "/src/fmriprep"]


docker run -p -v ${PWD}:/src/fmriprep fmriprep:code-server

If you have the test data downloaded in the guide you could mount that as well as specified in the guide.

This is awesome, appeared to work for me, just had trouble exiting the editor.