Commit aca45f4
ci: derive CANN version dynamically in build cache key
Follow-up to 0ab9915 and per review on #483. The previous commit
removed the cann version segment from the cache key entirely, which
was wrong: BUILD_HASH only covers source files, so an image bump that
changes only the container CANN version (without touching csrc/cmake/
python) would silently reuse stale .so artifacts and produce an ABI
mismatch.
Reviewer's intent was to avoid the hardcoded literal, not to drop the
version dimension. Restore the version segment, but derive it at
runtime from /usr/local/Ascend/ascend-toolkit/latest/version.cfg
inside the container, so the YAML no longer contains the literal
"8.5.0" and the cache key still tracks the actual CANN version of
whichever image the job is running on.
Falls back to "unknown" if the version file is unreadable; the echo
in the step log makes the resolved value visible per run so we can
spot regressions in image layout early.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0ab9915 commit aca45f4
2 files changed
Lines changed: 35 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | | - | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| |||
460 | 466 | | |
461 | 467 | | |
462 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
463 | 475 | | |
464 | 476 | | |
465 | 477 | | |
466 | 478 | | |
467 | 479 | | |
468 | | - | |
| 480 | + | |
469 | 481 | | |
470 | 482 | | |
471 | 483 | | |
| |||
837 | 849 | | |
838 | 850 | | |
839 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
840 | 858 | | |
841 | 859 | | |
842 | 860 | | |
843 | 861 | | |
844 | 862 | | |
845 | | - | |
| 863 | + | |
846 | 864 | | |
847 | 865 | | |
848 | 866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | | - | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
102 | | - | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
0 commit comments