Skip to content

Commit

Permalink
update packer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvija Tovernic committed Sep 23, 2024
1 parent ba6c224 commit 17ff8d7
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions images/packer/Readme.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
# packer
# Packer

This directory contains 2 repositories:
This project contains two main directories:

- image-factory-vm
- user-packer
1. `image-factory-vm`
2. `user-packer`

Both directories are used to build VM images with Packer and store them in Azure Shared Image Gallery however there is difference in when one is used:
Both directories are used to build VM images with Packer and store them in the Azure Shared Image Gallery. However, they are used in different contexts.

## image-factory-vm
## Image Factory VM

This directory contains Packer scripts to build Image Factory VM which will host GitHub Actions runner.
This directory includes Packer scripts to build the Image Factory VM, which hosts a GitHub Actions runner.

Produced VM image version is then used by Terraform module during deployment:
### VM Configuration Script

- runner
The Image Factory VM is configured using a shell script that performs the following tasks:

To trigger image rebuild following GitHub Actions Workflow needs to be executed:
- Sets the DEBIAN_FRONTEND to noninteractive to avoid user prompts during the package installation process.
- Updates and upgrades the system packages.
- Installs necessary packages such as `apt-transport-https`, `buildah`, `ca-certificates`, `curl`, `git`, `gnupg`, `jq`, `libcap2-bin`, `lsb-release`, `podman`, `slirp4netns`, `software-properties-common`, `unzip`, `vim`, and `wget`.
- Performs a clean-up of the package lists.
- Installs the Azure CLI.

- Build Image Factory VM
### Triggering an Image Rebuild

## user-packer
To trigger a rebuild of the Image Factory VM, execute the following GitHub Actions Workflow: [.github/workflows/packer-build-if-vm.yml](.github/workflows/packer-build-if-vm.yml)

This directory contains Packer scripts to build user VM images produced by Image Factory.
These scripts are used whenever user calls reusable workflow: "Reusable workflow - build packer VM"
## User Packer Template

The `user-packer` directory contains Packer scripts to build user VM images. These images are produced by the Image Factory VM.
These scripts come into play whenever a user calls the reusable workflow: [.github/workflows/packer-build-if-vm.yml](.github/workflows/packer-build-if-vm.yml)

By following these guidelines, you can efficiently build and deploy VM images using Packer and GitHub Actions.

0 comments on commit 17ff8d7

Please sign in to comment.