Skip to content

Commit e24d1a8

Browse files
committed
Revert of [ci] remove old USER_LAND code from ci scripts
- pytorch#80045
1 parent 5e5b42e commit e24d1a8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.ci/pytorch/common.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ if [[ "${BUILD_ENVIRONMENT}" == *rocm* ]]; then
1919
export HSA_FORCE_FINE_GRAIN_PCIE=1
2020
fi
2121

22+
# This token is used by a parser on Jenkins logs for determining
23+
# if a failure is a legitimate problem, or a problem with the build
24+
# system; to find out more, grep for this string in ossci-job-dsl.
25+
echo "ENTERED_USER_LAND"
26+
27+
trap_add cleanup EXIT
28+
29+
2230
# TODO: Renable libtorch testing for MacOS, see https://github.com/pytorch/pytorch/issues/62598
2331
# shellcheck disable=SC2034
2432
BUILD_TEST_LIBTORCH=0

.ci/pytorch/common_utils.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ trap_add() {
3939
# inherit them unless the trace attribute is set
4040
declare -f -t trap_add
4141

42+
# NB: define this function before set -x, so that we don't
43+
# pollute the log with a premature EXITED_USER_LAND ;)
44+
function cleanup {
45+
# Note that if you've exited user land, then CI will conclude that
46+
# any failure is the CI's fault. So we MUST only output this
47+
# string
48+
retcode=$?
49+
set +x
50+
if [ $retcode -eq 0 ]; then
51+
echo "EXITED_USER_LAND"
52+
fi
53+
}
54+
4255
function assert_git_not_dirty() {
4356
# TODO: we should add an option to `build_amd.py` that reverts the repo to
4457
# an unmodified state.

0 commit comments

Comments
 (0)