Skip to content

Commit 8302844

Browse files
authored
Merge pull request #1973 from antmicro/transition-to-gh-custom-runners
ci: transition to GH custom runners for nightly builds
2 parents 8e7efe5 + 8b8f9f0 commit 8302844

File tree

8 files changed

+249
-5
lines changed

8 files changed

+249
-5
lines changed

.github/scripts/hostsetup.sh

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
3+
set -e
4+
echo "========================================"
5+
echo "Host updating packages"
6+
echo "----------------------------------------"
7+
apt update
8+
echo "----------------------------------------"
9+
10+
11+
echo "========================================"
12+
echo "Add repositories"
13+
echo "----------------------------------------"
14+
apt install -y software-properties-common
15+
add-apt-repository ppa:ubuntu-toolchain-r/test
16+
echo "----------------------------------------"
17+
18+
echo
19+
echo "========================================"
20+
echo "Host install packages"
21+
echo "----------------------------------------"
22+
23+
apt install -y \
24+
autoconf \
25+
automake \
26+
bash \
27+
bison \
28+
binutils \
29+
binutils-gold \
30+
build-essential \
31+
capnproto \
32+
clang \
33+
cmake \
34+
ctags \
35+
curl \
36+
doxygen \
37+
flex \
38+
fontconfig \
39+
gdb \
40+
git \
41+
gperf \
42+
gzip \
43+
libcairo2-dev \
44+
libcapnp-dev \
45+
libgtk-3-dev \
46+
libevent-dev \
47+
libfontconfig1-dev \
48+
liblist-moreutils-perl \
49+
libncurses5-dev \
50+
libx11-dev \
51+
libxft-dev \
52+
libxml++2.6-dev \
53+
libreadline-dev \
54+
python \
55+
python3 \
56+
python3-dev \
57+
python3-pip \
58+
python3-virtualenv \
59+
python3-yaml \
60+
tcl-dev \
61+
libffi-dev \
62+
perl \
63+
texinfo \
64+
time \
65+
valgrind \
66+
zip \
67+
qt5-default \
68+
g++-9 \
69+
gcc-9 \
70+
wget
71+
# Don't include libtbb-dev since it may increase memory usage
72+
#libtbb-dev \
73+
74+
export PATH="$PATH:/home/kbuilder/.local/bin"
75+
76+
export CC=gcc-9
77+
export CXX=g++-9
78+
79+
python3 -m pip install -r requirements.txt
80+
81+
echo "----------------------------------------"

.github/scripts/run-vtr.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
5+
set -x
6+
set -e
7+
8+
export VTR_DIR=$(pwd)
9+
source $SCRIPT_DIR/hostsetup.sh
10+
11+
if ! { [ $VTR_TEST == "vtr_reg_strong" ] || [ $VTR_TEST == "odin_reg_strong" ] \
12+
|| [ $VTR_TEST == "odin_tech_strong" ] || [ $VTR_TEST == "vtr_reg_yosys_odin" ]; }; then
13+
source $SCRIPT_DIR/vtr-full-setup.sh
14+
fi
15+
16+
# Build VtR
17+
source $SCRIPT_DIR/vtr-build.sh
18+
# Run the reg test.
19+
source $SCRIPT_DIR/vtr-test.sh

.github/scripts/vtr-build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [ -z ${VTR_CMAKE_PARAMS+x} ]; then
4+
echo "Missing $$VTR_CMAKE_PARAMS value"
5+
exit 1
6+
fi
7+
8+
export FAILURE=0
9+
make -k CMAKE_PARAMS="$VTR_CMAKE_PARAMS" -j$(nproc) || export FAILURE=1
10+
11+
echo
12+
13+
# When the build fails, produce the failure output in a clear way
14+
if [ $FAILURE -ne 0 ]; then
15+
make CMAKE_PARAMS="$VTR_CMAKE_PARAMS" -j1
16+
exit 1
17+
fi

.github/scripts/vtr-full-setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
make get_titan_benchmarks
4+
make get_ispd_benchmarks
5+
6+
dev/upgrade_vtr_archs.sh
7+
8+
# Symbiflow archs do not require update
9+
make get_symbiflow_benchmarks

.github/scripts/vtr-test.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
set +x
4+
if [ -z ${VTR_TEST+x} ]; then
5+
echo "Missing $$VTR_TEST value"
6+
exit 1
7+
fi
8+
9+
if [ -z ${VTR_TEST_OPTIONS+x} ]; then
10+
echo "Missing $$VTR_TEST_OPTIONS value"
11+
exit 1
12+
fi
13+
14+
if [ -z $NUM_CORES ]; then
15+
echo "Missing $$NUM_CORES value"
16+
exit 1
17+
fi
18+
19+
echo $PWD
20+
pwd
21+
pwd -L
22+
pwd -P
23+
cd $(realpath $(pwd))
24+
echo $PWD
25+
pwd
26+
pwd -L
27+
pwd -P
28+
29+
(
30+
while :
31+
do
32+
date
33+
uptime
34+
free -h
35+
sleep 300
36+
done
37+
) &
38+
MONITOR=$!
39+
40+
set +e
41+
42+
echo "========================================"
43+
echo "VPR Build Info"
44+
echo "========================================"
45+
./vpr/vpr --version
46+
47+
echo "========================================"
48+
echo "Running Tests"
49+
echo "========================================"
50+
export VPR_NUM_WORKERS=1
51+
52+
./run_reg_test.py $VTR_TEST $VTR_TEST_OPTIONS -j$NUM_CORES
53+
TEST_RESULT=$?
54+
set -e
55+
kill $MONITOR
56+
57+
echo "========================================"
58+
echo "Packing benchmarks files"
59+
echo "========================================"
60+
61+
results=qor_results_$VTR_TEST.tar
62+
# Create archive with output files from the test
63+
find vtr_flow -type f \( -name "*.out" -o -name "*.log" -o -name "*.txt" -o -name "*.csv" \) -exec tar -rf $results {} \;
64+
gzip $results
65+
66+
exit $TEST_RESULT

.github/workflows/large-tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
11+
Run-tests:
12+
container: ubuntu:bionic
13+
14+
runs-on: [self-hosted, Linux, X64]
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- {test: "vtr_reg_nightly_test1", cores: "8", options: "", cmake: "" }
21+
- {test: "vtr_reg_nightly_test2", cores: "16", options: "", cmake: "" }
22+
- {test: "vtr_reg_nightly_test3", cores: "16", options: "", cmake: "" }
23+
- {test: "vtr_reg_nightly_test4", cores: "16", options: "", cmake: "" }
24+
- {test: "vtr_reg_strong", cores: "16", options: "", cmake: "-DVTR_ASSERT_LEVEL=3" }
25+
- {test: "vtr_reg_strong", cores: "16", options: "-skip_qor", cmake: "-DVTR_ASSERT_LEVEL=3 -DVTR_ENABLE_SANITIZE=ON"}
26+
- {test: "vtr_reg_yosys", cores: "16", options: "", cmake: "-DWITH_YOSYS=ON" }
27+
- {test: "vtr_reg_yosys_odin", cores: "16", options: "", cmake: "-DODIN_USE_YOSYS=ON" }
28+
- {test: "odin_tech_strong", cores: "16", options: "", cmake: "-DODIN_USE_YOSYS=ON" }
29+
- {test: "odin_reg_strong", cores: "16", options: "", cmake: "" }
30+
31+
env:
32+
DEBIAN_FRONTEND: "noninteractive"
33+
34+
steps:
35+
36+
- uses: actions/checkout@v2
37+
38+
- name: Setup
39+
run: stdbuf -i0 -i0 -e0 ./.github/scripts/hostsetup.sh
40+
41+
- name: Execute test script
42+
run: stdbuf -i0 -o0 -e0 ./.github/scripts/run-vtr.sh
43+
env:
44+
VTR_TEST: ${{ matrix.test }}
45+
VTR_TEST_OPTIONS: ${{ matrix.options }}
46+
VTR_CMAKE_PARAMS: ${{ matrix.cmake }}
47+
NUM_CORES: ${{ matrix.cores }}
48+
49+
- uses: actions/upload-artifact@v2
50+
if: ${{ always() }}
51+
with:
52+
path: |
53+
**/results*.gz
54+
**/plot_*.svg
55+
**/qor_results*.tar.gz

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ set(SANITIZE_FLAGS "")
246246
if(VTR_ENABLE_SANITIZE)
247247
#Enable sanitizers
248248
# -fuse-ld=gold force the gold linker to be used (required for sanitizers, but not enabled by default on some systems)
249-
set(SANITIZE_FLAGS "-g -fsanitize=address -fsanitize=leak -fsanitize=undefined -fuse-ld=gold")
249+
set(SANITIZE_FLAGS "-g -fsanitize=address -fsanitize=leak -fsanitize=undefined -fuse-ld=gold -static-libasan")
250250
message(STATUS "SANITIZE_FLAGS: ${SANITIZE_FLAGS}")
251251
endif()
252252

@@ -456,4 +456,4 @@ include(AutoPyFormat)
456456
#
457457
# Python Environment setup
458458
#
459-
include(PyEnv)
459+
include(PyEnv)

libs/librrgraph/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ file(GLOB_RECURSE LIB_SOURCES src/*/*.cpp)
77
file(GLOB_RECURSE LIB_HEADERS src/*/*.h)
88
files_to_dirs(LIB_HEADERS LIB_INCLUDE_DIRS)
99

10-
#Remove test executable from library
11-
list(REMOVE_ITEM LIB_SOURCES ${EXEC_SOURCES})
12-
1310
#Create the library
1411
add_library(librrgraph STATIC
1512
${LIB_HEADERS}

0 commit comments

Comments
 (0)