Skip to content

Commit 74ce9b8

Browse files
[CI] Enable short run of QEMU in PR/push workflow
Run full QEMU suite in nightly workflow only. Enable more Ubuntu OSes along.
1 parent 6a29d28 commit 74ce9b8

File tree

5 files changed

+64
-16
lines changed

5 files changed

+64
-16
lines changed

.github/workflows/nightly.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,11 @@ jobs:
185185
uses: ./.github/workflows/reusable_gpu.yml
186186
with:
187187
name: "CUDA"
188-
os: "['Ubuntu']"
188+
os: "['Ubuntu']"
189+
190+
# Full exeuction of QEMU tests
191+
QEMU:
192+
uses: ./.github/workflows/reusable_qemu.yml
193+
with:
194+
short_run: false
195+
os: "['ubuntu-23.04', 'ubuntu-24.04']"

.github/workflows/pr_push.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ jobs:
5151
Sanitizers:
5252
needs: [FastBuild]
5353
uses: ./.github/workflows/reusable_sanitizers.yml
54-
Qemu:
54+
QEMU:
5555
needs: [FastBuild]
5656
uses: ./.github/workflows/reusable_qemu.yml
57+
with:
58+
short_run: true
5759
Benchmarks:
5860
needs: [Build]
5961
uses: ./.github/workflows/reusable_benchmarks.yml
@@ -66,15 +68,15 @@ jobs:
6668
Coverage:
6769
# total coverage (on upstream only)
6870
if: github.repository == 'oneapi-src/unified-memory-framework'
69-
needs: [Build, DevDax, L0, CUDA, MultiNuma, Qemu, ProxyLib]
71+
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
7072
uses: ./.github/workflows/reusable_coverage.yml
7173
secrets: inherit
7274
with:
7375
trigger: "${{github.event_name}}"
7476
Coverage_partial:
7577
# partial coverage (on forks)
7678
if: github.repository != 'oneapi-src/unified-memory-framework'
77-
needs: [Build, Qemu, ProxyLib]
79+
needs: [Build, QEMU, ProxyLib]
7880
uses: ./.github/workflows/reusable_coverage.yml
7981
CodeQL:
8082
needs: [Build]

.github/workflows/reusable_qemu.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
# Builds project on qemu with custom hmat settings
22
name: Qemu
33

4-
on: workflow_call
4+
on:
5+
workflow_call:
6+
inputs:
7+
short_run:
8+
description: Should the workflow run only basic tests?
9+
type: boolean
10+
default: false
11+
os:
12+
description: List of OSes
13+
type: string
14+
default: '["ubuntu-23.04"]'
515

616
permissions:
717
contents: read
818

919
jobs:
1020
qemu-build:
1121
name: Qemu
22+
strategy:
23+
matrix:
24+
os: ${{ fromJson(inputs.os) }}
25+
26+
# Host QEMU on any Linux platform
1227
runs-on: ubuntu-22.04
1328

1429
steps:
@@ -79,11 +94,29 @@ jobs:
7994
8095
sudo -Sk genisoimage -output ubuntu-cloud-init.iso -volid cidata -joliet -rock ./user-data ./meta-data
8196
82-
- name: Download ubuntu image
83-
run: wget https://cloud-images.ubuntu.com/releases/lunar/release/ubuntu-23.04-server-cloudimg-amd64.img
97+
- name: Set vars if short run
98+
if: ${{ inputs.short_run == true }}
99+
run: |
100+
echo "SHORT_RUN=true" >> $GITHUB_ENV
101+
declare -a short_configs=("default.xml" "sock_2_var3.xml" "sock_4_var1_hmat.xml")
102+
echo "CONFIG_OPTIONS=${short_configs[@]}" >> $GITHUB_ENV
103+
echo "OS_FULL_NAME=${{matrix.os}}" >> $GITHUB_ENV
104+
echo "OS_VER=$(echo ${{matrix.os}} | cut -d'-' -f2)" >> $GITHUB_ENV
105+
106+
- name: Set vars if long run
107+
if: ${{ inputs.short_run == false }}
108+
run: |
109+
echo "SHORT_RUN=false" >> $GITHUB_ENV
110+
echo "CONFIG_OPTIONS=umf/scripts/qemu/configs/*.xml" >> $GITHUB_ENV
111+
echo "OS_FULL_NAME=${{matrix.os}}" >> $GITHUB_ENV
112+
echo "OS_VER=$(echo ${{matrix.os}} | cut -d'-' -f2)" >> $GITHUB_ENV
113+
114+
- name: Download Ubuntu image
115+
run: |
116+
wget https://cloud-images.ubuntu.com/releases/${OS_VER}/release/${OS_FULL_NAME}-server-cloudimg-amd64.img -O qemu_image.img
84117
85118
- name: Resize image
86-
run: qemu-img resize ./ubuntu-23.04-server-cloudimg-amd64.img +4G
119+
run: qemu-img resize ./qemu_image.img +4G
87120

88121
- name: Build UMF in QEMU
89122
run: |
@@ -98,7 +131,9 @@ jobs:
98131
99132
- name: Run tests in QEMU
100133
run: |
101-
for config_file in umf/scripts/qemu/configs/*.xml; do
134+
echo "Running tests for: ${CONFIG_OPTIONS}"
135+
136+
for config_file in ${CONFIG_OPTIONS}; do
102137
config_name=$(basename $config_file)
103138
104139
while ps -aux | grep qemu-system-x86_64 | grep -q -v grep; do
@@ -117,5 +152,5 @@ jobs:
117152
118153
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
119154
with:
120-
name: exports-coverage-qemu-all
155+
name: exports-coverage-qemu-short-${{matrix.os}}
121156
path: coverage

scripts/qemu/run-tests.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
# If env var SHORT_RUN is set to true, part of the tests are skipped here.
7+
68
set -e
79

810
COVERAGE=$1
@@ -30,15 +32,17 @@ ctest --verbose
3032

3133
# run tests bound to a numa node
3234
numactl -N 0 ctest --output-on-failure
33-
numactl -N 1 ctest --output-on-failure
35+
[ "${SHORT_RUN}" == "false" ] && numactl -N 1 ctest --output-on-failure
3436

3537
if [ "$COVERAGE" = "COVERAGE" ]; then
36-
COVERAGE_FILE_NAME=exports-coverage-qemu-$CONFIG_NAME
38+
COVERAGE_FILE_NAME=exports-coverage-qemu-${OS_FULL_NAME}-${CONFIG_NAME}
3739
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
3840
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
3941
mv ./$COVERAGE_FILE_NAME $COVERAGE_DIR
4042
fi
4143

42-
# run tests under valgrind
43-
echo "Running tests under valgrind memcheck ..."
44-
../test/test_valgrind.sh .. . memcheck
44+
# run tests under valgrind only on long run or for default configuration
45+
if [ "${SHORT_RUN}" == "false" ] || [ "${CONFIG_NAME}" = "default" ]; then
46+
echo "Running tests under valgrind memcheck ..."
47+
../test/test_valgrind.sh .. . memcheck
48+
fi

scripts/qemu/start_qemu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parsed_config=$(python3 "$(dirname $0)/parse_config.py" "$(dirname $0)/configs/$
1414
set -x
1515

1616
sudo qemu-system-x86_64 \
17-
-drive file=./ubuntu-23.04-server-cloudimg-amd64.img,format=qcow2,index=0,media=disk,id=hd \
17+
-drive file=./qemu_image.img,format=qcow2,index=0,media=disk,id=hd \
1818
-cdrom ./ubuntu-cloud-init.iso \
1919
-enable-kvm \
2020
-net nic -net user,hostfwd=tcp::2222-:22 \

0 commit comments

Comments
 (0)