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: docs/image-build.md
+18-39Lines changed: 18 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -24,65 +24,44 @@ The steps for building site-specific fat images or extending an existing fat ima
24
24
```hcl
25
25
flavor = "general.v1.small" # VM flavor to use for builder VMs
26
26
networks = ["26023e3d-bc8e-459c-8def-dbd47ab01756"] # List of network UUIDs to attach the VM to
27
+
source_image_name = "Rocky-9-GenericCloud-Base-9.4" # Name of image to create VM with, i.e. starting image
28
+
inventory_groups = "control,login,compute" # Comma-separated list of inventory groups to add build VM to, in addition to "builder" group
29
+
27
30
```
28
31
Note that:
29
32
- The network used for the Packer VM must provide outbound internet access but does not need to provide access to resources which the final cluster nodes require (e.g. Slurm control node, network filesystem servers etc.).
30
33
- For additional options such as non-default private key locations or jumphost configuration see the variable descriptions in `./openstack.pkr.hcl`.
31
-
- For an example of configuration for extending an existing fat image see below.
34
+
- The `control,login,compute` inventory groups mean that the resultant image contains packages for all nodes in the cluster - this produces
35
+
a site-specific fat image.
32
36
33
37
3. Activate the venv and the relevant environment.
34
38
35
39
4. Build images using the relevant variable definition file, e.g.:
Note that the `-only` flag here restricts Packer to a single specific "build" definition (in Packer terminology). Options here are:
41
-
- `-only=openstack.openhpc`: Build a fat image including Mellanox OFED
42
-
- `-only=openstack.openhpc-cuda`: Build a fat image including Mellanox OFED, Nvidia drivers and CUDA
43
-
- `-only=openstack.openhpc-extra`: Build an image which *extends* an existing fat image
44
-
45
-
5. The built image will be automatically uploaded to OpenStack with a name prefixed `openhpc-` and including a timestamp and a shortened git hash.
46
-
47
-
# Defining an "extra" image build
48
-
49
-
An "extra" image build starts with an existing fat image (e.g. one provided by StackHPC) rather than a RockyLinux GenericCloud image, and only runs a specific subset of the
50
-
Ansible in the appliance. This allows adding additional functionality into site-specific images, without modifying the existing functionality in the base fat image. This is the recommended way to build site-specific images.
51
-
52
-
To configure an "extra" image build, prepare a Packer variable definition file as described above but also including:
53
-
54
-
- `extra_build_image_name`: A string to add into the final image name.
55
-
- `source_image` or `source_image_name`: The UUID or name of the fat image to start from (which must already be present in OpenStack).
56
-
- `extra_build_groups`: A list of Ansible inventory groups to put the build VM into, in addition to the `builder` group. This defines the roles/functionality
57
-
which are added to the image.
58
-
- `extra_build_volume_size`: A number giving the size in GB of the volume for the build VM's root disk and therefore the resulting image size.
59
-
Note this assumes the default of `use_blockstorage_volume = true`.
60
-
61
-
E.g. to add the lustre client to an RockyLinux 9 image:
then delete the failed volume, select cancelling the build when Packer queries, and then retry. This is [Openstack bug 1823445](https://bugs.launchpad.net/cinder/+bug/1823445).
76
53
77
-
**NB:** If the build fails while creating the volume, check if the source image has the `signature_verified` property:
78
54
79
-
openstack image show $SOURCE_IMAGE
55
+
5. The built image will be automatically uploaded to OpenStack with a name prefixed `openhpc` and including a timestamp and a shortened git hash.
Extending an existing images uses the same process as described above is followed, but the Packer variable definition file should:
60
+
- Set `source_image_name` to be an existing fat image (e.g. one provided by StackHPC) rather than a RockyLinux GenericCloud image
61
+
- Set `inventory_groups` should only include the additional functionality (= role name), e.g. `lustre`
62
+
- Probably set the variable `image_name`, e.g. to `openhpc-lustre` to distinguish it from an existing fat image
84
63
85
-
then delete the failed volume, select cancelling the build when Packer queries, and then retry. This is [Openstack bug 1823445](https://bugs.launchpad.net/cinder/+bug/1823445).
64
+
Setting the inventory groups in this way allows adding additional functionality into images from StackHPC, without modifying the existing packages in the image (which have been tested in CI). This is the recommended way to modify images to add site-specific functionality.
0 commit comments