Wiki source code of JupyterHub

Last modified by publicadmin on 2025/12/16 13:04

Hide last authors
publicadmin 1.1 1 JupyterHub is an open-source, multi-user version of Jupyter Notebook for performing analysis of data in the VRE Core. More information can be found through the application documentation __[[https:~~/~~/jupyter.org/>>url:https://jupyter.org/]]__.
2
3 JupyterHub must be configured on a project basis by the [[Platform Administrator>>path:/xwiki/bin/view/user_guide/Managing%20User%20Accounts/User%20Roles/]]. If JupyterHub has been configured for your project, data available in the VRE Core will be accessible to you for analysis in JupyterHub. Users may import Jupyter Notebooks for use in this environment but are reminded that the VRE Platform Terms Use __prohibits any code or files containing personal information of data subjects__ from entering the VRE, including workbench tools, unless it has first been uploaded to the Green Room and approved by the Project Administrator for use in the VRE Core.
4
5 Jupyterhub is integrated with your VRE user account with Single Sign-On; no separate user account is required. To launch JupyterHub from the VRE Portal:
6
7 1. Navigate to your [[Project Landing Page>>path:/xwiki/bin/view/user_guide/Accessing%20the%20VRE/Finding%20Projects%20in%20the%20VRE/]] and click the Jupyterhub icon in the Left Sidebar, a new browser tab will open.
8 1. Click **Sign in with Keycloak** to initiate your [[single sign-on>>doc:Main.user_guide.Accessing the VRE.Logging in and out of the VRE.WebHome]] session.
9 1. Jupyterhub will spin up a new Notebook instance for each user.
10 1. From the JupyterHub home page, you can now perform various actions such as opening a Python notebook or importing an existing Jupyter Notebook.
11 1. When finished using JupyterHub, click **Logout** to end your session.
12
13 === Create Notebook ===
14
15 (% class="wikigeneratedid" %)
16 Users can create a new Jupyter notebook with Python 3 inside Jupyterhub, and will have 10Gi storage under users' Home Directory.
17
18 (% class="wikigeneratedid" %)
19 [[image:1627573749985-805.png]]
20
21
22 === Launching the Terminal ===
23
24 (% class="wikigeneratedid" %)
25 JupyterHub provides browser-based terminal access to advanced users if they need to run commands directly in the system shell (Ubuntu 18.04 is used by VRE to host Jupyter Notebook)
26
27 (% style="text-align:center" %)
28 [[image:terminal.png]]
29
30
31 === Installing New Python Packages ===
32
33 (% class="wikigeneratedid" %)
34 In compliance with Charité IT's policy, all outbound traffic must go through a proxy.  This rule will require users to provide the proxy command line argument such as ##pip, curl, wget##, etc.
35
36 {{{pip install my_package --proxy=http://proxy.charite.de:8080/}}}
37
38 If you are using conda to manage python packages, before running conda install xxx, you need to add this proxy config to ~~/.condarc:
39
40 {{{proxy_servers:
41     http: http://proxy.charite.de:8080
42     https: http://proxy.charite.de:8080}}}
43
44 (% style="text-align:center" %)
45 [[image:install python library.PNG]]
46
47
48 === Creating a Python Virtual Environment and Registering a Kernel ===
49
50 {{code language="none"}}
51 ##create python virtual environment
52 python3 -m venv test
53 source test/bin/activate
54 ##register a kernel in jupyter notebook
55 ipython kernel install --user --name=test
56 {{/code}}
57
58 (% style="text-align:center" %)
59 [[image:create python virtual env and register a kernel.PNG]]
60
61 (% style="text-align:center" %)
62 [[image:created python virtual env and register a kernel.PNG]]
63
64 === Launch VRE Command Line Tool in JupyterHub Terminal ===
65
66 VRE Command Line tool is deployed within JupyterHub Workbench so as VRE users can launch the tool to access to Project data for further analysis. Please visit this page: [[VRE User Guide/ Analyzing Data/Jupyterhub/Access to Project data in Jupyterhub using VRE Command Line Tool>>doc:Main.user_guide.Analyzing Data.JupyterHub.Accessing Project data in Jupyterhub using the VRE Command Line Tool.WebHome]] for details on:
67
68 * How to launch VRE Command Line Tool in Terminal
69 * How to be authenticated within VRE Command Line Tool
70 * How to perform file operations such as uploading/downloading Project Data within VRE Command Line Tool
71
72 If you have questions or suggestions about JupyterHub on VRE, please contact the Platform Administrator at __[[vre-support@charite.de>>path:mailto:vre-support@charite.de]]__.
73
74
75 === Set up analysis workflow in JupyterHub ===
76
77 The attached video jupyter-demo.mp4 demonstrates
78
79 * how data is copied from the core zone to the JupyterHub Workbench,
80 * how custom software is installed, and
81 * demonstrates a custom example analysis workflows including visualization.
82
83 ----
84
85 **See Also:**
86
87 [[Guacamole>>doc:Main.user_guide.Analyzing Data.Guacamole.WebHome]]
88
89 ----
90
91 {{box}}
92 (% style="text-align:center" %)
93 image:https://i.creativecommons.org/l/by-sa/4.0/88x31.png
94
95 (% style="text-align: center;" %)
96 Copyright © 2022, Indoc Research. This work is licensed under a [[Creative Commons Attribution-ShareAlike 4.0>>http://creativecommons.org/licenses/by-sa/4.0/ ||rel="noopener noreferrer" target="blank"]] International License.
97 {{/box}}