Skip to content

ENH: updates notebooks to newest docs/user version #128

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

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions notebooks/basic_debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
" config.enable_debug_mode()\n",
" ```\n",
"\n",
" as the first import of your nipype script. To enable debug logging use:\n",
"\n",
" ```python\n",
" from nipype import logging\n",
" logging.update_logging(config)\n",
" ```\n",
" as the first import of your nipype script.\n",
" \n",
" **Note:**\n",
" - Turning on debug will rerun your workflows and will rerun them after debugging is turned off.\n",
" - Turning on debug mode will also override log levels specified elsewhere, such as in the nipype configuration. \n",
" - `workflow`, `interface` and `utils` loggers will all be set to level `DEBUG`.\n",
" \n",
" **Note:** Turning on debug will rerun your workflows and will rerun them after debugging is turned off.\n",
"\n",
"- There are several configuration options that can help with debugging.\n",
" See [Configuration File](config_file.ipynb) for more details:\n",
Expand Down
22 changes: 18 additions & 4 deletions notebooks/basic_execution_configuration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@
"metadata": {},
"outputs": [],
"source": [
"from nipype import config, logging\n",
"config.enable_debug_mode()\n",
"logging.update_logging(config)"
"from nipype import config\n",
"config.enable_debug_mode()"
]
},
{
Expand All @@ -296,8 +295,23 @@
"source": [
"config.set('execution', 'stop_on_first_crash', 'true')\n",
"config.set('execution', 'remove_unnecessary_outputs', 'false')\n",
"config.set('execution', 'keep_inputs', 'true')\n",
"config.set('logging', 'workflow_level', 'DEBUG')\n",
"config.set('logging', 'interface_level', 'DEBUG')"
"config.set('logging', 'interface_level', 'DEBUG')\n",
"config.set('logging', 'utils_level', 'DEBUG')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The primary loggers (`workflow`, `interface` and `utils`) are also reset to level `DEBUG`.\n",
"\n",
"You may wish to adjust these manually using:\n",
"```python\n",
"from nipype import logging\n",
"logging.getLogger(<logger>).setLevel(<level>)\n",
"```"
]
},
{
Expand Down
59 changes: 41 additions & 18 deletions notebooks/introduction_neurodocker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
"source": [
"# Neurodocker tutorial\n",
"\n",
"[Neurodocker](https://github.com/kaczmarj/neurodocker) is a brilliant tool to create your own neuroimaging docker container. [Neurodocker](https://github.com/kaczmarj/neurodocker) is a command-line program that enables users to generate [Docker](http://www.docker.io/) containers that include neuroimaging software. These containers can be\n",
"converted to [Singularity](http://singularity.lbl.gov/) containers for use in high-performance computing\n",
"centers.\n",
"This page covers the steps to create containers with [Neurodocker](https://github.com/kaczmarj/neurodocker). [Neurodocker](https://github.com/kaczmarj/neurodocker) is a brilliant tool to create your own neuroimaging docker container. [Neurodocker](https://github.com/kaczmarj/neurodocker) is a command-line program that enables users to generate [Docker](http://www.docker.io/) containers and [Singularity](http://singularity.lbl.gov/) images that include neuroimaging software.\n",
"\n",
"Requirements:\n",
"\n",
"* [Docker](http://www.docker.io/)\n",
"* [Docker](http://www.docker.io/) or [Singularity](http://singularity.lbl.gov/)\n",
"* Internet connection"
]
},
Expand All @@ -24,7 +22,9 @@
"\n",
"To view the Neurodocker help message\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate --help\n",
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] --help\n",
"\n",
"**Note**: choose between ``docker`` and ``singularity`` in ``[docker|singularity]``.\n",
"\n",
"1. Users must specify a base Docker image and the package manager. Any Docker\n",
" image on DockerHub can be used as your base image. Common base images\n",
Expand All @@ -39,23 +39,26 @@
" machine into the container, and other operations. The list of supported\n",
" neuroimaging software packages is available in the ``neurodocker`` help\n",
" message.\n",
"3. The ``neurodocker`` command will generate a Dockerfile. This Dockerfile can\n",
" be used to build a Docker image with the ``docker build`` command."
"3. The ``neurodocker`` command will generate a Dockerfile or Singularity recipe.\n",
" The Dockerfile can be used with the ``docker build`` command to build a\n",
" Docker image. The Singularity recipe can be used to build a Singularity\n",
" container with the ``singularity build`` command."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create a Dockerfile with FSL, Python 3.6, and Nipype\n",
"## Create a Dockerfile or Singularity recipe with FSL, Python 3.6, and Nipype\n",
"\n",
"This command prints a Dockerfile (the specification for a Docker image) to the\n",
"This command prints a Dockerfile (the specification for a Docker image) or a\n",
"Singularity recipe (the specification for a Singularity container) to the\n",
"terminal.\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
" docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \\\n",
" --base debian:stretch --pkg-manager apt \\\n",
" --fsl version=5.0.10 \\\n",
" --miniconda env_name=neuro \\\n",
" --miniconda create_env=neuro \\\n",
" conda_install=\"python=3.6 traits\" \\\n",
" pip_install=\"nipype\""
]
Expand All @@ -68,7 +71,7 @@
"\n",
"The Dockerfile can be saved and used to build the Docker image\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate docker \\\n",
" --base debian:stretch --pkg-manager apt \\\n",
" --fsl version=5.0.10 \\\n",
" --miniconda env_name=neuro \\\n",
Expand All @@ -80,6 +83,24 @@
" docker build --tag my_image - < Dockerfile"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Build the Singularity container\n",
"\n",
"The Singularity recipe can be saved and used to build the Singularity container\n",
"\n",
" docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \\\n",
" --base debian:stretch --pkg-manager apt \\\n",
" --fsl version=5.0.10 \\\n",
" --miniconda create_env=neuro \\\n",
" conda_install=\"python=3.6 traits\" \\\n",
" pip_install=\"nipype\" > Singularity\n",
"\n",
" singularity build my_nipype.simg Singularity"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -89,7 +110,7 @@
"This example installs AFNI and ANTs from the NeuroDebian repositories. It also\n",
"installs ``git`` and ``vim``.\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] \\\n",
" --base neurodebian:stretch --pkg-manager apt \\\n",
" --install afni ants git vim\n",
"\n",
Expand All @@ -109,19 +130,21 @@
"Miniconda as a non-root user, and activate the Miniconda environment upon\n",
"running the container.\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate docker \\\n",
" --base centos:7 --pkg-manager yum \\\n",
" --dcm2niix version=master \\\n",
" --dcm2niix version=master method=source \\\n",
" --user neuro \\\n",
" --miniconda env_name=neuro conda_install=\"jupyter traits nipype\" \\\n",
" --miniconda create_env=neuro conda_install=\"jupyter traits nipype\" \\\n",
" > Dockerfile\n",
" docker build --tag my_nipype - < Dockerfile\n",
"\n",
"Copy local files into a container.\n",
"\n",
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] \\\n",
" --base ubuntu:16.04 --pkg-manager apt \\\n",
" --copy relative/path/to/source.txt /absolute/path/to/destination.txt"
" --copy relative/path/to/source.txt /absolute/path/to/destination.txt\n",
" \n",
"See the [Neurodocker examples page](https://github.com/kaczmarj/neurodocker/tree/master/examples/) for more."
]
}
],
Expand Down