Project

General

Profile

View metrics with jupyterlab » History » Version 10

Version 9 (Pengfei Ding, 10/14/2019 12:29 PM) → Version 10/12 (Pengfei Ding, 10/14/2019 03:38 PM)

h1. Getting setup with docker and jupyterlab

Assuming you have docker ready, the following commands will pull a script for starting a docker container (by default named as "metrics_nb"). In the container, an instance of jupyter notebook will be started automatically. The URL to the jupyter notebook instance will be displayed in your terminal.

<pre>
wget http://home.fnal.gov/~dingpf/artdaq/start_artdaq_metrics_nb.sh
chmod +x start_artdaq_metrics_nb.sh
</pre>

Once you get the container start script, you can pull down the notebook used for plotting metrics by:
<pre>
mkdir -p notebooks; cd notebooks
wget https://home.fnal.gov/~dingpf/artdaq/Plot_metrics-single_plot.ipynb
wget https://home.fnal.gov/~dingpf/artdaq/Plot_metrics-multi_plot.ipynb
cd ..
</pre>

Then run the container start script it with:
<pre>
# ./start_artdaq_metrics_nb.sh <metrics_dir_path> <notebook_dir_path> [notebook_name]
# e.g.
./start_artdaq_metrics_nb.sh /home/ron/work/artdaqPrj/demo2-develop/daqlogs/metrics ./notebooks
</pre>

Once the container is up, you can open a browser to the link displayed in your terminal. Open and run the "notebooks/Plot_metrics-single_plot.ipynb" notebook. There will be two drop-down boxes asking you which log file you want to parse and which metrics you want to plot.

You can test run this on sbn-daq02.fnal.gov as user "sbnd", "root" or add yourself to the "docker" group first. Remember to shutdown the container with (this message also gets printed out when starting up the container):



<pre>
docker rm -f [notebook_name] #default is metrics_nb
# replace "metrics_nb" with other name if you used a different one when starting up

</pre>