Skip to content

Commit 0b0fd54

Browse files
authored
[None][infra] add disable-cbts flag to explicitly disable CBTS (NVIDIA#15830)
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
1 parent 33526e6 commit 0b0fd54

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

jenkins/L0_MergeRequest.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def DEBUG_MODE = "debug"
123123
def DETAILED_LOG = "detailed_log"
124124
@Field
125125
def CBTS_RESULT = "cbts_result"
126+
@Field
127+
def DISABLE_CBTS = "disable_cbts"
126128

127129
def testFilter = [
128130
(REUSE_TEST): gitlabParamsFromBot.get(REUSE_TEST, null),
@@ -142,6 +144,7 @@ def testFilter = [
142144
(AUTO_TRIGGER_TAG_LIST): [],
143145
(DETAILED_LOG): gitlabParamsFromBot.get(DETAILED_LOG, false),
144146
(CBTS_RESULT): null,
147+
(DISABLE_CBTS): gitlabParamsFromBot.get((DISABLE_CBTS), false),
145148
]
146149

147150
String reuseBuild = gitlabParamsFromBot.get('reuse_build', null)
@@ -713,6 +716,13 @@ def getAutoTriggerTagList(pipeline, testFilter, globalVars) {
713716

714717
def getCbtsResult(pipeline, testFilter, globalVars)
715718
{
719+
// Explicit kill switch: `/bot run --disable-cbts` forces a full run.
720+
if (testFilter[(DISABLE_CBTS)]) {
721+
pipeline.echo("CBTS: disabled — user-specified /bot run --disable-cbts")
722+
_cbtsReportDecision(pipeline, globalVars, "disabled", "user flag: disable_cbts", null)
723+
return null
724+
}
725+
716726
def isOfficialPostMergeJob = (env.JOB_NAME ==~ /.*PostMerge.*/)
717727
if (env.alternativeTRT || isOfficialPostMergeJob) {
718728
pipeline.echo("CBTS: deferring — post-merge job or alternativeTRT set")

jenkins/scripts/cbts/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ stage-selection flag (`--stage-list`, `--extra-stage`, `--gpu-type`,
130130
`--test-backend`, `--skip-test`, `--add-multi-gpu-test`, `--only-multi-gpu-test`,
131131
`--disable-multi-gpu-test`) makes `getCbtsResult` return null.
132132

133+
`--disable-cbts` is an explicit kill switch: `getCbtsResult` returns null
134+
before any narrowing, so the pipeline runs the full test set. The opt-out is
135+
recorded in OpenSearch with `s_cbts_status=disabled`.
136+
133137
Orthogonal flags (`--reuse-test`, `--disable-reuse-test`, `--debug`,
134138
`--detailed-log`, `--disable-fail-fast`, `--high-priority`) do not affect CBTS.
135139

jenkins/scripts/cbts/tools/report_cbts_decision.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
"""Post a CBTS decision to OpenSearch (CI-health monitoring).
1616
17-
--status <pre_merge|post_merge|fallback|deferred> [--reason <text>]
17+
--status <pre_merge|post_merge|fallback|deferred|disabled> [--reason <text>]
1818
[--decision <main.py output>] [--pr-number <n>] [--repo-root <dir>].
1919
Context + creds come from env. Exits 0 on failure (never blocks CI).
2020
"""
@@ -116,7 +116,7 @@ def build_document(
116116
def main(argv: list[str] | None = None) -> int:
117117
parser = argparse.ArgumentParser(description="Post a CBTS decision to OpenSearch.")
118118
parser.add_argument(
119-
"--status", required=True, help="pre_merge / post_merge / fallback / deferred."
119+
"--status", required=True, help="pre_merge / post_merge / fallback / deferred / disabled."
120120
)
121121
parser.add_argument("--reason", default="", help="Reason text (deferred only).")
122122
parser.add_argument("--decision", default=None, help="Path to cbts/main.py decision JSON.")

0 commit comments

Comments
 (0)