Skip to content

fix(ci): retry Brev lookups that run before allocation - #1895

Merged
chaofengw-nv merged 1 commit into
NVIDIA:ci/developerfrom
chaofengw-nv:ci/brev-resilience-20261029
Oct 29, 2026
Merged

chaofengw-nv merged 1 commit into
NVIDIA:ci/developerfrom
chaofengw-nv:ci/brev-resilience-20261029

Conversation

@chaofengw-nv

Copy link
Copy Markdown
Collaborator

Background

Between Oct 16 and Oct 29, 32 Dev Community CI runs (on ci/developer at 3a6a6562d) failed on Brev control-plane errors before any test ran. None of them was caused by the PR under test:

When (UTC) Runs Error
Oct 19 09:31 – Oct 21 01:11 21 Brev catalog must contain exactly one requested instance type
Oct 22 19:52 – 20:52 5 brev login returned 503 Service Unavailable
Oct 22 19:06, 19:14 2 SSH certificate service unavailable during the test
Oct 27 14:21, 23:39 2 Brev cleanup request is unavailable; organization check failed
Oct 20 16:04 1 brev login received a mismatched TLS certificate
Oct 17 04:54 1 Brev environment setup failed

brev login, the organization check and the catalog search each fail the run on their first error. The catalog error also does not say whether the type was missing or listed more than once, which need different fixes. Example runs: 39451003914 (catalog), 39847833005 (login 503), 39454247954 (TLS), 40603625522 (organization check).

Exit Criteria

  • brev login in the GPU and cleanup jobs survives a few minutes of Brev unavailability.
  • The organization check and catalog search, which run before the create request, are retried when Brev reports them unavailable. A retry never submits a second create.
  • Deterministic failures fail immediately as before: a rejected credential (for example HTTP 401), a catalog type that cannot provide the requested disk, or a provider that does not match the profile.
  • A persistent catalog mismatch reports how many offers Brev returned and from which provider.
  • Non-goals: automatic re-dispatch of runs that exit 75 (coordination runs from main), a Nebius fallback when AWS has no capacity (it changes the GPU from L4 to L40S), and failures after the VM exists.

Implementation

  • .github/workflows/community-ci.yml: both Log in to Brev steps retry five times, 30, 60, 90 and 120 seconds apart, then fail with an annotation.
  • tools/brev_exec.py:
    • New PreflightUnavailable(ProvisionError) for read-only lookups that failed before the create request.
    • _allocation_organization raises it for HTTP 429 and 5xx. Other non-200 responses keep raising ProvisionError and are not retried.
    • _select_instance raises it when the search fails, returns invalid JSON, or lists the requested type zero or several times. The message now includes the number of matching offers, their providers and the catalog size, for example found 2 g6.4xlarge offers from aws, aws among 2.
    • New _preflight retries those lookups and InventoryError up to PREFLIGHT_ATTEMPTS = 4 times, 60, 120 and 180 seconds apart, within the provisioning deadline. provision() uses it for the organization check and the catalog search, which both run before create_started is set.
  • .github/community-ci.md: documents the new retries next to the existing create-429 policy.

Change categories

  • Model or runtime behavior
  • Public API
  • ABI
  • Bundle or artifact format
  • Dependencies
  • Documentation only
  • CI or developer tooling

Validation

Commands and Results

All commands ran on CPU with CUDA_VISIBLE_DEVICES='' and PYTHONPATH=core/builder:apps/benchmark:..

  • python -m pytest -q -n 8 tools/tests/test_community_gpu_ci.py tools/tests/test_community_ci.py tools/tests/test_community_gpu_lease.py: 1249 passed, 1 skipped.

  • New tests in tools/tests/test_community_gpu_ci.py:

    • a catalog that is empty and then duplicated is retried, with the expected delays, before the only create;
    • a persistent empty or duplicated catalog reports its contents after four searches and never creates;
    • an unavailable organization check is retried before allocation;
    • HTTP 503 and 429 are retryable and 401 is not;
    • a disk mismatch is still searched only once.

    With tools/brev_exec.py reverted, 7 of these cases fail; only the disk-mismatch check passes.

  • python -m pytest -q -n 8 tools/tests/test_architecture.py tools/tests/test_family_impact.py tools/tests/test_public_source_hygiene.py tools/tests/test_new_ci.py tools/tests/test_pr_metadata.py: 154 passed.

  • ruff check and ruff format --check on the changed Python files: clean. python tools/legal_headers.py --check: 0 findings. git diff --check: clean.

  • The Log in to Brev script, extracted from the workflow and run with a stub brev and sleep: two failures then success exits 0 after sleeping 30 and 60 seconds. Five failures exit 1 after sleeping 30, 60, 90 and 120 seconds.

Hardware, Environment, and Revisions

Base ci/developer at 3a6a6562d. Python 3.12 on a Linux x86_64 host; no GPU was used.

Not Run / Remaining Gaps

  • No live Brev run. The retries are exercised against the existing FakeBrev and FakeCleanupAPI fixtures and a stub CLI.
  • No actionlint run; the workflow file was parsed with PyYAML.
  • The retries cover outages of minutes: up to about 5 minutes for login and 6 minutes for the lookups. The 40-hour catalog outage and the 1-hour login outage would still fail, now with a clearer error.

Contributor Self-Review

  • I have completed a self-review of this change.

Notes For Future Readers

  • Review order: _preflight and the two call sites in provision(), then _select_instance and _allocation_organization, then the workflow and the tests.
  • --attempts 1 and the one-allocation rule are unchanged; the new retries stop before create_started is set.
  • The same Oct 16–29 survey found two problems this PR does not address. 67 failures were Docker OOMKilled on the 64 GiB host profile. Dependency-layer failures for NeMo families came from virtualenv==21.14.6 in the shared GPU base lock, which needs packaging>=26.3, while NeMo's lightning<=2.4.0 needs packaging<25. Both need separate changes.

Risk level

  • Low
  • Medium
  • High

Retries only repeat read-only lookups and an idempotent login, and only before any create request. The worst case is that a run reports the same infrastructure failure a few minutes later.

Between Oct 16 and 29, 32 dev-lane runs failed on Brev control-plane
errors before or without a usable VM: a catalog that did not list
g6.4xlarge exactly once for about 40 hours, login 503s, a mismatched TLS
certificate and an unavailable organization check. Each failed the run on
its first error.

- Retry brev login five times, 30 to 120 seconds apart, in the GPU and
  cleanup jobs.
- Retry the organization check (HTTP 429, 5xx or no response) and the
  catalog search up to four times, 60 to 180 seconds apart. Both run
  before the create request, so a retry cannot allocate a second VM.
- Report how many offers the catalog returned and from which provider,
  so an empty catalog can be told apart from a duplicated one.

Signed-off-by: chaofengw <chaofengw@nvidia.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chaofengw-nv
chaofengw-nv merged commit 50c10d6 into NVIDIA:ci/developer Oct 29, 2026
2 checks passed
@chaofengw-nv
chaofengw-nv deleted the ci/brev-resilience-20261029 branch October 29, 2026 13:55
zhenshanx-nv added a commit to zhenshanx-nv/TensorRT-Model-Connect that referenced this pull request Oct 29, 2026
Community GPU CI has seen 30+ failures in two weeks from Brev catalog
searches returning empty or duplicated results for the standard
g6.4xlarge type. The existing preflight retries (NVIDIA#1895) give up if
capacity never returns. Retry once against g6e.4xlarge, the same type
already used by the manual GPU_PROFILE=large qualification lane, after
the primary type's retries are exhausted on a capacity-shaped failure.
A deterministic rejection (bad disk, wrong provider, credentials) is
never retried.

Signed-off-by: Zhenshan Xie <zhenshanx@nvidia.com>
zhenshanx-nv added a commit that referenced this pull request Oct 30, 2026
…#1906)

Community GPU CI has seen 30+ failures in two weeks from Brev catalog
searches returning empty or duplicated results for the standard
g6.4xlarge type. The existing preflight retries (#1895) give up if
capacity never returns. Retry once against g6e.4xlarge, the same type
already used by the manual GPU_PROFILE=large qualification lane, after
the primary type's retries are exhausted on a capacity-shaped failure.
A deterministic rejection (bad disk, wrong provider, credentials) is
never retried.

Signed-off-by: Zhenshan Xie <zhenshanx@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant