Skip to content

Commit ec632a0

Browse files
committed
feat: Add authoring howtos
Signed-off-by: Jean-Luc Davern <jdavern@linuxfoundation.org>
1 parent 4c80d04 commit ec632a0

File tree

4 files changed

+142
-204
lines changed

4 files changed

+142
-204
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# HOW TO Add Instructions to a Lab
2+
3+
This guide explains how to add instructions to your lab after creating the compute environment.
4+
5+
## Prerequisites
6+
7+
Before you begin, ensure you:
8+
9+
- Have access to the `lftraining` GitHub Organization
10+
- Are a member of the `lab-authors` team
11+
- Have created a compute environment using [this HOW TO ](create-a-compute-environment-using-templates.md)
12+
13+
14+
## Adding Instructions Using GitHub Web Interface
15+
16+
![Writing Instructions](../img/writing-instructions.gif)
17+
18+
1. Navigate to your Pull Request created by the workflow
19+
2. Click the feature branch `feature/implement-<your-compute-environment>`
20+
2. Locate the `compute-environments/available/<your-compute-environment>` directory
21+
3. Find `instructions.en.md` in this directory
22+
4. Click the edit button (pencil icon) to modify the file
23+
24+
### Writing Instructions
25+
26+
The file uses standard Markdown syntax. When rendered in the lab UI:
27+
28+
- Code blocks get syntax highlighting
29+
- A copy button appears next to code blocks for easy copying
30+
31+
### Saving Your Changes
32+
33+
After editing the instructions:
34+
35+
1. Click the `Commit changes...` button
36+
2. Add a meaningful commit message (e.g., "feat: add lab instructions")
37+
3. Click "Sign off and commit changes"
38+
39+
40+
!!!note "Working Locally"
41+
If you prefer to work locally, you can clone the repository and edit the files in your preferred editor.
42+
43+
### Automated Environment Creation
44+
45+
After committing your changes:
46+
47+
1. Return to your Pull Request in GitHub
48+
2. Look for a new comment containing the staging environment URL
49+
3. Use this URL to preview and test your lab instructions in the actual lab as a student would
50+
51+
![Automated Environment Creation](../img/automated-environment-creation.gif)
52+
53+
!!!tip "Testing Your Lab"
54+
The staging environment is a complete copy of your lab, allowing you to verify that:
55+
56+
- Instructions render correctly
57+
- Code blocks work as expected
58+
- The environment matches your requirements
59+
60+
61+
!!!tip "Skipping Environment Creation"
62+
Add `[skip ci]` to your commit message body to skip environment creation. This is useful when:
63+
64+
- Making minor text corrections
65+
- Fixing typos
66+
- Making multiple small changes before testing
Lines changed: 76 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -1,217 +1,89 @@
1-
# HOW TO Creates a Compute Environment Using Templates
1+
# HOW TO Create a new Lab Compute Environment
22

3+
This guide explains how to create a new compute environment using our automated GitHub workflow.
34

4-
# Prerequisites
5-
6-
!!!tip "You'll need access before begining"
7-
For access refer to [request-access-to-systems.md](request-access-to-systems.md)
5+
## Prerequisites
86

97
Before you begin, ensure you:
108

11-
- Have access to lftraining GitHub Organization.
12-
- Have access to the following repos in the LF-Certification GitHub Organization.
13-
- [LF-Certification/copier-compute-environment](https://github.com/LF-Certification/copier-compute-environment)
14-
- LF-Certification/copier-multi-vm-shim
15-
- LF-Certification/copier-product
16-
- You have [setup your environment](setup-and-configure-your-environment.md) and with required tools.
9+
- Have access to the `lftraining` GitHub Organization
10+
- You are a member of the `lab-authors` team
11+
12+
## Creating a New Compute Environment
13+
1. Open the lab repository in your browser
14+
2. Navigate to the Actions tab in the repository
15+
3. Locate and select the `New Compute Environment` workflow
16+
4. Click `Run workflow` and fill in the following parameters:
17+
18+
![Repository Actions](../img/create-lab-compute-environment.gif)
19+
20+
21+
### Workflow Parameters
22+
23+
- **Environment Template** (required)
24+
Choose one of the following templates:
25+
26+
- `k8s-single-node`: Single node Kubernetes environment
27+
- `k8s-multi-node`: Multi-node Kubernetes environment
28+
- `linux-single`: Single Linux host environment
29+
- `linux-dual`: Dual Linux host environment
30+
31+
- **Compute Environment** (required)
32+
- Enter the prefix for your compute environment (e.g., "LFS25800")
33+
34+
- **Use Workstation** (required)
35+
- Choose whether to include a workstation VM for the student
36+
- Defaults to `true`
37+
38+
### Template Configurations
39+
40+
Each template creates different VM configurations:
41+
42+
#### k8s-single-node
43+
- 1 control plane node
44+
- Optional workstation
45+
46+
#### k8s-multi-node
47+
- 1 control plane node
48+
- 1 worker node
49+
- Optional workstation
50+
51+
#### linux-single
52+
- 1 Linux host
53+
- Optional workstation
54+
55+
#### linux-dual
56+
- 2 Linux hosts
57+
- Optional workstation
58+
59+
## What Happens Next
60+
61+
After triggering the workflow:
1762

18-
## Create a feature branch from main
19-
open your devcontainer
63+
1. A new feature branch is created (`feature/implement-<compute-environment>`)
64+
2. The necessary template files are generated based on your selection
65+
3. A draft pull request is automatically created
66+
4. You can then customize the environment further by working on the created branch
2067

21-
Create a feature branch from main to work on the compute environment.
68+
!!!note "Next Steps"
69+
After the workflow completes, review the generated pull request and make any necessary customizations to the environment configuration.
2270

23-
!!!warning
24-
must be named `feature/implement-<compute-environment>`
71+
### Finding Your Pull Request
2572

73+
1. Navigate to the Pull Requests tab in the repository
74+
2. Look for a PR titled `Implement <your-compute-environment>`
75+
3. Open the PR to review the generated files
2676

27-
```bash
28-
git branch feature/implement-LFS2580004
29-
```
77+
![Finding your PR](../img/finding-your-pr.gif)
3078

31-
switch to your branch
79+
### Working on the Environment Locally
3280

33-
```bash
34-
git checkout feature/implement-LFS2580004
35-
```
81+
1. Navigate to your local repository
82+
2. In the PR, click the `Code` dropdown button
83+
3. Copy the command under "Checkout with GitHub CLI"
84+
4. Paste and run the command in your terminal:
85+
```bash
86+
gh pr checkout <PR-NUMBER>
87+
```
3688

37-
38-
cd to `compute-environments/available`
39-
40-
41-
### Render the copier-multi-vm-shim template
42-
43-
!!!warning
44-
Before rendering copier templates, ensure your git repository is clean.
45-
46-
The `copier-multi-vm-shim` creates the base compute environment directory for the lab. it allows building, packing and publishing to be executed simultaneously on all virtual machine hosts needed in the lab
47-
48-
!!!note
49-
TODO explain the front end service
50-
explain that the lf-training one has ssh keys
51-
explain the default port
52-
53-
54-
```bash
55-
copier copy --trust "gh:LF-Certification/copier-multi-vm-shim" ./LFS2580004
56-
🎤 What is the prefix for the compute environments?
57-
LFS2580004
58-
🎤 What is the image for the front end service?
59-
ghcr.io/lftraining/ttyd:1.7.7
60-
🎤 What is the port for the front end service?
61-
7681
62-
63-
Copying from template version 1.4.0
64-
create .make
65-
create .make/lab
66-
create .make/lab/build
67-
create .make/lab/clean
68-
create .make/lab/package
69-
create .make/lab/publish
70-
create .make/lib.sh
71-
create Makefile
72-
create .copier-answers.yml
73-
74-
```
75-
76-
Commit the changes to the repository
77-
78-
```bash
79-
git add ./LFS2580004/ && git commit -sm"feat(LFS2580004): Initalize copier-multi-vm-shim"
80-
```
81-
82-
83-
### Render the virtual machine directories required for hosts within the lab compute-environment
84-
85-
LFS2580004 Will require 2 VMs in the lab compute environment.
86-
87-
cd into the newly created directory:
88-
89-
```bash
90-
cd ./LFS2580004
91-
```
92-
93-
Apply the copier-compute-environment template for each host in the lab compute environment. We will start with `host1`
94-
95-
!!!note
96-
only `host<N>` are allowed as host names
97-
98-
99-
```bash
100-
copier copy --trust "gh:LF-Certification/copier-compute-environment" LFS2580004-host1
101-
🎤 What is the name of the compute environment?
102-
LFS2580004-host1
103-
🎤 Which base image does the compute environment use?
104-
ubuntu/kubernetes
105-
🎤 How many CPU cores does the item require?
106-
2
107-
🎤 How much memory does the compute environment require?
108-
4096M
109-
🎤 How much storage (MiB) does the compute environment require for the user layer?
110-
300
111-
🎤 How much storage (GiB) does the compute environment require for the build layer?
112-
5
113-
🎤 Does the compute environment require swap?
114-
No
115-
🎤 List of ports to expose?
116-
(Finish with 'Alt+Enter' or 'Esc then Enter')
117-
> [22]
118-
🎤 How are the scripts implemented?
119-
bashp
120-
121-
Copying from template version 1.2.2
122-
create .hooks
123-
create .hooks/lab
124-
create .hooks/lab/post-build.sh
125-
create .hooks/lab/pre-image.sh
126-
create .hooks/p3
127-
create .hooks/p3/post-build.sh
128-
create .hooks/p3/pre-image.sh
129-
create .hooks/temu
130-
create .hooks/temu/pre-image.sh
131-
create .hooks/post-clean.sh
132-
create .make
133-
create .make/jslinux
134-
create .make/jslinux/build
135-
create .make/jslinux/image
136-
create .make/jslinux/package
137-
create .make/jslinux/publish
138-
create .make/jslinux/run
139-
create .make/jslinux/test
140-
create .make/lab
141-
create .make/lab/build
142-
create .make/lab/image
143-
create .make/lab/package
144-
create .make/lab/publish
145-
create .make/lab/run
146-
create .make/lab/test
147-
create .make/lib.sh
148-
create .make/p3
149-
create .make/p3/Dockerfile
150-
create .make/p3/build
151-
create .make/p3/image
152-
create .make/p3/k8s
153-
create .make/p3/k8s/ssh
154-
create .make/p3/k8s/ssh/id_rsa
155-
create .make/p3/k8s/ssh/id_rsa.pub
156-
create .make/p3/package
157-
create .make/p3/publish
158-
create .make/p3/run
159-
create .make/p3/test
160-
create .make/qemu
161-
create .make/qemu/build
162-
create .make/qemu/cloud-init
163-
create .make/qemu/cloud-init/meta-data
164-
create .make/qemu/cloud-init/user-data
165-
create .make/qemu/image
166-
create .make/qemu/package
167-
create .make/qemu/publish
168-
create .make/qemu/run
169-
create .make/qemu/test
170-
create .make/qemu/lib.sh
171-
create .make/qti
172-
create .make/qti/build
173-
create .make/qti/image
174-
create .make/qti/lib.sh
175-
create .make/qti/package
176-
create .make/qti/publish
177-
create .make/temu
178-
create .make/temu/build
179-
create .make/temu/image
180-
create .make/temu/lib.sh
181-
create .make/temu/package
182-
create .make/temu/publish
183-
create .make/temu/run
184-
create .make/temu/test
185-
create Dockerfile
186-
create Makefile
187-
create assets
188-
create assets/format-candidate-layer.sh
189-
create assets/mkfs-hook.sh
190-
create cli.sh
191-
create k8s
192-
create k8s/base
193-
create k8s/base/kustomization.yaml
194-
create k8s/base/virtualized-env.yaml
195-
create k8s/base/manifest.yaml
196-
create scripts
197-
create scripts/answer.sh
198-
create scripts/build.sh
199-
create scripts/score.sh
200-
create scripts/setup.sh
201-
create temu
202-
create temu/.gitattributes
203-
create temu/.gitignore
204-
create temu/temu.cfg
205-
create temu/bbl64.bin
206-
create temu/kernel-riscv64-4.19.249-minimal.bin
207-
create temu/initrd
208-
create .envrc
209-
create .copier-answers.yml
210-
```
211-
212-
213-
Now that you have created the first virtual machine directory, commit your changes before rendering the second virtual machine directory.
214-
215-
```bash
216-
git add ./LFS2580004-host1/ && git commit -sm"feat(host1): Initalize copier-compute-environment"
217-
```
89+
![Working locally](../img/working-locally.gif)

docs/HOWTOs/request-access-to-systems.md

Whitespace-only changes.

docs/HOWTOs/setup-and-configure-your-environment.md

Whitespace-only changes.

0 commit comments

Comments
 (0)