Skip to content

Commit d7d6703

Browse files
authored
Merge pull request #210 from plasmabio/update-resource-monitoring
Update resource monitoring in documentation
2 parents 2d23aec + af70ebd commit d7d6703

3 files changed

Lines changed: 30 additions & 19 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ volumes/
2222
# the Ansible file
2323
ansible/hosts*
2424
ansible/users-config.yml
25+
ansible/*.csv
2526

2627
# local TLJH config used for testing
2728
config.yaml

docs/configuration/batch-users.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(batch-users)=
22

3-
# Creating users in batches
3+
# Creating and deleting users in batches
44

55
The {ref}`install-users` section details how to create the initial list of users.
66

77
However in some cases it is useful to have a more automated way to create (and delete) users
88
in batches. For example when preparing and cleaning up a group of students at the beginning and end of a semester.
99

10-
This section details how to create users defined in a CSV file using Ansible Playbooks.
10+
This section details how to create and delete users defined in a CSV file using Ansible Playbooks.
1111

1212
## Creating the CSV File
1313

@@ -33,24 +33,19 @@ stu-megm1-10,QjhalcW9Uq5wxo,megm1
3333
Since the fields in the CSV file are delimited by commas, passwords should not contain any `,` character.
3434
````
3535

36-
## Running the playbooks
36+
## Running the playbook to create users
3737

3838
To create the users, go to the `ansible/` folder and run the `student-create.yml` playbook with:
3939

4040
```sh
4141
ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv"
4242
```
4343

44-
It is also possible to delete the users from the same CSV definition, using the `student-remove.yml` playbook:
45-
46-
```sh
47-
ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv"
48-
```
4944

5045
````{note}
5146
It is possible to pass additional parameters when creating users in batches.
5247
53-
For example if you have a file defining disk quotas for a group of students:
48+
For example if you have a file `students-config.yml` defining disk quotas for a group of students:
5449
5550
```yaml
5651
# default quotas for students
@@ -61,7 +56,24 @@ quota:
6156
6257
You can run the playbook and reference that extra file:
6358
64-
```bash
59+
```sh
6560
ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv" -e @students-config.yml
6661
```
62+
````
63+
64+
65+
## Running the playbook to delete users
66+
67+
To delete users, go to the `ansible/` folder and run the `student-remove.yml` playbook with:
68+
69+
```sh
70+
ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv"
71+
```
72+
73+
````{warning}
74+
You need to provide the exact same CSV file you used to create users in the first place.
75+
````
76+
77+
````{warning}
78+
Please note that user home directories are deleted.
6779
````

docs/configuration/resources.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Resources
22

3-
Plasma provides default values to limit the Memory and CPU usage.
3+
Plasma provides default values to limit the memory and CPU usage.
44

55
## Memory
66

@@ -19,7 +19,7 @@ Users can monitor their memory usage using the indicator in the top bar area if
1919

2020
## CPU
2121

22-
By default Plasma sets a limit of `2 cpus` for each user server.
22+
By default Plasma sets a limit of `2 CPUs` for each user server.
2323

2424
This limit is enforced by the operating system, which throttles access to the CPU by the processes running in the
2525
Docker container.
@@ -37,13 +37,11 @@ Users can monitor their CPU usage using the indicator in the top bar area if the
3737

3838
## Displaying the indicators
3939

40-
To enable the Memory and CPU indicators as shown above, the following dependencies must be added to the user environment:
40+
To enable the memory and CPU indicators as shown above, the following dependencies must be added to the user environment:
4141

42-
- `nbresuse`
43-
- `jupyterlab-topbar-extension`
42+
- `jupyter-resource-usage`
43+
- `jupyterlab-topbar`
44+
- `jupyterlab-topbar-text`
4445
- `jupyterlab-system-monitor`
4546

46-
As an example, checkout the following two links:
47-
48-
- [Adding nbresuse](https://github.com/plasmabio/template-python/blob/a4edf334c6b4b16be3a184d0d6e8196137ee1b06/environment.yml#L9)
49-
- [Adding the JupyterLab extensions](https://github.com/plasmabio/template-python/blob/a4edf334c6b4b16be3a184d0d6e8196137ee1b06/postBuild#L4-L5)
47+
As an example, checkout this [template](https://github.com/plasmabio/template-python/blob/master/binder/environment.yml) for a Python environment.

0 commit comments

Comments
 (0)