1: 2020-08-18 (火) 20:20:25 iseki |
2: 2020-08-18 (火) 22:11:14 iseki |
| ** JupyterHub [#mb71944e] | | ** JupyterHub [#mb71944e] |
- | - Jupyterサーバー(ユーザ認証機能つき) | + | - マルチユーザのための [[Jupyter]] サーバー(ユーザ認証機能つき) |
| - https://horomary.hatenablog.com/entry/2019/11/09/181614 | | - https://horomary.hatenablog.com/entry/2019/11/09/181614 |
| #br | | #br |
| | | |
- | *** INSTALL [#nfb5f43c] | + | ** INSTALL [#nfb5f43c] |
- | (base) conda create -n jupyterhub python=3.8 -y | + | **** main には conda を使用 [#z4c989ab] |
- | (base) conda activate jupyterhub | + | (base) # conda create -n jupyterhub python=3.8 -y |
- | (jupyterhub) conda install -c conda-forge notebook -y | + | (base) # conda activate jupyterhub |
- | (jupyterhub) conda install -c conda-forge jupyterlab -y | + | (jupyterhub) # conda install -c conda-forge notebook -y |
- | (jupyterhub) conda install -c conda-forge jupyterhub -y | + | (jupyterhub) # conda install -c conda-forge jupyterlab -y |
- | (jupyterhub) conda install -c conda-forge voila -y | + | (jupyterhub) # conda install -c conda-forge jupyterhub -y |
- | (jupyterhub) conda install jupyter_client -y | + | (jupyterhub) # conda install -c conda-forge voila -y |
| + | (jupyterhub) # conda install jupyter_client -y |
| | | |
- | (jupyterhub) git clone https://github.com/jupyterhub/nativeauthenticator.git | + | (jupyterhub) # git clone https://github.com/jupyterhub/nativeauthenticator.git (認証モジュール:オプション) |
- | (jupyterhub) pip install -e nativeauthenticator | + | (jupyterhub) # pip install -e nativeauthenticator (認証モジュール:オプション) |
- | (jupyterhub) pip install dockerspawner | + | (jupyterhub) # pip install dockerspawner |
| #br | | #br |
| | | |
- | *** 設定 [#idb49705] | + | ** 設定 [#idb49705] |
| - jupyterhub --generate-config を実行すると カレントディレクトリに設定ファイル ''jupyterhub_config.py'' が生成される. | | - jupyterhub --generate-config を実行すると カレントディレクトリに設定ファイル ''jupyterhub_config.py'' が生成される. |
| - 個人的には jupyterhub が /usr/local 以下にある場合は /usr/local/etc/jupyterhub 以下に置く. | | - 個人的には jupyterhub が /usr/local 以下にある場合は /usr/local/etc/jupyterhub 以下に置く. |
| + | - 設定ファイルは拡張子が .py でないと,読み込まれない場合がある? |
| + | #br |
| + | *** Authenticator Class (authenticator_class) [#g1e9cdae] |
| + | **** auth.DummyAuthenticator [#g40f4bb4] |
| + | - その名の通りダミー.認証無し. |
| + | - 全てのユーザを許可する.(一応パスワード入力欄は表示される) |
| + | #br |
| + | **** jupyterhub.auth.PAMAuthenticator (default) [#n3acea52] |
| + | - 認証に[[PAM]]を使用する.恐らくサービスは login |
| + | - バグあり. [[Trouble Shooting>#rf83821d]] 参照. |
| #br | | #br |
| | | |
- | *** 実行 [#a826d7f6] | + | **** nativeauthenticator.NativeAuthenticator [#u43dca72] |
- | (base) conda activate jupyterhub | + | - 追加モジュール(オプション) |
- | (jupyterhub) jupyterhub --no-ssl -f /usr/local/etc/jupyterhub/jupyterhub_config.py | + | - 詳細は検証中 |
| + | #br |
| | | |
- | **** 使用ポート [#me192c34] | + | **** LDAP [#n1c54d11] |
- | - 8000 | + | - LDap 認証用. |
- | - 8081 | + | - 書きかけ |
| + | - モジュールのInstall |
| + | (jupyterhub) # conda install -c conda-forge jupyterhub-ldapauthenticator -y |
| + | #br |
| + | |
| + | *** Spawner Class (spawner_class) [#dded2dd0] |
| + | |
| + | **** jupyterhub.spawner.LocalProcessSpawner (default)[#ueaf7599] |
| + | - サーバに各ユーザの環境でアクセスできる |
| + | - 通常作業ディレクトリは /home/{username}/notebook (notebook は設定による) |
| + | #br |
| + | |
| + | **** jupyterhub.spawner.SimpleLocalProcessSpawner [#eb28d681] |
| + | - 名前がややこしい |
| + | - 詳細は不明(検証する気があまりない) |
| + | #br |
| + | |
| + | **** dockerspawner.DockerSpawner [#dc30b0cf] |
| + | - https://github.com/jupyterhub/dockerspawner.git |
| + | - サーバでユーザ毎に [[Docker]]でNoteBook コンテナを起動して接続. |
| + | - 作業ホームは /home/jovjan/work 固定(多分 Docker Image固定) |
| + | - Install |
| + | (jupyterhub) # pip --no-cache-dir install git+https://github.com/jupyterhub/dockerspawner.git |
| + | or |
| + | (jupyterhub) # pip install dockerspawner |
| + | #br |
| + | |
| + | **** dockerspawner.SwarmSpawner [#vad945d1] |
| + | - dockerspawner.DockerSpawner からの派生クラス |
| + | - DockerSpawner と同じパッケージ |
| + | - NoreBook コンテナを Docker-Compose で管理し,複数のサーバーのいずれかで実行できる. |
| + | - 検証中 |
| + | #br |
| + | |
| + | **** niicloudoperation/jupyterhub-singleuser [#ld71d218] |
| + | - https://github.com/NII-cloud-operation/CoursewareHub-LC_platform |
| + | - Document: https://github.com/nii-gakunin-cloud/ocs-templates |
| + | - NII開発.自由度低し(個人的感想).[[CoursewareHub]] 用 Spawner Class |
| + | - dockerspawner.SwarmSpawner からの派生クラス |
| + | - 検証中 |
| + | - INSTALL |
| + | (jupyterhub) # git clone https://github.com/NII-cloud-operation/CoursewareHub-LC_platform.git |
| + | (jupyterhub) # cd CoursewareHub-LC_platform/jupyterhub/spawner/coursewareuserspawner |
| + | (jupyterhub) # pip --no-cache-dir install . |
| #br | | #br |
| | | |
| *** jovyan って誰? [#w4a21247] | | *** jovyan って誰? [#w4a21247] |
- | - Docker を使用すると,作業ディレクトリが /home/jovyan/work 固定なのだが? | + | - DockerSpawner を使用すると,作業ディレクトリが /home/jovyan/work 固定なのだが? |
| - c.DockerSpawner.notebook_dir 辺りをいじっても変化しない? | | - c.DockerSpawner.notebook_dir 辺りをいじっても変化しない? |
| + | #br |
| + | |
| + | ** 実行 [#a826d7f6] |
| + | (base) # conda activate jupyterhub |
| + | (jupyterhub) # jupyterhub --no-ssl -f /usr/local/etc/jupyterhub/jupyterhub_config.py |
| + | |
| + | **** 使用ポート [#me192c34] |
| + | - 8000 |
| + | - 8081 |
| #br | | #br |
| | | |
| | | |
| *** JupyterHub: PAM使用時に 再login するとPAMの認証エラーになる. [#cec1cefc] | | *** JupyterHub: PAM使用時に 再login するとPAMの認証エラーになる. [#cec1cefc] |
| + | - 認証モジュールに jupyterhub.auth.PAMAuthenticator を使用した場合,再Loginで失敗 |
| + | -- c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' |
| - バグだろ. | | - バグだろ. |
| - Resolve: jupyterhub_config.py に ''c.PAMAuthenticator.open_sessions = False'' を追加する | | - Resolve: jupyterhub_config.py に ''c.PAMAuthenticator.open_sessions = False'' を追加する |
| - see: https://github.com/jupyterhub/jupyterhub/issues/486 | | - see: https://github.com/jupyterhub/jupyterhub/issues/486 |
| #br | | #br |