-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,095 additions
and
158 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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.. _reprozip-jupyter: | ||
|
||
Making Jupyter Notebooks Reproducible with ReproZip | ||
*************************************************** | ||
|
||
**reprozip-jupyter** is a plugin for `Jupyter Notebooks <https://jupyter.org>`__, a popular open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. These are valuable documents for data cleaning, analysis, writing executable papers/articles, and more. However, Jupyter Notebooks are subject to dependency hell like any other application -- just the Notebook is not enough for full reproducibility. We have written a ReproZip plugin for Jupyter Notebooks to help users automatically capture dependencies (including data, environment variables, etc.) of Notebooks and also automatically set up those dependencies in another computing environment. | ||
|
||
Installation | ||
============ | ||
You can install *reprozip-jupyter* with pip:: | ||
|
||
$ pip install reprozip-jupyter | ||
|
||
Or Anaconda:: | ||
|
||
$ conda install reprozip-jupyter | ||
|
||
Once successfully installed, you should then enable the plugin for both the client and server side of Jupyter Notebooks:: | ||
|
||
$ jupyter nbextension install --py reprozip_jupyter --user | ||
$ jupyter nbextension enable --py reprozip_jupyter --user | ||
$ jupyter serverextension enable --py reprozip_jupyter --user | ||
|
||
Once these steps are completed, when you start a Jupyter Notebook server, you should be able to see the ReproZip button in your notebook's toolbar. | ||
|
||
Packing | ||
======= | ||
|
||
Once you have a notebook that executes the way you want, you can trace and pack all the dependencies, data, and provenance with *reprozip-jupyter* by simply clicking the button on the notebook's toolbar: | ||
|
||
.. image:: figures/rzj-button.png | ||
|
||
The notebook will execute from top-to-bottom and *reprozip-jupyter* traces that execution. If there are no errors in the execution, you'll see two pop-ups like this one after the other: | ||
|
||
.. image:: figures/rzj-running.png | ||
|
||
*reprozip-jupyter* will name the resulting ReproZip package (*.rpz*) as ``notebookname_datetime.rpz`` and save it to the same working directory the notebook is in: | ||
|
||
.. image:: figures/rzj-pkg.png | ||
|
||
Note that the notebook file itself (``.ipynb``) is not included in the package, so you should share or archive both of those files. The reason is that a lot of services can render notebooks (GitHub, OSF...), and they wouldn't be able to if it was in the RPZ file. | ||
|
||
Unpacking | ||
========= | ||
|
||
Now, anyone can rerun the Jupyter notebook, with all dependencies automatically configured. First, they would need to install *reprounzip* and the *reprounzip-docker* plugin (see the :ref:`installation steps <install>`). Second, they need to download or otherwise acquire the ``.rpz`` file and original ``.ipynb`` notebook they'd like to reproduce. | ||
|
||
To reproduce the notebook using the GUI, follow these steps: | ||
|
||
1. Double-click the .rpz file. | ||
2. The first tab in the window that appears is for you to set up how you'd like ReproUnzip to unpack and configure the contents of the *.rpz*. Choose docker as your unpacker, and choose the directory you'd like to unpack into. | ||
3. Make sure the Jupyter Integration is checked, and click Run experiment: | ||
|
||
.. image:: figures/rzj-setup.png | ||
|
||
4. This second table allows you to interact with and rerun the notebook. All you need to do is click 'Run Experiment' and the Jupyter Notebook home file list should pop up in your default browser (if not, navigate to ``localhost:8888``). Open the notebook, and rerun with every dependency configured for you! | ||
|
||
.. image:: figures/rzj-run.png | ||
|
||
On the command line, you would: | ||
|
||
1. Set up the experiment using *reprounzip-docker*:: | ||
|
||
$ reprounzip docker setup <package.rpz> <directory> | ||
|
||
2. Rerun the notebook using *reprozip-jupyter*:: | ||
|
||
$ reprozip-jupyter run <directory> | ||
|
||
3. The Jupyter Notebook home file list should pop up in your default browser (if not, navigate to ``localhost:8888``). | ||
4. Open the notebook, and rerun with every dependency configured for you! | ||
|
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
.\" Manpage for reprounzip | ||
.\" Contact reprozip-dev@vgc.poly.edu to correct errors or typos. | ||
.TH man 1 "4 November 2017" "1.0.10" "reprounzip\-docker man page" | ||
.SH NAME | ||
reprounzip\-docker \- Docker unpacker for reprounzip | ||
.SH SYNOPSIS | ||
reprounzip [\-v] docker [\-h] [\-\-version] [\-\-docker\-cmd DOCKER] ... | ||
.SH DESCRIPTION | ||
reprounzip\-docker is the unpacker plugin for reprounzip that allows reproducing packed experiments on different environments by using a Docker container. You will need Docker to be installed on your machine to use it. | ||
.SH OPTIONS | ||
.SS General options: | ||
.TP | ||
.B \-h, \-\-help | ||
show this help message and exit | ||
.TP | ||
.B \-\-version | ||
show program's version number and exit | ||
.TP | ||
.B \-v, \-\-verbose | ||
augments verbosity level | ||
.TP | ||
.B \-\-docker\-cmd DOCKER | ||
changes the location or command used to run the Docker client. This option is split on spaces, for example you can use | ||
\-\-docker\-cmd 'sudo /opt/bin/docker' | ||
|
||
.SS Commands: | ||
.TP | ||
.BI setup " [\-\-base\-image IMAGE] [\-\-distribution DISTRIBUTION] [\-\-install\-pkgs] [\-\-image\-name NAME] [\-\-docker\-option OPTION] <package.rpz> <directory>" | ||
Unpacks an experiment and sets it up for reproduction in the specified directory. A Docker image | ||
.I NAME | ||
will be created from the specified base | ||
.I IMAGE | ||
by adding the experiment's content on top of it. You can use \-\-docker\-option to pass additional options to docker build for example \-\-docker\-option=\-\-squash. | ||
.TP | ||
.BI run " [\-\-expose\-port PORT] [\-\-enable\-x11] [\-\-x11\-display DISPLAY] [\-\-tunneled\-x11] [\-d] [\-\-docker\-option OPTION] [\-\-pass\-env VAR] [\-\-set\-env VAR[=val]] <directory> [run] [\-\-cmdline ...]" | ||
Runs an experiment that has been unpacked to a directory. | ||
.TP | ||
.BI upload " <directory> [localfile:experimentfile] [...]" | ||
Replaces a file inside the experiment image with your own. This allows you to reproduce an experiment in its original environment, but with modified data or configuration. Running this command with only the | ||
.I directory | ||
will list all the named files that you can replace with this command. | ||
.TP | ||
.BI download " <directory> [experimentfile[:localfile]] [...]" | ||
Download a file from the experiment container to your filesystem. If | ||
.I localfile | ||
is not specified, a file of the same name will be written in the current directory. Running this command with only the | ||
.I directory | ||
will list all the named files that you can download with this command. | ||
.TP | ||
.BI reset " <directory>" | ||
Reset the experiment to the state it was when it was first unpacked. This undoes the effects of | ||
.BR upload " and " run | ||
commands on the experiment's environment. | ||
.TP | ||
.BI destroy " <directory>" | ||
Removes an unpacked experiment directory, and the associated Docker images. | ||
.SH SEE ALSO | ||
.TP | ||
The ReproZip website | ||
https://www.reprozip.org/ | ||
.TP | ||
ReproZip's GitHub repository | ||
https://github.com/ViDA\-NYU/reprozip | ||
.TP | ||
The Docker website | ||
https://www.docker.com/ | ||
.SH BUGS | ||
Please report bugs on our mailing-list at users@reprozip.org or on GitHub at https://github.com/ViDA\-NYU/reprozip/issues. | ||
.SH AUTHOR | ||
.RB "ReproZip is being developed at" " New York University" . | ||
|
||
The team includes: | ||
.RS | ||
.nf | ||
Remi Rampin | ||
Fernando Chirigati | ||
Vicky Steeves | ||
Juliana Freire | ||
Dennis Shasha | ||
.fi | ||
.RE | ||
.SH COPYRIGHT | ||
Copyright 2014-2017 New York University. | ||
|
||
.RB "Licensed under a" " BSD 3-Clause license." " See the LICENSE file included with the software for details." |
Oops, something went wrong.