Skip to content

Commit 480336e

Browse files
committed
fix linter markdown error
1 parent 9ed6a4d commit 480336e

File tree

2 files changed

+92
-87
lines changed

2 files changed

+92
-87
lines changed

docs/image-build.md

Lines changed: 79 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
The appliance contains configuration to use [Packer](https://developer.hashicorp.com/packer)
44
with the [OpenStack builder](https://www.packer.io/plugins/builders/openstack)
55
to build images. Using images:
6+
67
- Enables the image to be tested in a `staging` environment before deployment
78
to the `production` environment.
89
- Ensures re-deployment of the cluster or deployment of additional nodes is
910
repeatable.
1011
- Improves deployment speed by reducing the number of package installation.
1112

1213
The Packer configuration here can be used to build two types of images:
14+
1315
1. "Fat images" which contain packages, binaries and container images but no
1416
cluster-specific configuration. These start from a RockyLinux GenericCloud
1517
(or compatible) image. The fat images StackHPC builds and tests in CI are
@@ -20,7 +22,7 @@ The Packer configuration here can be used to build two types of images:
2022
image with with additional packages or functionality. For example the NVIDIA
2123
`cuda` packages cannot be redistributed hence require an "extra" build.
2224

23-
# Usage
25+
## Usage
2426

2527
For either a site-specific fat-image build or an extra-build:
2628

@@ -30,97 +32,101 @@ For either a site-specific fat-image build or an extra-build:
3032
2. If package installs are required, add the provided dev credentials for
3133
StackHPC's "Ark" Pulp server to the `site` environment:
3234

33-
```yaml
34-
# environments/site/inventory/group_vars/all/dnf_repos.yml:
35-
dnf_repos_username: your-ark-username
36-
dnf_repos_password: "{{ vault_dnf_repos_password }}"
37-
```
38-
```yaml
39-
# environments/site/inventory/group_vars/all/dnf_repos.yml:
40-
dnf_repos_password: 'your-ark-password'
41-
```
35+
```yaml
36+
# environments/site/inventory/group_vars/all/dnf_repos.yml:
37+
dnf_repos_username: your-ark-username
38+
dnf_repos_password: "{{ vault_dnf_repos_password }}"
39+
```
40+
41+
```yaml
42+
# environments/site/inventory/group_vars/all/dnf_repos.yml:
43+
dnf_repos_password: "your-ark-password"
44+
```
45+
4246
> [!IMPORTANT]
4347
> The latter file should be vault-encrypted.
4448
45-
Alternatively, configure a [local Pulp mirror](experimental/pulp.md).
49+
Alternatively, configure a [local Pulp mirror](experimental/pulp.md).
4650
4751
3. Create a Packer [variable definition file](https://developer.hashicorp.com/packer/docs/templates/hcl_templates/variables#assigning-values-to-input-variables). It must specify at least the
4852
the following variables:
49-
50-
```hcl
51-
# environments/site/builder.pkrvars.hcl:
52-
flavor = "general.v1.small" # VM flavor to use for builder VMs
53-
networks = ["26023e3d-bc8e-459c-8def-dbd47ab01756"] # List of network UUIDs to attach the VM to
54-
source_image_name = "Rocky-9-GenericCloud-Base-9.4" # Name of image to create VM with, i.e. starting image
55-
inventory_groups = "cuda" # Build VM inventory groups => functionality to add to image
56-
```
57-
58-
Note that:
59-
- Normally the network must provide outbound internet access. However it
60-
does not need to provide access to resources used by the actual cluster
61-
nodes (e.g. Slurm control node, network filesystem servers etc.).
62-
- The flavor used must have sufficent memory for the build tasks (usually
63-
8GB), but otherwise does not need to match the actual cluster node
64-
flavor(s).
65-
- By default, the build VM is volume-backed to allow control of the root
66-
disk size (and hence final image size), so the flavor's disk size does not
67-
matter. The default volume size is not sufficent if enabling `cuda` and/or
68-
`doca` and should be increased:
69-
```terraform
70-
volume_size = 35 # GB
71-
```
72-
- The source image should be either:
73-
- For a site-specific fatimage build: A RockyLinux GenericCloud or
74-
compatible image.
75-
- For an extra-build image: Usually the appropriate StackHPC fat image,
76-
as defined in `environments/.stackhpc/tofu/cluster_image.auto.tfvars.json` at the
77-
checkout's current commit. See the [GitHub release page](https://github.com/stackhpc/ansible-slurm-appliance/releases)
78-
for download links. In some cases extra builds may be chained, e.g.
79-
one extra build adds a Lustre client, and the resulting image is used
80-
as the source image for an extra build adding GPU support.
81-
- The `inventory_groups` variable takes a comma-separated list of Ansible
82-
inventory groups to add the build VM to (in addition to the `builder`
83-
group which is it always in). This controls which Ansible roles and
84-
functionality run during build, and hence what gets added to the image.
85-
All possible groups are listed in `environments/common/groups` but common
86-
options for this variable will be:
87-
- For a fatimage build: `fatimage`: This is defined in `enviroments/{common,site}/inventory/groups`
88-
and results in an update of all packages in the source image, plus
89-
installation of packages for default control, login and compute nodes.
90-
- For an extra-built image, one or more specific groups e.g. `cuda` or
91-
`doca,lustre`. This extends the source image with just this additional
92-
functionality.
93-
94-
See the top of [packer/openstack.pkr.hcl](../packer/openstack.pkr.hcl)
95-
for all possible variables which can be set.
53+
54+
```hcl
55+
# environments/site/builder.pkrvars.hcl:
56+
flavor = "general.v1.small" # VM flavor to use for builder VMs
57+
networks = ["26023e3d-bc8e-459c-8def-dbd47ab01756"] # List of network UUIDs to attach the VM to
58+
source_image_name = "Rocky-9-GenericCloud-Base-9.4" # Name of image to create VM with, i.e. starting image
59+
inventory_groups = "cuda" # Build VM inventory groups => functionality to add to image
60+
```
61+
62+
Note that:
63+
64+
- Normally the network must provide outbound internet access. However it
65+
does not need to provide access to resources used by the actual cluster
66+
nodes (e.g. Slurm control node, network filesystem servers etc.).
67+
- The flavor used must have sufficent memory for the build tasks (usually
68+
8GB), but otherwise does not need to match the actual cluster node
69+
flavor(s).
70+
- By default, the build VM is volume-backed to allow control of the root
71+
disk size (and hence final image size), so the flavor's disk size does not
72+
matter. The default volume size is not sufficent if enabling `cuda` and/or
73+
`doca` and should be increased:
74+
```terraform
75+
volume_size = 35 # GB
76+
```
77+
- The source image should be either:
78+
- For a site-specific fatimage build: A RockyLinux GenericCloud or
79+
compatible image.
80+
- For an extra-build image: Usually the appropriate StackHPC fat image,
81+
as defined in `environments/.stackhpc/tofu/cluster_image.auto.tfvars.json` at the
82+
checkout's current commit. See the [GitHub release page](https://github.com/stackhpc/ansible-slurm-appliance/releases)
83+
for download links. In some cases extra builds may be chained, e.g.
84+
one extra build adds a Lustre client, and the resulting image is used
85+
as the source image for an extra build adding GPU support.
86+
- The `inventory_groups` variable takes a comma-separated list of Ansible
87+
inventory groups to add the build VM to (in addition to the `builder`
88+
group which is it always in). This controls which Ansible roles and
89+
functionality run during build, and hence what gets added to the image.
90+
All possible groups are listed in `environments/common/groups` but common
91+
options for this variable will be:
92+
93+
- For a fatimage build: `fatimage`: This is defined in `enviroments/{common,site}/inventory/groups`
94+
and results in an update of all packages in the source image, plus
95+
installation of packages for default control, login and compute nodes.
96+
- For an extra-built image, one or more specific groups e.g. `cuda` or
97+
`doca,lustre`. This extends the source image with just this additional
98+
functionality.
99+
100+
See the top of [packer/openstack.pkr.hcl](../packer/openstack.pkr.hcl)
101+
for all possible variables which can be set.
96102
97103
4. Activate the venv and the relevant environment.
98104
99105
5. Build images using the relevant variable definition file, e.g.:
100106
101-
```shell
102-
cd packer/
103-
PACKER_LOG=1 /usr/bin/packer build -on-error=ask -var-file=../environments/site/builder.pkrvars.hcl openstack.pkr.hcl
104-
```
107+
```shell
108+
cd packer/
109+
PACKER_LOG=1 /usr/bin/packer build -on-error=ask -var-file=../environments/site/builder.pkrvars.hcl openstack.pkr.hcl
110+
```
105111

106-
**NB:** If the build fails while creating the volume, check if the source image has the `signature_verified` property:
112+
**NB:** If the build fails while creating the volume, check if the source image has the `signature_verified` property:
107113

108-
```shell
109-
openstack image show $SOURCE_IMAGE
110-
```
114+
```shell
115+
openstack image show $SOURCE_IMAGE
116+
```
111117

112-
If it does, remove this property:
118+
If it does, remove this property:
113119

114-
```shell
115-
openstack image unset --property signature_verified $SOURCE_IMAGE
116-
```
120+
```shell
121+
openstack image unset --property signature_verified $SOURCE_IMAGE
122+
```
117123

118-
then delete the failed volume, select cancelling the build when Packer asks,
119-
and then retry. This is [OpenStack bug 1823445](https://bugs.launchpad.net/cinder/+bug/1823445).
124+
then delete the failed volume, select cancelling the build when Packer asks,
125+
and then retry. This is [OpenStack bug 1823445](https://bugs.launchpad.net/cinder/+bug/1823445).
120126

121127
6. The built image will be automatically uploaded to OpenStack. By default it
122128
will have a name prefixed `openhpc` and including a timestamp and a shortened
123-
git hash.
129+
Git hash.
124130

125131
## Build Process
126132

docs/operations.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,25 +104,24 @@ Additional packages can be added during image builds by:
104104
1. Configuring an [image build](./image-build.md) to enable the
105105
`extra_packages` group:
106106

107-
108-
```terraform
109-
# environments/site/builder.pkrvars.hcl:
110-
...
111-
inventory_groups = "extra_packages"
112-
...
113-
```
107+
```terraform
108+
# environments/site/builder.pkrvars.hcl:
109+
...
110+
inventory_groups = "extra_packages"
111+
...
112+
```
114113

115114
2. Defining a list of packages in `appliances_extra_packages_other`, for example:
116115

117-
```yaml
118-
# environments/site/inventory/group_vars/all/defaults.yml:
119-
appliances_extra_packages_other:
120-
- somepackage
121-
- anotherpackage
122-
```
116+
```yaml
117+
# environments/site/inventory/group_vars/all/defaults.yml:
118+
appliances_extra_packages_other:
119+
- somepackage
120+
- anotherpackage
121+
```
123122
124123
3. Either adding [Ark credentials](./image-build.md) or a [local Pulp mirror](./experimental/pulp.md)
125-
to provide access to the required [repository snapshots](../environments/common/inventory/group_vars/all/dnf_repo_timestamps.yml).
124+
to provide access to the required [repository snapshots](../environments/common/inventory/group_vars/all/dnf_repo_timestamps.yml).
126125
127126
The packages available from the OpenHPC repos are described in Appendix E of
128127
the OpenHPC installation guide (linked from the

0 commit comments

Comments
 (0)