JupyterHub for Ubuntu Server 24[edit]

Install & Setup[edit]

Install[edit]

Python (pip)[edit]
export PIP_ROOT_USER_ACTION=ignore
add-apt-repository ppa:deadsnakes/ppa
apt update
apt install python3.11 python3.11-distutils
python3.11 -m ensurepip --upgrade
python3.11 -m pip install --upgrade pip       # これで pip 使用可
apt -y install npm
npm install -g configurable-http-proxy@4
Jupyter[edit]
apt remove python3-jsonschema
pip install jupyterhub==4.*    # JupyterHub5 は未サポート
pip install jupyterhub-ltiauthenticator
pip install dockerspawner
pip install notebook
pip install jupyterlab
pip install jupyterlab-language-pack-ja-JP
pip install jupyter_server_fileid
pip install jupyter_server_ydoc
pip install jinja2
pip install attrs
Docker[edit]
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctrl start docker     # or systemctl enable --now docker
LTIContainerSpawner[edit]
docker pull ghcr.io/jupyter-fumihax/jupyterhub-ltictr.singleuser
git clone https://github.com/jupyter-fumihax/lticontainerspawner
cd lticontainerspawner/
make

最小セットアップ[edit]

openssl (TEST用のサーバ証明書)[edit]
openssl req -x509 -newkey rsa:2048 -sha256 -days 365 -nodes \
   -keyout /etc/ssl/private/jupyterhub.key \
   -out /etc/ssl/certs/jupyterhub.crt \
   -subj "/CN=localhost"
Configure of LTIContainerSpawner[edit]
vi /usr/local/etc/ltictr/jupyterhub_lticontainer_config.py    # change my_ip_addr and ssl_server_cert, ssl_private_key

接続テスト[edit]

systemctl start jupyterhub

Options of Install[edit]

Culler[edit]
pip install wheel 
pip install pycurl
wget https://raw.githubusercontent.com/jupyterhub/jupyterhub/a6b7e303df03865d6420f6bccdf627b39f1d0dc1/examples/cull-idle/cull_idle_servers.py
cp cull_idle_servers.py /usr/local/bin
chmod a+rx /usr/local/bin/cull_idle_servers.py
vi /usr/local/etc/ltictr/jupyterhub_lticontainer_config.py      # Culler を有効にする

Trouble Shooting[edit]

JupyterHub のバージョンを変更[edit]
jupyterhub upgrade-db

または

\rm /var/lib/jupyterhub/*

トップ   新規 ページ一覧 検索 最終更新   ヘルプ   最終更新のRSS