Skip to content

Commit 0f92160

Browse files
authored
Rebuild the EEST venv when its cached interpreter is gone (#4510)
Execution Specs shards fail before running any test, with `.venv/bin/execute: cannot execute: required file not found` (exit 127). The cached EEST venv links to the setup-python interpreter that built it, and the cache key has only the install script and patch hashes in it. The current entry was built on a runner with Python 3.12.14. Runner image 20261002 ships 3.12.15, so on those runners the restored venv's interpreter path is missing. `install.sh` only checks that `execute` has its executable bit set, so it reports the install as current and never repairs it. Shards on 3.12.14 runners pass and shards on 3.12.15 runners fail, and as the image rolls out more shards fail. The cache key now includes `steps.python.outputs.python-version`, so a runner only restores a venv built with the same interpreter. `install.sh` also requires the venv's `python` to start before it skips the install, which covers a stale venv however it got there. When that check fails, `uv sync` replaces the broken venv. I tested this locally by pointing the venv's interpreter link at a missing path: the script reinstalled, `execute` ran again, and a second run returned immediately. Flaked in: https://github.com/sei-protocol/sei-chain/actions/runs/37764957815/job/113271939325
1 parent 8ab697f commit 0f92160

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/execution-specs.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ jobs:
165165
cache: npm
166166
cache-dependency-path: integration_test/precompile_tests/package-lock.json
167167
- uses: actions/setup-python@v6
168+
id: python
168169
with:
169170
python-version: '3.12'
170171
- name: Install uv
@@ -198,7 +199,7 @@ jobs:
198199
uses: actions/cache@v4
199200
with:
200201
path: integration_test/exec_specs/.cache/execution-specs
201-
key: exec-specs-${{ runner.os }}-${{ hashFiles('integration_test/exec_specs/scripts/install.sh', 'integration_test/exec_specs/patches/sei-compat.patch') }}
202+
key: exec-specs-${{ runner.os }}-py${{ steps.python.outputs.python-version }}-${{ hashFiles('integration_test/exec_specs/scripts/install.sh', 'integration_test/exec_specs/patches/sei-compat.patch') }}
202203
- name: Install execution specs
203204
run: bash integration_test/exec_specs/scripts/install.sh
204205
- name: Start isolated Sei devnet

‎integration_test/exec_specs/scripts/install.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ file_digest() {
2727
fingerprint="${EEST_REVISION} $(file_digest "${EEST_PATCH}")"
2828
fingerprint_file="${EEST_DIR}/.sei-eest-fingerprint"
2929

30+
# The venv links to the interpreter that built it, so a restored cache from a
31+
# runner with a different Python patch release has scripts that cannot start.
3032
if [[ -x "${EEST_DIR}/.venv/bin/execute" && -f "${fingerprint_file}" ]] \
31-
&& [[ "$(<"${fingerprint_file}")" == "${fingerprint}" ]]; then
33+
&& [[ "$(<"${fingerprint_file}")" == "${fingerprint}" ]] \
34+
&& "${EEST_DIR}/.venv/bin/python" -c '' 2>/dev/null; then
3235
exit 0
3336
fi
3437

0 commit comments

Comments
 (0)