You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/training-development.md
+71-83Lines changed: 71 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,21 @@ title: Training development instructions
3
3
description: How to set up and prepare a BioShell training environment for the BioCommons Training Cooperative, including VM configuration, CVMFS use, trainee directory layout, and pre-snapshot requirements.
4
4
---
5
5
6
-
> **Draft:** These instructions are under active development. Contact Mitchell for
7
-
> clarification on any steps or requirements — feedback is welcome.
6
+
> **Draft:** These instructions are a work in progress. If anything is unclear, reach out to Mitchell directly. Feedback is very welcome.
8
7
9
-
This guide is for **training developers** (`tdevNN` users) setting up BioShell training
10
-
environments on virtual machines. You will configure tools, build training materials, and
11
-
prepare a template that is automatically applied to trainee accounts when VMs are provisioned.
8
+
This guide is for **training developers** (`tdevNN` users) who are setting up BioShell training environments for the BioCommons Training Cooperative. You will configure tools, build training materials, and prepare a template that gets automatically applied to trainee accounts when VMs are provisioned.
12
9
13
10
---
14
11
15
12
## 1. VM setup and access {#vm-setup}
16
13
17
14
### Launch a VM instance
18
15
19
-
VM instances are provisioned by Giorgia or Mitchell. Machines are named with the prefix `D`
20
-
(for dev) followed by a number, for example `D1`.
16
+
VM instances are provisioned by Giorgia or Mitchell. Each dev machine is named with the prefix `D` followed by a number (for example `D1`).
21
17
22
18
### Log in via SSH
23
19
24
-
A username and IP address will be provided by the training team. Your username follows the
25
-
format `tdevNN` where `NN` matches your VM's prefix number.
20
+
The training team will provide you with a username and IP address. Your username follows the format `tdevNN`, where `NN` matches your VM's prefix number.
26
21
27
22
```bash
28
23
ssh tdevNN@<IP_Address>
@@ -32,17 +27,15 @@ ssh tdevNN@<IP_Address>
32
27
33
28
## 2. Disk budget {#disk-budget}
34
29
35
-
The base VM template is approximately **12 GB** on a **30 GB** disk, leaving roughly **16 GB**
36
-
of usable space. This must cover:
30
+
The base VM template takes up approximately **12 GB** on a **30 GB** disk, leaving roughly **16 GB** of usable space. That space has to cover:
37
31
38
32
- Training materials saved in the template directory (`/etc/skel/`)
39
33
- CVMFS-cached container layers and reference data (written to the CVMFS cache on first use)
40
34
- Trainee working files generated during the session
41
35
42
-
> **Critical:** If the disk fills up during user creation, the `useradd` step will fail and
43
-
> the trainee account will not be created. Keep `/etc/skel/` as lean as possible.
36
+
> **Watch the disk:** If the disk fills up during user creation, the `useradd` step will fail and the trainee account will not be created. Keep `/etc/skel/` as lean as possible.
44
37
45
-
Check disk availability with:
38
+
Check how much space you have with:
46
39
47
40
```bash
48
41
df -h
@@ -59,7 +52,7 @@ tmpfs 5.0M 0 5.0M 0% /run/lock
59
52
tmpfs 197M 16K 197M 1% /run/user/1000
60
53
```
61
54
62
-
To recover disk space:
55
+
If you need to recover some disk space, these commands can help:
63
56
64
57
```bash
65
58
sudo apt clean # Clear apt cache (~640 MB saving)
@@ -72,16 +65,13 @@ sudo journalctl --vacuum-size=50M # Trim system logs
72
65
73
66
## 3. Using CVMFS resources {#cvmfs}
74
67
75
-
CVMFS provides read-only, on-demand access to reference data and Singularity containers while
76
-
consuming very little cached local disk space. Always prioritise CVMFS resources over local
77
-
copies — they do not count against the disk budget.
68
+
CVMFS gives you read-only, on-demand access to reference data and Singularity containers. Importantly, CVMFS does not count against your disk budget, so you should always prefer CVMFS resources over local copies wherever possible.
78
69
79
-
For documentation on using data in the CVMFS repository, see the
80
-
[CVMFS reference data guide](https://docs.google.com/document/d/11YKFZjxzpjKPvyqK3SuAX7zUdgB24ziuGtgdvPcYrBs/edit?tab=t.0#heading=h.fbpu5xkpq96d).
70
+
For a full walkthrough of what is available and how to use it, see the [CVMFS and reference data guide](tools).
81
71
82
-
### Singularity containers via shelley-bio
72
+
### Finding and installing tools with shelley-bio
83
73
84
-
Use `shelley-bio` to find and install tools from CVMFS-hosted Singularity images:
74
+
Use `shelley-bio` to search for and install tools from CVMFS-hosted Singularity images:
## 4. Developing training materials {#developing-materials}
104
104
105
-
Set up your home directory (`/home/tdevNN`) exactly as you want trainees to experience it.
106
-
Build and test your workflows there, using CVMFS containers and references throughout. The
107
-
goal is a working, self-contained training environment that a trainee could follow from
108
-
start to finish.
105
+
Set up your home directory (`/home/tdevNN`) exactly as you want trainees to experience it. Build and test your workflows there, using CVMFS containers and references throughout. The goal is a working, self-contained environment that a trainee could follow from start to finish.
109
106
110
-
> **Data size:** When the Australian BioCommons dataset repository is ready it will be the
111
-
> main access point for training data — like CVMFS, data stored there will not count against
112
-
> VM size. Until then, keep data small. Use the minimum input data needed to demonstrate the
113
-
> workflow. If your ideal dataset is too large to copy to every trainee home directory, see
114
-
> [Section 6](#non-cvmfs) for how to pull it at boot time instead.
107
+
> **Keep data small:** When the Australian BioCommons dataset repository is ready, it will be the main access point for training data. Like CVMFS, data stored there will not count against VM size. Until then, use the minimum input data needed to demonstrate the workflow. If your ideal dataset is too large to copy to every trainee home directory, see [Section 6](#non-cvmfs) for how to pull it at boot time instead.
115
108
116
109
Once everything works end-to-end, your home directory becomes the template.
Organise your home directory to reflect what trainees should see on login:
115
+
Organise your home directory to reflect what trainees should see when they first log in. A typical layout might look like this:
123
116
124
117
```
125
118
~/
126
119
├── README.md # Introduction and step-by-step instructions
127
-
├── data/ # Minimal test input data if not available on CVMFS
128
-
├── containers/ # Containers not available on CVMFS (see Section 6)
129
-
├── references/ # References not available on CVMFS (see Section 6)
120
+
├── data/ # Minimal test input data if not available on CVMFS otherwise symlinked
121
+
├── containers/ # Containers symlinked unless not available on CVMFS (see Section 6)
122
+
├── references/ # References symlinked unless not available on CVMFS (see Section 6)
130
123
├── configs/ # Workflow configuration files
131
124
├── scripts/ # Example and helper scripts
132
125
└── results/ # Empty output directory for trainee use
133
126
```
134
127
135
-
Not all directories are needed for every module — include only what is relevant.
128
+
Not every module will need all of these folders. Only include what is relevant.
129
+
130
+
### Copy your directory into the template
136
131
137
-
### Check your size before copying
132
+
Before copying, check how large your home directory is:
138
133
139
134
```bash
140
135
du -sh /home/<username>/
141
136
```
142
137
143
-
Once satisfied, copy your home directory to `/etc/skel/`:
138
+
Once you are happy with the contents, copy everything to `/etc/skel/`:
144
139
145
140
```bash
146
141
sudo cp -r /home/<username>/. /etc/skel/
147
142
```
148
143
149
-
Replace `<username>` with your actual username (e.g.`tdev01`).
144
+
Replace `<username>` with your actual username (for example`tdev01`).
150
145
151
-
Review and clean up the template directory:
146
+
Then review what landed in the template and remove anything you do not want:
152
147
153
148
```bash
154
149
ls -a /etc/skel/
155
150
```
156
151
157
-
Remove any unwanted files. The contents of `/etc/skel/` act as the template and will be
158
-
applied automatically to every trainee's home directory when their account is created.
152
+
The contents of `/etc/skel/` will be copied automatically into every trainee's home directory when their account is created.
153
+
154
+
Once you are confident the template is correct, you can clean up your own home directory to free space:
159
155
160
-
Once you are confident the template is correct, delete the contents of your own home
161
-
directory to free space.
156
+
```bash
157
+
rm -rf ~/*
158
+
```
162
159
163
-
> **Tip:** Ask to have a snapshot taken at key checkpoints if you want a backup before
164
-
> making significant changes.
160
+
> **Tip:** Ask Giorgia or Mitchell to take a snapshot at key checkpoints if you want a backup before making significant changes.
165
161
166
162
---
167
163
168
164
## 6. If resources are not available on CVMFS {#non-cvmfs}
169
165
170
-
If a required container or reference is not available on CVMFS and is too large to include
171
-
directly in the trainee directory, it must be fetched at boot time via the VM provisioning
172
-
script. Prepare the required scripts and share with Giorgia or Mitchell.
166
+
If a required container or reference dataset is not on CVMFS and is too large to include directly in the trainee directory, it needs to be fetched at boot time via the VM provisioning script. Prepare the required scripts and share them with Giorgia or Mitchell.
173
167
174
168
### Adding a pull step to the provisioning script
175
169
176
-
Add downloads before the `useradd` block, targeting the relevant folder within`/etc/skel/`:
170
+
Downloads should be added before the `useradd` block, targeting the relevant folder inside`/etc/skel/`:
177
171
178
172
```bash
179
173
# Pull a Singularity container into the trainee containers directory
Resources pulled this way will appear in the correct location within the trainee's home
189
-
directory, consistent with the layout in [Section 5](#directory-layout).
182
+
Resources pulled this way will appear in the correct location in the trainee's home directory, matching the layout described in [Section 5](#directory-layout).
190
183
191
-
> **Note:** Boot-time pulls add to your disk budget. Factor their size into your 30 GB total.
184
+
> **Note:** Boot-time pulls count toward your disk budget. Factor their size into your 30 GB total.
192
185
193
186
---
194
187
195
188
## 7. How trainees are provisioned {#provisioning}
196
189
197
-
When a VM is built from your snapshot (done by Giorgia or Mitchell), the provisioning script
198
-
runs automatically:
190
+
When a VM is built from your snapshot (done by Giorgia or Mitchell), the provisioning script runs automatically:
199
191
200
-
- The trainee's username will be `userNN` (e.g.`user1`)
201
-
- Their password is deterministically generated from their username, unique per VM
192
+
- The trainee's username will be `userNN` (for example`user1`)
193
+
- Their password is generated deterministically from their username, and is unique per VM
202
194
- The contents of `/etc/skel/` at snapshot time become the trainee's home directory
203
195
- After the user is created, `/etc/skel/` is cleared to reduce VM image size
## 8. Cloud-init datasource check (required before every snapshot) {#cloud-init}
208
200
209
-
Running `apt upgrade` during VM setup can silently alter cloud-init configuration, causing all
210
-
VMs built from the snapshot to inherit the wrong hostname. The following must be checked and
211
-
corrected before every snapshot.
201
+
Running `apt upgrade` during VM setup can silently change cloud-init configuration, which causes all VMs built from your snapshot to inherit the wrong hostname. Please check and fix this before asking the VM to be snapshot.
212
202
213
-
### Step 1 — Check for the offending apt file
203
+
### Step 1: Check for the offending apt file
214
204
215
205
```bash
216
206
ls /etc/cloud/cloud.cfg.d/
217
207
```
218
208
219
-
A working VM should contain only `05_logging.cfg` and `README`. If `90_dpkg.cfg` is present,
220
-
remove it:
209
+
A working VM should only contain `05_logging.cfg` and `README`. If `90_dpkg.cfg` is present, remove it:
0 commit comments