-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
25 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Centralise the mage package for a given beat in Buildkite. | ||
# It enables multi-arch builds to avoid the exec format errors when | ||
# attempting to build arm64 inside arm64 workers. | ||
# | ||
# For further details, see https://github.com/elastic/elastic-agent/pull/6948 | ||
# and https://github.com/elastic/golang-crossbuild/pull/507 | ||
# | ||
|
||
set -ueo pipefail | ||
|
||
BEAT_DIR=${1:?-"Error: Beat directory must be specified."} | ||
|
||
if [[ "$(uname -m)" == "aarch64" || "$(uname -m)" == "arm64" ]]; then | ||
echo "Skipping qemu installation on arm64 worker" | ||
else | ||
BINFMT_IMAGE="tonistiigi/binfmt:qemu-v9.2.2" | ||
|
||
# Make sure to uninstall first to avoid conflicts | ||
docker run --privileged --rm "$BINFMT_IMAGE" --uninstall qemu-* | ||
docker run --privileged --rm "$BINFMT_IMAGE" --install all | ||
fi | ||
# shellcheck source=/dev/null | ||
source .buildkite/scripts/qemu.sh | ||
|
||
cd $BEAT_DIR | ||
mage package |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# It enables multi-arch builds to avoid the exec format errors when | ||
# attempting to build arm64 inside arm64 workers. | ||
# | ||
# For further details, see https://github.com/elastic/elastic-agent/pull/6948 | ||
# and https://github.com/elastic/golang-crossbuild/pull/507 | ||
# | ||
set -euo pipefail | ||
|
||
if [[ "$(uname -m)" == "aarch64" || "$(uname -m)" == "arm64" ]]; then | ||
echo "Skipping qemu installation on arm64 worker" | ||
else | ||
BINFMT_IMAGE="tonistiigi/binfmt:qemu-v9.2.2" | ||
|
||
# Make sure to uninstall first to avoid conflicts | ||
docker run --privileged --rm "$BINFMT_IMAGE" --uninstall qemu-* | ||
docker run --privileged --rm "$BINFMT_IMAGE" --install all | ||
fi |
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