-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build ARM packages without QEMU emulation (#682)
This splits the package building and testing logic into x86_64 and arm64 targets, and allows triggering either both, or just one of them. It also changes the GitHub actions for package testing and release to no longer use QEMU emulation (which recently started failing with segfaults), and instead uses separate runners for each architecture. Further we add an explicit check for cgroups v2. Testing the Amazon Linux 2 package is only supported on a cgroups v1 host, since the container itself has a too old systemd version to support cgroups v2. Because the ARM runner is only available on Ubuntu 22.04 or newer (which requires cgroups v2) we do not test the ARM packages on Amazon Linux 2. In passing remove stale "DOCKER_BUILDKIT=1" settings from package release action, which should no longer be needed since GH actions updated their Docker version, and allow overriding the docker command used with "DOCKER_CMD", like we already supported for the release step.
- Loading branch information
Showing
5 changed files
with
236 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
# Note: This requires variables that are set in the top-level packages Makefile | ||
|
||
BUILD_ARGS=--no-cache --build-arg VERSION=$(VERSION) --build-arg GIT_VERSION=$(GIT_VERSION) | ||
DOCKER_CMD=docker | ||
|
||
.PHONY: all | ||
.PHONY: all x86_64 arm64 | ||
|
||
all: $(TMP_DIR)/$(RPM_PACKAGE_X86_64) $(TMP_DIR)/$(RPM_PACKAGE_ARM64) \ | ||
$(TMP_DIR)/$(DEB_PACKAGE_X86_64) $(TMP_DIR)/$(DEB_PACKAGE_ARM64) | ||
all: x86_64 arm64 | ||
|
||
x86_64: $(TMP_DIR)/$(RPM_PACKAGE_X86_64) $(TMP_DIR)/$(DEB_PACKAGE_X86_64) | ||
|
||
arm64: $(TMP_DIR)/$(RPM_PACKAGE_ARM64) $(TMP_DIR)/$(DEB_PACKAGE_ARM64) | ||
|
||
$(TMP_DIR)/$(RPM_PACKAGE_X86_64): Dockerfile.build.rpm-systemd | ||
docker build --platform linux/amd64 $(BUILD_ARGS) -f Dockerfile.build.rpm-systemd -t pga-collector-build ../../ | ||
docker run --platform linux/amd64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(RPM_PACKAGE_X86_64) /out" | ||
docker rmi pga-collector-build | ||
$(DOCKER_CMD) build --platform linux/amd64 $(BUILD_ARGS) -f Dockerfile.build.rpm-systemd -t pga-collector-build ../../ | ||
$(DOCKER_CMD) run --platform linux/amd64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(RPM_PACKAGE_X86_64) /out" | ||
$(DOCKER_CMD) rmi pga-collector-build | ||
|
||
$(TMP_DIR)/$(RPM_PACKAGE_ARM64): Dockerfile.build.rpm-systemd | ||
docker build --platform linux/arm64 $(BUILD_ARGS) -f Dockerfile.build.rpm-systemd -t pga-collector-build ../../ | ||
docker run --platform linux/arm64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(RPM_PACKAGE_ARM64) /out" | ||
docker rmi pga-collector-build | ||
$(DOCKER_CMD) build --platform linux/arm64 $(BUILD_ARGS) -f Dockerfile.build.rpm-systemd -t pga-collector-build ../../ | ||
$(DOCKER_CMD) run --platform linux/arm64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(RPM_PACKAGE_ARM64) /out" | ||
$(DOCKER_CMD) rmi pga-collector-build | ||
|
||
$(TMP_DIR)/$(DEB_PACKAGE_X86_64): Dockerfile.build.deb-systemd | ||
docker build --platform linux/amd64 $(BUILD_ARGS) -f Dockerfile.build.deb-systemd -t pga-collector-build ../../ | ||
docker run --platform linux/amd64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(DEB_PACKAGE_X86_64) /out" | ||
docker rmi pga-collector-build | ||
$(DOCKER_CMD) build --platform linux/amd64 $(BUILD_ARGS) -f Dockerfile.build.deb-systemd -t pga-collector-build ../../ | ||
$(DOCKER_CMD) run --platform linux/amd64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(DEB_PACKAGE_X86_64) /out" | ||
$(DOCKER_CMD) rmi pga-collector-build | ||
|
||
$(TMP_DIR)/$(DEB_PACKAGE_ARM64): Dockerfile.build.deb-systemd | ||
docker build --platform linux/arm64 $(BUILD_ARGS) -f Dockerfile.build.deb-systemd -t pga-collector-build ../../ | ||
docker run --platform linux/arm64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(DEB_PACKAGE_ARM64) /out" | ||
docker rmi pga-collector-build | ||
$(DOCKER_CMD) build --platform linux/arm64 $(BUILD_ARGS) -f Dockerfile.build.deb-systemd -t pga-collector-build ../../ | ||
$(DOCKER_CMD) run --platform linux/arm64 --rm -v $(TMP_DIR):/out pga-collector-build sh -c "cp /root/$(DEB_PACKAGE_ARM64) /out" | ||
$(DOCKER_CMD) rmi pga-collector-build |
Oops, something went wrong.