Skip to content

Commit 43d7c26

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 6889db6 commit 43d7c26

File tree

5 files changed

+65
-18
lines changed

5 files changed

+65
-18
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: 40 additions & 8 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:
11-
name: Qemu
21+
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,26 @@ 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+
104+
- name: Set vars if long run
105+
if: ${{ inputs.short_run == false }}
106+
run: |
107+
echo "SHORT_RUN=false" >> $GITHUB_ENV
108+
echo "CONFIG_OPTIONS=umf/scripts/qemu/configs/*.xml" >> $GITHUB_ENV
109+
110+
- name: Download Ubuntu image
111+
run: |
112+
OS_VER=$(echo ${{matrix.os}} | cut -d'-' -f2)
113+
wget https://cloud-images.ubuntu.com/releases/${OS_VER}/release/${{matrix.os}}-server-cloudimg-amd64.img -O qemu_image.img
84114
85115
- name: Resize image
86-
run: qemu-img resize ./ubuntu-23.04-server-cloudimg-amd64.img +4G
116+
run: qemu-img resize ./qemu_image.img +4G
87117

88118
- name: Build UMF in QEMU
89119
run: |
@@ -98,7 +128,9 @@ jobs:
98128
99129
- name: Run tests in QEMU
100130
run: |
101-
for config_file in umf/scripts/qemu/configs/*.xml; do
131+
echo "Running tests for: ${CONFIG_OPTIONS}"
132+
133+
for config_file in ${CONFIG_OPTIONS}; do
102134
config_name=$(basename $config_file)
103135
104136
while ps -aux | grep qemu-system-x86_64 | grep -q -v grep; do
@@ -109,13 +141,13 @@ jobs:
109141
echo "\n ### Testing ${config_name} ###"
110142
umf/scripts/qemu/start_qemu.sh ${config_name}
111143
112-
ssh [email protected] -p 2222 -t "bash /home/testuser/scripts/qemu/run-tests.sh COVERAGE ${config_name}"
144+
ssh [email protected] -p 2222 -t "export SHORT_RUN=${SHORT_RUN} OS_FULL_NAME=${{matrix.os}} && /home/testuser/scripts/qemu/run-tests.sh COVERAGE ${config_name}"
113145
scp -r -P 2222 [email protected]:/home/testuser/coverage ./
114146
ssh [email protected] -p 2222 -t "sudo shutdown -h now"
115147
done
116148
ls -al ./coverage
117149
118150
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
119151
with:
120-
name: exports-coverage-qemu-all
152+
name: exports-coverage-qemu-${{matrix.os}}
121153
path: coverage

scripts/qemu/run-tests.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
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+
# For coverage, OS_FULL_NAME env variable has to be set to the name of the OS.
8+
69
set -e
710

811
COVERAGE=$1
@@ -26,19 +29,22 @@ echo password | sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
2629
numactl -H
2730

2831
cd build
32+
echo "## Running all tests ..."
2933
ctest --verbose
3034

31-
# run tests bound to a numa node
35+
echo "## Running tests bound to a numa node 0 & 1 ..."
3236
numactl -N 0 ctest --output-on-failure
3337
numactl -N 1 ctest --output-on-failure
3438

3539
if [ "$COVERAGE" = "COVERAGE" ]; then
36-
COVERAGE_FILE_NAME=exports-coverage-qemu-$CONFIG_NAME
40+
COVERAGE_FILE_NAME=exports-coverage-qemu-${OS_FULL_NAME}-${CONFIG_NAME}
3741
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
3842
../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
3943
mv ./$COVERAGE_FILE_NAME $COVERAGE_DIR
4044
fi
4145

42-
# run tests under valgrind
43-
echo "Running tests under valgrind memcheck ..."
44-
../test/test_valgrind.sh .. . memcheck
46+
# run tests under valgrind only on long run or for default configuration
47+
if [ "${SHORT_RUN}" != "true" ] || [ "${CONFIG_NAME}" == "default" ]; then
48+
echo "## Running tests under valgrind memcheck ..."
49+
../test/test_valgrind.sh .. . memcheck
50+
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)