Show last authors
1 = How to start Jupyter =
2
3
4 (% class="box infomessage" %)
5 (((
6 **NB**:
7 * port numbers used below depend on the user! (see [[here>>doc:UOG.Technical Documentation.Nginxproxymanager.WebHome]])
8 * this section requires a preinstalled (configures) ##conda## data-science environmen!
9 )))
10
11
12 == Start ==
13
14 Open the terminal (on Windows: Start, then cmd and press Enter). When the terminal window opens, type the following command (replace username with own name):
15
16 (% class="box" %)
17 (((
18 ##ssh username@dashy -p 8082##
19 )))
20
21 Now you will be asked for the password (this is Beethoven's password), enter the password.
22
23 When the password has been entered correctly, you can see that Beethoven is now logged in by (base) ##username@beethoven##. To start the Jupyter environment, enter the following command: ##my_jupyter.sh## and press Enter.
24
25 In the browser local on Safari or Chrome the following must now be entered:
26
27 [[url:http://116.203.106.242:8887/]]
28
29 The Jupyter environment will now open.
30
31 == First time access ==
32
33 If it is the first time to access this environment, a token must be entered at the top of the web page. The Token (a combination of numbers and/or letters) can be found in the Terminal here:
34
35 http://beethoven:8887/?Token=
36
37 You can copy the number (after ##Token=##) from the terminal and paste it at the top of the newly opened browser Jupyter page. Paste the number of the Token and press Log in or the Enter key.
38
39 The Jupyter environment will now be opened and ready for use.
40
41 == Shut down ==
42
43 To exit, you can manually close the browser.
44
45 In the terminal, use ##Ctrl+C## and you will see ##username@beethoven## again, after this you type ##"exit"## which will log you out of ##dashy##.
46
47 == Scripts ==
48
49 === Jupyter ===
50
51 This is the ##my_jupyter.sh## shell script used to start a Jupyter session. Every user has a slightly different one due to teh different port number. To let this script remain active even after you log out one can use ##screen##. Just start ##screen## and click through the initial message until you get a command prompt again. Then start the script and detach the session using the ##Ctrl-A D## key combination.
52
53 (% class="box" %)
54 {{{#!/bin/bash
55 source $HOME/miniconda3/etc/profile.d/conda.sh
56 #JBR Activate the desired conda environment (edit if needed).
57 conda activate data-science
58 echo "switching to environment:"
59 echo $CONDA_DEFAULT_ENV
60 echo -e "\nStarting Jupyter,...."
61 echo "When done with your work don't forget to shutdown Jupyter using the web-browser! (Files>Shut Down)"
62 echo "This script can be terminated using Ctrl-C"
63 echo -e "Manually stop/kill hanging processes (if any).\n"
64 #JBR If not properly shutdown use 'ps' and 'kill' to terminate the jupyter-lab process
65 #JBR Remember we reserve port 8888 for the local instance of Jupyter
66 echo "Browse to http://116.203.106.242:8883 to see your notebooks"
67 echo -e "Then copy & paste the token from here and create your own password (only once)\n"
68 #JBR_OFF jupyter-lab --ip 0.0.0.0 --port 8883 --no-browser &
69 jupyter-lab --ip 0.0.0.0 --port 8883 --no-browser
70 #JBR remember to once: ssh-copy-id guul@dashy
71 #JBR_OFF ssh guul@116.203.106.242 -N -R \*:8883:localhost:8883
72 }}}
73
74 A slightly "better/flexible" version:
75
76 (% class="box" %)
77 {{{#!/bin/bash
78 #JBRv a shell proedure to change to the desired datas science directory alternately a . or source command would also work
79 dshome () {
80 cd $HOME/Data-Science
81 }
82
83 source $HOME/miniconda3/etc/profile.d/conda.sh
84 dshome
85
86 #JBR Activate the desired conda environment (edit if needed).
87 conda activate data-science
88
89 echo -e "\nStarting Jupyter,...."
90 echo "When done with your work don't forget to shutdown Jupyter using the web-browser! (Files>Shut Down)"
91 echo "This script can be terminated using Ctrl-C"
92 echo -e "Manually stop/kill hanging processes (if any).\n"
93 #JBR If not properly shutdown use 'ps' and 'kill' to terminate the jupyter-lab process
94 #JBR Remember we reserve port 8888 for the local instance of Jupyter
95 echo "Browse to http://116.203.106.242:8889 to see your notebooks"
96 echo -e "Then copy & paste the token from here and create your own password (only once)\n"
97 jupyter-lab --ip 0.0.0.0 --port 8889 --no-browser
98 #JBR_OFF jupyter-lab --ip 0.0.0.0 --port 8889 --no-browser &
99 #JBR_OFF ssh jan@116.203.106.242 -N -R \*:8889:localhost:8889
100 }}}
101
102 === Tensorman ===
103
104 Here's ##my_tensorman_plain.sh## which does not start ##jupyter##:
105
106 (% class="box" %)
107 {{{#!/bin/sh
108 cd $HOME/project
109 tensorman =jupyter-lab-gpu run -p 8889:8889 --gpu --python3 --name $USER bash
110 }}}
111
112 Here's the versioen that also starts ##jupyter## which usually is what we want:
113
114 (% class="box" %)
115 {{{#!/bin/sh
116 cd $HOME/project
117 tensorman =jupyter-lab-gpu run -p 8889:8889 --gpu --python3 --jupyter --name $USER bash
118 }}}

Need help?

If you need help with XWiki you can contact: