diff --git a/notebooks/basic_debug.ipynb b/notebooks/basic_debug.ipynb index 0a74c3e..4db8088 100644 --- a/notebooks/basic_debug.ipynb +++ b/notebooks/basic_debug.ipynb @@ -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", diff --git a/notebooks/basic_execution_configuration.ipynb b/notebooks/basic_execution_configuration.ipynb index 6056fda..582608d 100644 --- a/notebooks/basic_execution_configuration.ipynb +++ b/notebooks/basic_execution_configuration.ipynb @@ -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()" ] }, { @@ -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().setLevel()\n", + "```" ] }, { diff --git a/notebooks/introduction_neurodocker.ipynb b/notebooks/introduction_neurodocker.ipynb index 26866a4..dd2a5e6 100644 --- a/notebooks/introduction_neurodocker.ipynb +++ b/notebooks/introduction_neurodocker.ipynb @@ -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" ] }, @@ -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", @@ -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\"" ] @@ -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", @@ -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": {}, @@ -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", @@ -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." ] } ],