Skip to content

Commit 80f6832

Browse files
authored
Merge pull request #157 from johrstrom/update-ood-tutorial
update ood tutorial
2 parents f53f02a + d3a6c3a commit 80f6832

17 files changed

Lines changed: 468 additions & 14 deletions

ondemand/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ COPY python_job_template /etc/ood/config/apps/myjobs/templates/python
3030
COPY motd /etc/motd
3131
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
3232
COPY notebook_data /data/notebook_data
33-
COPY initializers/dashboard.rb /etc/ood/config/apps/dashboard/initializers/dashboard.rb
33+
COPY initializers /etc/ood/config/apps/dashboard/initializers
3434
COPY themes/hpc-coop /usr/share/ondemand-dex/web/themes/hpc-coop
35+
COPY config/dashboard/env /etc/ood/config/apps/dashboard/env
36+
COPY config/ondemand.yml /etc/ood/config/ondemand.d/ondemand.yml
37+
COPY config/dashboard/widgets /etc/ood/config/apps/dashboard/views/widgets
3538

3639
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

ondemand/README.md

Lines changed: 290 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
Live tutorial steps we took during PEARC. See the PEARC video recording to follow along (with images and explanations!):
66

7-
- [Dashboard-developer-mode-tutorial](#dashboard-developer-mode-tutorial)
8-
- [Jupyter App Tutorial](#jupyter-app-tutorial)
7+
- [Walkthrough tutorial](#walkthrough-tutorial)
8+
- [Dashboard developer mode tutorial](#dashboard-developer-mode-tutorial)
9+
- [Jupyter App Development Tutorial](#jupyter-app-development-tutorial)
910
- [Dynamic Batch Connect Fields](#dynamic-batch-connect-fields)
1011
- [Passenger App Tutorial](#passenger-app-tutorial)
1112
- [XDMoD Integration Tutorial](#xdmod-integration-tutorial)
@@ -31,8 +32,272 @@ At some points during this tutorial you'll need to execute commands in a shell s
3132
You can [use the shell app](https://localhost:3443/pun/sys/shell/ssh/ondemand)
3233
to get an ssh session in the web browser for this purpose.
3334

35+
## Walkthrough Tutorial
36+
37+
<details>
38+
<summary>Click to open or close tutorial details.</summary>
39+
40+
<br>
41+
42+
This tutorial walks through common features in Open OnDemand. There's no development
43+
involved. It simply walks through features as a user would interact with them to demonstrate
44+
what OnDemand can do.
45+
46+
- [The dashboard landing page](#the-dashboard-landing-page)
47+
- [File management](#file-management)
48+
- [File viewing and editing](#file-viewing-and-editing)
49+
- [The Job Composer](#the-job-composer)
50+
- [Active Jobs](#active-jobs)
51+
- [Interactive Apps](#interactive-apps)
52+
- [Profiles](#profiles)
53+
54+
### The dashboard landing page
55+
56+
The dashboard landing page is the first page users see. Administrators can
57+
customize what panels are displayed here as well as their position. Administrators
58+
can choose from predefined panels like the 'Message of the Day' and even create their
59+
own.
60+
61+
The panel welcoming you to this tutorial is a custom panel.
62+
63+
There is a panel with your recently used applications that may show up depending on if
64+
you've run any apps. Once you have started either the desktop or jupyter applications,
65+
you'll see buttons here to relaunch those applications.
66+
67+
The 'Message of the Day' can display your message of the day similar to how shell
68+
logins work. OnDemand supports many formats, and the one shown is in markdown.
69+
70+
Lastly you'll see panels for [XDMoD](../xdmod/README.md). OnDemand integrates
71+
with XDMoD to show pertinant information about the jobs you've recently ran.
72+
73+
### File management
74+
75+
In the navigation bar you'll see a dropdown menu entitled `Files`. The first
76+
menu item is your `$HOME` and this comes by default with every installation.
77+
The second menu item has been added as a 'favorite path'. Administrators
78+
can add many favorite paths to scrach or project spaces for example.
79+
80+
Click the link to `HOME` and you'll be redirected to the file manager.
81+
82+
Here you'll see all the files & directories in your `$HOME` directory.
83+
You'll see several buttons for file management like making new files and directories,
84+
deleting, downloading, and more.
85+
86+
Go ahead and:
87+
* Make a new directory (you can call it `demo_dir` if you don't have a name handy).
88+
* Add a file to that directory (you can call it `demo_file.txt` if you don't have a name
89+
handy).
90+
* Download that file.
91+
* Delete that file.
92+
* Open a terminal to this new directory (use the 'open in terminal button').
93+
You'll see that instead of starting in your `$HOME` directory, you're in this
94+
new directory that you've created.
95+
96+
Now that you know how to create files, go ahead and create a file and in the next
97+
section we'll edit it.
98+
99+
### File viewing and editing
100+
101+
If you haven't already created a new file to edit, please do so now. It doesn't
102+
really matter _where_ this file is.
103+
104+
Once you have a file you want to edit, click the drop down menu in the same
105+
row as the file and you should see an option to `Edit`.
106+
107+
Press `Edit` in this menu and the file editor will open in a new tab.
108+
In this view, you can edit the file in the web browser! Go ahead and
109+
do that now, add something to this file. A simple `hello world!` will
110+
suffice. Once you've added something to the file, click the `Save` button
111+
in the top left.
112+
113+
Now that you've edited the file navigate back to the file browser where
114+
this file exists. Click the same drop down menu you clicked to edit the file
115+
but instead press `View`. This will open a new tab with a read only copy
116+
of the file you just edited.
117+
118+
![editing file demo](imgs/file_editing_demo.gif)
119+
120+
### The Job Composer
121+
122+
The job composer let's users create and schedule batch jobs from templates.
123+
124+
To navigate there press the `Jobs` menu button from the top level navigation
125+
bar. Press the `Job Composer` link in that dropdown menu and you'll be redirected
126+
to the job composer.
127+
128+
There's a so called `joy ride` that describes what all the buttons do. You can
129+
click `Next` to go through them all or dismiss it.
130+
131+
To create a job from a template click the `New Job` button at the top left.
132+
Next, select `From Template`. This will fill the table with all the available
133+
templates on the system. Only one has been provided in this tutorial, but
134+
administrators at actual sites can supply as many as they wish.
135+
136+
Press the `Create new job` button in panel on the right side of the screen titled
137+
`Create New "Basic Python Serial Job"`. Once selected, you've created your own
138+
job from this template. You'll see it's placed in the
139+
`/home/hpcadmin/ondemand/data/sys/myjobs/projects/default/1`
140+
directory and you can open this directory with buttons on the bottom of the page.
141+
142+
Click the job's row in table in the center of the screen. When this job's row
143+
is highlighted the button to `Submit` the job becomes available. Press the submit
144+
button and you'll submit this job.
145+
146+
The job should succesfully submit and you should see the state badge in the `Status`
147+
column of the central table go from queued to running to completed.
148+
149+
Let's go ahead and edit the script we submit by pressing the `Open Editor` button
150+
at the bottom of the script's panel (you likely have to scroll down).
151+
152+
Add this `sleep 1000` anywhere in the file (so long as it's not commented).
153+
154+
```bash
155+
sleep 1000
156+
```
157+
158+
Submit this job again and next we'll see another view where you can see
159+
your active jobs.
160+
161+
![job composer demo](imgs/job_composer_demo.gif)
162+
163+
### Active jobs
164+
165+
Now that you've got a job running that'll last a little bit from the
166+
previous section, let's navigate to the active jobs page to view it.
167+
168+
Navigate back to the main OnDemand page by pressing `OnDemand` at the
169+
top left of the navigation bar.
170+
171+
Now that we're back to the main OnDemand page, open the `Jobs` drop down
172+
menu at the top of the navigation bar and press `Active Jobs`.
173+
174+
This will redirect you to our Active Jobs page. On this page you can
175+
see the details of all the active jobs running on your clusters. There
176+
aren't many jobs running here because we're looking at the cluster that's
177+
in these containers, but on a real system it would show all the jobs on that
178+
system.
179+
180+
![active jobs demo](imgs/active_jobs_demo.gif)
181+
182+
### Interactive Apps
183+
184+
Interactive apps are one of the main features of Open OnDemand. They allow
185+
users a click through interface to some of the most popular applications in
186+
HPC.
187+
188+
This tutorial will go over luanching the Jupyter application as well as generic
189+
Linux desktops
190+
191+
The `Interactive Apps` dropdown menu on the top navigation bar lists all the
192+
interactive applications on this system. Other sites can have many more for example
193+
RStudio and MATLAB.
194+
195+
#### Launching a desktop
196+
197+
Open the `Interactive Apps` menu and press the `Desktop` link. This will redirect
198+
you to a form for this application. This form can allow users to fill out different
199+
settings to submit the job with. For example the `Number of Hours` field will specify
200+
how long the job can run for. Administrators can specify these fields. So for example
201+
a real site may allow desktops with GPUs and a checkbox in the form for the user to
202+
select a GPU.
203+
204+
There's no need to specify the account, so you can leave it blank. Fill out the rest
205+
of the form (noting that there are only 2 nodes in this cluster) and press the `Launch`
206+
button.
207+
208+
You'll be redirected to `My Interactive Sessions` page where you will see a card for this
209+
job. It should start in the queued state and eventually into the running state. When
210+
it's in the running state a button will appear at the bottom of the card with the text
211+
`Launch HPC Desktop`. Press that button when it becomes available to connect to the desktop.
212+
213+
When you press `Launch HPC Desktop` a new tab will open connecting you to the desktop.
214+
Note that this desktop is running in a container on one of the compute nodes in the Slurm
215+
cluster. You now have a desktop running on your compute cluster!
216+
217+
Open the applications menu and launch a terminal. Once inside the terminal issue the
218+
`glxgears` command and see the GUI for glxgears open up. Feel free to keep the session
219+
open for a while and play around with the XFCE desktop.
220+
221+
![desktop demo](imgs/desktop_demo.gif)
222+
223+
#### Launching Jupyter
224+
225+
Navigate back to the tab with Open OnDemand and open the `Interactive Apps` menu
226+
again. Now choose Jupyter instead of a desktop.
227+
228+
This will redirect you to a similar form as we saw before, only it's a form for
229+
launching a Jupyter session instead of a desktop. Choose your settings and launch
230+
by pressing the `Launch` button.
231+
232+
Similar to the desktop launching, this will redirect you to `My Interactive Sessions`
233+
where a new card for this Jupyter application should be.
234+
235+
You'll note on this card though, it has extra information on it. It displays the
236+
choices that you've made in the form, for example how much memory you've requested.
237+
Administrators, when creating applications, can choose to display certian choices
238+
users make in the form in these cards.
239+
240+
Again when the button to `Connect to Jupyter` becomes available don't press it
241+
just yet. Instead you can press the button near the top of the card labeled `Host`.
242+
This is the host that the job is running on. It's likely cpn01 but could also be
243+
cpn02. Press this button and OnDemand will open a shell session on that compute
244+
node in a new tab.
245+
246+
This allows users to not only run an interactive application they can connect to,
247+
but also shell access to the job as well.
248+
249+
Navigate back to Open OnDemand's `My interactive sessions` page and press the
250+
`Connect to Jupyter` button. This will open a new tab to the Jupyter application
251+
that's running on a compute node in your Slurm cluster!
252+
253+
Connect to the Jupyter session and navigate to the `jupyter_notebook_data` directory.
254+
Open the `GUI-demo.ipynb` and this should open a new tab to this notebook. Run all
255+
the cells in this notebook for a demonstration that this Jupyter does in fact work.
256+
257+
![jupyter demo](imgs/jupyter_demo.gif)
258+
259+
### Profiles
260+
261+
Open OnDemand 3.0 released with support profiles. Profiles are a way to change
262+
the look and feel of an Open OnDemand installation.
263+
264+
Open the `Help` menu on the right hand side of the navigation bar and click
265+
the `Chemistry` profile. This will redirect you back to the starting page
266+
and set the application into this new profile. You can select `Default`
267+
from the same menu to get back to the original profile.
268+
269+
The first thing you may notice is that the navigation bar has changed.
270+
The main idea with profiles is to construct a view into the OnDemand system
271+
that limits the choices of users, so that they may more easily find the application
272+
they're interested in or so the system can gear itself towards a specific use
273+
case instead of being more general purpose.
274+
275+
We've changed the navigation bar to limit the choices a user can make
276+
within this profile. The desktop application has been removed and only
277+
Jupyter is available. Also the `Jobs` menu has been removed along with
278+
several other menu items on the right hand side.
279+
280+
The landing page has also changed. Mostly just re-arranged, but it demonstrates
281+
that different profiles can have different landing pages.
282+
283+
Lastly there's a new link entitled `Chemistry Notes`. Press this link
284+
and you'll be redirected to a custom page. This page is completely defined
285+
by administrators. Administrators supplied every single panel on this page.
286+
The idea here being that administrators can supply content to their own OnDemand
287+
installation, thereby extending it's functionality by also supplying some
288+
documentation.
289+
290+
![profile demo](imgs/profile_demo.gif)
291+
292+
</details>
293+
34294
## Dashboard developer mode Tutorial
35295

296+
<details>
297+
<summary>Click to open or close tutorial details.</summary>
298+
299+
<br>
300+
36301
This tutorial covers:
37302

38303
- [Starting the dashboard in development mode](#starting-the-dashboard-in-development-mode)
@@ -245,7 +510,14 @@ dashboard.
245510

246511
![dashboard landing page with a new custom widget](imgs/dashboard_w_new_widget.png)
247512

248-
## Jupyter App Tutorial
513+
</details>
514+
515+
## Jupyter App development tutorial
516+
517+
<details>
518+
<summary>Click to open or close tutorial details.</summary>
519+
520+
<br>
249521

250522
This tutorial covers:
251523

@@ -1033,8 +1305,15 @@ field when the debug option is chosen.
10331305
]
10341306
```
10351307

1308+
</details>
1309+
10361310
## Passenger app tutorial
10371311

1312+
<details>
1313+
<summary>Click to open or close tutorial details.</summary>
1314+
1315+
<br>
1316+
10381317
Access OnDemand dashboard https://localhost:3443
10391318

10401319
### Ensure environment is configured for development
@@ -1330,8 +1609,15 @@ Notes
13301609

13311610
* app is still accessible even if navbar does not display it
13321611

1612+
</details>
1613+
13331614
## XDMoD Integration Tutorial
13341615

1616+
<details>
1617+
<summary>Click to open or close tutorial details.</summary>
1618+
1619+
<br>
1620+
13351621
(Optional) submit a job from job composer to demonstrate XDMoD integration with Job Composer:
13361622

13371623
1. Jobs => Job Composer
@@ -1358,7 +1644,7 @@ Review dashboard widgets - restart Web Server to see
13581644

13591645
Review Job Composer links - access Job Composer
13601646

1361-
1647+
</details>
13621648

13631649
## Tutorial Navigation
13641650
[Next - Acknowledgments](../docs/acknowledgments.md)

ondemand/config/dashboard/env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
OOD_DEV_SSH_HOST="ondemand"
2+
MOTD_PATH="/etc/motd"
3+
MOTD_FORMAT="markdown"
4+
OOD_BC_DYNAMIC_JS=1
5+
OOD_XDMOD_HOST="https://localhost:4443"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<p>
2+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id tempor odio, ac maximus ipsum.
3+
Suspendisse egestas sapien nunc, id viverra tellus pretium in. Vestibulum auctor venenatis ipsum,
4+
condimentum pretium nunc convallis sagittis. Aliquam tempor nunc ante, ac convallis lorem blandit
5+
eget. Proin volutpat ut erat nec efficitur. Praesent condimentum quam vel neque porta tincidunt
6+
quis sit amet ipsum. Donec convallis tortor ac nisl tristique, nec commodo erat faucibus. Maecenas
7+
volutpat libero vitae enim mattis porttitor. Sed posuere iaculis tristique. Proin et convallis lectus.
8+
Donec mollis leo nec tortor ultricies imperdiet.
9+
</p>
10+
11+
<p>
12+
Donec ut pharetra lectus. Aliquam condimentum pretium tortor, quis porta odio pellentesque dignissim.
13+
Maecenas ut nibh aliquet, scelerisque odio nec, laoreet lorem. Ut eget dui vitae nulla malesuada
14+
rhoncus ac rhoncus turpis. Vestibulum sit amet ex vitae leo aliquet maximus ac ac nibh. Morbi dignissim
15+
eros ut nibh venenatis, eget ornare ante fermentum. Curabitur et convallis ipsum, eu maximus justo. Sed auctor,
16+
erat non placerat pharetra, mauris diam iaculis enim, vel tincidunt ante libero sed urna. Cras ac dignissim quam.
17+
Duis mi nulla, gravida sit amet dictum quis, tempor pulvinar ex. Donec vestibulum pellentesque est nec facilisis.
18+
</p>
19+
20+
<p>
21+
Donec diam magna, fringilla nec cursus luctus, varius et diam. Morbi lacinia nec nisi
22+
viverra consectetur. Nulla placerat, eros at tristique volutpat, purus elit tristique
23+
nulla, ac bibendum augue urna sed dolor. Donec non ornare mauris, a dictum felis. In pulvinar
24+
commodo libero sed dignissim. Nulla tempor metus nulla, eget imperdiet ex lobortis vel. Sed
25+
sit amet nunc risus. Sed quis risus nec magna lacinia laoreet a et urna. Aliquam pharetra
26+
est sagittis eros tristique, placerat fermentum mauris posuere. Nam aliquam ex eget sapien
27+
iaculis, auctor consectetur enim bibendum. Vestibulum vehicula ligula nec nulla mattis finibus.
28+
Vivamus ullamcorper aliquam purus, non accumsan magna hendrerit accumsan. Quisque scelerisque,
29+
tortor vel mollis consequat, enim magna consectetur justo, in scelerisque ex lacus eu nisi. Cras at
30+
turpis sit amet ante mollis venenatis. Integer molestie commodo orci, vel mollis nunc volutpat at.
31+
Vestibulum eu auctor libero.
32+
</p>

0 commit comments

Comments
 (0)