Using client tools in Jupyter notebook
You can use panda-client tools (pathena, prun, phpo, and pbook) in Jupyter notebook through the magic command interface, %command args.
First, you need to setup Jupyter interface as usual.
[ ]:
from pandaclient import panda_jupyter
panda_jupyter.setup()
Then, for example
[ ]:
%prun -h
gives
usage: prun [options]
HowTo is available at https://twiki.cern.ch/twiki/bin/view/PanDA/PandaRun
optional arguments:
-h, --help show this help message and exit
--helpGroup {PRINT,PRUN,CONFIG,INPUT,OUTPUT,JOB,BUILD,SUBMIT,EVTFILTER,EXPERT,CONTAINERJOB,ALL}
Print individual group help (the group name is not
case-sensitive), where "ALL" will print all groups
together. Some options such as --inOutDsJson may SPAN
several groups
Examples:
prun --exec "echo %IN > input.txt; root.exe; root -b -q macrotest.C" --athenaTag=22.0.0 --inDS ...
prun --exec "cpptest %IN" --bexec "make" --athenaTag=22.0.0 --inDS ...
prun --loadJson prunConfig.json # read all prun options from one json file
and
[ ]:
%prun -3 --exec ls --outDS user.hoge.`uuidgen` --vo sphenix
gives
INFO : gathering files under /Users/hoge/jupyter/home/panda
INFO : upload source files
INFO : submit user.hoge.73818405-09D2-4BA0-8186-E3EB22BC9AFD/
INFO : succeeded. new jediTaskID=473
respectively.
Note that it wold also be possible to call those tools as shell commands !command args, but they will be hang up if you need to enter information, such as passphrase, on the console. Especially this is the case for pbook, so you need to use %pbook instead of !pbook.
[ ]:
%pbook
Then you go into the interactive session and can use pbook commands on the command prompt.
PBook user: hoge
Start pBook 1.4.47
>>> show()
Showing only max 1000 tasks in last 14 days. One can set days=N to see tasks in last N days, and limit=M to see at most M latest tasks
JediTaskID Status Fin% TaskName
________________________________________________________________
23084322 done 100.0% user.hoge.61cdfaf1-5cea-4a94-8f38-f8f2eb035303/
23083910 done 100.0% user.hoge.f2b8736f-6471-4fe2-a0a0-13b67ee63ac0/
23083909 done 100.0% user.hoge.5db466a4-f04f-4a7a-94ba-80722f7f9639/
23012863 done 100.0% user.hoge.aeab8f8b-271a-4c63-9763-695d77d09b61/
23012862 done 100.0% user.hoge.f2ddc8cf-9892-410c-9d6d-5db577e84ebc/
>>> kill(475)
Kill command registered: reqID=475 will be killed soon.
[True]
>>>
Download notebook