Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 93 to 93 | ||||||||
Once Docker is installed and running, you'll be able to download and run a Docker container: | ||||||||
Changed: | ||||||||
< < | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot | |||||||
> > | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot:latest- | |||||||
Added: | ||||||||
> > | ... where <proc> is amd64 for any machine with an Intel or AMD processor, or arm64 for a system with an ARM processor (such as a Mac with an M1 or M2 chip). | |||||||
(Windows users will probably need to use %CD% instead of $PWD .)
The first time you run this command, it will download a ~2.5GB container. Give it time. | ||||||||
Line: 115 to 117 | ||||||||
Consider the command: | ||||||||
Changed: | ||||||||
< < | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot | |||||||
> > | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot:latest- | |||||||
That first 8080 is the port to use on your local computer. If you want to use a different port on your computer (for example, you're already using port 8080 for something else), change that first 8080 to a different port. Note that if you change the port, you'll also have to change the port in the URL in the output; e.g., | ||||||||
Changed: | ||||||||
< < | sudo docker run -p 7000:8080 -v $PWD:/work wgseligman/jupyter-pyroot | |||||||
> > | sudo docker run -p 7000:8080 -v $PWD:/work wgseligman/jupyter-pyroot:latest- | |||||||
means you'll have to change: | ||||||||
Line: 137 to 139 | ||||||||
Again, consider: | ||||||||
Changed: | ||||||||
< < | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot | |||||||
> > | sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot:latest- | |||||||
That $PWD (%CD% in WIndows) just means "the current directory." The execution environment within the container uses /work for its files; the -v option in the command means "map /work to the current directory in the terminal." If you'd like to use a different directory on your computer as the work directory for the Docker container, just substitute that directory for $PWD . For example: | ||||||||
Changed: | ||||||||
< < | sudo docker run -p 8080:8080 -v ~jsmith/root-class:/work wgseligman/jupyter-pyroot | |||||||
> > | sudo docker run -p 8080:8080 -v ~jsmith/root-class:/work wgseligman/jupyter-pyroot:latest- | |||||||
Changing the container | ||||||||
Line: 178 to 180 | ||||||||
Docker container notes | ||||||||
Changed: | ||||||||
< < | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Feb-2023, that's AlmaLinux 9 and ROOT 6.26.10). | |||||||
> > | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Feb-2023, that's AlmaLinux 9 and ROOT 6.28.02). | |||||||
A little bit web searching will show there are other ROOT containers available. For example: | ||||||||
Line: 195 to 197 | ||||||||
To download the container and convert it to Singularity's .sif format: | ||||||||
Changed: | ||||||||
< < | singularity pull docker://wgseligman/jupyter-pyroot | |||||||
> > | singularity pull docker://wgseligman/jupyter-pyroot:latest- | |||||||
Changed: | ||||||||
< < | After some processing, you'll have the image file jupyter-pyroot_latest.sif . Then you can run Singularity on that container: | |||||||
> > | After some processing, you'll have the image file with a name like jupyter-pyroot_latest.sif . Then you can run Singularity on that container: | |||||||
singularity run --bind=$PWD:/work jupyter-pyroot_latest.sif |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 16 to 16 | ||||||||
Anaconda is a software manager that allows you download and execute packages in your home directory. | ||||||||
Changed: | ||||||||
< < | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda, if for no other reason than to save disk space (see below). But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. All the Nevis Linux cluster systems running CentOS 7 have conda installed. | |||||||
> > | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda, if for no other reason than to save disk space (see below). But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. All the Nevis Linux cluster systems running AlmaLinux 9 or CentOS 7 have conda installed. | |||||||
If you're not at Nevis, you can also separately install Anaconda![]() | ||||||||
Line: 178 to 178 | ||||||||
Docker container notes | ||||||||
Changed: | ||||||||
< < | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Sep-2021, that's CentOS 7 and ROOT 6.24.04). | |||||||
> > | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Feb-2023, that's AlmaLinux 9 and ROOT 6.26.10). | |||||||
A little bit web searching will show there are other ROOT containers available. For example: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 20 to 20 | ||||||||
If you're not at Nevis, you can also separately install Anaconda![]() | ||||||||
Added: | ||||||||
> > | If you are at Nevis, please look at the conda page for tips on how to save space in your home directory. | |||||||
Once you've installed Anaconda, you’ll probably have to include conda-forge![]() conda config --add channels conda-forge |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 176 to 176 | ||||||||
Docker container notes | ||||||||
Changed: | ||||||||
< < | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Aug-2020, that's CentOS 7 and ROOT 6.22.00). | |||||||
> > | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Sep-2021, that's CentOS 7 and ROOT 6.24.04). | |||||||
A little bit web searching will show there are other ROOT containers available. For example: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 87 to 87 | ||||||||
While Anaconda is an environment-level container, Docker![]() | ||||||||
Changed: | ||||||||
< < | The first step is to install Docker. For Mac and Windows systems, use Docker Desktop![]() ![]() | |||||||
> > | The first step is to install Docker. For Mac and Windows systems, use Docker Desktop![]() ![]() | |||||||
Once Docker is installed and running, you'll be able to download and run a Docker container: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 70 to 70 | ||||||||
| ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 12 to 12 | ||||||||
| ||||||||
Added: | ||||||||
> > | AnacondaAnaconda is a software manager that allows you download and execute packages in your home directory. If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda, if for no other reason than to save disk space (see below). But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. All the Nevis Linux cluster systems running CentOS 7 have conda installed. If you're not at Nevis, you can also separately install Anaconda![]() ![]() conda config --add channels conda-forge conda config --set channel_priority strictTo install Jupyter/ROOT: conda create --name jupyter-pyroot jupyter python rootNote that the name jupyter-pyroot is arbitrary; you can use any name for the conda environment ![]() ![]() ![]() conda install --name jupyter-pyroot jupyterlab numpy scipy matplotlibYour working group may use additional packages. For example, the VERITAS group at Nevis might want to use (in addition to the above): conda install --name jupyter-pyroot astropy gammapyYou only have to go through the above steps once to define an environment (e.g., jupyter-pyroot). Afterwards, once per login session, it’s necessary to activate it: conda activate jupyter-pyrootOnce activated, you should be able to run ROOT by simply typing: rootYou can run jupyter with: jupyter notebookor to enable remote access (read all the instructions at the bottom of the Jupyter page): jupyter notebook --no-browser --port=XXXX Warnings
| |||||||
Docker | ||||||||
Changed: | ||||||||
< < | Docker![]() | |||||||
> > | While Anaconda is an environment-level container, Docker![]() | |||||||
The first step is to install Docker. For Mac and Windows systems, use Docker Desktop![]() ![]() | ||||||||
Line: 132 to 203 | ||||||||
Note that while you can change the mapping of the /work directory within the container (see above), you can't change Jupyter's binding to port 8080. This might be a problem if you're running on a shared computer system and more than one user wants to run this container at the same time. | ||||||||
Deleted: | ||||||||
< < | AnacondaDocker and Singularity are OS-level containers (in contrast to emulators like VMware, which are machine-level containers). Anaconda![]() ![]() conda create --name jupyter-pyroot jupyter python rootHowever, I've found this method to be unreliable. Typically there's no problem with jupyter or python, but installing ROOT via Anaconda is hit-or-miss. Assuming you succeed, you can run the jupyter command as described near the bottom of the notebook server page; e.g.,:
jupyter notebookor to enable remote access (again, read all the instructions at the bottom of the Jupyter page): jupyter notebook --no-browser --port=XXXX | |||||||
The hard wayIf all other methods fail, you can embark on the adventure of compiling these packages on your own. You can install Python![]() ![]() ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 149 to 149 | ||||||||
jupyter notebook | ||||||||
Changed: | ||||||||
< < | or if you want control of the port: | |||||||
> > | or to enable remote access (again, read all the instructions at the bottom of the Jupyter page): | |||||||
jupyter notebook --no-browser --port=XXXX |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 136 to 136 | ||||||||
Docker and Singularity are OS-level containers (in contrast to emulators like VMware, which are machine-level containers). Anaconda![]() | ||||||||
Changed: | ||||||||
< < | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda. But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. You can install Anaconda in your home directory![]() | |||||||
> > | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda. But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. All the Nevis Linux cluster systems running CentOS 7 have conda installed. You can also separately install Anaconda in your home directory![]() | |||||||
Changed: | ||||||||
< < | Once you've installed Anaconda, to install Jupyter/ROOT, this command is supposed to work: | |||||||
> > | To install Jupyter/ROOT via conda, this command is supposed to work: | |||||||
conda create --name jupyter-pyroot jupyter python root |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 14 to 14 | ||||||||
Docker | ||||||||
Changed: | ||||||||
< < | Docker![]() | |||||||
> > | Docker![]() | |||||||
The first step is to install Docker. For Mac and Windows systems, use Docker Desktop![]() ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 105 to 105 | ||||||||
Docker container notes | ||||||||
Changed: | ||||||||
< < | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Apr-2020, that's CentOS 7 and ROOT 6.20.04). | |||||||
> > | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Aug-2020, that's CentOS 7 and ROOT 6.22.00). | |||||||
A little bit web searching will show there are other ROOT containers available. For example: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 105 to 105 | ||||||||
Docker container notes | ||||||||
Changed: | ||||||||
< < | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Feb-2020, that's CentOS 7 and ROOT 6.18.04). | |||||||
> > | WilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Apr-2020, that's CentOS 7 and ROOT 6.20.04). | |||||||
A little bit web searching will show there are other ROOT containers available. For example: | ||||||||
Line: 136 to 136 | ||||||||
Docker and Singularity are OS-level containers (in contrast to emulators like VMware, which are machine-level containers). Anaconda![]() | ||||||||
Changed: | ||||||||
< < | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda. But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. You can install it in your home directory![]() | |||||||
> > | If you use the Nevis Linux cluster, then you should consider using environment modules over Anaconda. But if you're on a different system, or the Nevis environment modules don't offer the package or version you're looking for, Anaconda is a better choice. You can install Anaconda in your home directory![]() | |||||||
Changed: | ||||||||
< < | To install Jupyter/ROOT, this command is supposed to work: | |||||||
> > | Once you've installed Anaconda, to install Jupyter/ROOT, this command is supposed to work: | |||||||
conda create --name jupyter-pyroot jupyter python root |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 6 to 6 | ||||||||
Changed: | ||||||||
< < | Users of the Nevis particle-physic Linux cluster have access to a notebook server that lets them execute Python and ROOT C++ scripts on a web browser. This page describes alternative methods for installing and using the Jupyter/ROOT/Python/C++ combination with (hopefully) a minimum of installation overhead. For example, this may be helpful for: | |||||||
> > | Users of the Nevis particle-physics Linux cluster have access to a notebook server that lets them execute Python and ROOT C++ scripts on a web browser. This page describes alternative methods for installing and using the Jupyter/ROOT/Python/C++ combination with (hopefully) a minimum of installation overhead. For example, this may be helpful for: | |||||||
| ||||||||
Line: 27 to 27 | ||||||||
The first time you run this command, it will download a ~2.5GB container. Give it time. | ||||||||
Changed: | ||||||||
< < | Finally you'll see some output. Look at that output carefully, as it will tell you how to access Jupyter via web browser. For example, assume the output contains something like this: | |||||||
> > | Finally you'll see some output. Look at that output carefully, as it will tell you how to access Jupyter via a web browser. For example, assume the output contains something like this: | |||||||
To access the notebook, open this file in a browser: file:///root/.local/share/jupyter/runtime/nbserver-1-open.html | ||||||||
Line: 67 to 67 | ||||||||
sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot | ||||||||
Changed: | ||||||||
< < | That $PWD (%CD% in WIndows) just means "the current directory." The execution environment within the container uses /work for its files; the -v option in the command means "map /work to the current directory in the terminal." If you'd like to use different directory on your computer as the work directory for the Docker container, just substitute $PWD . For example: | |||||||
> > | That $PWD (%CD% in WIndows) just means "the current directory." The execution environment within the container uses /work for its files; the -v option in the command means "map /work to the current directory in the terminal." If you'd like to use a different directory on your computer as the work directory for the Docker container, just substitute that directory for $PWD . For example: | |||||||
sudo docker run -p 8080:8080 -v ~jsmith/root-class:/work wgseligman/jupyter-pyroot | ||||||||
Line: 109 to 109 | ||||||||
A little bit web searching will show there are other ROOT containers available. For example: | ||||||||
Changed: | ||||||||
< < | docker run -p 3000:8080 pedwink/pyroot-notebook | |||||||
> > | sudo docker run -p 3000:8080 pedwink/pyroot-notebook | |||||||
That particular container uses Fedora 28 and ROOT 6.14, and it also offers Python 2 versions of its notebook kernels (wgseligman/jupyter-pyroot only offers Python 3). |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Jupyter/ROOT Containers | ||||||||
Line: 160 to 160 | ||||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
\ No newline at end of file |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Jupyter/ROOT Containers
DockerDocker![]() ![]() ![]() sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyroot(Windows users will probably need to use %CD% instead of $PWD .)
The first time you run this command, it will download a ~2.5GB container. Give it time.
Finally you'll see some output. Look at that output carefully, as it will tell you how to access Jupyter via web browser. For example, assume the output contains something like this:
To access the notebook, open this file in a browser: file:///root/.local/share/jupyter/runtime/nbserver-1-open.html Or copy and paste one of these URLs: http://649d0c4b4dc1:8080/?token=97d7242fc79734f1429bc425c627ccc4f586675c01ecdd9c or http://127.0.0.1:8080/?token=97d7242fc79734f1429bc425c627ccc4f586675c01ecdd9cThen start up a web browser and visit http://127.0.0.1:8080/?token=97d7242fc79734f1429bc425c627ccc4f586675c01ecdd9c . You'll see the standard Jupyter home page.
Changing the portConsider the command:sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyrootThat first 8080 is the port to use on your local computer. If you want to use a different port on your computer (for example, you're already using port 8080 for something else), change that first 8080 to a different port. Note that if you change the port, you'll also have to change the port in the URL in the output; e.g.,
sudo docker run -p 7000:8080 -v $PWD:/work wgseligman/jupyter-pyrootmeans you'll have to change: http://127.0.0.1:8080/?token=97d7242fc79734f1429bc425c627ccc4f586675c01ecdd9cto: http://127.0.0.1:7000/?token=97d7242fc79734f1429bc425c627ccc4f586675c01ecdd9c Changing the directoryAgain, consider:sudo docker run -p 8080:8080 -v $PWD:/work wgseligman/jupyter-pyrootThat $PWD (%CD% in WIndows) just means "the current directory." The execution environment within the container uses /work for its files; the -v option in the command means "map /work to the current directory in the terminal." If you'd like to use different directory on your computer as the work directory for the Docker container, just substitute $PWD . For example:
sudo docker run -p 8080:8080 -v ~jsmith/root-class:/work wgseligman/jupyter-pyroot Changing the containerYou can useNew -> Terminal within Jupyter to get a shell. Within that shell, you can modify anything within the container you want; for example, you can use pip3![]() ![]() ![]() sudo docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1105371318e8 wgseligman/jupyter-pyroot "jupyter notebook ..." 13 minutes ago Up 13 minutes 0.0.0.0:7000->8080/tcp cranky_albattaniYour output will be different; you'll have different CONTAINER ID and NAMES . Commit a revised container using your own image name:
sudo docker commit 1105371318e8 $USER/jupyter-pyrootYou'll can see your new image with the docker images ![]() $USER is "jsmith":
sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE jsmith/jupyter-pyroot latest 97ca601cbf9c 7 seconds ago 2.66 GB docker.io/wgseligman/jupyter-pyroot latest 16c3bbdc8144 17 hours ago 2.66 GBFrom that point forward, you'll probably want to run your new container with your changes: sudo docker run -p 8080:8080 -v $PWD:/work jsmith/jupyter-pyroot Docker container notesWilliamSeligman prepared the container wgseligman/jupyter-pyroot to be similar to the environment of the notebook server; for example, it runs the same version of the OS and of ROOT (as of Feb-2020, that's CentOS 7 and ROOT 6.18.04). A little bit web searching will show there are other ROOT containers available. For example:docker run -p 3000:8080 pedwink/pyroot-notebookThat particular container uses Fedora 28 and ROOT 6.14, and it also offers Python 2 versions of its notebook kernels (wgseligman/jupyter-pyroot only offers Python 3). So if you can't find the feature you want in wgseligman/jupyter-pyroot, hunt around a bit. It's probably out there. SingularityIf you don't have admin access to your local computer, or you simply prefer it, you can use Singularity![]() .sif format:
singularity pull docker://wgseligman/jupyter-pyrootAfter some processing, you'll have the image file jupyter-pyroot_latest.sif . Then you can run Singularity on that container:
singularity run --bind=$PWD:/work jupyter-pyroot_latest.sifNote that while you can change the mapping of the /work directory within the container (see above), you can't change Jupyter's binding to port 8080. This might be a problem if you're running on a shared computer system and more than one user wants to run this container at the same time.
AnacondaDocker and Singularity are OS-level containers (in contrast to emulators like VMware, which are machine-level containers). Anaconda![]() ![]() conda create --name jupyter-pyroot jupyter python rootHowever, I've found this method to be unreliable. Typically there's no problem with jupyter or python, but installing ROOT via Anaconda is hit-or-miss. Assuming you succeed, you can run the jupyter command as described near the bottom of the notebook server page; e.g.,:
jupyter notebookor if you want control of the port: jupyter notebook --no-browser --port=XXXX The hard wayIf all other methods fail, you can embark on the adventure of compiling these packages on your own. You can install Python![]() ![]() ![]()
|