flagflag  
1: 2020-08-18 (Tue) 20:20:25 iseki source 2: 2020-08-18 (Tue) 22:11:14 iseki source
Line 1: Line 1:
** JupyterHub [#mb71944e] ** JupyterHub [#mb71944e]
-- Jupyterサーバー(ユーザ認証機能つき)+- マルチユーザのための [[Jupyter]] サーバー(ユーザ認証機能つき)
- https://horomary.hatenablog.com/entry/20​19/11/09/181614 - https://horomary.hatenablog.com/entry/20​19/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/nativeauth​enticator.git + (jupyterhub) # git clone https://github.com/jupyterhub/nativeauth​enticator.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_con​fig.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.SimpleLocalProcessSpa​wner [#eb28d681] 
 +- 名前がややこしい 
 +- 詳細は不明(検証する気があまりない) 
 +#br 
 + 
 +**** dockerspawner.DockerSpawner [#dc30b0cf] 
 +- https://github.com/jupyterhub/dockerspaw​​ner.git 
 +- サーバでユーザ毎に [[Docker]]でNoteBook コンテナを起動して接続. 
 +- 作業ホームは /home/jovjan/work 固定(多分 Docker Image固定) 
 +- Install 
 + (jupyterhub) # pip --no-cache-dir install git+https://github.com/jupyterhub/docker​spawner.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/C​oursewareHub-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/C​oursewareHub-LC_platform.git 
 + (jupyterhub) # cd CoursewareHub-LC_platform/jupyterhub/spa​wner/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_con​fig.py
 +
 +**** 使用ポート [#me192c34]
 +- 8000
 +- 8081
#br #br
Line 40: Line 104:
*** 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


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthMay 2024Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Today

Who's Online

41 user(s) are online (8 user(s) are browsing xpwiki)

Members: 0
Guests: 41

more...

Access Counter

Today : 5601560156015601
Yesterday : 1361113611136111361113611
Total : 2364400823644008236440082364400823644008236440082364400823644008
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com