forked from hpc/xpmem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hpc#29 from Alexey-Rivkin/test_on_VMs
CI: Testing on VMs
- Loading branch information
Showing
3 changed files
with
139 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env ruby | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "generic/#{ENV['BOX_NAME']}" | ||
config.vm.provision "shell", :path => "entrypoint.sh", args: "#{ENV['BOX_NAME']} #{ENV['SYSTEM_PULLREQUEST_PULLREQUESTNUMBER']}" | ||
config.vm.define "#{ENV['BOX_NAME']}" do |vm01| | ||
vm01.vm.provider :libvirt do |libvirt| | ||
vm01.vm.box_check_update = false | ||
libvirt.memory = 8192 | ||
libvirt.cpus = 8 | ||
end | ||
end | ||
end |
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,69 @@ | ||
#!/bin/bash | ||
set -Exeuo pipefail | ||
|
||
OS=$1 | ||
PR_NUM=$2 | ||
|
||
install_packages() { | ||
if [[ $OS == *"ubuntu"* ]]; then | ||
apt-get update && | ||
DEBIAN_FRONTEND=noninteractive apt-get install -yq \ | ||
automake \ | ||
dkms \ | ||
git \ | ||
libtool && | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
elif [[ $OS == *"centos"* ]]; then | ||
yum install -y -q centos-release-scl | ||
yum install -y -q \ | ||
automake \ | ||
devtoolset-8-gcc \ | ||
devtoolset-8-gcc-c++ \ | ||
elfutils-libelf-devel \ | ||
git \ | ||
libtool \ | ||
make && | ||
yum clean all | ||
fi | ||
} | ||
|
||
xpmem_build() { | ||
git clone -q https://github.com/openucx/xpmem.git | ||
cd xpmem | ||
git fetch origin pull/"$PR_NUM"/merge | ||
git checkout FETCH_HEAD | ||
./autogen.sh | ||
if [[ $OS == *"ubuntu"* ]]; then | ||
./configure --with-kerneldir=/usr/src/linux-headers-"$(uname -r)" | ||
make -s | ||
make check | ||
elif [[ $OS == *"centos"* ]]; then | ||
# Build with GCC-8 | ||
scl enable devtoolset-8 -- bash -c " | ||
./configure --with-kerneldir=/usr/src/kernels/'$(uname -r)' | ||
make -s | ||
make check | ||
" | ||
fi | ||
} | ||
|
||
xpmem_load() { | ||
sudo insmod kernel/xpmem.ko | ||
cat /sys/module/xpmem/srcversion | ||
modinfo kernel/xpmem.ko | ||
if modinfo kernel/xpmem.ko | grep -qf /sys/module/xpmem/srcversion; then | ||
echo "XPMEM loaded successfully" | ||
else | ||
echo "Error: Failed to load xpmem kernel module" >&2 | ||
exit 1 | ||
fi | ||
} | ||
|
||
err_report() { | ||
echo "Exited with ERROR in line $1" | ||
} | ||
trap 'err_report $LINENO' ERR | ||
|
||
install_packages | ||
xpmem_build | ||
xpmem_load |