fix: use current_image_tags.properties in rename_docker_images.py (#5846)

Signed-off-by: ixlmar <206748156+ixlmar@users.noreply.github.com>
This commit is contained in:
ixlmar 2025-07-09 10:07:52 +02:00 committed by GitHub
parent a32f7083b4
commit 10e686466e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 15 deletions

View File

@ -4,9 +4,11 @@
# https://code.visualstudio.com/remote/advancedcontainers/environment-variables#_option-2-use-an-env-file
# for reuse in Dev Containers configuration.
# Also, the file needs to be parseable by 'sh' for reuse by docker/Makefile.
LLM_DOCKER_IMAGE_URI=urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm
LLM_DOCKER_IMAGE_TAG_SUFFIX=-trt10.11.0.33-skip-tritondevel-202507071100-5534
LLM_DOCKER_IMAGE=${LLM_DOCKER_IMAGE_URI}:pytorch-25.05-py3-x86_64-ubuntu24.04${LLM_DOCKER_IMAGE_TAG_SUFFIX}
LLM_SBSA_DOCKER_IMAGE=${LLM_DOCKER_IMAGE_URI}:pytorch-25.05-py3-aarch64-ubuntu24.04${LLM_DOCKER_IMAGE_TAG_SUFFIX}
LLM_ROCKYLINUX8_PY310_DOCKER_IMAGE=${LLM_DOCKER_IMAGE_URI}:cuda-12.9.0-devel-rocky8-x86_64-rocky8-py310${LLM_DOCKER_IMAGE_TAG_SUFFIX}
LLM_ROCKYLINUX8_PY312_DOCKER_IMAGE=${LLM_DOCKER_IMAGE_URI}:cuda-12.9.0-devel-rocky8-x86_64-rocky8-py312${LLM_DOCKER_IMAGE_TAG_SUFFIX}
#
# NB: Although string interpolation is supported, redundant substrings are
# kept in the variables below for interoperability with
# scripts/rename_docker_images.py
LLM_DOCKER_IMAGE=urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm:pytorch-25.05-py3-x86_64-ubuntu24.04-trt10.11.0.33-skip-tritondevel-202507071100-5534
LLM_SBSA_DOCKER_IMAGE=urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm:pytorch-25.05-py3-aarch64-ubuntu24.04-trt10.11.0.33-skip-tritondevel-202507071100-5534
LLM_ROCKYLINUX8_PY310_DOCKER_IMAGE=urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm:cuda-12.9.0-devel-rocky8-x86_64-rocky8-py310-trt10.11.0.33-skip-tritondevel-202507071100-5534
LLM_ROCKYLINUX8_PY312_DOCKER_IMAGE=urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm:cuda-12.9.0-devel-rocky8-x86_64-rocky8-py312-trt10.11.0.33-skip-tritondevel-202507071100-5534

View File

@ -5,7 +5,7 @@ import os
import pathlib as _pl
import subprocess as _sp
MERGE_REQUEST_GROOVY = "L0_MergeRequest.groovy"
CURRENT_TAG_FILE = "current_image_tags.properties"
IMAGE_MAPPING = {
"LLM_DOCKER_IMAGE":
"urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm-staging/__stage__:x86_64-__stage__-torch_skip",
@ -78,7 +78,7 @@ def find_script_directory() -> _pl.Path:
return _pl.Path(__file__).resolve().parent
def extract_line_after_prefix(file_path: _pl.Path, prefix: str) -> str or None:
def extract_line_after_prefix(file_path: _pl.Path, prefix: str) -> str | None:
"""
Extracts the line starting with a certain prefix from the given file.
@ -193,13 +193,13 @@ def rename_images(*,
timestamp = timestamp or get_current_timestamp()
src_branch_sanitized = src_branch.replace("/", "_")
base_dir = find_script_directory().parent
mr_groovy = base_dir / "jenkins" / MERGE_REQUEST_GROOVY
current_tags_path = base_dir / "jenkins" / CURRENT_TAG_FILE
for dst_key, src_pattern in IMAGE_MAPPING.items():
print(f"Processing {dst_key} ...")
src_image = f"{src_pattern}-{src_branch_sanitized}-{src_build_id}".replace(
"__stage__", stage)
dst_image_old = extract_line_after_prefix(mr_groovy,
dst_image_old = extract_line_after_prefix(current_tags_path,
dst_key + "=").strip('"')
dst_image = replace_text_between_dashes(
f"{image_prefix(dst_image_old)}-{timestamp}-{dst_mr}", 3, stage)
@ -207,10 +207,9 @@ def rename_images(*,
run_shell_command(f"docker pull {src_image}", dry_run)
run_shell_command(f"docker tag {src_image} {dst_image}", dry_run)
run_shell_command(f"docker push {dst_image}", dry_run)
find_and_replace_in_files(base_dir / "jenkins", ".groovy",
dst_image_old, dst_image, dry_run)
find_and_replace_in_files(base_dir / ".devcontainer", ".yml",
dst_image_old, dst_image, dry_run)
find_and_replace_in_files(current_tags_path.parent,
current_tags_path.name, dst_image_old,
dst_image, dry_run)
def main() -> None: