|
1 | 1 | # Open OnDemand Tutorial |
2 | 2 |
|
| 3 | +- [Jupyter App Tutorial Summary](#jupyter-app-tutorial-summary) |
3 | 4 | - [Jupyter App Tutorial](#jupyter-app-tutorial) |
4 | 5 | - [Passenger App Tutorial](#passenger-app-tutorial) |
5 | 6 | - [XDMoD Integration Tutorial](#xdmod-integration-tutorial) |
|
9 | 10 | * [Online Documentation](https://osc.github.io/ood-documentation/master/) |
10 | 11 | * [Jupyter Install Tutorial](https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps/add-jupyter.html) |
11 | 12 |
|
12 | | -## Jupyter App Tutorial |
| 13 | +## Jupyter App Tutorial Summary |
| 14 | + |
| 15 | +This section provides a few snippets helpful for following along with the live tutorial. |
| 16 | + |
| 17 | +Login to OnDemand as hpcadmin to https://localhost:3443 |
| 18 | + |
| 19 | +### Get the app working |
| 20 | + |
| 21 | +1. Develop => My Sandbox Apps |
| 22 | +2. Click New App |
| 23 | +3. Click Clone Existing App: `jupyter` and `/var/git/bc_example_jupyter` |
| 24 | + |
| 25 | +Fix environment: `source /usr/local/jupyter/2.1.4/bin/activate` |
| 26 | + |
| 27 | + |
| 28 | +### Modify the Partition field |
| 29 | + |
| 30 | +form.yml changes: |
| 31 | + |
| 32 | +``` |
| 33 | +attributes: |
| 34 | + custom_queue: |
| 35 | + widget: "select" |
| 36 | + label: "Partition" |
| 37 | + options: |
| 38 | + - ["Compute", "compute"] |
| 39 | + - ["Debug", "debug"] |
| 40 | +form: |
| 41 | + - custom_queue |
| 42 | +# - bc_queue |
| 43 | +``` |
| 44 | + |
| 45 | +- `custom_queue` is used instead of `partition` because of 1.8 bug that will be fixed prior to release |
| 46 | + |
| 47 | +script.yml.erb changes: |
| 48 | + |
| 49 | +```yaml |
| 50 | +script: |
| 51 | + queue_name: "<%= custom_queue %>" |
| 52 | +``` |
| 53 | +
|
| 54 | +- the constructor for the Ruby object https://osc.github.io/ood_core/0.11.4/OodCore/Job/Script.html shows all the options you can set in the script.yml above (https://www.rubydoc.info/gems/ood_core/OodCore/Job/Script typically shows the latest - but sometimes this service is unavailable) |
| 55 | +
|
| 56 | +### Deploy to production |
| 57 | +
|
| 58 | +Edit manifest: |
| 59 | +
|
| 60 | +``` |
| 61 | +--- |
| 62 | +# change the name, this is what shows up in the menu |
| 63 | +name: HPC Tutorial Jupyter |
| 64 | +# change the category just to differentiate from the system installed |
| 65 | +# deskop application |
| 66 | +category: Tutorial Apps |
| 67 | +# change the subcategory |
| 68 | +subcategory: Machine Learning |
| 69 | +role: batch_connect |
| 70 | +# change the description, this shows up when you hover over the menu item on the interactive sessions page |
| 71 | +description: | |
| 72 | + This app will launch a Jupyter Lab or Notebootk on one or more nodes. |
| 73 | +
|
| 74 | +``` |
| 75 | +
|
| 76 | +Deployment steps on ondemand host via Shell: |
| 77 | +
|
| 78 | + sudo mv /var/www/ood/apps/sys/jupyter /var/www/ood/apps/sys/jupyter.old |
| 79 | + sudo cp -r jupyter /var/www/ood/apps/sys/jupyter |
| 80 | +
|
| 81 | +- app directory names with periods in them do not display in the navbar, which is why we can rename the old app to jupyter.old |
| 82 | +
|
| 83 | +
|
| 84 | +### Set the memory for the job |
| 85 | +
|
| 86 | +form.yml changes: |
| 87 | +
|
| 88 | +``` |
| 89 | +attributes: |
| 90 | + memory: |
| 91 | + widget: "number_field" |
| 92 | + max: 1000 |
| 93 | + min: 200 |
| 94 | + step: 200 |
| 95 | + value: 600 |
| 96 | + label: "Memory (MB)" |
| 97 | + help: "RSS Memory" |
| 98 | +form: |
| 99 | + - memory |
| 100 | +``` |
| 101 | +
|
| 102 | +- widget specifies the type of widget to be a number |
| 103 | +- max the maximum value, ~1 GB in this case |
| 104 | +- min the minimum value, 200 MB |
| 105 | +- step the step size when users increase or decrease the value |
| 106 | +- value the default value of 600 MB |
| 107 | +- label the for UIs label |
| 108 | +- help a help message |
| 109 | +- See https://osc.github.io/ood-documentation/master/app-development/interactive/form.html#customizing-attributes for more details about what you can set in each "attribute" |
| 110 | +
|
| 111 | +script.yml.erb modifications: |
| 112 | +
|
| 113 | +``` |
| 114 | +script: |
| 115 | + native: |
| 116 | + - "--mem" |
| 117 | + - "<%= memory %>M" |
| 118 | +``` |
| 119 | +
|
| 120 | +- script.native attributes are way for us to specify scheduler specific argument to sbatch or qsub or bsub |
| 121 | +- this lets you set arguments that OnDemand doesn't provide an abstraction for |
| 122 | +
|
| 123 | +### Limit number of cores |
| 124 | +
|
| 125 | +form.yml: |
| 126 | +
|
| 127 | +```yaml |
| 128 | +attributes: |
| 129 | + bc_num_slots: |
| 130 | + max: 2 |
| 131 | +``` |
| 132 | +
|
| 133 | +
|
| 134 | +## Jupyter App Detailed Tutorial |
13 | 135 |
|
14 | 136 | This tutorial will be using the the `hpcadmin` credentials listed in |
15 | 137 | [Accessing the Applications](../docs/applications.md). |
|
0 commit comments