-
Notifications
You must be signed in to change notification settings - Fork 304
277 lines (248 loc) · 10.8 KB
/
bundleTest-thor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
name: BundleTest on Thor
on:
workflow_call:
inputs:
os:
type: string
description: 'Operating System'
required: false
default: 'ubuntu-22.04'
asset-name:
type: string
description: 'Asset Name'
required: false
default: 'build-docker-package'
dependencies:
type: string
description: 'Dependencies'
required: false
default: 'bison flex build-essential binutils-dev curl lsb-release libcppunit-dev python3-dev default-jdk r-base-dev r-cran-rcpp r-cran-rinside r-cran-inline libtool autotools-dev automake git cmake xmlstarlet'
get-stat:
type: boolean
description: 'Run Query stat'
required: false
default: false
generate-zap:
type: string
description: 'Generate ZAP files'
required: false
default: ''
test-core-file-generation:
type: boolean
description: 'Test core file generation'
required: false
default: false
env:
ML_SUPPRESS_WARNING_FILES: "RegressionTestModified.ecl ClassificationTestModified.ecl"
ML_EXCLUDE_FILES: "--ef ClassicTestModified.ecl,SVCTest.ecl,ClassificationTestModified.ecl"
BUNDLES_TO_TEST: "ML_Core PBblas GLM GNN DBSCAN LearningTrees TextVectors KMeans SupportVectorMachines LinearRegression LogisticRegression"
uploadArtifact: false
jobs:
main:
runs-on: ${{ inputs.os }}
steps:
- name: Free additional disk space (remove Android SDK + Tools)
run: |
sudo rm -rf /usr/local/lib/android
- name: Download Package
uses: actions/download-artifact@v3
with:
name: ${{ inputs.asset-name }}
path: ${{ inputs.asset-name }}
- name: Install Dependencies
shell: "bash"
run: |
sudo apt-get update
sudo apt-get install -y \
git \
wget \
net-tools \
tzdata \
unzip \
xvfb \
libxi6 \
default-jdk \
gdb \
${{ inputs.dependencies }}
- name: Install Package
shell: "bash"
run: |
sudo apt-get install -y -f ./${{ inputs.asset-name }}/*.deb
sudo chown -R $USER:$USER /opt/HPCCSystems
sudo xmlstarlet ed -L -u 'Environment/Software/ThorCluster/@slavesPerNode' -v 2 -u 'Environment/Software/ThorCluster/@channelsPerSlave' -v 1 /etc/HPCCSystems/environment.xml
- name: Install ML Dependencies
shell: "bash"
run: |
sudo apt install libsvm-dev libsvm-tools
sudo pip install tensorflow numpy keras
- name: Start HPCC-Platform
shell: "bash"
run: |
ulimit -c 100
echo 'core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern
export LANG="en_US.UTF-8"
sudo update-locale
sudo /etc/init.d/hpcc-init start
- name: Core generation test
if: ${{ inputs.test-core-file-generation }}
shell: "bash"
run: |
echo """
boolean seg() := beginc++ #option action
#include <csignal>
#body
raise(SIGABRT);
return false;
endc++;
output(seg()); """ > crash.ecl
ecl run -t hthor crash.ecl
continue-on-error: true
- name: Get test from Github
shell: "bash"
run: |
IFS=' ' read -a BUNDLES_TO_TEST <<< $BUNDLES_TO_TEST
BUNDLES_COUNT=${#BUNDLES_TO_TEST[@]}
for ((i=0; i<$BUNDLES_COUNT; i++))
do
BUNDLE_NAME=${BUNDLES_TO_TEST[i]}
BUNDLE_REPO="https://github.com/hpcc-systems/${BUNDLES_TO_TEST[i]}.git"
INSTALL_CMD="ecl bundle install --update --force ${BUNDLE_REPO}"
echo "Bundle Name : ${BUNDLE_NAME}"
echo "Bundle Repo : ${BUNDLE_REPO}"
tryCountMax=5
tryCount=$tryCountMax
tryDelay=1m
while true
do
cRes=$( ${INSTALL_CMD} 2>&1 )
retCode=$?
if [[ $retCode -ne 0 ]]
then
tryCount=$(( $tryCount-1 ))
if [[ $tryCount -ne 0 ]]
then
sleep ${tryDelay}
continue
else
echo "Install $BUNDLE_NAME bundle was failed after ${tryCountMax} attempts. Result is: '${cRes}'" >> /home/runner/HPCCSystems-regression/log/Failed_bundle_install.summary
echo "uploadArtifact=true" >> $GITHUB_ENV
break;
fi
else
echo "Install $BUNDLE_NAME bundle was success."
BUNDLE_VERSION=$( echo "${cRes}" | egrep "^$BUNDLE_NAME" | awk '{ print $2 }' )
echo "Version: $BUNDLE_VERSION"
break
fi
done
done
- name: Run Tests
id: run
shell: "bash"
working-directory: /home/runner/.HPCCSystems/bundles/_versions/
run: |
ProcessLog()
{
BUNDLE=$1
TARGET=$2
logfilename=$( ls -clr /home/runner/HPCCSystems-regression/log/thor.*.log | head -1 | awk '{ print $9 }' )
failed=$(cat ${logfilename} | sed -n "s/^[[:space:]]*Failure:[[:space:]]*\([0-9]*\)[[:space:]]*$/\1/p")
if [[ "$failed" -ne 0 ]]
then
echo "Bundle : ${BUNDLE}" >> /home/runner/HPCCSystems-regression/log/Failed_test.summary
cat ${logfilename} >> /home/runner/HPCCSystems-regression/log/Failed_test.summary
echo "uploadArtifact=true" >> $GITHUB_ENV
fi
# Rename result log file to name of the bundle
logname=$(basename $logfilename)
bundlelogfilename=${logname//$TARGET/$BUNDLE}
printf "%s, %s\n" "$logname" "$bundlelogfilename"
mv -v $logfilename /home/runner/HPCCSystems-regression/log/ml-$bundlelogfilename
}
IFS=' ' read -a BUNDLES_TO_TEST <<< $BUNDLES_TO_TEST
while read bundle
do
bundleRunPath=${bundle%/ecl} # remove '/ecl' from the end of the $bundle
bundlePath=${bundleRunPath%/OBTTests}; # remove '/OBTTests' from the end of the $bundleRunPath if exists
bundleName=${bundlePath%/test} # remove '/test' from the end of the $bundlePath if exists
bundleName=$(basename $bundleName ) # remove path from $bundleName
if [[ "$bundle" =~ "LearningTrees" ]]
then
# add a warning supression parameter in the file
for file in $ML_SUPPRESS_WARNING_FILES
do
if [[ $( egrep -c '#ONWARNING\(30004' $bundle/$file ) -eq 0 ]]
then
pushd $bundle
cp -fv $file $file-back
# Insert a comment and the "#ONWARNING" after the Copyright header
sed -i '/## \*\//a \\n// Patched by the bundleTest on '"$( date '+%Y.%m.%d %H:%M:%S')"' \n#ONWARNING(30004, ignore); // Do not report execute time skew warning' $file
popd
fi
done
fi
if [[ ! "${BUNDLES_TO_TEST[*]}" =~ "$bundleName" ]]
then
continue
fi
pushd $bundleRunPath
/opt/HPCCSystems/testing/regress/ecl-test run -t thor --config /opt/HPCCSystems/testing/regress/ecl-test.json --timeout 3600 -fthorConnectTimeout=3600 --pq 1 $ML_EXCLUDE_FILES
retCode=$( echo $? )
if [ ${retCode} -eq 0 ]
then
ProcessLog "$bundleName" "thor"
fi
popd
done< <(find . -iname 'ecl' -type d | sort )
- name: Generate ZAP files
if: ${{ ! inputs.generate-zap == '' }}
run: |
IFS=' ' read -a ML_GENERATE_ZAP_FOR <<< ${{ inputs.generate-zap }}
if [ ${#ML_GENERATE_ZAP_FOR[@]} -ne 0 ]
then
for test in ${ML_GENERATE_ZAP_FOR[*]}
do
test=${test/.ecl/*}
wuid=$(ecl getwuid -n $test --limit 1)
if [[ -n $wuid ]]
then
ecl zapgen $wuid --path /home/runner/HPCCSystems-regression/zap --inc-thor-slave-logs
echo "testName : ${test} wuid : ${wuid}" >> zap.summary
cp zap.summary /home/runner/HPCCSystems-regression/zap
echo "uploadArtifact=true" >> $GITHUB_ENV
fi
done
fi
- name: Check for Core files
run: |
NUM_OF_ML_CORES=( $(sudo find /var/lib/HPCCSystems/ -iname 'core*' -mtime -1 -type f -exec printf "%s\n" '{}' \; ) )
if [ ${#NUM_OF_ML_CORES[@]} -ne 0 ]
then
for core in ${NUM_OF_ML_CORES[@]}
do
base=$( dirname $core )
lastSubdir=${base##*/}
comp=${lastSubdir##my}
sudo gdb --batch --quiet -ex "set interactive-mode off" -ex "echo \n Backtrace for all threads\n==========================" -ex "thread apply all bt" -ex "echo \n Registers:\n==========================\n" -ex "info reg" -ex "echo \n Disas:\n==========================\n" -ex "disas" -ex "quit" "/opt/HPCCSystems/bin/${comp}" $core | sudo tee "$core.trace" 2>&1
cp "$core.trace" /home/runner/HPCCSystems-regression/log/
done
echo "uploadArtifact=true" >> $GITHUB_ENV
fi
- name: Get test stat
if: ${{ inputs.get-stat }}
run: |
./QueryStat2.py -p /home/runner/HPCCSystems-regression/log/ -d '' -a --timestamp --compileTimeDetails 1 --graphTimings --allGraphItems --addHeader
NUM_OF_STAT_FILES=$( find /home/runner/HPCCSystems-regression/log/ -type f -iname "*.csv" -o -iname "*.cfg" | wc -l )
if [[ $NUM_OF_STAT_FILES -ne 0 ]]
then
echo "uploadArtifact=true" >> $GITHUB_ENV
fi
- name: ml-thor-test-logs-artifact
if: ${{ failure() || cancelled() || env.uploadArtifact == 'true' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.asset-name }}-bundle-test-logs
path: |
/home/runner/HPCCSystems-regression/log/*
/home/runner/HPCCSystems-regression/zap/*
if-no-files-found: ignore