Changes for page Using JupyterHub in HDC
Last modified by Dennis Segebarth on 2024/10/02 18:14
To version 4.1
edited by Susan Evans
on 2023/07/11 14:19
on 2023/07/11 14:19
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 5 added, 0 removed)
- Jupyter downloaded file in Home folder v2.4.11 2023-05-25 1850.png
- Jupyterhub file upload back to core v2.4.11 2023-05-25 1926.png
- Jupyterhub-Logo-300x100px cropped.png
- Pilotcli Jupyter user login Device Login Successful v2.4.0 2023-05-25.png
- Pilotcli Jupyter user login Grant Access window v2.4.0 2023-05-25.png
Details
- Page properties
-
- Content
-
... ... @@ -1,5 +1,13 @@ 1 +{{box cssClass="floatinginfobox" title="Table of Contents"}} 2 +{{toc depth="2"/}} 3 +{{/box}} 4 + 5 + 1 1 JupyterHub is an open-source, multi-user version of Jupyter Notebook for performing analysis of Project files in the Core. More information can be found in the application documentation [[https:~~/~~/jupyter.org/>>https://jupyter.org/]]. 2 2 8 +[[image:Jupyterhub-Logo-300x100px cropped.png||height="13%" width="20%"]] 9 + 10 + 3 3 = How it Works = 4 4 5 5 JupyterHub allows Project members to create or import Jupyter Notebooks into the Project Workspace environment, retrieve Project files from the Core, perform computational workflows on the data, and write the outputs back to the Core where they can be accessed by other Project members. JupyterHub spins up a new JupyterLab instance for each Project member. ... ... @@ -19,7 +19,7 @@ 19 19 20 20 = Launching JupyterHub = 21 21 22 -[[image:HDC Project Workspace tool navigation Jupyterhub v1.0.0 2023-05-25.png||height=" 10%" width="30%"]]30 +[[image:HDC Project Workspace tool navigation Jupyterhub v1.0.0 2023-05-25.png||height="9%" width="25%"]] 23 23 24 24 1. Launch your Project and click the **JupyterHub icon** in the left menu bar. 25 25 1. Click **Sign in with Keycloak** to initiate your session. JupyterHub automatically authenticates with your existing username and password and launches your session - no additional sign-in is required. ... ... @@ -185,7 +185,7 @@ 185 185 186 186 and also from each opened Notebook, e.g., via **Kernel > Change Kernel…** : 187 187 188 -[[image:Project Workspace Jupyter Kernel change Kernel dropdown 2023-07-11.png||height=" 64%" width="50%"]]196 +[[image:Project Workspace Jupyter Kernel change Kernel dropdown 2023-07-11.png||height="32%" width="25%"]] 189 189 190 190 = Installing New Python Packages = 191 191 ... ... @@ -222,4 +222,190 @@ 222 222 1. In the Jupyterhub Terminal, type {{code}}pilotcli{{/code}} to launch the latest version of the Pilot Command Line Interface. 223 223 1. Use the {{code}}pilotcli --help{{/code}} at any time to show the welcome message again. 224 224 233 +{{code language="none"}} 234 +collaborator4@jupyter-collaborator4:~$ pilotcli 235 +Usage: pilotcli [OPTIONS] COMMAND [ARGS]... 225 225 237 + What's new (Version 2.2.0): 238 + 239 + 1. CLI supports to perform multi-threading upload for file/folders 240 + 241 + 2. CLI supports to perform resumable upload for single file 242 + 243 + 244 + 245 +Options: 246 + --help Show this message and exit. 247 + 248 +Commands: 249 + container_registry Container Registry Actions. 250 + dataset Dataset Actions. 251 + file File Actions. 252 + project Project Actions. 253 + use_config Config Actions. 254 + user User Actions. 255 +{{/code}} 256 + 257 +== Logging into the Pilot Command Line Interface == 258 + 259 +Users are required to login with platform credentials before performing any tasks through Pilot Command Line Interface. 260 + 261 +* Use the command {{code}}pilotcli user login{{/code}} to log into the Pilot Command Line Interface. 262 + 263 +{{code language="none"}} 264 +collaborator4@jupyter-collaborator4:~$ pilotcli user login 265 +Please, access https://iam.staging.pilot.indocresearch.com/realms/pilot/device?user_code=XXXX-XXXX to proceed 266 + ▄▄▄▄▄▄▄ ▄ ▄▄ ▄ ▄▄▄▄ ▄ ▄▄▄▄▄▄▄ 267 + █ ▄▄▄ █ ▄ ▄███ ▀▀ █▀ ▀██▄ █ ▄▄▄ █ 268 + █ ▄ ▀ ▄ ▀▄ ▀▀ ▄█▀▄▀ ▀▀▄█▄▄▀ █████▄▄▀▄ 269 + ▄▄▄▄▄▄▄ ▀ ▀█▄ ▀▄ ██▀█ ▄▀▄▄ █ ▄ █▀▄▄▄ 270 + █ ▄▄▄ █ █▀█▄▀ █▀ █▀▀█ ▀▄█▄█▄▄▄█▀▄█ 271 + █ ███ █ █▀██▀▄ █▀▄▄▀▀█▄▀▀█▄▀█ ▀ ▀▄▀██ 272 + █▄▄▄▄▄█ ▄▀▄▄██▄▄▀▄ ▀▀▄ ▄▄▀▀▀▄ █▄▄▄█ 273 + 274 + Waiting validation finish... 275 +{{/code}} 276 + 277 +* ((( 278 +You’ll be asked to validate your HDC user account using one of the provided methods. 279 + 280 +* Copy and paste the provided validation link into a new browser tab or 281 +* Scan the QR code with your mobile device. 282 +))) 283 +* Open the login window and enter your HDC username and password (i.e. your EBRAINS account credentials). 284 +* Grant access by clicking **Yes**. 285 + 286 +[[image:Pilotcli Jupyter user login Grant Access window v2.4.0 2023-05-25.png||height="28%" width="30%"]] 287 + 288 +[[image:Pilotcli Jupyter user login Device Login Successful v2.4.0 2023-05-25.png||height="10%" width="30%"]] 289 + 290 +* After successful confirmation, return to the terminal in your JupyterHub browser tab. 291 + 292 +{{code language="none"}} 293 +Welcome to the Command Line Tool! 294 +{{/code}} 295 + 296 +* You’re now ready to start using the Pilot Command Line Interface to work with your Project data in JupyterHub. 297 + 298 +== Zone Restrictions when using Pilot Command Line Interface in JupyterHub == 299 + 300 +When using the Pilot Command Line Interface in JupyterHub and the following actions are possible on the derivative files generated in JupyterHub: 301 + 302 +|=(% colspan="1" rowspan="1" %)((( 303 +**File Operation** 304 +)))|=(% colspan="1" rowspan="1" %)((( 305 +**Permitted in the ** 306 +**Green Room** 307 +)))|=(% colspan="1" rowspan="1" %)((( 308 +**Permitted in the ** 309 +**Core** 310 +))) 311 +|(% colspan="1" rowspan="1" %)File upload 312 +(upload derivative output files from JupyterHub to the Green Room or Core storage)|(% colspan="1" rowspan="1" %)((( 313 +Yes 314 +)))|(% colspan="1" rowspan="1" %)((( 315 +Yes 316 +))) 317 +|(% colspan="1" rowspan="1" %)File download 318 +(download files from Green Room or Core into JupyterHub)|(% colspan="1" rowspan="1" %)((( 319 +**No** 320 +)))|(% colspan="1" rowspan="1" %)((( 321 +Yes 322 +))) 323 + 324 +== Downloading Project Data to JupyterHub using the Pilot Command Line Interface == 325 + 326 +After logging into the Pilot Command Line Interface, you can download data from the Project Core into the JupyterHub environment to start your data analyses. 327 + 328 +File related commands are grouped in the {{code}}file{{/code}} category. To view the full list of commands in this category, type {{code}}pilotcli file --help{{/code}}. To download project data, use the file sync command. To view the full list of commands in this category, type {{code}}pilotcli file sync --help{{/code}}. 329 + 330 + 331 +{{code language="none"}} 332 +collaborator4@jupyter-collaborator4:~$ pilotcli file sync --help 333 +Usage: pilotcli file sync [OPTIONS] [PATHS]... OUTPUT_PATH 334 + 335 + Download files/folders from a given Project/folder/file in core zone. 336 + 337 +Options: 338 + -z, --zone TEXT Target Zone (i.e., core/greenroom) 339 + --zip Download files as a zip. 340 + -i, --geid Enable downloading by geid. 341 + --help Show this message and exit. 342 +{{/code}} 343 + 344 +=== Example === 345 + 346 +Downloading a file from the Core to your Home Directory: 347 + 348 +Reminder: Please follow Linux conventions for file management. If your filename contains spaces, wrap it in single or double quotes. 349 + 350 +* //Filename~:// “Chemical Tracking Data.csv” 351 +* //Source~:// Project “Indoc Test Project”, “Core” storage zone, folder “collaborator4” {{code}}indoctestproject/collaborator4/Chemical Tracking Data.csv -z core{{/code}} 352 +* //Destination: //user's Home directory in the Guacamole or JupyterHub VM {{code}}.{{/code}} 353 +* //Command group/option: //{{code}}file sync{{/code}} 354 + 355 +{{code language="none"}} 356 +collaborator4@jupyter-collaborator4:~$ pilotcli file sync indoctestproject/collaborator4/'Chemical Tracking Data.csv' . -z core 357 +start downloading... 358 +Downloading Chemical Tracking Data.csv |██████████████████████████████ 100% 00:00 359 +File has been downloaded successfully and saved to: ./Chemical Tracking Data.csv 360 +{{/code}} 361 + 362 +To confirm successful download, type {{code}}ls{{/code}} and verify the file "Chemical Tracking Data.csv" is stored in the Home folder. 363 + 364 +{{code language="none"}} 365 +collaborator4@jupyter-collaborator4:~$ ls 366 +'Chemical Tracking Data.csv' pilotcli 367 +{{/code}} 368 + 369 +The file “Chemical Tracking Data.csv” can be viewed in the JupyterHub graphical user interface: 370 + 371 +[[image:Jupyter downloaded file in Home folder v2.4.11 2023-05-25 1850.png||height="15%" width="50%"]] 372 + 373 + 374 +== Uploading Project Data from JupyterHub using the Pilot Command Line Interface == 375 + 376 +After analyzing Project data inside the JupyterHub, you can upload the generated outputs back into the Project via the Pilot Command Line Interface. 377 + 378 +=== Example === 379 + 380 +* //Filename//: Chemical Tracking Data rev.csv 381 +* //Source~:// user's Home directory in JupyterHub {{code}}.{{/code}} 382 +* //Destination//: Project “Indoc Test Project”, folder “collaborator4”, “Core” storage zone, 383 +{{code}}indoctestproject/collaborator4{{/code}} {{code}}-z core{{/code}} 384 +* //Command group/option~:// {{code}}file upload{{/code}} 385 +* //User message// (for upload back to the Core): “my workbench output, no additional sensitive data" 386 +* //Command~:// {{code}}pilotcli file upload ./'Chemical Tracking Data rev.csv' -p{{/code}} {{code}}indoctestproject/collaborator4 -z core -m "my workbench output, no additional sensitive data"{{/code}} 387 + 388 +When uploading data to the Core, you are reminded that you are bypassing the usual Green Room upload workflow. To confirm, type {{code}}y{{/code}} at the prompt, or {{code}}N{{/code}} to cancel. 389 + 390 +{{code language="none"}} 391 +collaborator4@jupyter-collaborator4:~$ pilotcli file upload ./'Chemical Tracking Data rev.csv' -p indoctestproject/collaborator4 -z core -m "my workbench output, no additional sensitive data" 392 +You are about to transfer data directly to the PILOT Core! In accordance with the PILOT Terms of Use, please confirm that you have made your best efforts to 393 +pseudonymize or anonymize the data and that you have the legal authority to transfer and make this data available for dissemination and use within the PILOT .If you 394 +need to process the data to remove sensitive identifiers, please cancel this transfer and upload the data to the Green Room to perform these actions. 395 +To cancel this transfer, enter [n/No] 396 +To confirm and proceed with the data transfer, enter [y/Yes] 397 + [y/N]: y 398 +Starting upload of: ./Chemical Tracking Data rev.csv 399 +Pre-upload complete. 400 +Uploading Chemical Tracking Data rev.csv: |██████████████████████████████ 100% 00:00 401 +Upload Time: 2.92s for 1 files 402 +All uploading jobs have finished. 403 +{{/code}} 404 + 405 +After completing the upload, you can confirm the new file “Chemical Tracking Data rev.csv" exists in the correct directory using the pilotcli file list command and/or in the Portal File Explorer. 406 + 407 +{{code language="none"}} 408 +collaborator4@jupyter-collaborator4:~$ pilotcli file list indoctestproject/collaborator4 -z core 409 +Chemical Tracking Data rev.csv Chemical Tracking Data.csv 410 +{{/code}} 411 + 412 +[[image:Jupyterhub file upload back to core v2.4.11 2023-05-25 1926.png||height="13%" width="50%"]] 413 + 414 +---- 415 + 416 +Copyright © 2023 [[Indoc Research>>url:https://www.indocresearch.org/]]. 417 + 418 +HealthDataCloud is powered by Pilot technology, a product of [[Indoc Research>>url:https://www.indocresearch.org/]]. 419 +
- Jupyter downloaded file in Home folder v2.4.11 2023-05-25 1850.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.sgevans - Size
-
... ... @@ -1,0 +1,1 @@ 1 +35.0 KB - Content
- Jupyterhub file upload back to core v2.4.11 2023-05-25 1926.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.sgevans - Size
-
... ... @@ -1,0 +1,1 @@ 1 +507.5 KB - Content
- Jupyterhub-Logo-300x100px cropped.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.sgevans - Size
-
... ... @@ -1,0 +1,1 @@ 1 +27.7 KB - Content
- Pilotcli Jupyter user login Device Login Successful v2.4.0 2023-05-25.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.sgevans - Size
-
... ... @@ -1,0 +1,1 @@ 1 +10.3 KB - Content
- Pilotcli Jupyter user login Grant Access window v2.4.0 2023-05-25.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.sgevans - Size
-
... ... @@ -1,0 +1,1 @@ 1 +13.9 KB - Content