Skip to content

Commit f37bf0c

Browse files
authored
Merge pull request #87 from silx-kit/update-doc
Update demo config and readme
2 parents e48b2be + d50109c commit f37bf0c

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
partitions set in the Spawner and allows the user to select Slurm resources to
1111
use.
1212

13-
<img style="margin:auto" src=https://user-images.githubusercontent.com/9449698/194308511-f0e6d6a9-ba7a-4086-a871-23b08523c61a.png width="50%">
13+
<img style="margin:auto" src=https://user-images.githubusercontent.com/9449698/215526389-2ef5ac32-5d50-49de-aa5f-46972feaccf1.png width="50%">
1414

1515
## Install
1616

@@ -99,6 +99,9 @@ c.MOSlurmSpawner.partitions = {
9999
}
100100
```
101101

102+
For a minimalistic working demo, check the
103+
[`demo/jupyterhub_conf.py`](demo/jupyterhub_conf.py) config file.
104+
102105
### Field descriptions
103106

104107
- `architecture`: The architecture of the partition. This is only cosmetic and
@@ -147,7 +150,7 @@ The spawn page (available at `/hub/spawn`) will be generated according to the
147150
partition settings. For example, this is the spawn page generated for the
148151
partition settings above:
149152

150-
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/194308511-f0e6d6a9-ba7a-4086-a871-23b08523c61a.png width="50%">
153+
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/215526389-2ef5ac32-5d50-49de-aa5f-46972feaccf1.png width="50%">
151154

152155
This spawn page is separated in two tabs: a _Simple_ and an _Advanced_ tab. On
153156
the _Simple_ tab, the user can choose between the partitions set though
@@ -159,15 +162,15 @@ Clicking on the **Start** button will request the job.
159162
The spawn page adapts to the chosen partition. This is the page when selecting
160163
the `partition_2`:
161164

162-
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/194308454-697c717f-daf0-4927-9fa6-6b96ba09dba6.png width="50%">
165+
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/215526553-4ba57510-efac-4a28-a576-ef81ff9ec2f5.png width="50%">
163166

164167
As the maximum number of cores is different, the CPUs row change accordingly.
165168
Also, as `gpu` was set for `partition_2`, a new button row appears to enable GPU
166169
requests.
167170

168171
The _Advanced_ tab allows finer control on the requested resources.
169172

170-
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/194308524-38417bb8-f520-4940-9c94-af960f11e535.png width="50%">
173+
<img style="margin:1rem auto" src=https://user-images.githubusercontent.com/9449698/215526665-a650a54d-e7ec-4d50-b5ab-a02d93b23d19.png width="50%">
171174

172175
The user can select any partition (`partition_3` is added in this case) and the
173176
table of available resources reflects this. The user can also choose any number

demo/jupyterhub_conf.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@
1313
jupyterhub_moss.set_config(c)
1414

1515

16-
SINFO_OUTPUT = """unused 40 28+ 121/1191/0/1312 (null) 196000+ infinite
17-
partition_1 48 35+ 38/1642/0/1680 (null) 196000+ 1-00:00:00
18-
partition_2 7 128 116/780/0/896 gpu:GPU-MODEL:2 512000 12:00:00
19-
partition_3 28 40 114/1006/0/1120 (null) 310000 4:00:00
20-
other_mixed 10 64 152/488/0/640 gpu:OTHER-GPU:2(S:0-1) 455000+ 7-00:00:00
21-
other_mixed 94 28+ 153/3583/0/3736 (null) 196000+ 7-00:00:00
22-
"""
23-
c.MOSlurmSpawner.slurm_info_cmd = f'echo "{SINFO_OUTPUT}"'
24-
25-
2616
# Partition descriptions, see https://github.com/silx-kit/jupyterhub_moss#partition-settings
2717
c.MOSlurmSpawner.partitions = {
2818
"partition_1": {
@@ -85,12 +75,23 @@
8575
},
8676
}
8777

78+
# Uncomment the following to customize the options_form template
79+
# c.JupyterHub.template_paths = [os.path.join(os.path.dirname(__file__), "templates")]
8880

89-
# JupyterHub
81+
# Mock SLURM sinfo command for the demo
82+
SINFO_OUTPUT = """unused 5/35/0/40 28+ 121/1191/0/1312 (null) 196000+ infinite
83+
partition_1 2/46/0/48 35+ 38/1642/0/1680 (null) 196000+ 1-00:00:00
84+
partition_2 2/5/0/7 128 116/780/0/896 gpu:GPU-MODEL:2 512000 12:00:00
85+
partition_3 4/24/0/28 40 114/1006/0/1120 (null) 310000 4:00:00
86+
other_mixed 3/7/0/10 64 152/488/0/640 gpu:OTHER-GPU:2(S:0-1) 455000+ 7-00:00:00
87+
other_mixed 6/86/0/94 28+ 153/3583/0/3736 (null) 196000+ 7-00:00:00
88+
"""
89+
c.MOSlurmSpawner.slurm_info_cmd = f'echo "{SINFO_OUTPUT}"'
90+
91+
# Batchspawner: Do not run sudo for the demo
92+
c.BatchSpawnerBase.exec_prefix = ""
93+
94+
# JupyterHub basic config
9095
c.JupyterHub.ip = "127.0.0.1"
9196
c.JupyterHub.hub_ip = "127.0.0.1"
9297
c.JupyterHub.port = 8000
93-
c.JupyterHub.template_paths = [os.path.join(os.path.dirname(__file__), "templates")]
94-
95-
# Batchspawner
96-
c.BatchSpawnerBase.exec_prefix = "" # Do not run sudo

0 commit comments

Comments
 (0)