Skip to content

Commit e5b91a4

Browse files
committed
updating training instructions
1 parent c8b6724 commit e5b91a4

1 file changed

Lines changed: 71 additions & 83 deletions

File tree

pages/training-development.md

Lines changed: 71 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@ title: Training development instructions
33
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.
44
---
55

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.
87
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.
129

1310
---
1411

1512
## 1. VM setup and access {#vm-setup}
1613

1714
### Launch a VM instance
1815

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`).
2117

2218
### Log in via SSH
2319

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.
2621

2722
```bash
2823
ssh tdevNN@<IP_Address>
@@ -32,17 +27,15 @@ ssh tdevNN@<IP_Address>
3227

3328
## 2. Disk budget {#disk-budget}
3429

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:
3731

3832
- Training materials saved in the template directory (`/etc/skel/`)
3933
- CVMFS-cached container layers and reference data (written to the CVMFS cache on first use)
4034
- Trainee working files generated during the session
4135

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.
4437
45-
Check disk availability with:
38+
Check how much space you have with:
4639

4740
```bash
4841
df -h
@@ -59,7 +52,7 @@ tmpfs 5.0M 0 5.0M 0% /run/lock
5952
tmpfs 197M 16K 197M 1% /run/user/1000
6053
```
6154

62-
To recover disk space:
55+
If you need to recover some disk space, these commands can help:
6356

6457
```bash
6558
sudo apt clean # Clear apt cache (~640 MB saving)
@@ -72,16 +65,13 @@ sudo journalctl --vacuum-size=50M # Trim system logs
7265

7366
## 3. Using CVMFS resources {#cvmfs}
7467

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.
7869

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).
8171

82-
### Singularity containers via shelley-bio
72+
### Finding and installing tools with shelley-bio
8373

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:
8575

8676
```bash
8777
# Search for available tools
@@ -94,86 +84,90 @@ shelley-bio versions <toolname>
9484
shelley-bio build <toolname>
9585
```
9686

97-
Always check whether a required tool or reference is available on CVMFS before considering
98-
alternatives. Where a CVMFS path exists, point configs and scripts directly at it — do not
99-
copy resources into the trainee directory.
87+
### Symlinking reference data from CVMFS {#symlinking}
88+
89+
Rather than copying reference files into the trainee directory, create a symlink that points directly to the CVMFS path. For example:
90+
91+
```bash
92+
ln -s /cvmfs/data.galaxyproject.org/byhand/CHM13_T2T_v2.0/seq/CHM13_T2T_v2.0.fa CHM13_T2T_v2.0.fa
93+
```
94+
95+
This creates a symlink in your current directory pointing to the CVMFS source. You can also give it a custom name or place it somewhere else:
96+
97+
```bash
98+
ln -s /cvmfs/data.galaxyproject.org/byhand/CHM13_T2T_v2.0/seq/CHM13_T2T_v2.0.fa /path/to/destination/my_reference.fa
99+
```
100100

101101
---
102102

103103
## 4. Developing training materials {#developing-materials}
104104

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.
109106

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.
115108
116109
Once everything works end-to-end, your home directory becomes the template.
117110

118111
---
119112

120113
## 5. Trainee directory layout {#directory-layout}
121114

122-
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:
123116

124117
```
125118
~/
126119
├── 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)
130123
├── configs/ # Workflow configuration files
131124
├── scripts/ # Example and helper scripts
132125
└── results/ # Empty output directory for trainee use
133126
```
134127

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
136131

137-
### Check your size before copying
132+
Before copying, check how large your home directory is:
138133

139134
```bash
140135
du -sh /home/<username>/
141136
```
142137

143-
Once satisfied, copy your home directory to `/etc/skel/`:
138+
Once you are happy with the contents, copy everything to `/etc/skel/`:
144139

145140
```bash
146141
sudo cp -r /home/<username>/. /etc/skel/
147142
```
148143

149-
Replace `<username>` with your actual username (e.g. `tdev01`).
144+
Replace `<username>` with your actual username (for example `tdev01`).
150145

151-
Review and clean up the template directory:
146+
Then review what landed in the template and remove anything you do not want:
152147

153148
```bash
154149
ls -a /etc/skel/
155150
```
156151

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:
159155

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+
```
162159

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.
165161
166162
---
167163

168164
## 6. If resources are not available on CVMFS {#non-cvmfs}
169165

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.
173167

174168
### Adding a pull step to the provisioning script
175169

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/`:
177171

178172
```bash
179173
# Pull a Singularity container into the trainee containers directory
@@ -185,109 +179,103 @@ mkdir -p /home/$USERNAME/references
185179
wget -q -O /home/$USERNAME/references/<file> <url>
186180
```
187181

188-
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).
190183

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.
192185
193186
---
194187

195188
## 7. How trainees are provisioned {#provisioning}
196189

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:
199191

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
202194
- The contents of `/etc/skel/` at snapshot time become the trainee's home directory
203195
- After the user is created, `/etc/skel/` is cleared to reduce VM image size
204196

205197
---
206198

207-
## 8. Cloud-init datasource check (pre-snapshot requirement) {#cloud-init}
199+
## 8. Cloud-init datasource check (required before every snapshot) {#cloud-init}
208200

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.
212202

213-
### Step 1 Check for the offending apt file
203+
### Step 1: Check for the offending apt file
214204

215205
```bash
216206
ls /etc/cloud/cloud.cfg.d/
217207
```
218208

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:
221210

222211
```bash
223212
sudo rm /etc/cloud/cloud.cfg.d/90_dpkg.cfg
224213
```
225214

226-
### Step 2 Verify the datasource order
215+
### Step 2: Verify the datasource order
227216

228217
```bash
229218
cat /etc/cloud/cloud.cfg | grep -A5 "datasource_list"
230219
```
231220

232-
The output should show only `ConfigDrive` and `OpenStack`:
221+
The output should list only `ConfigDrive` and `OpenStack`:
233222

234223
```yaml
235224
datasource_list:
236225
- ConfigDrive
237226
- OpenStack
238227
```
239228
240-
### Step 3 Clean cloud-init state
229+
### Step 3: Clean cloud-init state
241230
242231
```bash
243232
sudo cloud-init clean --logs
244233
```
245234

246-
> **Important:** `cloud-init clean` deletes `/etc/cloud/ds-identify.cfg`. Recreate it
247-
> immediately:
235+
> **Important:** `cloud-init clean` deletes `/etc/cloud/ds-identify.cfg`. You will need to recreate it:
248236
249237
```bash
250238
sudo tee /etc/cloud/ds-identify.cfg << 'EOF'
251239
policy: enabled
252240
EOF
253241
```
254242

255-
Verify it was created correctly:
243+
Verify it looks right:
256244

257245
```bash
258246
cat /etc/cloud/ds-identify.cfg
259247
```
260248

261249
Expected output: `policy: enabled`
262250

263-
### Step 4 Confirm the datasource
251+
### Step 4: Confirm the datasource
264252

265253
```bash
266254
sudo cloud-init init
267255
sudo cloud-init status --long
268256
```
269257

270-
Check the `detail` line in the output — it should read `DataSourceOpenStackLocal` or
271-
`DataSourceOpenStack`:
258+
Look at the `detail` line in the output. It should read `DataSourceOpenStackLocal` or `DataSourceOpenStack`:
272259

273260
```
274261
detail: DataSourceOpenStackLocal [net,ver=2]
275262
```
276263

277-
If it reads `DataSourceNoCloud`, recheck Steps 1–4 and contact Mitchell or Giorgia if the
278-
problem persists.
264+
If it reads `DataSourceNoCloud`, work through Steps 1 to 4 again. If it still does not resolve, contact Mitchell or Giorgia.
279265

280266
---
281267

282-
## 9. Pre-snapshot checklist {#checklist}
268+
## Pre-snapshot checklist {#checklist}
269+
270+
Run through this before taking any snapshot:
283271

284272
- [ ] Workflow tested end-to-end from a trainee's perspective
285-
- [ ] All tools use CVMFS Singularity containers via `shelley-bio` where available
286-
- [ ] All references point to CVMFS paths where available
273+
- [ ] All tools use CVMFS Singularity containers installed via `shelley-bio` where available
274+
- [ ] All references point to CVMFS paths or symlinks where available
287275
- [ ] Input data is as small as practical
288276
- [ ] `du -sh /home/<username>/` confirms the directory size is acceptable
289-
- [ ] Any non-CVMFS resources that are too large to bundle are pulled via the provisioning script
277+
- [ ] Any non-CVMFS resources that are too large to bundle have been prepared as provisioning script pull steps and shared with Giorgia or Mitchell
290278
- [ ] `sudo cp -r /home/<username>/. /etc/skel/` completed successfully
291279
- [ ] `/etc/skel/` contents verified before snapshotting
292-
- [ ] Total estimated disk usage (base ~12 GB + skel + boot-time pulls) comfortably under 30 GB
280+
- [ ] Total estimated disk usage (base ~12 GB + skel + boot-time pulls) is comfortably under 30 GB
293281
- [ ] `/etc/cloud/ds-identify.cfg` is present and reads `policy: enabled`

0 commit comments

Comments
 (0)