-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from kaczmarj/examples
FIX+ENH: pip install and examples
- Loading branch information
Showing
24 changed files
with
1,088 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ coverage.xml | |
*.pyc | ||
*.tar | ||
*.tar.gz | ||
|
||
/build | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
In this directory you can find a `Dockerfile` with conda python environment. | ||
# conda python example | ||
|
||
The bash script `create_dockerfile.sh` contains a `neurodocker` command that was used to create the `Dockerfile`. | ||
In this directory you can find a `Dockerfile` and `Singularity` file with a conda python environment. | ||
|
||
The `Dockerfile` contains: | ||
The shell script `generate.sh` contains a `neurodocker` command that creates the `Dockerfile` and `Singularity` file. | ||
|
||
- using `neurodebian:stretch-non-free` as a base image | ||
- installing text editors | ||
- creating a conda environment and installing various python library including jupyter-notebook; most of the libraries are installed using `conda`, and `nilearn` is installed using a `pip` command; the environment will be automatically activated | ||
- changing a jupyter configuartion, so you'll be able to open notebooks locally | ||
- using `jupyter-notebook` as a default command | ||
Both specs: | ||
|
||
- use `neurodebian:stretch-non-free` as the base image | ||
- install text editors | ||
- create a conda environment and installing various python library including jupyter-notebook; most of the libraries are installed using `conda`, and `nilearn` is installed using a `pip` command; the environment will be automatically activated | ||
- change the jupyter configuration, so you'll be able to open notebooks locally | ||
|
||
You can test the script and `Dockerfile` | ||
The Dockerfile uses `jupyter-notebook` as the default command. The Singularity file will start a bash shell by default. | ||
|
||
- creating a `Dockerfile`: `bash create_dockerfile.sh` | ||
- building a Docker image (this will take a few minutes): `docker build -t test/conda .` | ||
- running a Docker container: `docker run -it --rm -p8888:8888 test/conda` (container should start `jupyter-notebook`, you can copy the link and paste to your browser) | ||
- you can still start container with `bash` instead of `jupyter-notebook`: `docker run -it --rm test/conda bash` | ||
|
||
|
||
## Docker | ||
|
||
```shell | ||
# Generate Dockerfile | ||
$ ./generate.sh | ||
# Build Docker image | ||
$ docker build -t test/conda . | ||
# Run the container (start jupyter notebook) | ||
$ docker run --rm -it -p 8888:8888 test/conda | ||
# Start interactive bash shell | ||
$ docker run --rm -it test/conda bash | ||
``` | ||
|
||
## Singularity | ||
|
||
```shell | ||
# Generate Singularity file | ||
$ ./generate.sh | ||
# Build Singularity image | ||
$ singularity build jupyter.sqsh Singularity | ||
# Run the container (start jupyter notebook) | ||
$ singularity run jupyter.sqsh jupyter-notebook | ||
# Start interactive bash shell | ||
$ singularity run jupyter.sqsh | ||
``` |
Oops, something went wrong.