Skip to content

Prepare server build for arm64#5630

Open
EvgeniyPatlan wants to merge 5 commits into
mainfrom
arm64-server-build
Open

Prepare server build for arm64#5630
EvgeniyPatlan wants to merge 5 commits into
mainfrom
arm64-server-build

Conversation

@EvgeniyPatlan

Copy link
Copy Markdown
Contributor

This makes it possible to build pmm-server natively on arm64. The client side has been building on arm for a while, the server was the missing piece.

  • build-server-rpm: the S3 build cache was keyed only by dist (el9), so an arm build would download cached x86_64 rpms and skip the build entirely. Cache paths get an arch suffix for non-x86 (el9-aarch64), x86_64 paths are unchanged.
  • grafana.spec: added aarch64 to ExclusiveArch and stopped hardcoding bin/linux/amd64 when installing the binaries. percona-dashboards.spec already handles arm64.
  • pmm-images role: disable all percona-release repos during dnf update instead of only the x86_64 one.
  • cloud-node role: the "change cloud user" task is gated on OracleLinux or AlmaLinux but edits an Oracle-only file (00_ol-default-user.cfg), so it could never work on Alma. Split it into two tasks, one per distro. The OL behavior is unchanged.
  • packer: added an arm64 AMI builder (AlmaLinux 9 arm64 base, c7g.xlarge) and a pmm-ami-arm64 make target. The manifest post-processor lists both builders so the AMI_ID extraction in Jenkins keeps working. Oracle doesn't publish OL9 aarch64 AMIs, that's why the base differs from the x86 one.
  • agent playbook: yq was always installed as the amd64 binary, so arm agents ended up with /usr/bin/yq they can't execute.

All of it is a no-op on x86_64: cache paths stay byte-identical, the grafana spec change only adds an arch, the yq url resolves to the same file on amd64.

Tested by building the full server on a Graviton instance from this branch (all 7 rpms, docker image, watchtower) - the image comes up, readyz returns 200, supervisorctl shows everything running, api-tests pass. The arm64 AMI builds with packer from this branch and boots.

- build-server-rpm: namespace the S3 build cache by architecture
  (RELEASE/el9-aarch64, PR-BUILDS/el9-aarch64). Without this, arm64
  builds hit the amd64-populated cache keys, skip the build, and
  produce an x86-contaminated server image. x86_64 paths are unchanged.
- grafana.spec: allow aarch64 in ExclusiveArch and install Go binaries
  from bin/linux/%{go_arch} instead of hardcoded amd64.
- pmm-images ansible role: make the percona-release repo disable and
  the local repo description architecture-neutral.

percona-dashboards.spec already handles arm64 (linux_arm64 plugin
platform), and build/packer already defines the arm64 agent AMI.
- packer/pmm.json: new 'amazon-ebs-arm64' builder — AlmaLinux 9 arm64 base
  (source_ami_filter on the AlmaLinux owner account, most recent), c7g.xlarge,
  same disks/network/tags/provisioners as the x86_64 builder. The provisioning
  roles are architecture-agnostic: they podman-pull the (multi-arch) pmm-server
  image, which resolves to the arm64 layer on a Graviton build instance.
- manifest post-processor now includes the arm64 builder so AMI_ID extraction
  in Jenkins (jq .builds[-1].artifact_id) keeps working.
- Makefile: 'make pmm-ami-arm64' target (-only amazon-ebs-arm64).
The playbook provisions both amd64 and arm64 agents but hardcoded the
yq_linux_amd64 binary, leaving arm64 agents with a non-executable /usr/bin/yq.
Uses the existing ansible_architecture_alt fact (amd64/arm64), so the amd64
URL is unchanged.
The cloud-node role edits /etc/cloud/cloud.cfg.d/00_ol-default-user.cfg,
which only exists on Oracle Linux — the AlmaLinux arm64 base failed there.
Everything before that task ran clean on aarch64.
…Linux 9

Oracle does not appear to publish OL9 aarch64 AMIs under the expected
name pattern. AlmaLinux 9 arm64 is proven to boot and provision (first
run passed 14/15 cloud-node tasks); the one failure was this task, whose
'when' already claimed AlmaLinux support but edited an Oracle-only file
(/etc/cloud/cloud.cfg.d/00_ol-default-user.cfg). Split it per distro:
OL keeps the exact same behavior, Alma edits /etc/cloud/cloud.cfg.
@EvgeniyPatlan EvgeniyPatlan requested a review from a team as a code owner July 10, 2026 13:17
@EvgeniyPatlan EvgeniyPatlan requested review from 4nte and JiriCtvrtka and removed request for a team July 10, 2026 13:17
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.80%. Comparing base (31318c7) to head (35a4a9b).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5630      +/-   ##
==========================================
+ Coverage   43.59%   43.80%   +0.20%     
==========================================
  Files         415      415              
  Lines       43134    42893     -241     
==========================================
- Hits        18804    18789      -15     
+ Misses      22454    22231     -223     
+ Partials     1876     1873       -3     
Flag Coverage Δ
admin 34.78% <ø> (ø)
agent 49.15% <ø> (+0.11%) ⬆️
managed 43.25% <ø> (+0.27%) ⬆️
vmproxy 72.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant