Project

General

Profile

View metrics with jupyterlab » History » Version 8

Pengfei Ding, 10/07/2019 03:50 PM

1 8 Pengfei Ding
h1. Getting setup with docker and jupyterlab
2 1 Ron Rechenmacher
3 5 Pengfei Ding
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.
4 1 Ron Rechenmacher
5 1 Ron Rechenmacher
<pre>
6 6 Ron Rechenmacher
wget http://home.fnal.gov/~dingpf/artdaq/start_artdaq_metrics_nb.sh
7 7 Ron Rechenmacher
chmod +x start_artdaq_metrics_nb.sh
8 1 Ron Rechenmacher
</pre>
9 1 Ron Rechenmacher
10 5 Pengfei Ding
Once you get the container start script, you can pull down the notebook used for plotting metrics by:
11 1 Ron Rechenmacher
<pre>
12 5 Pengfei Ding
mkdir -p notebooks; cd notebooks
13 5 Pengfei Ding
wget https://home.fnal.gov/~dingpf/artdaq/Plot_metrics-single_plot.ipynb
14 5 Pengfei Ding
cd ..
15 5 Pengfei Ding
</pre>
16 5 Pengfei Ding
17 5 Pengfei Ding
Then run the container start script it with:
18 5 Pengfei Ding
<pre>
19 1 Ron Rechenmacher
# ./start_artdaq_metrics_nb.sh <metrics_dir_path> <notebook_dir_path> [notebook_name]
20 4 Pengfei Ding
# e.g.
21 5 Pengfei Ding
./start_artdaq_metrics_nb.sh /home/ron/work/artdaqPrj/demo2-develop/daqlogs/metrics ./notebooks
22 1 Ron Rechenmacher
</pre>
23 1 Ron Rechenmacher
24 1 Ron Rechenmacher
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. 
25 8 Pengfei Ding
26 8 Pengfei Ding
You can test run this on sbn-daq02.fnal.gov as user "sbnd", "root" or add yourself to the "docker" group first.