Skip to content

Commit aabd1e1

Browse files
committed
[TRTLLM-5878] add stage for image registration to nspect
Signed-off-by: Yiteng Niu <[email protected]>
1 parent de0b522 commit aabd1e1

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

jenkins/BuildDockerImage.groovy

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def createKubernetesPodConfig(type, arch = "amd64", build_wheel = false)
9090
{
9191
case "agent":
9292
containerConfig = """
93-
- name: alpine
94-
image: urm.nvidia.com/docker/alpine:latest
93+
- name: python3
94+
image: urm.nvidia.com/docker/python:3.12-slim
9595
command: ['cat']
9696
tty: true
9797
resources:
@@ -494,5 +494,44 @@ pipeline {
494494
}
495495
}
496496
}
497+
stage("Register Images") {
498+
when {
499+
expression {
500+
return params.nspect_id && params.action == "push"
501+
}
502+
}
503+
steps {
504+
script {
505+
container("python3") {
506+
sh "pip3 install --upgrade pip"
507+
sh "pip3 install --upgrade requests"
508+
def nspect_commit = "227a6012d2c247bd7b6350cb443f016afc6f53d4"
509+
withCredentials([string(credentialsId: "TRTLLM_NSPECT_REPO", variable: "NSPECT_REPO")]) {
510+
trtllm_utils.checkoutSource("${NSPECT_REPO}", nspect_commit, "nspect")
511+
}
512+
def nspect_env = params.nspect_env ? params.nspect_env : "prod"
513+
def program_version_name = params.program_version_name ? params.program_version_name : "PostMerge"
514+
def wait_success_seconds = params.wait_success_seconds ? params.wait_success_seconds : "3600"
515+
def cmd = """./nspect/nspect.py \
516+
--env ${nspect_env} \
517+
--nspect_id ${params.nspect_id} \
518+
--program_version_name '${program_version_name}' \
519+
--check_launch_api \
520+
--wait_success ${wait_success_seconds} \
521+
"""
522+
if (params.register_images) {
523+
cmd += "--register "
524+
}
525+
if (params.osrb_ticket) {
526+
cmd += "--osrb_ticket ${params.osrb_ticket} "
527+
}
528+
cmd += imageKeyToTag.values().join(" ")
529+
withCredentials([usernamePassword(credentialsId: "NSPECT_CLIENT-${nspect_env}", usernameVariable: 'NSPECT_CLIENT_ID', passwordVariable: 'NSPECT_CLIENT_SECRET')]) {
530+
sh cmd
531+
}
532+
}
533+
}
534+
}
535+
}
497536
} // stages
498537
} // pipeline

0 commit comments

Comments
 (0)