Skip to content

Commit 8260ecc

Browse files
[CI] don't extra clone repo in QEMU job
just use the one available in the workflow - copy it into image.
1 parent e920b5f commit 8260ecc

File tree

4 files changed

+16
-28
lines changed

4 files changed

+16
-28
lines changed

.github/workflows/qemu.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Qemu
33

44
on: workflow_call
55

6-
env:
7-
CI_BRANCH: "${{ github.head_ref || github.ref_name }}"
8-
96
permissions:
107
contents: read
118

@@ -19,6 +16,7 @@ jobs:
1916
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2017
with:
2118
fetch-depth: 0
19+
path: umf
2220

2321
- name: Enable KVM
2422
run: |
@@ -31,7 +29,7 @@ jobs:
3129
sudo apt-get update
3230
sudo apt-get install -y qemu-system genisoimage qemu-utils \
3331
libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils
34-
pip install -r scripts/qemu/requirements.txt
32+
pip install -r umf/scripts/qemu/requirements.txt
3533
3634
- name: Add user to kvm group
3735
run: sudo usermod -a -G kvm,libvirt $USER
@@ -82,33 +80,27 @@ jobs:
8280

8381
- name: Build UMF in QEMU
8482
run: |
85-
scripts/qemu/start_qemu.sh scripts/qemu/configs/default.xml
86-
87-
if [ ${{ github.event_name }} = 'pull_request' ]; then
88-
CI_REPO="${{ github.event.pull_request.head.repo.full_name }}"
89-
else
90-
CI_REPO="$GITHUB_REPOSITORY"
91-
fi
83+
umf/scripts/qemu/start_qemu.sh default.xml
9284
93-
scp -P 2222 ${{github.workspace}}/scripts/qemu/run-build.sh [email protected]:/home/cxltest
94-
scp -P 2222 ${{github.workspace}}/scripts/qemu/run-tests.sh [email protected]:/home/cxltest
85+
rsync -az -e "ssh -p 2222" ${{github.workspace}}/umf/ [email protected]:/home/cxltest/
86+
ssh [email protected] -p 2222 -t "sudo chown -R cxltest:users /home/cxltest"
9587
96-
ssh [email protected] -p 2222 -t "bash /home/cxltest/run-build.sh https://github.com/$CI_REPO ${{env.CI_BRANCH}}"
88+
ssh [email protected] -p 2222 -t "bash /home/cxltest/scripts/qemu/run-build.sh"
9789
ssh [email protected] -p 2222 -t "sudo shutdown -h now"
9890
9991
- name: Run tests in QEMU
10092
run: |
101-
for config_file in scripts/qemu/configs/*.xml; do
102-
config_name=$(basename $config_file .xml)
93+
for config_file in umf/scripts/qemu/configs/*.xml; do
94+
config_name=$(basename $config_file)
10395
10496
while ps -aux | grep qemu-system-x86_64 | grep -q -v grep; do
10597
echo "Waiting for QEMU to shut down..."
10698
sleep 5
10799
done
108100
109101
echo "\n ### Testing ${config_name} ###"
110-
scripts/qemu/start_qemu.sh $config_file
102+
umf/scripts/qemu/start_qemu.sh ${config_name}
111103
112-
ssh [email protected] -p 2222 -t "bash /home/cxltest/run-tests.sh"
104+
ssh [email protected] -p 2222 -t "bash /home/cxltest/scripts/qemu/run-tests.sh"
113105
ssh [email protected] -p 2222 -t "sudo shutdown -h now"
114106
done

scripts/qemu/run-build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@
55

66
set -e
77

8-
repo=$1
9-
branch=$2
10-
118
echo password | sudo -Sk apt-get update
129
echo password | sudo -Sk apt-get install -y git cmake gcc g++ pkg-config \
1310
numactl libnuma-dev hwloc libhwloc-dev libjemalloc-dev libtbb-dev valgrind
1411

15-
git clone $repo umf
16-
cd umf
17-
git checkout $branch
18-
1912
mkdir build
2013
cd build
2114

scripts/qemu/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ echo password | sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
1313

1414
numactl -H
1515

16-
cd umf/build
16+
cd build
1717
ctest --verbose
1818

1919
# run tests bound to a numa node

scripts/qemu/start_qemu.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66
set -e
77

8-
config_file=$1
8+
# The config file name (should be located in ./configs/ sub-dir)
9+
config_name=$1
910

1011
# Parse the config file to get topology info and fix escaped single quotes
11-
parsed_config=$(python3 scripts/qemu/parse_config.py ${config_file} | sed s/''\''/'/g)
12+
parsed_config=$(python3 "$(dirname $0)/parse_config.py" "$(dirname $0)/configs/${config_name}" | sed s/''\''/'/g)
13+
14+
set -x
1215

1316
sudo qemu-system-x86_64 \
1417
-drive file=./ubuntu-23.04-server-cloudimg-amd64.img,format=qcow2,index=0,media=disk,id=hd \

0 commit comments

Comments
 (0)