From T3_KR_KNU
| Line 24: | Line 24: | ||
==== 사용자 커널 추가하기 ==== | ==== 사용자 커널 추가하기 ==== | ||
* | * 커널 디렉토리 생성 | ||
mkdir -p ~/.local/share/jupyter/kernels/python3-pyroot-user | |||
* | * kernel.json 생성 | ||
cat > ~/.local/share/jupyter/kernels/python3-pyroot-user/kernel.json <<'EOF' | |||
{ | |||
"argv": [ | |||
"bash", | |||
"-lc", | |||
"source /cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/setup.sh && exec /opt/jupyterhub/user/bin/python -m ipykernel_launcher -f {connection_file}" | |||
], | |||
"display_name": "Python 3 + PyROOT (user)", | |||
"language": "python" | |||
} | |||
EOF | |||
* 확인 | |||
jupyter kernelspec list | |||
* | |||
* 커널 삭제 | * 커널 삭제 | ||
jupyter kernelspec uninstall mykernel | |||
=== HTCondor Python API === | === HTCondor Python API === | ||
Revision as of 07:34, 30 April 2026
JupyterHub
소개
- jupyterhub는 jupyter notebook을 다중 사용자가 사용할 수 있도록 만들어진 환경입니다.
- 아래 주소를 이용하여 경북대 Tier3 jupyterhub에 접속할 수 있습니다.
- https://cms.knu.ac.kr:8000
커널
- 노트북 커널은 노트북 문서에 포함 된 코드를 실행하는 "계산 엔진"입니다.
기본 제공 커널
Python 3
- python 3.9.25
Python 3 + PyROOT
- python 3.11.9
- ROOT 6.32.02
사용자 커널 추가하기
- 커널 디렉토리 생성
mkdir -p ~/.local/share/jupyter/kernels/python3-pyroot-user
- kernel.json 생성
cat > ~/.local/share/jupyter/kernels/python3-pyroot-user/kernel.json <<'EOF'
{
"argv": [
"bash",
"-lc",
"source /cvmfs/sft.cern.ch/lcg/views/LCG_106/x86_64-el9-gcc13-opt/setup.sh && exec /opt/jupyterhub/user/bin/python -m ipykernel_launcher -f {connection_file}"
],
"display_name": "Python 3 + PyROOT (user)",
"language": "python"
}
EOF
- 확인
jupyter kernelspec list
- 커널 삭제
jupyter kernelspec uninstall mykernel
HTCondor Python API
- HTCondor Python API를 이용하면 jupyter 환경에서 htcondor 를 사용할수 있습니다.
- HTCondor Python Bindings Tutorials
- Submitting and Managing Jobs
- Advanced Job Submission and Management
- 위 문서중에 있는 [launch binder]를 클릭하면 해당 예제를 실습해볼수 있습니다.
ROOT
- C++ ROOT
TCanvas c;
TH1F h("h","ROOT Histo;X;Y",64,-4,4);
h.FillRandom("gaus");
h.Draw();
c.Draw();
- Python ROOT
import ROOT
c = ROOT.TCanvas("c")
h = ROOT.TH1F("h","ROOT Histo;X;Y",64,-4,4)
%%cpp
h->FillRandom("gaus");
h->Draw();
c->Draw();
tensorflow
- 현재 jupyterhub에서는 tensoflow cpu 만 사용할 수 있습니다.
- tensorflow gpu의 사용을 위해서는 기존과 같이 htcondor를 이용해야합니다.