Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Relationships:
| **Kong** | CLI framework for pmm-admin |
| **Docker Compose** | Development environment |
| **Ansible** | Server provisioning and configuration |
| **Packer** | Machine image builds (AMI, OVA, Azure, DigitalOcean) |
| **Packer** | Machine image builds (AMI) |

## Global Development Conventions

Expand Down
9 changes: 3 additions & 6 deletions build/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> **Parent guide**: [AGENTS.md](../AGENTS.md) — product overview, architecture, domain model, global conventions

The `/build` directory contains everything needed to build, package, and distribute PMM Server and PMM Client as Docker images, RPM/DEB packages, and cloud machine images (AMI, OVA).
The `/build` directory contains everything needed to build, package, and distribute PMM Server and PMM Client as Docker images, RPM/DEB packages, and cloud machine images (AMI).

## Architecture

Expand All @@ -16,7 +16,6 @@ The `/build` directory contains everything needed to build, package, and distrib
| PMM Client RPM | RPM (EL9) | `packages/rpm/client/pmm-client.spec` |
| PMM Client DEB | DEB | `packages/deb/` |
| PMM Server AMI | AWS AMI | `packer/pmm.json` |
| PMM Server OVA | VirtualBox OVF | `packer/pmm.json` |

### Build Pipeline

Expand Down Expand Up @@ -50,21 +49,19 @@ Source code (Go, TypeScript)
| `cloud-node` | Cloud VM preparation |
| `lvm-init` | LVM storage setup for persistent data |
| `init-admin-password-ami` | Set admin password from EC2 instance ID |
| `ami-ovf` | AMI/OVF-specific customization |
| `ami` | AMI-specific customization |

## Packer Templates

### PMM Server Images (`packer/pmm.json`)

Builds machine images for multiple platforms:
Builds machine images:
- **amazon-ebs** — AWS AMI
- **virtualbox-ovf** — OVA for on-premises

### Make Targets

```bash
make pmm-ami # Build AWS AMI
make pmm-ovf # Build VirtualBox OVA
make rpmbuild-el9 # Build RPM build environment image
```

Expand Down
33 changes: 0 additions & 33 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
export PACKER_CACHE_DIR := .cache
export PACKER_VERSION := 1.9.4
# check available versions at https://vagrantcloud.com/api/v2/vagrant/bento/oraclelinux-9
export BOX_VERSION := 202502.21.0
export PMM_SERVER_IMAGE ?= docker.io/perconalab/pmm-server:3-dev-latest
export WATCHTOWER_IMAGE ?= docker.io/perconalab/watchtower:dev-latest
# --- Go-related variables ----------------------------------------------------------------
GO_VERSION := $(shell grep '^go ' $(CURDIR)/../go.mod | awk '{print $$2}')

## ----------------- PACKER ------------------
fetch:
mkdir -p ${PACKER_CACHE_DIR}/box
test -f ${PACKER_CACHE_DIR}/id_rsa_vagrant \
|| curl -L https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant -o ${PACKER_CACHE_DIR}/id_rsa_vagrant
chmod 600 ${PACKER_CACHE_DIR}/id_rsa_vagrant

# Add the box using Vagrant
test -f ${PACKER_CACHE_DIR}/box/box.ovf \
|| VAGRANT_HOME=${PACKER_CACHE_DIR}/box vagrant box add bento/oraclelinux-9 --box-version ${BOX_VERSION} --provider virtualbox

test -f ${PACKER_CACHE_DIR}/box/box.ovf \
|| cp -rp ${PACKER_CACHE_DIR}/box/boxes/bento-VAGRANTSLASH-oraclelinux-9/${BOX_VERSION}/amd64/virtualbox/* ${PACKER_CACHE_DIR}/box

deps:
mkdir -p ${PACKER_CACHE_DIR} ~/bin || :
curl -fL https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip -o ${PACKER_CACHE_DIR}/packer.zip
unzip -o ${PACKER_CACHE_DIR}/packer.zip -d ~/bin

pmm-ovf: fetch
/usr/bin/packer build \
-var 'pmm_server_image_name=${PMM_SERVER_IMAGE}' \
-var 'watchtower_image_name=${WATCHTOWER_IMAGE}' \
-only virtualbox-ovf -color=false packer/pmm.json | tee build.log

pmm-digitalocean:
packer build -only digitalocean -var 'single_disk=true' packer/pmm.json

pmm-azure:
packer build -only azure-arm packer/pmm.json

pmm-ami:
docker run --rm -v ${HOME}/.aws:/root/.aws -v `pwd`:/build -w /build \hashicorp/packer:${PACKER_VERSION} \
build -var 'pmm_server_image_name=${PMM_SERVER_IMAGE}' \
Expand Down
2 changes: 1 addition & 1 deletion build/ansible/pmm-docker/post-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# This playbook runs post build tasks for all pmm distributions (AMI/OVF/Docker/Digitalocean).
# This playbook runs post build tasks for all pmm distributions (AMI/Docker).

- hosts: all
become: yes
Expand Down
28 changes: 0 additions & 28 deletions build/ansible/roles/ami-ovf/files/show-pmm-url

This file was deleted.

50 changes: 0 additions & 50 deletions build/ansible/roles/ami-ovf/tasks/main.yml

This file was deleted.

10 changes: 0 additions & 10 deletions build/ansible/roles/cloud-node/files/banner.service

This file was deleted.

29 changes: 0 additions & 29 deletions build/ansible/roles/cloud-node/files/show-url

This file was deleted.

32 changes: 0 additions & 32 deletions build/ansible/roles/cloud-node/tasks/ami.yml

This file was deleted.

Loading
Loading