Repository navigation
Fix agent public inference API key in CI - #1413
Conversation
Signed-off-by: Xinjie Yao <[email protected]>
🤖 Isaac Lab-Arena Review BotSummaryBoth test jobs set Findings🔵 Infra change: please confirm the secret exists. This changes VerdictShip it (once the secret is confirmed) |
|
Skip the 6 tests that call the real inference endpoint unless `ISAACLAB_ARENA_RUN_LIVE_ENDPOINT_TESTS=1` is set. This stops them from making the CI test jobs run out of time. ## Why this change? Since Oct 9, the "Run tests" job and the native uv job on main run out of time and get cancelled. No code is broken. All other tests pass. The cause is 6 tests that call the real public inference endpoint (build.nvidia.com): - `test_environment_generation_agent.py`: `test_generate_spec_atomic_pick_and_place_against_live_endpoint`, `test_generate_spec_five_bananas_parallel_pick_and_place_against_live_endpoint`, `test_resolve_usd_prim_robocasa_kitchen_counter_and_fridge` - `test_missing_object_inference.py`: `test_infer_names_the_uncatalogued_object_against_live_endpoint`, `test_infer_names_nothing_when_the_catalog_covers_the_prompt_against_live_endpoint` - `test_shared_inference_backend.py`: `test_multimodal_image_against_live_endpoint` These tests used to be skipped because CI had the wrong API key. #1413 fixed the key, so they started running. How long they take depends on how busy the free public endpoint is, which we don't control: - On Oct 8, in #1413's CI rerun, the 5 tests that existed then took about 6 minutes together. - From Oct 9 to Oct 12 they took 28 to 48 minutes, or hung for over an hour when the endpoint returned errors. A failed request waits about 5 minutes for a 504 error, and hidden retries in `InferenceBackend` repeat that several times. "Run tests" takes about 58 minutes without these tests and has an 80 minute limit, so the slow days push it over. The native uv job (120 minute limit) has the same problem. PR runs are affected too. ## What changes? The 6 tests now run only when both of these are set: - `ISAACLAB_ARENA_RUN_LIVE_ENDPOINT_TESTS=1` (new) - the API key for the selected endpoint, which is `NVIDIA_API_KEY` for the default public endpoint Before, the API key alone was enough. The skip helper is renamed from `skip_without_live_endpoint_key()` to `skip_unless_live_endpoint_tests_enabled()` to match what it checks. What this means: - CI no longer runs the 6 live tests, so the test jobs finish in time again. - Locally, having `NVIDIA_API_KEY` set no longer runs them. `run_docker.sh` passes that key into the container, so this changes local test runs too. - The tests that use a fake endpoint for the same code still run. - For now, nothing in CI checks that environment generation still works with the real public model. This was also the case from August until Oct 9, while the tests were skipped because of the wrong key. This is a stopgap. Possible follow-ups, to discuss with the code owners: - Fix the hidden, stacked retries in `InferenceBackend`. The OpenAI client retries on its own, and the backend retries on top of that, so one call can hang for about an hour. This also affects people running environment generation from the command line or the GUI. A small first step: create the client with its own retries turned off and an explicit timeout, and remove the `@pytest.mark.flaky` markers, which do nothing because the plugin is not installed. - Decide whether the check request that `InferenceBackend` sends when it is created (`_ping`) is needed. It adds a full request to every test and is never retried. At least 5 of the 8 live tests that failed on Oct 11-12 failed in this request. - Ask authors to run the live tests (see below) when they change prompts, schemas, catalogues, or the model, and to paste the result under Validation. #1368 already did this. - If the code owners want automated coverage, add a separate scheduled workflow for the live tests, with its own time limit, stopping at the first failure, and failing if the key is missing. ## Usage example Running the live tests inside the Arena container. Before: ```bash export NVIDIA_API_KEY=<your NGC API key> python -m pytest -sv \ isaaclab_arena/tests/test_environment_generation_agent.py \ isaaclab_arena/tests/test_missing_object_inference.py \ isaaclab_arena/tests/test_shared_inference_backend.py ``` After: ```bash export NVIDIA_API_KEY=<your NGC API key> export ISAACLAB_ARENA_RUN_LIVE_ENDPOINT_TESTS=1 python -m pytest -sv \ isaaclab_arena/tests/test_environment_generation_agent.py \ isaaclab_arena/tests/test_missing_object_inference.py \ isaaclab_arena/tests/test_shared_inference_backend.py ``` Each live test can take from under a minute to several minutes, depending on the endpoint. ## Validation Ran the 3 affected test files in the Arena container: - Key set, no opt-in (the CI setup before this PR): 25 passed, 6 live tests skipped. - Opt-in set, no key: 6 live tests skipped. - Opt-in and key set: the live test runs. It fails with a 401 because a placeholder key was used, as expected. - pre-commit passes. CI on this PR: - "Run tests" passed in 58 minutes. The no-camera step took 40 minutes with exactly the 6 live tests skipped. The camera and GR00T policy steps, which have not run on main since Oct 8 because of the timeouts, also passed. Not yet confirmed: - The native uv job does not run on this PR because of its path filter, so it will only be confirmed on main after merge. Signed-off-by: Clemens Volk <[email protected]>
Update Docker and native uv CI to use the correct public inference API key secret.
Why this change?
Both CI test jobs select the public inference endpoint, but reference
ARENA_NVIDIA_API_KEY.The public key is stored inARENA_PUBLIC_NVIDIA_API_KEY.It caused CI tests using public API to skip.What changes?
Set
NVIDIA_API_KEYto${{secrets.ARENA_PUBLIC_NVIDIA_API_KEY}}in CI workflows.Validation
CI Tests