Micah P. Dombrowski / Jul 21 2018

JupyterPIC Plasma Physics Simulation Setup

Setup for notebooks using the UCLA Plasma Physics Simulation Group's JupyterPIC codes. This is adapted from the dockerfiles for JupyterPIC and jupyter/scipy-notebook.

HS_ROOT, PATH, and PYTHONPATH set via environment variable config.

Install required system packages. The Osiris PIC binary requires versions of the libhdf5 and openmpi libraries which are in the Xenial repo.

echo 'deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe' > \
  /etc/apt/sources.list.d/xenial.list
  
apt-get update > /dev/null
apt-get install -y --no-install-recommends \
  ffmpeg \
  libhdf5-openmpi-10 libopenmpi1.10 \
  libopenmpi-dev=1.10.\* libhdf5-openmpi-dev=1.8.\* \
  openmpi-bin=1.10.\* openmpi-common=1.10.\* \
  gfortran gcc-4.8 \
  git

apt-get clean
rm -rf /var/lib/apt/lists/*

Python packages. Note h5py v2.8 breaks some utility scripts, so we'll hold back.

conda install -y jupyter \
  'dill>=0.2' 'cloudpickle>=0.1' 'h5py=2.7.1' 'cython>=0.23' 'numba>=0.23'  \
  'pandas>=0.17' 'seaborn>=0.7' 'statsmodels>=0.6' 'patsy>=0.4' \
  'scikit-learn>=0.17' 'scikit-image>=0.11' 'scipy>=0.17' 'sympy>=0.7' \
  'ipywidgets>=4.1' 'matplotlib>=1.5' 'bokeh>=0.11'

conda clean -tipsy

Download JupyterPIC.

git clone https://github.com/UCLA-Plasma-Simulation-Group/JupyterPIC

Set up directory and code structure.

mkdir /usr/local/osiris
mkdir /usr/local/beps
mkdir /usr/local/quickpic

cd JupyterPIC
cp bin/osiris-1D.e /usr/local/osiris/osiris-1D.e
cp bin/upic-es.out /usr/local/beps/upic-es.out
cp bin/qpic.e /usr/local/quickpic/qpic.e
cp analysis/osiris.py /usr/local/osiris/osiris.py
cp analysis/combine_h5_util_1d.py /usr/local/osiris/combine_h5_util_1d.py
cp analysis/combine_h5_util_2d.py /usr/local/osiris/combine_h5_util_2d.py
cp analysis/analysis.py /usr/local/osiris/analysis.py
cp analysis/h5_utilities.py /usr/local/osiris/h5_utilities.py
cp analysis/str2keywords.py /usr/local/osiris/str2keywords.py
cp analysis/quickpic.py /usr/local/quickpic/quickpic.py
cp -a notebooks /notebooks

chmod -R 711 /usr/local/osiris/osiris-1D.e
chmod -R 711 /usr/local/beps/upic-es.out
chmod -R 711 /usr/local/quickpic/qpic.e
chmod -R 777 /notebooks

cd /
rm -r JupyterPIC