Skip to content

Commit 7a448c6

Browse files
authored
Merge pull request #128 from miykael/update_user_doc_notebooks
ENH: updates notebooks to newest docs/user version
2 parents 52e0c2b + 7553c64 commit 7a448c6

File tree

3 files changed

+65
-29
lines changed

3 files changed

+65
-29
lines changed

notebooks/basic_debug.ipynb

+6-7
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
" config.enable_debug_mode()\n",
2222
" ```\n",
2323
"\n",
24-
" as the first import of your nipype script. To enable debug logging use:\n",
25-
"\n",
26-
" ```python\n",
27-
" from nipype import logging\n",
28-
" logging.update_logging(config)\n",
29-
" ```\n",
24+
" as the first import of your nipype script.\n",
25+
" \n",
26+
" **Note:**\n",
27+
" - Turning on debug will rerun your workflows and will rerun them after debugging is turned off.\n",
28+
" - Turning on debug mode will also override log levels specified elsewhere, such as in the nipype configuration. \n",
29+
" - `workflow`, `interface` and `utils` loggers will all be set to level `DEBUG`.\n",
3030
" \n",
31-
" **Note:** Turning on debug will rerun your workflows and will rerun them after debugging is turned off.\n",
3231
"\n",
3332
"- There are several configuration options that can help with debugging.\n",
3433
" See [Configuration File](config_file.ipynb) for more details:\n",

notebooks/basic_execution_configuration.ipynb

+18-4
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,8 @@
276276
"metadata": {},
277277
"outputs": [],
278278
"source": [
279-
"from nipype import config, logging\n",
280-
"config.enable_debug_mode()\n",
281-
"logging.update_logging(config)"
279+
"from nipype import config\n",
280+
"config.enable_debug_mode()"
282281
]
283282
},
284283
{
@@ -296,8 +295,23 @@
296295
"source": [
297296
"config.set('execution', 'stop_on_first_crash', 'true')\n",
298297
"config.set('execution', 'remove_unnecessary_outputs', 'false')\n",
298+
"config.set('execution', 'keep_inputs', 'true')\n",
299299
"config.set('logging', 'workflow_level', 'DEBUG')\n",
300-
"config.set('logging', 'interface_level', 'DEBUG')"
300+
"config.set('logging', 'interface_level', 'DEBUG')\n",
301+
"config.set('logging', 'utils_level', 'DEBUG')"
302+
]
303+
},
304+
{
305+
"cell_type": "markdown",
306+
"metadata": {},
307+
"source": [
308+
"The primary loggers (`workflow`, `interface` and `utils`) are also reset to level `DEBUG`.\n",
309+
"\n",
310+
"You may wish to adjust these manually using:\n",
311+
"```python\n",
312+
"from nipype import logging\n",
313+
"logging.getLogger(<logger>).setLevel(<level>)\n",
314+
"```"
301315
]
302316
},
303317
{

notebooks/introduction_neurodocker.ipynb

+41-18
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
"source": [
77
"# Neurodocker tutorial\n",
88
"\n",
9-
"[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",
10-
"converted to [Singularity](http://singularity.lbl.gov/) containers for use in high-performance computing\n",
11-
"centers.\n",
9+
"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",
1210
"\n",
1311
"Requirements:\n",
1412
"\n",
15-
"* [Docker](http://www.docker.io/)\n",
13+
"* [Docker](http://www.docker.io/) or [Singularity](http://singularity.lbl.gov/)\n",
1614
"* Internet connection"
1715
]
1816
},
@@ -24,7 +22,9 @@
2422
"\n",
2523
"To view the Neurodocker help message\n",
2624
"\n",
27-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate --help\n",
25+
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] --help\n",
26+
"\n",
27+
"**Note**: choose between ``docker`` and ``singularity`` in ``[docker|singularity]``.\n",
2828
"\n",
2929
"1. Users must specify a base Docker image and the package manager. Any Docker\n",
3030
" image on DockerHub can be used as your base image. Common base images\n",
@@ -39,23 +39,26 @@
3939
" machine into the container, and other operations. The list of supported\n",
4040
" neuroimaging software packages is available in the ``neurodocker`` help\n",
4141
" message.\n",
42-
"3. The ``neurodocker`` command will generate a Dockerfile. This Dockerfile can\n",
43-
" be used to build a Docker image with the ``docker build`` command."
42+
"3. The ``neurodocker`` command will generate a Dockerfile or Singularity recipe.\n",
43+
" The Dockerfile can be used with the ``docker build`` command to build a\n",
44+
" Docker image. The Singularity recipe can be used to build a Singularity\n",
45+
" container with the ``singularity build`` command."
4446
]
4547
},
4648
{
4749
"cell_type": "markdown",
4850
"metadata": {},
4951
"source": [
50-
"## Create a Dockerfile with FSL, Python 3.6, and Nipype\n",
52+
"## Create a Dockerfile or Singularity recipe with FSL, Python 3.6, and Nipype\n",
5153
"\n",
52-
"This command prints a Dockerfile (the specification for a Docker image) to the\n",
54+
"This command prints a Dockerfile (the specification for a Docker image) or a\n",
55+
"Singularity recipe (the specification for a Singularity container) to the\n",
5356
"terminal.\n",
5457
"\n",
55-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
58+
" docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \\\n",
5659
" --base debian:stretch --pkg-manager apt \\\n",
5760
" --fsl version=5.0.10 \\\n",
58-
" --miniconda env_name=neuro \\\n",
61+
" --miniconda create_env=neuro \\\n",
5962
" conda_install=\"python=3.6 traits\" \\\n",
6063
" pip_install=\"nipype\""
6164
]
@@ -68,7 +71,7 @@
6871
"\n",
6972
"The Dockerfile can be saved and used to build the Docker image\n",
7073
"\n",
71-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
74+
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate docker \\\n",
7275
" --base debian:stretch --pkg-manager apt \\\n",
7376
" --fsl version=5.0.10 \\\n",
7477
" --miniconda env_name=neuro \\\n",
@@ -80,6 +83,24 @@
8083
" docker build --tag my_image - < Dockerfile"
8184
]
8285
},
86+
{
87+
"cell_type": "markdown",
88+
"metadata": {},
89+
"source": [
90+
"## Build the Singularity container\n",
91+
"\n",
92+
"The Singularity recipe can be saved and used to build the Singularity container\n",
93+
"\n",
94+
" docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \\\n",
95+
" --base debian:stretch --pkg-manager apt \\\n",
96+
" --fsl version=5.0.10 \\\n",
97+
" --miniconda create_env=neuro \\\n",
98+
" conda_install=\"python=3.6 traits\" \\\n",
99+
" pip_install=\"nipype\" > Singularity\n",
100+
"\n",
101+
" singularity build my_nipype.simg Singularity"
102+
]
103+
},
83104
{
84105
"cell_type": "markdown",
85106
"metadata": {},
@@ -89,7 +110,7 @@
89110
"This example installs AFNI and ANTs from the NeuroDebian repositories. It also\n",
90111
"installs ``git`` and ``vim``.\n",
91112
"\n",
92-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
113+
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] \\\n",
93114
" --base neurodebian:stretch --pkg-manager apt \\\n",
94115
" --install afni ants git vim\n",
95116
"\n",
@@ -109,19 +130,21 @@
109130
"Miniconda as a non-root user, and activate the Miniconda environment upon\n",
110131
"running the container.\n",
111132
"\n",
112-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
133+
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate docker \\\n",
113134
" --base centos:7 --pkg-manager yum \\\n",
114-
" --dcm2niix version=master \\\n",
135+
" --dcm2niix version=master method=source \\\n",
115136
" --user neuro \\\n",
116-
" --miniconda env_name=neuro conda_install=\"jupyter traits nipype\" \\\n",
137+
" --miniconda create_env=neuro conda_install=\"jupyter traits nipype\" \\\n",
117138
" > Dockerfile\n",
118139
" docker build --tag my_nipype - < Dockerfile\n",
119140
"\n",
120141
"Copy local files into a container.\n",
121142
"\n",
122-
" docker run --rm kaczmarj/neurodocker:v0.3.2 generate \\\n",
143+
" docker run --rm kaczmarj/neurodocker:v0.4.0 generate [docker|singularity] \\\n",
123144
" --base ubuntu:16.04 --pkg-manager apt \\\n",
124-
" --copy relative/path/to/source.txt /absolute/path/to/destination.txt"
145+
" --copy relative/path/to/source.txt /absolute/path/to/destination.txt\n",
146+
" \n",
147+
"See the [Neurodocker examples page](https://github.com/kaczmarj/neurodocker/tree/master/examples/) for more."
125148
]
126149
}
127150
],

0 commit comments

Comments
 (0)