You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tqchen (via GitHub)" <gi...@apache.org> on 2026/04/25 16:38:02 UTC
[PR] [CI][REFACTOR] Decouple data.py from Jenkins script and docker images [tvm]
tqchen opened a new pull request, #19445:
URL: https://github.com/apache/tvm/pull/19445
## Summary
`ci/jenkins/data.py` was carrying two unrelated concerns: artifact bundle definitions for s3 staging, and the docker image tag registry. This PR decouples both from the Jenkinsfile-generated code, making each concern standalone and machine-readable without Python.
## Changes
### Part 1 — Bundle refactor (`10950ac192`)
- `ci/scripts/jenkins/s3.py` gains `--bundle <name>` (repeatable) that resolves bundle names from `ci/jenkins/data.py::files_to_stash` at runtime; `--items` preserved for back-compat
- `ci/jenkins/templates/utils/macros.j2` `upload_artifacts` macro emits `--bundle <name>` flags instead of inlining the file list as `--items`
- Template callsites (cpu, gpu, arm) updated to pass `bundles=[...]` names
- Generated `.groovy` files regenerated — no `build/` paths appear in artifact upload blocks; only bundle names
### Part 2 — Docker image registry extraction (`6df22c09b9`)
- New `ci/docker-images.ini` (one `[ci_*]` section per image) is the single source of truth for image tags
- `docker/dev_common.sh::lookup_image_spec` reads the ini directly with `awk` — no Python invocation
- `ci/jenkins/data.py` drops the inline `docker_images` dict; loads it via `configparser` from the ini, preserving the same nested-dict shape so Jinja templates and the current `s3.py` module import keep working unchanged
- `data.py __main__` is now the bundle-resolver CLI (`python3 ci/jenkins/data.py <bundle> [...]` → file paths, one per line) — no more dual-purpose image-name lookup branch
- `ci/scripts/jenkins/open_docker_update_pr.py` updated to read/write `ci/docker-images.ini` instead of `data.py`
## Acceptance
```
# No build/ artifact paths in generated Jenkinsfiles (bundle names only):
grep -rn "build/lib\|build/cpptest" ci/jenkins/generated/ # → nothing
# generate.py is byte-identical after the change:
python3 ci/jenkins/generate.py # → "no changes made" for all 5 groovy files
# dev_common.sh resolves same tag as before:
bash -c 'source docker/dev_common.sh && lookup_image_spec ci_cpu'
# → tlcpack/ci-cpu:20251130-061900-c429a2b1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI][REFACTOR] Decouple data.py from Jenkins script and docker images [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #19445:
URL: https://github.com/apache/tvm/pull/19445
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI][REFACTOR] Decouple data.py from Jenkins script and docker images [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #19445:
URL: https://github.com/apache/tvm/pull/19445#issuecomment-4320123867
cc @yongwww
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI][REFACTOR] Decouple data.py from Jenkins script and docker images [tvm]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19445:
URL: https://github.com/apache/tvm/pull/19445#discussion_r3142255113
##########
docker/dev_common.sh:
##########
@@ -30,7 +30,17 @@ GIT_TOPLEVEL=$(cd $(dirname ${BASH_SOURCE[0]}) && git rev-parse --show-toplevel)
DOCKER_IS_ROOTLESS=$(docker info 2> /dev/null | grep 'Context: \+rootless' || true)
function lookup_image_spec() {
- img_spec=$(python3 "${GIT_TOPLEVEL}/ci/jenkins/data.py" "$1")
+ local name="$1"
+ local ini="${GIT_TOPLEVEL}/ci/docker-images.ini"
+ img_spec=$(awk -v section="[$name]" '
+ $0 == section { in_section=1; next }
+ /^\[/ { in_section=0 }
+ in_section && /^tag *=/ {
+ sub(/^tag *= */, "")
+ print
+ exit
+ }
+ ' "$ini")
Review Comment:

The `awk` script for parsing the INI file is somewhat fragile. It doesn't handle leading/trailing whitespace around keys or values, and it could be incorrectly triggered by comments that happen to start with `[` (e.g., `; [Note]`). While it works for the current file format, making it more robust would prevent future issues if the INI file formatting changes slightly.
```suggestion
img_spec=$(awk -v section="[$name]" '
/^[[:space:]]*[;#]/ { next }
{ line=$0; gsub(/^[[:space:]]+|[[:space:]]+$/, "", line) }
line == section { in_section=1; next }
line ~ /^\[/ { in_section=0 }
in_section && line ~ /^tag[[:space:]]*=/ {
sub(/^[[:space:]]*tag[[:space:]]*=[[:space:]]*/, "", line)
print line
exit
}
' "$ini")
```
##########
ci/jenkins/data.py:
##########
@@ -47,28 +49,14 @@
aws_default_region = "us-west-2"
aws_ecr_url = "dkr.ecr." + aws_default_region + ".amazonaws.com"
-# Docker Images
+# Docker image registry — loaded from ci/docker-images.ini.
+# Shape preserved: {"ci_cpu": {"tag": "...", "platform": "..."}, ...}
+_DOCKER_IMAGES_INI = Path(__file__).parent.parent / "docker-images.ini"
+_ini = configparser.ConfigParser()
+_ini.read(_DOCKER_IMAGES_INI)
docker_images = {
- "ci_arm": {
- "tag": "tlcpack/ci-arm:20251130-061900-c429a2b1",
- "platform": "ARM",
- },
- "ci_cpu": {
- "tag": "tlcpack/ci-cpu:20251130-061900-c429a2b1",
- "platform": "CPU",
- },
- "ci_gpu": {
- "tag": "tlcpack/ci-gpu:20251130-061900-c429a2b1",
- "platform": "GPU",
- },
- "ci_lint": {
- "tag": "tlcpack/ci-lint:20251130-061900-c429a2b1",
- "platform": "CPU",
- },
- "ci_wasm": {
- "tag": "tlcpack/ci-wasm:20251130-061900-c429a2b1",
- "platform": "CPU",
- },
+ section: {"tag": _ini.get(section, "tag"), "platform": _ini.get(section, "platform")}
+ for section in _ini.sections()
}
Review Comment:

This dictionary comprehension assumes that every section in `ci/docker-images.ini` contains both `tag` and `platform` keys. If a non-image section is added to the INI file in the future, this will raise a `NoOptionError`. It is safer to filter the sections to ensure they contain the expected keys.
```suggestion
docker_images = {
section: {"tag": _ini.get(section, "tag"), "platform": _ini.get(section, "platform")}
for section in _ini.sections()
if _ini.has_option(section, "tag") and _ini.has_option(section, "platform")
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org