blob: 597e64b0d037672b3da9cc2edd13f55251f5155f [file] [log] [blame]
Andrew Grimbergebc710a2017-01-30 12:59:38 -08001# Open-O Project CI Packer
2
3[Packer][1] is a tool for automatically creating VM and container images,
4configuring them and post-processing them into standard output formats.
5
6We build Open-O's CI images via Packer.
7
8## Building
9
10You'll need to [install Packer][2], of course.
11
12Open-O's Packer configuration is divided into build-specific variables,
13output-specific templates and a set of shared provisioning scripts. To do a
14specific build, combine the template for the desired output artifact type with
Jessica Wagantall564913e2018-03-19 13:41:33 -070015a variable file. To build a new builder instance the following would be done:
Andrew Grimbergebc710a2017-01-30 12:59:38 -080016
17```
Jessica Wagantall564913e2018-03-19 13:41:33 -070018packer build -var-file=vars/cloud-env.json -var-file=vars/centos.json templates/builder.json
Andrew Grimbergebc710a2017-01-30 12:59:38 -080019```
20
21**NOTE:** vars/cloud-env.json is a gitignored file as it contains private
22information. There is a vars/cloud-env.json.example file that may be used as a
23base for creating the one needed.
24
25This would build a bootable image in the Open-O CI cloud environment.
26
27From a high level, the builds:
28
Andrew Grimberga6b750c2023-05-03 08:47:44 -070029- Boot a specified base image in the cloud
30- Run a set of shell scripts, listed in the template's shell provisioner
31 section, to do any configuration required by the builder.
32- Execute a shutdown of the running instance
33- Execute a 'nova image-create' operation against the shutdown instance.
34- Perform a 'nova delete' operation against the shutdown instance.
Andrew Grimbergebc710a2017-01-30 12:59:38 -080035
36[1]: https://www.packer.io/
37[2]: https://www.packer.io/intro/getting-started/setup.html