Skip to content

Commit 265eb28

Browse files
authored
Merge branch 'release/rocm-rel-7.0' into amd/dev/rlieberm/7.0CPswdev543585
2 parents 6d4135d + b2a1d76 commit 265eb28

File tree

2 files changed

+102
-32
lines changed

2 files changed

+102
-32
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ROCm CI Caller
2+
on:
3+
pull_request:
4+
branches: [release/rocm-rel-*]
5+
types: [opened, reopened, synchronize]
6+
workflow_dispatch:
7+
issue_comment:
8+
types: [created]
9+
10+
jobs:
11+
call-workflow:
12+
if: github.event_name != 'issue_comment' ||(github.event_name == 'issue_comment' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '!verify') || startsWith(github.event.comment.body, '!verify release') || startsWith(github.event.comment.body, '!verify retest')))
13+
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/rocm_ci.yml@mainline
14+
secrets: inherit
15+
with:
16+
input_sha: ${{github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && github.sha) || (github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha) || github.sha}}
17+
input_pr_num: ${{github.event_name == 'pull_request' && github.event.pull_request.number || (github.event_name == 'issue_comment' && github.event.issue.number) || 0}}
18+
input_pr_url: ${{github.event_name == 'pull_request' && github.event.pull_request.html_url || (github.event_name == 'issue_comment' && github.event.issue.pull_request.html_url) || ''}}
19+
input_pr_title: ${{github.event_name == 'pull_request' && github.event.pull_request.title || (github.event_name == 'issue_comment' && github.event.issue.pull_request.title) || ''}}
20+
repository_name: ${{ github.repository }}
21+
base_ref: ${{github.event_name == 'pull_request' && github.event.pull_request.base.ref || (github.event_name == 'issue_comment' && github.event.issue.pull_request.base.ref) || github.ref}}
22+
trigger_event_type: ${{ github.event_name }}
23+
comment_text: ${{ github.event_name == 'issue_comment' && github.event.comment.body || '' }}

bin/run_rocm_test.sh

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -163,60 +163,107 @@ if [ "$aomp" != 1 ]; then
163163
tmpdir="$HOME/tmp/openmp-extras"
164164
os_name=$(cat /etc/os-release | grep NAME)
165165
test_package_name="openmp-extras-tests"
166+
166167
if [ "$SKIP_TEST_PACKAGE" != 1 ] && [ "$TEST_BRANCH" == "" ]; then
168+
rm -rf $tmpdir
169+
mkdir -p $tmpdir
170+
export debsupport=0
171+
export rpmsupport=0
167172
git --no-pager log -1
173+
if [ -e "$ROCMINF/share/openmp-extras/tests/bin/run_rocm_test.sh" ] && [ "$EPSDB" == "1" ] ; then
174+
packages=$(dpkg --list | wc -l)
175+
if [ $packages -ne 0 ]; then
176+
export debsupport=1
177+
else
178+
export rpmsupport=1
179+
fi
180+
else
181+
#------- Begin testing for package manager -------
182+
echo Testing apt...
183+
pushd $tmpdir
184+
apt-get download $test_package_name && pkg_mgr_found=1 || pkg_mgr_found=0
185+
popd
186+
if [ $pkg_mgr_found -eq 1 ]; then
187+
export debsupport=1
188+
apt=1
189+
fi
190+
if [ $pkg_mgr_found -eq 0 ]; then
191+
echo Testing dnf...
192+
dnf -y download --destdir=$tmpdir openmp-extras-tests && pkg_mgr_found=1 || pkg_mgr_found=0
193+
if [ $pkg_mgr_found -eq 1 ]; then
194+
export rpmsupport=1
195+
dnf=1
196+
fi
197+
fi
198+
if [ $pkg_mgr_found -eq 0 ]; then
199+
echo Testing yum...
200+
osversion=$(cat /etc/os-release | grep -e ^VERSION_ID)
201+
if [[ $osversion =~ '"7' ]]; then
202+
yumdownloader --destdir=$tmpdir $test_package_name && pkg_mgr_found=1 || pkg_mgr_found=0
203+
else
204+
yum download --destdir $tmpdir $test_package_name && pkg_mgr_found=1 || pkg_mgr_found=0
205+
fi
206+
if [ $pkg_mgr_found -eq 1 ]; then
207+
yum=1
208+
export rpmsupport=1
209+
fi
210+
fi
211+
if [ $pkg_mgr_found -eq 0 ]; then
212+
echo Testing zypper...
213+
local_dir=~/openmp-extras-test
214+
rm -f "$local_dir"/*
215+
zypper --pkg-cache-dir $local_dir download $test_package_name && pkg_mgr_found=1 || pkg_mgr_found=0
216+
if [ $pkg_mgr_found -eq 1 ]; then
217+
zypper=1
218+
export rpmsupport=1
219+
fi
220+
fi
221+
fi
222+
#------- End testing for package manager -------
168223
if [ ! -e "$ROCMINF/share/openmp-extras/tests/bin/run_rocm_test.sh" ]; then
169224
if [ "$EPSDB" == "1" ]; then
170225
echo "Error: nPSDB should have the openmp-extras-tests package installed before this test step."
171226
exit 1
172227
fi
173-
rm -rf $tmpdir
174-
mkdir -p $tmpdir
175-
# Determine OS and download package not using sudo.
176-
if [[ "$os_name" =~ "Ubuntu" ]] || [[ "$os_name" =~ "Debian" ]]; then
228+
# Determine package manager and download package not using sudo.
229+
# apt support
230+
if [ "$apt" == "1" ]; then
231+
echo Using apt package manager
177232
cd $tmpdir
178-
apt-get download $test_package_name
179233
test_package=$(ls -lt $tmpdir | grep -Eo -m1 openmp-extras-tests.*)
180234
dpkg -x $test_package .
181235
script=$(find . -type f -name 'run_rocm_test.sh')
182236
cd $(dirname $script)
183-
# CentOS/RHEL support. CentOS 7 requires a different method.
184-
elif [[ "$os_name" =~ "CentOS" ]] || [[ "$os_name" =~ "Red Hat" ]] || [[ "$os_name" =~ "Oracle Linux Server" ]] || [[ "$os_name" =~ "Alibaba Linux Server" ]]; then
185-
osversion=$(cat /etc/os-release | grep -e ^VERSION_ID)
186-
if [[ $osversion =~ '"7' ]]; then
187-
yumdownloader --destdir=$tmpdir $test_package_name
188-
else
189-
yum download --destdir $tmpdir $test_package_name
190-
fi
237+
# dnf/yum support, CentOS 7 requires a different method.
238+
elif [ "$dnf" == "1" ]; then
239+
echo Using dnf package manager
191240
test_package=$(ls -lt $tmpdir | grep -Eo -m1 openmp-extras-tests.*)
192241
extract_rpm $test_package
193-
# SLES support.
194-
elif [[ "$os_name" =~ "SLES" ]]; then
195-
local_dir=~/openmp-extras-test
196-
rm -f "$local_dir"/*
197-
zypper --pkg-cache-dir $local_dir download $test_package_name
242+
elif [ "$yum" == "1" ]; then
243+
echo Using yum package manager
244+
test_package=$(ls -lt $tmpdir | grep -Eo -m1 openmp-extras-tests.*)
245+
extract_rpm $test_package
246+
# zypper support
247+
elif [ "$zypper" == "1" ]; then
248+
echo Using zypper package manager
198249
test_package=$(ls -lt "$local_dir"/rocm/ | grep -Eo -m1 openmp-extras-tests.*)
199250
cp "$local_dir"/rocm/"$test_package" $tmpdir
200251
extract_rpm $test_package
201-
elif [[ "$os_name" =~ "Microsoft Azure Linux" ]]; then
202-
dnf download --destdir=$tmpdir openmp-extras-tests
203-
test_package=$(ls -lt $tmpdir | grep -Eo -m1 openmp-extras-tests.*)
204-
extract_rpm $test_package
205252
else
206-
echo "Error: Could not determine operating system package manager type."
253+
echo "Error: Could not determine package manager type."
207254
exit 1
208255
fi
209-
# Environment already has test package
256+
# Environment already has test package, use it
210257
else
211258
rm -rf $tmpdir
212259
mkdir -p $tmpdir
213260
cp -ra "$ROCMINF"/share/openmp-extras/tests $tmpdir
214261
cd $tmpdir/tests/bin
215262
fi
216-
./rocm_quick_check.sh
217-
export SKIP_TEST_PACKAGE=1
218-
./run_rocm_test.sh
219-
exit $?
263+
./rocm_quick_check.sh
264+
export SKIP_TEST_PACKAGE=1
265+
./run_rocm_test.sh
266+
exit $?
220267
fi
221268
fi
222269
echo $AOMP $REAL_AOMP using test branch $TEST_BRANCH
@@ -347,11 +394,11 @@ function getversion(){
347394
ompextrasregex="openmp-extras-?[a-z]*-?\s*[0-9]+\.([0-9]+)\.([0-9]+)"
348395
rpmregex="Red Hat|CentOS|SLES|Oracle Linux Server|Microsoft Azure Linux|Alibaba Linux Server"
349396
echo $osname
350-
if [[ "$osname" =~ $rpmregex ]]; then
351-
echo "Red Hat/CentOS/SLES/Oracle/Microsoft Azure/Alibaba Linux Server found"
397+
if [ $rpmsupport -eq 1 ]; then
398+
echo "OS with rpm support found"
352399
ompextraspkg=$(rpm -qa | grep openmp-extras | tail -1)
353-
elif [[ "$os_name" =~ "Ubuntu" ]] || [[ "$os_name" =~ "Debian" ]]; then
354-
echo "Ubuntu/Debian found"
400+
elif [ $debsupport -eq 1 ]; then
401+
echo "OS with deb support found"
355402
ompextraspkg=$(dpkg --list | grep openmp-extras | tail -1)
356403
fi
357404
if [[ "$ompextraspkg" =~ $ompextrasregex ]]; then

0 commit comments

Comments
 (0)