{"id":46179,"date":"2023-09-03T02:05:51","date_gmt":"2022-12-24T22:41:03","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/"},"modified":"2024-04-30T21:18:26","modified_gmt":"2024-04-30T13:18:26","slug":"46179-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/","title":{"rendered":""},"content":{"rendered":"<h1>\u306f\u3058\u3081\u306b<\/h1>\n<p>JupyterHub\u306fJupyter Notebook\u3068\u3044\u3046Python\u306a\u3069\u3092WEB\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3092\u8907\u6570\u30e6\u30fc\u30b6\u30fc\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u304c\u3001GitHub\u306e\u8a8d\u8a3c\u3092\u5229\u7528\u3057\u3066\u306e\u30ed\u30b0\u30a4\u30f3\u3084Django\u306eShell\u74b0\u5883\u3068\u3046\u307e\u304f\u63a5\u7d9a\u3059\u308b\u60c5\u5831\u304c\u65ad\u7247\u7684\u306b\u306f\u3042\u308a\u3064\u3064\u3082\u307e\u3068\u307e\u3063\u305f\u60c5\u5831\u304c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u3002<br \/>\nAWS\u306eELB\/EC2\/RDS\u3092\u5229\u7528\u3057\u3066\u3001Web\u30b5\u30fc\u30d0\u30fc\u306b\u306fnginx\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u3057\u3066\u306f\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306eDjango\u74b0\u5883\u3092\u3059\u3067\u306b\u69cb\u7bc9\u3057\u3066\u308b\u3093\u3060\u3051\u3069\u305d\u308c\u3092WEB\u4e0a\u304b\u3089\u3055\u304f\u3063\u3068\u89e6\u308c\u308b\u74b0\u5883\u304c\u6b32\u3057\u3044\u30fb\u30e6\u30fc\u30b6\u30fc\u6bce\u306b\u74b0\u5883\u3092\u5207\u308a\u5206\u3051\u3066\u4f7f\u3044\u305f\u3044\u3051\u3069\u8907\u96d1\u306a\u8a8d\u8a3c\u306e\u4ed5\u7d44\u307f\u3092\u4f5c\u308a\u8fbc\u3093\u3060\u308a\u306f\u3057\u305f\u304f\u306a\u3044\u3063\u3066\u5834\u5408\u306b\u4fbf\u5229\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d636337434c4406d02059\/3-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2017-02-19 15.47.47.png\" \/><\/div>\n<p>\u203b\u74b0\u5883\u69cb\u7bc9\u6642\u306e\u30ed\u30b0\u3092\u5143\u306b\u624b\u9806\u3092\u307e\u3068\u3081\u305f\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u6a29\u9650\u306e\u8a2d\u5b9a\u306a\u3069\u4e00\u90e8\u6f0f\u308c\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u518d\u73fe\u3057\u3066\u307f\u3066\u3046\u307e\u304f\u52d5\u4f5c\u3057\u306a\u3044\u306a\u3069\u3042\u308a\u307e\u3057\u305f\u3089\u30b3\u30e1\u30f3\u30c8\u306a\u3069\u3067\u6559\u3048\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002\u307e\u305f\u3001\u3082\u3063\u3068\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u74b0\u5883\u69cb\u7bc9\u624b\u9806\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u305d\u3061\u3089\u3082\u3042\u308a\u307e\u3057\u305f\u3089\u3001\u3001\u3001<\/p>\n<h2>\u52d5\u4f5c\u306e\u6d41\u308c<\/h2>\n<p>\u3059\u3054\u304f\u3056\u3063\u304f\u308a\u3068\u8a00\u3046\u3068\u4ee5\u4e0b\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>http:\/\/jupyter.example.jp\/ \u306b\u30a2\u30af\u30bb\u30b9\uff08BASIC\u8a8d\u8a3c\u306a\u3069\u4ed8\u3051\u3066\u304a\u3044\u305f\u65b9\u304c\u3044\u3044\u3067\u3059\uff09<br \/>\nnginx\u304c\u51e6\u7406\u3092\u53d7\u3051\u3066127.0.0.1:8000\u3067\u52d5\u4f5c\u3057\u3066\u3044\u308bJupyterHub\u306bproxy\u3059\u308b<br \/>\nGitHub\u3067\u8a8d\u8a3c\u3092\u884c\u3046\u3068Jupyter Notebook\u3092\u64cd\u4f5c\u3067\u304d\u308b<br \/>\nJupyter Notebook\u306fKernel\u3068\u3057\u3066Django\u306e\u30d7\u30ed\u30bb\u30b9\u3068\u3064\u306a\u3044\u3067\u52d5\u4f5c\u3059\u308b\u305f\u3081\u3059\u3050\u306bDB\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd<\/p>\n<h2>\u6b8b\u8ab2\u984c:SSL\u74b0\u5883\u304c\u69cb\u7bc9\u3067\u304d\u3066\u3044\u306a\u3044<\/h2>\n<p>\u3084\u308a\u65b9\u306f\u3042\u308b\u3093\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001https\u63a5\u7d9a\u306b\u3059\u308b\u3068\u3001ELB\u3067SSL\u2192nginx\u2192Virtualenv\u4e0a\u306eTornade\u3067JupyterHub\u3068\u3044\u3046\u69cb\u6210\u306b\u3057\u305f\u6642\u306b\u3001notebook\u3067Django\u306eKernel\u306b\u6307\u5b9a\u3057\u305f\u969b\u306eAttach\u306b\u5931\u6557\u3059\u308b\u3068\u3044\u3046\u554f\u984c\u306b\u3042\u305f\u308a\u307e\u3057\u305f\u3002<br \/>\nhttp\u30a2\u30af\u30bb\u30b9\u3060\u3068\u3060\u3044\u3058\u3087\u3046\u3076\u306a\u3093\u3067\u3059\u304cJupyterHub\u306b\u5185\u90e8\u3067\u306fhttp\u3067\u3042\u308b\u65e8\u6559\u3048\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u304b\u3001\u306a\u306b\u304b\u4ed6\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u305d\u3046\u3067\u3059\u3002<br \/>\nGitHub\u3068\u306e\u9023\u643a\u306a\u3069\u5916\u90e8\u3068\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308b\u306e\u3067https\u306b\u3059\u3079\u304d\u306a\u306e\u3067\u3059\u304c\u305d\u3053\u307e\u3067\u884c\u304d\u7740\u304b\u305a\u3061\u3087\u3063\u3068\u6b8b\u5ff5\u3067\u3059\u304c\u3002<\/p>\n<h1>\u74b0\u5883\u69cb\u7bc9\u624b\u9806<\/h1>\n<h2>\u5168\u4f53\u69cb\u6210<\/h2>\n<p>\u79c1\u304c\u5229\u7528\u3057\u3066\u3044\u308b\u74b0\u5883\u3067\u306f\u3001\u672c\u756a\u30b5\u30fc\u30d0\u30fc\u306eDB\u3092Daily\u3067\u30de\u30b9\u30af\u3057\u3066\u5225RDS\u306b\u683c\u7d0d\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30c6\u30b9\u30c8\/\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3067\u306f\u305d\u306e\u30de\u30b9\u30afDB\u3092Django\u304b\u3089\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u672c\u8cc7\u6599\u3067\u306f\u305d\u306eRDS\u306b\u5bfe\u3057\u3066Django\u3067\u64cd\u4f5c\u3059\u308b\u74b0\u5883\u3092JupyterHub\u3092\u901a\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3092Goal\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d636337434c4406d02059\/13-0.png\" alt=\"JupyterHub\u5168\u4f53\u69cb\u6210\" \/><\/div>\n<h2>\u74b0\u5883\u306b\u95a2\u3059\u308b\u524d\u63d0<\/h2>\n<p>\/var\/www\/jupyter.example.jp\/ \u4ee5\u4e0b\u306bDjango\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u524d\u63d0\u3067\u3059\u3002<br \/>\n\u95a2\u4fc2\u3042\u308a\u305d\u3046\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u3092\u4e00\u90e8\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>\/var\/www\/jupyter.example.jp\/\r\n\u251c\u2500\u2500 README.md\r\n\u251c\u2500\u2500 jupyter  # \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b3\u30fc\u30c9\u3092\u914d\u7f6e(\u3053\u306e\u4e0b\u306bmanage.py\u304c\u3042\u308b)\r\n\u251c\u2500\u2500 requirements.txt\r\n\u251c\u2500\u2500 virtualenv\r\n<\/code><\/pre>\n<p>virtualenv\u74b0\u5883\u306bDjango\u304c\u3059\u3067\u306b\u5165\u3063\u3066\u304a\u308a\u3001shell_plus\u3092\u5229\u7528\u3057\u3066Model\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306bdjango-extensions\u304c\u5165\u3063\u3066\u3044\u308b\u524d\u63d0\u3067\u9032\u3081\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>virtualenv\u74b0\u5883\u306f\u4ee5\u4e0b\u306a\u611f\u3058\u3067\u5165\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>cd \/var\/www\/jupyter.example.jp\/\r\nvirtualenv --prompt \"(jupyter)\" virtualenv\r\n<\/code><\/pre>\n<p>\u307e\u305f\u3001JupyterHub\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f \/etc\/jupyterhub \u4ee5\u4e0b\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<h2>JupyterHub\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u4f5c\u6210<\/h2>\n<p>JupyterHub\u306fjupyterhub\u30e6\u30fc\u30b6\u30fc\u3067\u64cd\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo useradd jupyterhub\r\nsudo usermod -a -G shadow jupyterhub\r\nsudo mkdir \/etc\/jupyterhub\r\nsudo chown jupyterhub \/etc\/jupyterhub\r\n<\/code><\/pre>\n<h2>JupyterHub\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>jupyterhub\/jupyterhub: Multi-user server for Jupyter notebooks\u306e\u307e\u307e\u9032\u3081\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo apt-get install npm nodejs-legacy\r\nsudo npm install -g configurable-http-proxy\r\n(virtualenv\u74b0\u5883\u4ee5\u4e0b\u306bpip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb)\r\npip install ipython jupyterhub\r\n<\/code><\/pre>\n<p>\uff08npm\u3084node\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u4ed5\u65b9\u3001\u3001\u53e4\u3044\u3088\u3046\u306a\u6c17\u3082\u3057\u3064\u3064\uff09<\/p>\n<p>JupyterHub\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/p>\n<pre class=\"post-pre\"><code>jupyterhub --generate-config\r\n\/etc\/jupyterhub\/jupyterhub_config.py \u306b\u79fb\u52d5\u3057\u3066\u4ee5\u4e0b\u306e\u7b87\u6240\u3092\u4fee\u6b63\r\n\r\nL.137\u4ed8\u8fd1\r\nc.JupyterHub.ip = '127.0.0.1'\r\n\r\nL. 106\u4ed8\u8fd1\r\nc.JupyterHub.cookie_secret_file = '\/etc\/jupyterhub\/jupyterhub_cookie_secret'\r\nc.JupyterHub.db_url = '\/etc\/jupyterhub\/jupyterhub.sqlite'\r\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1ahttp:\/\/jupyterhub.readthedocs.io\/en\/latest\/config-examples.html<\/p>\n<h2>GitHub\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306e\u30ed\u30b0\u30a4\u30f3<\/h2>\n<p>JupyterHub\u304b\u3089Oauth\u3067GitHub\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>pip install oauthenticator\r\n<\/code><\/pre>\n<p>jupyterhub_config.py\u306eL.58\u304f\u3089\u3044\u306b\u4ee5\u4e0b\u8ffd\u52a0<\/p>\n<pre class=\"post-pre\"><code>c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator'\r\nc.GitHubOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL']\r\nc.GitHubOAuthenticator.client_id = os.environ['GITHUB_CLIENT_ID']\r\nc.GitHubOAuthenticator.client_secret = os.environ['GITHUB_CLIENT_SECRET']\r\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1a https:\/\/github.com\/jupyterhub\/oauthenticator<\/p>\n<h2>Spawner<\/h2>\n<p>Spawner\u304c\u3069\u3046\u3044\u3063\u305f\u6982\u5ff5\u304b\u6df1\u304f\u7406\u89e3\u3067\u304d\u3066\u3044\u308b\u308f\u3051\u3067\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30d7\u30ed\u30bb\u30b9\u306e\u7ba1\u7406\u306e\u305f\u3081\u306bJupyterHub\u3067\u5229\u7528\u3059\u308bSpawner\u3092\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u203b\u4eca\u56deSudoSpawner\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3088\u308a\u9069\u5207\u306a\u3082\u306e\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u53c2\u8003: http:\/\/jupyterhub.readthedocs.io\/en\/latest\/spawners.html<\/p>\n<pre class=\"post-pre\"><code>pip install git+https:\/\/github.com\/jupyter\/sudospawner\r\n<\/code><\/pre>\n<p>jupyterhub_config.py\u306eL.220\u4ed8\u8fd1\u306b\u4ee5\u4e0b\u3092\u8a18\u8ff0<\/p>\n<pre class=\"post-pre\"><code>c.JupyterHub.confirm_no_ssl = True\r\nc.JupyterHub.spawner_class = 'sudospawner.SudoSpawner'\r\nc.Spawner.notebook_dir = '~\/notebooks'\r\n\r\nc.SudoSpawner.sudospawner_path = '\/var\/www\/jupyter.example.jp\/virtualenv\/bin\/sudospawner'\r\n<\/code><\/pre>\n<p>sudo visudo\u3067\u672b\u5c3e\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"post-pre\"><code>## Jupyterhub\r\n# comma-separated whitelist of users that can spawn single-user servers\r\nRunas_Alias JUPYTER_USERS = \u5229\u7528\u3059\u308bGitHub\u30e6\u30fc\u30b6\u30fc\u540d(\u30ab\u30f3\u30de\u533a\u5207\u308a)\r\n\r\n# the command(s) the Hub can run on behalf of the above users without needing a password# the exact pa$\r\nCmnd_Alias JUPYTER_CMD = \/var\/www\/jupyter.example.jp\/virtualenv\/bin\/sudospawner\r\n\r\n# actually give the Hub user permission to run the above command on behalf# of the above users without$\r\njupyterhub ALL=(JUPYTER_USERS) NOPASSWD:JUPYTER_CMD\r\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1ahttp:\/\/qiita.com\/mt08\/items\/301f9fb93d01e78bda47<br \/>\n\u203bLinux\u30e6\u30fc\u30b6\u30fc\u540d\uff1dGitHub\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u306a\u3093\u3089\u304b\u30de\u30c3\u30d4\u30f3\u30b0\u30ed\u30b8\u30c3\u30af\u304c\u4f5c\u308c\u308b\u3068\u5e78\u305b\u3067\u3059\u304c\u305d\u3053\u307e\u3067\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093<\/p>\n<h2>JupyterHub\u8d77\u52d5<\/h2>\n<p>\u3053\u3053\u307e\u3067\u306e\u8a2d\u5b9a\u3067\u3001JupyterHub\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3055\u305b\u308b\u3053\u3068\u306f\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u3066\u8d77\u52d5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo -u jupyterhub vi \/etc\/jupyterhub\/launch_notebook.sh\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>#!\/bin\/bash\r\n\r\nexport OAUTH_CALLBACK_URL=http:\/\/jupyter.example.jp\/hub\/oauth_callback\r\nexport GITHUB_CLIENT_ID=xxx\r\nexport GITHUB_CLIENT_SECRET=xxx\r\n\r\nsource \/var\/www\/jupyter.example.jp\/virtualenv\/bin\/activate\r\njupyterhub -f \/etc\/jupyterhub\/jupyterhub_config.py\r\n<\/code><\/pre>\n<p>GitHub\u9023\u643a\u306e\u305f\u3081\u306b\u5fc5\u8981\u306aCLIENT_ID\u3068CLIENT_SECRET\u306f\u4ee5\u4e0b\u304b\u3089\u53d6\u5f97\u53ef\u80fd\u3067\u3059\u3002<br \/>\nhttps:\/\/github.com\/settings\/applications\/new<br \/>\n\u203b\u74b0\u5883\u5909\u6570\u306f\u5916\u3060\u3057\u3059\u3079\u304d\u3060\u3068\u306f\u601d\u3044\u307e\u3059\u304c\u3001\u3001<\/p>\n<p>\u3053\u308c\u3067<\/p>\n<pre class=\"post-pre\"><code>sudo -u jupyterhub \/etc\/jupyterhub\/launch_notebook.sh\r\n<\/code><\/pre>\n<p>\u3068\u5b9f\u884c\u3059\u308c\u3070 http:\/\/127.0.0.1:8000\/ \u3067JupyterHub\u304c\u8d77\u52d5\u3059\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<h2>nginx\u306e\u8a2d\u5b9a<\/h2>\n<p>JupyterHub\u304c\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u308c\u3070\u6b21\u306fELB\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u6d41\u3057\u3066\u3042\u3052\u307e\u3059\u3002<br \/>\nnginx\u306f80\u756a\u30dd\u30fc\u30c8\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u53d7\u3051\u3066\u3001JupyterHub\u3067\u51e6\u7406\u3059\u3079\u304d\u3082\u306e\u3067\u3042\u308c\u30708000\u756a\u30dd\u30fc\u30c8\u306b\u6d41\u3059proxy\u3068\u3057\u3066\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo vi vi \/etc\/nginx\/nginx.conf\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>http {\r\n    map $http_upgrade $connection_upgrade {\r\n        default upgrade;\r\n        ''      close;\r\n    }\r\n    ...\r\n<\/code><\/pre>\n<p>\/etc\/nginx\/sites-enabled\/ \u4ee5\u4e0b\u306bjupyter.example.jp\u7528\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3059\u308bconf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u4f8b\uff1ajupyter.example.jp.conf\uff09<\/p>\n<pre class=\"post-pre\"><code>server {\r\n    listen 80;\r\n    server_name jupyter.example.jp;\r\n\r\n    # HTTPS\u63a5\u7d9a\u74b0\u5883\u304c\u3067\u304d\u305f\u3089\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u6709\u52b9\u5316\u3057\u305f\u3044\r\n    # add_header Strict-Transport-Security max-age=15768000;\r\n\r\n    # Managing literal requests to the JupyterHub front end\r\n    location \/ {\r\n        proxy_pass http:\/\/127.0.0.1:8000;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n    }\r\n\r\n    # Managing WebHook\/Socket requests between hub user servers and external proxy\r\n    location ~* \/(api\/kernels\/[^\/]+\/(channels|iopub|shell|stdin)|terminals\/websocket)\/? {\r\n        proxy_pass http:\/\/127.0.0.1:8000;\r\n\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        # WebSocket support\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection $connection_upgrade;\r\n    }\r\n}\r\n<\/code><\/pre>\n<h2>GitHub\u7d4c\u7531\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h2>\n<p>Linux\u30e6\u30fc\u30b6\u30fc\u3067\u5229\u7528\u3059\u308bGitHub\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u540c\u3058\u3082\u306e\u304c\u3059\u3067\u306b\u3067\u304d\u3066\u3044\u308c\u3070\u554f\u984c\u306a\u3044\u304c\u3001\u7121\u3044\u5834\u5408\u306f\u4f5c\u6210\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u203bGitHub\u306fg_hoge\u3067\u3001Linux\u306f\uff4c_hoge\u3063\u3066\u30e6\u30fc\u30b6\u30fc\u304c\u3042\u308b\u3068\u304d\u306bg_hoge\u2192l_hoge\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u3067\u304d\u308c\u3070\u7406\u60f3\u7684\u3067\u3059\u304c\u3001\u305d\u3053\u307e\u3067\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code>USER=\u5229\u7528\u3059\u308bGitHub\u30e6\u30fc\u30b6\u30fc\u540d\r\nuseradd -d \/home\/${USER} -m ${USER}\r\nmkdir \/home\/${USER}\/notebooks\r\nchown ${USER}\/home\/${USER}\/notebooks\r\n<\/code><\/pre>\n<h2>Kernel\u306e\u8a2d\u5b9a<\/h2>\n<p>Jupyter notebook\u306b\u306fKernel\u3068\u3044\u3046\u6982\u5ff5\u304c\u3042\u308a\u3001\u5b9f\u884c\u6642\u306b\u3069\u306ePython\u74b0\u5883\u3092\u5229\u7528\u3059\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6a19\u6e96\u3067\u306f\u8d77\u52d5\u6642\u306ePython\u74b0\u5883\u3067\u3059\u304c\u3001\u3053\u308c\u306bDjango\u306eshell_plus\u3092\u5229\u7528\u3057\u305f\u74b0\u5883\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067DB\u306b\u63a5\u7d9a\u6e08\u3067Model\u306eimport\u3082\u5b8c\u4e86\u3057\u305f\u72b6\u614b\u3067\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u5927\u5909\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>Virtualenv\u74b0\u5883\u306bJupyterHub\u3092\u5165\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002WARNING\u51fa\u3066\u307e\u3059\u304c\u3001\u3001<\/p>\n<pre class=\"post-pre\"><code>% jupyter kernelspec install-self --user\r\n[InstallNativeKernelSpec] WARNING | `jupyter kernelspec install-self` is DEPRECATED as of 4.0. You probably want `ipython kernel install` to install the IPython kernelspec.\r\n[InstallNativeKernelSpec] Installed kernelspec python3 in \/home\/your_user\/.local\/share\/jupyter\/kernels\/python3\r\n<\/code><\/pre>\n<p>Virtualenv\u74b0\u5883\u306b\u5165\u308c\u305a\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u9818\u57df\u306b\u5165\u308c\u3066\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u3067\u3067\u304d\u308b\u304b\u3082\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>% python -m ipykernel install\r\nInstalled kernelspec python3 in \/usr\/local\/share\/jupyter\/kernels\/python3\r\n<\/code><\/pre>\n<p>\u203broot\u74b0\u5883\u306bipython\u3092\u5165\u308c\u3066\u3044\u306a\u3044\u306e\u3067Virtualenv\u74b0\u5883\u3067\u4f5c\u6210\u3057\u305f\u3082\u306e\u3092\u5fc5\u8981\u306a\u5834\u6240\u306b\u4fdd\u5b58\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u3001\u3067\u304d\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7fa4\u3092\u79fb\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>% cd \/usr\/local\/share\r\n% sudo mv \/home\/your_user\/.local\/share\/jupyter .\/\r\n% sudo chmod 775 jupyter\r\n% sudo chown -R root:root jupyter\r\n% cd \/usr\/local\/share\/jupyter\/kernels\r\n\r\n% ls \/usr\/local\/share\/jupyter\/kernels\r\npython3\r\n\r\n% sudo mv python3 django\r\n\r\n% ls \/usr\/local\/share\/jupyter\/kernels\/django\r\nkernel.json  logo-32x32.png  logo-64x64.png\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>sudo vi django\/kernel.json\r\n<\/code><\/pre>\n<p>\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u306e\u3067\u3001\u5f8c\u8ff0\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>{\r\n \"language\": \"python\",\r\n \"argv\": [\r\n  \"\/var\/www\/jupyter.example.jp\/virtualenv\/bin\/python3.4\",\r\n  \"-m\",\r\n  \"ipykernel\",\r\n  \"-f\",\r\n  \"{connection_file}\"\r\n ],\r\n \"display_name\": \"Python 3\"\r\n}\r\n<\/code><\/pre>\n<p>\u2193<\/p>\n<pre class=\"post-pre\"><code>{\r\n  \"display_name\": \"Django\",\r\n  \"language\": \"python\",\r\n  \"codemirror_mode\": {\r\n    \"version\": 3,\r\n    \"name\": \"ipython\"\r\n  },\r\n  \"argv\": [\r\n    \"\/var\/www\/jupyter.example.jp\/virtualenv\/bin\/python\",\r\n    \"\/var\/www\/jupyter.example.jp\/jupyter\/manage.py\",\r\n    \"shell_plus\",\r\n    \"--settings=jupyter.settings\",\r\n    \"--kernel\",\r\n    \"--connection-file\",\r\n    \"{connection_file}\"\r\n  ]\r\n}\r\n\r\n\u203b--settings=jupyter.settings \u306f\u3001manage.py\u3067\u5229\u7528\u3059\u308bDjango\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\r\n\u203bshell_plus\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306bDjango\u306b\u306fdjango-extensions\u3092\u5165\u308c\u3066INSTALLED_APPS\u306bdjango_extensions\u3092\u6307\u5b9a\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\r\n<\/code><\/pre>\n<p>\u53c2\u80031: https:\/\/ipython.org\/ipython-doc\/3\/development\/kernels.html<br \/>\n\u53c2\u80032: http:\/\/stackoverflow.com\/questions\/31088080\/django-extensions-shell-plus-kernel-specify-connection-file \uff08\u30b3\u30e1\u30f3\u30c8\u306b\u3082\u3042\u308b\u3088\u3046\u306b&#8221;&#8211;connection-file&#8221;\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\uff09<br \/>\n\u53c2\u80033: http:\/\/stackoverflow.com\/questions\/39007571\/running-jupyter-with-multiple-python-and-ipython-paths<\/p>\n<p>\u307e\u305f\u3001<br \/>\nhttps:\/\/github.com\/Cadair\/jupyter_environment_kernels<br \/>\n\u3053\u3061\u3089\u3092\u5165\u308c\u308b\u3053\u3068\u3067Kernel\u306e\u5207\u308a\u66ff\u3048\u306f\u3082\u3063\u3068\u7c21\u5358\u306b\u3067\u304d\u308b\u304b\u3082\u3067\u3059\u304c\u3084\u3063\u3066\u306a\u3044\u3067\u3059\u3002<\/p>\n<h2>supervisord\u3067JupyterHub\u3092\u7ba1\u7406<\/h2>\n<p>\u3053\u308c\u3067 launch_notebook.sh \u3092\u5b9f\u884c\u3059\u308c\u3070\u8d77\u52d5\u3067\u304d\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u518d\u8d77\u52d5\u6bce\u306b\u7acb\u3061\u4e0a\u3052\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067supervisord\u3067\u81ea\u52d5\u7684\u306b\u7acb\u3061\u4e0a\u304c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo vi \/etc\/supervisor\/conf.d\/\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>[program:notebook]\r\ncommand=\/etc\/jupyterhub\/launch_notebook.sh\r\ndirectory=\/etc\/jupyterhub\/\r\nautostart=true\r\nautorestart=true\r\nstopgroup=true\r\nstartretries=3\r\nexitcodes=0,2\r\nstopsignal=TERM\r\nuser=jupyterhub\r\ngroup=jupyterhub\r\n<\/code><\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>supervisord reread\r\nsupervisord reload\r\nsupervisord start notebook\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u30ed\u30b0\u306f \/etc\/log\/supervisor\/notebook-xxx.log \u306b\u8a18\u8ff0\u3055\u308c\u307e\u3059\u3002<\/p>\n<h1>Appendix<\/h1>\n<p>\u74b0\u5883\u69cb\u7bc9\u6642\u306b\u306f\u307e\u3063\u305f\u5185\u5bb9\u3084\u3001\u53c2\u8003\u306b\u3057\u305f\u30ea\u30f3\u30af\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n<h2>connection_upgrade\u306e\u554f\u984c<\/h2>\n<p>\u4f55\u3082\u8003\u3048\u305a\u306b80\u756a\u30a2\u30af\u30bb\u30b9\u3092JupyterHub\u306b\u6d41\u3057\u305f\u5834\u5408\u3001<\/p>\n<pre class=\"post-pre\"><code>2017\/02\/03 17:20:44 [emerg] 16297#16297: unknown \"connection_upgrade\" variable\r\n<\/code><\/pre>\n<p>\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>http:\/\/mogile.web.fc2.com\/nginx\/http\/websocket.html \u3092\u53c2\u8003\u306b\u3057\u3066\u89e3\u6c7a\u6e08\u307f\u3067\u3059\u304c\u3001 \/etc\/nginx\/nginx.conf\u306b\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3057\u305f\u3002<\/p>\n<pre class=\"post-pre\"><code>http {\r\n    map $http_upgrade $connection_upgrade {\r\n        default upgrade;\r\n        ''      close;\r\n    }\r\n<\/code><\/pre>\n<h2>https\u63a5\u7d9a\u306b\u3057\u305f\u969b\u306e\u30a8\u30e9\u30fc<\/h2>\n<p>ELB\u3067https\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3055\u305b\u305f\u5834\u5408\u3001JupyterHub\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u3067\u304d\u307e\u3059\u304c\u3001Kernel\u3092\u8a2d\u5b9a\u3057\u305f\u969b\u306bsupervisord\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>[I 2017-02-05 21:43:24.410 JupyterHub log:100] 200 GET \/hub\/api\/authorizations\/cookie\/jupyter-hub-token-xxx\/[secret] (xxx@127.0.0.1) 14.89ms\r\n21:44:26.703 - error: [ConfigProxy] Proxy error:  Error: socket hang up\r\n    at createHangUpError (http.js:1472:15)\r\n    at Socket.socketCloseListener (http.js:1522:23)\r\n    at Socket.EventEmitter.emit (events.js:95:17)\r\n    at TCP.close (net.js:466:12)\r\n<\/code><\/pre>\n<p>cookie\u3068\u304b\u8a00\u3063\u3066\u308b\u3057\u8a2d\u5b9a\u5024\u3092\u3069\u3053\u304b\u4fee\u6b63\u3059\u308b\u3053\u3068\u3067\u304d\u308c\u3044\u306b\u6cbb\u308a\u305d\u3046\u3060\u304c\u305d\u3053\u307e\u3067\u3067\u304d\u305a\u3044\u3063\u305f\u3093\u65ad\u5ff5\u3002\u3044\u3064\u304b\u518d\u30c8\u30e9\u30a4\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u5206\u6790\u7528\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8272\u3005\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u3053\u306e\u3042\u305f\u308a\u306f\u4ed6\u306b\u63b2\u8f09\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u5272\u611b\u3067\u3044\u3044\u304b\u3082\u3067\u3059\u304c\u3001matplotlib\u306a\u3069\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306a\u3069\u3067\u30c7\u30fc\u30bf\u5206\u6790\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5165\u308c\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo apt-get install -y libpng12-dev libjpeg8-dev libfreetype6-dev libxft-dev\r\npip install numpy pandas matplotlib seaborn scikit-learn\r\n\u203bvirtualenv\u74b0\u5883\u306b\u5165\u308c\u3066supervisord restart notebook\u3068\u3059\u308b\u3053\u3068\u3067\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059 \r\n<\/code><\/pre>\n<h2>\u305d\u306e\u4ed6\u53c2\u8003\u8cc7\u6599<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Jupyter notebook\u304c\u3044\u304b\u306b\u30a4\u30b1\u3066\u308b\u304b\u8a9e\u3089\u308c\u3066\u307e\u3059<\/ul>\n<\/li>\n<\/ul>\n<p>\u73fe\u4ee3\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306e\u5f37\u529b\u306a\u30e1\u30e2\u5e33 Jupyter notebook\u306e\u3059\u309d\u3081<\/p>\n<p>\u3044\u3044\u611f\u3058\u306b\u6063\u610f\u7684\u3067\u3059\u304c\u3001Jupyter notebook\u3078\u306e\u611b\u304c\u611f\u3058\u3089\u308c\u307e\u3059<\/p>\n<p>\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u306b\u5411\u3051\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u74b0\u5883Jupyter Notebook\u306e\u52e7\u3081<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b JupyterHub\u306fJupyter Notebook\u3068\u3044\u3046Python\u306a\u3069\u3092WEB\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u64cd\u4f5c [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-46179","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>- Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"\u306f\u3058\u3081\u306b JupyterHub\u306fJupyter Notebook\u3068\u3044\u3046Python\u306a\u3069\u3092WEB\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u64cd\u4f5c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-24T22:41:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T13:18:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d636337434c4406d02059\/3-0.png\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-12-24T22:41:03+00:00\",\"dateModified\":\"2024-04-30T13:18:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"- Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/","og_locale":"zh_CN","og_type":"article","og_description":"\u306f\u3058\u3081\u306b JupyterHub\u306fJupyter Notebook\u3068\u3044\u3046Python\u306a\u3069\u3092WEB\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u64cd\u4f5c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-12-24T22:41:03+00:00","article_modified_time":"2024-04-30T13:18:26+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d636337434c4406d02059\/3-0.png"}],"author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-12-24T22:41:03+00:00","dateModified":"2024-04-30T13:18:26+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46179-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=46179"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46179\/revisions"}],"predecessor-version":[{"id":94354,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46179\/revisions\/94354"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=46179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=46179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=46179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}