From 085ad1d23171511006fd07e8e97c89297bc80915 Mon Sep 17 00:00:00 2001 From: Pierre Poulain Date: Fri, 8 Apr 2022 18:43:30 +0200 Subject: [PATCH 1/5] Add explanation to remove users in batch --- docs/configuration/batch-users.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/docs/configuration/batch-users.md b/docs/configuration/batch-users.md index 3437df1..daaf3fa 100644 --- a/docs/configuration/batch-users.md +++ b/docs/configuration/batch-users.md @@ -1,13 +1,13 @@ (batch-users)= -# Creating users in batches +# Creating and deleting users in batches The {ref}`install-users` section details how to create the initial list of users. However in some cases it is useful to have a more automated way to create (and delete) users in batches. For example when preparing and cleaning up a group of students at the beginning and end of a semester. -This section details how to create users defined in a CSV file using Ansible Playbooks. +This section details how to create and delete users defined in a CSV file using Ansible Playbooks. ## Creating the CSV File @@ -33,7 +33,7 @@ stu-megm1-10,QjhalcW9Uq5wxo,megm1 Since the fields in the CSV file are delimited by commas, passwords should not contain any `,` character. ```` -## Running the playbooks +## Running the playbook to create users To create the users, go to the `ansible/` folder and run the `student-create.yml` playbook with: @@ -50,7 +50,7 @@ ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv" ````{note} It is possible to pass additional parameters when creating users in batches. -For example if you have a file defining disk quotas for a group of students: +For example if you have a file `students-config.yml` defining disk quotas for a group of students: ```yaml # default quotas for students @@ -64,4 +64,21 @@ You can run the playbook and reference that extra file: ```bash ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv" -e @students-config.yml ``` +```` + + +## Running the playbook to delete users + +To create the users, go to the `ansible/` folder and run the `student-remove.yml` playbook with: + +```sh +ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv" +``` + +````{warning} +You need to provide the exact same CSV file you used to create users in the first place. +```` + +````{warning} +Please note that user home directories are deleted. ```` \ No newline at end of file From ce63b94d29e35baabeaa6266867b95a28fc4b6a4 Mon Sep 17 00:00:00 2001 From: Pierre Poulain Date: Fri, 8 Apr 2022 18:44:41 +0200 Subject: [PATCH 2/5] Fix typo --- docs/configuration/batch-users.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/batch-users.md b/docs/configuration/batch-users.md index daaf3fa..b728907 100644 --- a/docs/configuration/batch-users.md +++ b/docs/configuration/batch-users.md @@ -69,7 +69,7 @@ ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv" -e @s ## Running the playbook to delete users -To create the users, go to the `ansible/` folder and run the `student-remove.yml` playbook with: +To delete users, go to the `ansible/` folder and run the `student-remove.yml` playbook with: ```sh ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv" From 312089c2889fae39f149339416d9e83eb7cd59bc Mon Sep 17 00:00:00 2001 From: Pierre Poulain Date: Fri, 8 Apr 2022 18:45:34 +0200 Subject: [PATCH 3/5] Ignore CSV files used for batch users --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 48a5e89..87b0ee0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ volumes/ # the Ansible file ansible/hosts* ansible/users-config.yml +ansible/*.csv # local TLJH config used for testing config.yaml From 2fd48c2917c13df37d312c0f9e86fc892ca91862 Mon Sep 17 00:00:00 2001 From: Pierre Poulain Date: Sat, 9 Apr 2022 19:41:02 +0200 Subject: [PATCH 4/5] Remove redondant text --- docs/configuration/batch-users.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/configuration/batch-users.md b/docs/configuration/batch-users.md index b728907..bc257cb 100644 --- a/docs/configuration/batch-users.md +++ b/docs/configuration/batch-users.md @@ -41,11 +41,6 @@ To create the users, go to the `ansible/` folder and run the `student-create.yml ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv" ``` -It is also possible to delete the users from the same CSV definition, using the `student-remove.yml` playbook: - -```sh -ansible-playbook student-remove.yml -u ubuntu -e "studentdef=students.csv" -``` ````{note} It is possible to pass additional parameters when creating users in batches. @@ -61,7 +56,7 @@ quota: You can run the playbook and reference that extra file: -```bash +```sh ansible-playbook student-create.yml -u ubuntu -e "studentdef=students.csv" -e @students-config.yml ``` ```` From af70ebdfb41b2f346b90a30985e375a33a2a9df9 Mon Sep 17 00:00:00 2001 From: Pierre Poulain Date: Sat, 9 Apr 2022 19:48:35 +0200 Subject: [PATCH 5/5] Update dependencies for resource monitoring --- docs/configuration/resources.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/configuration/resources.md b/docs/configuration/resources.md index 358f916..92e8a51 100644 --- a/docs/configuration/resources.md +++ b/docs/configuration/resources.md @@ -1,6 +1,6 @@ # Resources -Plasma provides default values to limit the Memory and CPU usage. +Plasma provides default values to limit the memory and CPU usage. ## Memory @@ -19,7 +19,7 @@ Users can monitor their memory usage using the indicator in the top bar area if ## CPU -By default Plasma sets a limit of `2 cpus` for each user server. +By default Plasma sets a limit of `2 CPUs` for each user server. This limit is enforced by the operating system, which throttles access to the CPU by the processes running in the Docker container. @@ -37,13 +37,11 @@ Users can monitor their CPU usage using the indicator in the top bar area if the ## Displaying the indicators -To enable the Memory and CPU indicators as shown above, the following dependencies must be added to the user environment: +To enable the memory and CPU indicators as shown above, the following dependencies must be added to the user environment: -- `nbresuse` -- `jupyterlab-topbar-extension` +- `jupyter-resource-usage` +- `jupyterlab-topbar` +- `jupyterlab-topbar-text` - `jupyterlab-system-monitor` -As an example, checkout the following two links: - -- [Adding nbresuse](https://github.com/plasmabio/template-python/blob/a4edf334c6b4b16be3a184d0d6e8196137ee1b06/environment.yml#L9) -- [Adding the JupyterLab extensions](https://github.com/plasmabio/template-python/blob/a4edf334c6b4b16be3a184d0d6e8196137ee1b06/postBuild#L4-L5) +As an example, checkout this [template](https://github.com/plasmabio/template-python/blob/master/binder/environment.yml) for a Python environment.