Skip to content

Commit

Permalink
Move aarch64 from QEMU to native aarch64 machines
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen committed Jan 18, 2025
1 parent e5fcce7 commit 8a647e1
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:24.04

# Keep annoying tzdata prompt from coming up
# Thanks cmake!
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
clang \
cmake \
git \
libclang-rt-dev \
lldb \
make \
xz-utils \
zlib1g-dev \
curl \
python3-pip \
wget \
systemtap-sdt-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove --purge \
&& apt-get -y clean \
&& pip3 install --break-system-packages cloudsmith-cli

# needed for GitHub actions
RUN git config --global --add safe.directory /__w/ponyc/ponyc

# add user pony in order to not run tests as root
RUN useradd -u 1001 -ms /bin/bash -d /home/pony -g root pony
USER pony
WORKDIR /home/pony
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -o errexit
set -o nounset

#
# *** You should already be logged in to GHCR when you run this ***
#

NAME="ghcr.io/ponylang/ponyc-ci-aarch64-unknown-linux-ubuntu24.04-builder"
TODAY=$(date +%Y%m%d)
DOCKERFILE_DIR="$(dirname "$0")"
BUILDER="aarch64-builder-$(date +%s)"

docker buildx create --use --name "${BUILDER}"
docker buildx build --platform linux/arm64 --pull -t "${NAME}:${TODAY}" --output "type=image,push=true" "${DOCKERFILE_DIR}"
docker buildx stop "${BUILDER}"
20 changes: 8 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ jobs:
run: make test-cross-ci config=release PONYPATH=../armv7-a/release cross_triple=arm-unknown-linux-gnueabihf cross_arch=armv7-a cross_cpu=cortex-a9 cross_linker=arm-linux-gnueabihf-gcc cross_runner="qemu-arm-static -cpu cortex-a9 -L /usr/local/arm-linux-gnueabihf/libc"

aarch64-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
matrix:
include:
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427
- image: ghcr.io/ponylang/ponyc-ci-aarch64-unknown-linux-ubuntu24.04-builder:20250118
name: aarch64 Linux glibc

name: ${{ matrix.name }}
Expand All @@ -310,20 +310,16 @@ jobs:
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }}
- name: Build Debug Runtime
run: |
make configure config=debug
make configure arch=armv8-a config=debug
make build config=debug
- name: Build Debug Cross-Compiled Runtime
run: make cross-libponyrt config=debug CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ arch=armv8-a cross_cflags="-march=armv8-a -mtune=cortex-a53" cross_lflags="-O3;-march=aarch64"
- name: Test with Debug Cross-Compiled Runtime
run: make test-cross-ci config=debug PONYPATH=../armv8-a/debug cross_triple=aarch64-unknown-linux-gnu cross_arch=armv8-a cross_cpu=cortex-a53 cross_linker=aarch64-linux-gnu-gcc cross_runner="qemu-aarch64-static -cpu cortex-a53 -L /usr/local/aarch64-linux-gnu/libc"
- name: Test with Debug Runtime
run: make test-ci config=debug usedebugger=lldb
- name: Build Release Runtime
run: |
make configure config=release
make configure arch=armv8-a config=release
make build config=release
- name: Build Release Cross-Compiled Runtime
run: make cross-libponyrt config=release CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ arch=armv8-a cross_cflags="-march=armv8-a -mtune=cortex-a53" cross_lflags="-O3;-march=aarch64"
- name: Test with Release Cross-Compiled Runtime
run: make test-cross-ci config=release PONYPATH=../armv8-a/release cross_triple=aarch64-unknown-linux-gnu cross_arch=armv8-a cross_cpu=cortex-a53 cross_linker=aarch64-linux-gnu-gcc cross_runner="qemu-aarch64-static -cpu cortex-a53 -L /usr/local/aarch64-linux-gnu/libc"
- name: Test with Release Runtime
run: make test-ci config=release usedebugger=lldb

x86_64-macos:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
runs-on: macos-13
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/stress-test-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,26 @@ jobs:
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }}failed.

aarch64-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
matrix:
include:
# these don't currently use a debugger as cross compilation hasn't
# been set up to do 'run in debugger'
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427
- image: ponyc-ci-aarch64-unknown-linux-ubuntu24.04-builder:20250118
name: aarch64-unknown-linux-ubuntu24.04 [release]
target: test-cross-stress-release
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427
target: test-stress-release
debugger: lldb
- image: ponyc-ci-aarch64-unknown-linux-ubuntu24.04-builder:20250118
name: aarch64-unknown-linux-ubuntu24.04 [debug]
target: test-cross-stress-debug
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427
name: aarch64-unknown-linux-ubuntu24.04 [cd] [release]
target: test-cross-stress-with-cd-release
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427
name: aarch64-unknown-linux-ubuntu24.04 [cd] [debug]
target: test-cross-stress-with-cd-debug
target: test-stress-debug
debugger: lldb

name: ${{ matrix.name }}
container:
image: ${{ matrix.image }}
options: --user pony --cap-add=SYS_PTRACE --security-opt seccomp=unconfined

steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -132,12 +127,10 @@ jobs:
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }}
- name: Build Debug Runtime
run: |
make configure config=debug
make configure arch=armv8-a config=debug
make build config=debug
- name: Build Debug Cross-Compiled Runtime
run: make cross-libponyrt config=debug CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ arch=armv8-a cross_cflags="-march=armv8-a -mtune=cortex-a53" cross_lflags="-O3;-march=aarch64"
- name: Run Stress Test
run: make ${{ matrix.target }} config=debug PONYPATH=../armv8-a/debug cross_triple=aarch64-unknown-linux-gnu cross_arch=armv8-a cross_cpu=cortex-a53 cross_linker=aarch64-linux-gnu-gcc cross_runner="qemu-aarch64-static -cpu cortex-a53 -L /usr/local/aarch64-linux-gnu/libc"
run: make ${{ matrix.target }} config=debug usedebugger='${{ matrix.debugger }}'
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/update-lib-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,32 @@ jobs:
- image: ghcr.io/ponylang/ponyc-ci-cross-arm:20240427
- image: ghcr.io/ponylang/ponyc-ci-cross-armhf:20240427
- image: ghcr.io/ponylang/ponyc-ci-cross-riscv64:20240427
- image: ghcr.io/ponylang/ponyc-ci-cross-aarch64:20240427

name: ${{ matrix.image }}
container:
image: ${{ matrix.image }}
options: --user pony
steps:
- name: Checkout
uses: actions/[email protected]
- name: Cache Libs
id: cache-libs
uses: actions/cache@v4
with:
path: build/libs
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'lib/CMakeLists.txt') }}
- name: Build Libs
if: steps.cache-libs.outputs.cache-hit != 'true'
run: make libs build_flags=-j8

aarch64-linux:
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
matrix:
include:
- image: ghcr.io/ponylang/ponyc-ci-aarch64-unknown-linux-ubuntu24.04-builder:20250118

name: ${{ matrix.image }}
container:
Expand Down

0 comments on commit 8a647e1

Please sign in to comment.