Skip to content

ci: retry transient APT downloads and stop on index failures - #8453

Merged
mohanchen merged 2 commits into
deepmodeling:developfrom
cheerly-pku:ci/apt-download-reliability
Dec 4, 2026
Merged

mohanchen merged 2 commits into
deepmodeling:developfrom
cheerly-pku:ci/apt-download-reliability

Conversation

@cheerly-pku

@cheerly-pku cheerly-pku commented Nov 30, 2026 •

Copy link
Copy Markdown

CI runners intermittently failed to download indexes and packages from Ubuntu archive/security endpoints during dependency setup, before ABACUS compilation or tests could start. This PR adds limited retries and connection/read timeouts, and ensures that an incomplete index update stops the installation step. The available logs do not identify which part of the network path caused the connection failures.

Linked Issue

Observed during #8264; no separate issue is required because the failed runs provide the reproducer:

This branch starts from develop at a3d90481d48be532d4e8dbdeb1f0d35bb19fb030. Its only commit changes the four affected workflows.

What the failure and rerun establish

The failed jobs reported Connection failed or connection timeouts while contacting archive.ubuntu.com / security.ubuntu.com. This establishes a connectivity failure between the CI environment and those endpoints. The logs do not distinguish an Ubuntu server problem from a routing, proxy, or runner-side problem.

For #8264, commit 7b799dd9e is an empty commit on top of f508f54f1: the comparison contains no file changes. It triggered a fresh CI run, which successfully installed dependencies and completed the CPU tests, CUDA tests, build matrix, and ASE tests. As checked on 2026-12-01, all 16 GitHub checks and both Read the Docs checks on that commit passed.

That successful rerun did not contain this PR's patch. It supports an intermittent dependency-download failure; the recovery cannot be attributed to the changes proposed here. #8453 is a separate reliability improvement intended to tolerate some short-lived download failures and stop clearly when dependency setup remains incomplete. Persistent outages can still fail a job, and additional retries can increase the wait before failure.

What's changed?

  • Use apt-get consistently, with Acquire::Retries=5 for index and package downloads. Current APT already defaults to three retries; this increases that budget.
  • Set HTTP and HTTPS connection/read timeouts to 30 seconds. This is a per-transport timeout, not a 30-second limit for the entire installation.
  • Set APT::Update::Error-Mode=any so an incomplete index refresh fails explicitly, including when APT could otherwise reuse old indexes.
  • Run update and install as separate commands. In the CMake and ASE workflows, the old update && install list could continue to subsequent toolchain commands after update failed, despite Bash -e.

Package lists, repository URLs, signature verification, and build/test commands are unchanged.

Unit Tests and/or Case Tests for my changes

Fresh local validation used APT 2.8.4, a temporary GPG-signed HTTP repository, and isolated APT state/configuration/cache directories. Packages were downloaded only; their SHA256 hashes were checked and the isolated dpkg status remained empty.

Fault-injection check Observed result
Four initial HTTP 503 responses, default three retries Exit 100 after 7.09 s
Same failures, five retries Index download succeeded after 15.21 s
Persistent HTTP 503 responses, five retries Exit 100
Normal signed index and package download Succeeded; package hash matched
Four initial package-download HTTP 503 responses Download succeeded; package hash matched
Persistent index failure, ordinary update / strict update Exit 0 with warnings / exit 100
Failed update in old && list / separate command Toolchain marker reached / correctly skipped
Server waits 35 s before responding, timeout set to 30 s Requests timed out; exit 100. With APT retries disabled for this control, transport-internal attempts still took about 60 s total.

The retry-count comparison used strict update errors on both sides to isolate retry behavior. 12/12 real-APT expected-outcome checks passed, including the deliberately failing controls.

Commands run (local diagnostic harness retained outside the repository):

python3 /mnt/data/Cheerly/ci-apt-validation-20261130/validate_apt.py
python3 /mnt/data/Cheerly/ci-apt-validation-20261130/validate_error_mode.py
/home/Cheerly/.cache/pre-commit/repoi08j6bws/py_env-python3.14/bin/python /mnt/data/Cheerly/ci-apt-validation-20261130/check_workflows.py

The last command passed 16/16 workflow checks: YAML parsing, bash -n, unchanged package lists, and actual modified installation blocks executed with a stubbed sudo under bash --noprofile --norc -e -o pipefail to verify failure propagation.

Additional checks passed:

/mnt/data/Cheerly/ci-apt-validation-20261130/lint-tools/actionlint \
  -config-file /mnt/data/Cheerly/ci-apt-validation-20261130/actionlint.yaml \
  -shellcheck= -pyflakes= \
  .github/workflows/ase_plugin_test.yml .github/workflows/build_test_cmake.yml \
  .github/workflows/cuda.yml .github/workflows/test.yml
python3 tools/03_code_analysis/agent_governance_check.py --staged --format text
git diff --cached --check

Actionlint v1.7.12 used a local configuration declaring the existing cpu, gpu, and linux-x64 runner labels; separate ShellCheck/Pyflakes integrations were disabled. Governance reported no findings. The fault-injection harness exercised HTTP, not HTTPS. Full ABACUS builds and runtime tests were not rerun locally for these workflow-only changes. As checked on 2026-12-01, all GitHub Actions checks on this PR passed, including the CPU, CUDA, build-matrix and ASE jobs. The two external Read the Docs checks failed as described below.

Read the Docs follow-up (updated 2026-12-01)

Both external documentation builds timed out: abacus-rtd after 900 seconds and abacus-develop after 1852 seconds. RTD's notifications explicitly report build timeouts. In both records, the last command is apt-get update --assume-yes --quiet, with no command output or exit status recorded. No documentation-generation or Sphinx command was reached. The empty output does not identify a specific mirror or lower-level cause.

The unchanged develop base a3d90481d passed both abacus-rtd and abacus-develop documentation builds. Earlier builds on #8264 and #8436 show the same 900-second stall at APT update. This is consistent with an intermittent dependency-setup problem; the available records do not establish that it has the same underlying cause as the GitHub Actions connection errors.

The four GitHub Actions installation commands changed here do not configure RTD's separate build.apt_packages phase; .readthedocs.yaml and documentation files are unchanged. Both RTD checks still require a successful retry and remain failed in this PR's validation status.

Governance Notes

  • INPUT/docs changes: none; dependency setup only.
  • Core module impact: none; changes are confined to four workflow files.
  • Exceptions requested: none.

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

@ABACUS-PR-BOT ABACUS-PR-BOT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable issue found in the four workflow APT changes at 253ed68193 (base 5064965fa8). The static review covered failure propagation, retry and timeout scope, package lists, and compatibility with the updated workflow matrix. Hosted behavior and runner APT versions remain unverified.

Static review only; no builds or runtime tests were run.

@mohanchen
mohanchen merged commit 6378079 into deepmodeling:develop Dec 4, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants