Skip to content

fix: use current Brev create flags (Fixes #998)#1038

Open
deepujain wants to merge 1 commit intoNVIDIA:mainfrom
deepujain:fix/998-brev-gpu-name
Open

fix: use current Brev create flags (Fixes #998)#1038
deepujain wants to merge 1 commit intoNVIDIA:mainfrom
deepujain:fix/998-brev-gpu-name

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

@deepujain deepujain commented Mar 28, 2026

Summary

nemoclaw deploy now uses the current Brev CLI create flags instead of the removed --gpu option. The deploy flow derives --type and --gpu-name from the legacy NEMOCLAW_GPU value so existing env-based setups still work, and it also accepts direct overrides for each flag when needed.

Changes

  • bin/nemoclaw.js - replaced the legacy brev create <name> --gpu ... call with --type and --gpu-name, added helpers to normalize legacy GPU strings, and added explicit NEMOCLAW_BREV_TYPE / NEMOCLAW_BREV_GPU_NAME overrides.
  • test/cli.test.js - added coverage that nemoclaw deploy now invokes Brev with --type and --gpu-name and no longer emits the removed --gpu flag.
  • docs/deployment/deploy-to-remote-gpu.md - documented the new Brev override variables alongside the legacy NEMOCLAW_GPU format.

Testing

  • npx vitest run test/cli.test.js passes (24 passed).
  • npm test still has 2 pre-existing timeout failures in test/install-preflight.test.js and test/uninstall.test.js, unrelated to this change.

Fixes #998

Summary by CodeRabbit

  • New Features

    • Enhanced GPU configuration for remote deployments with separate instance type and GPU name options.
    • Added support for NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME environment variables for granular GPU control.
  • Documentation

    • Updated deployment guide with GPU configuration examples and environment variable instructions.
  • Tests

    • Added test coverage for GPU deployment parameter handling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

📝 Walkthrough

Walkthrough

Updated the Brev CLI integration to replace the deprecated --gpu flag with new --type and --gpu-name flags. Helper functions parse GPU configuration from environment variables, with documentation and tests updated to reflect the new invocation format.

Changes

Cohort / File(s) Summary
Brev CLI Command Update
bin/nemoclaw.js
Replaced legacy brev create <name> --gpu invocation with brev create <name> --type <type> --gpu-name <gpuName>. Added normalizeBrevGpuName() and resolveBrevCreateConfig() helper functions to derive VM creation parameters from environment variables with defaults (type: a2-highgpu-1g, gpuName: A100).
Documentation Update
docs/deployment/deploy-to-remote-gpu.md
Updated GPU override instructions to describe new NEMOCLAW_GPU behavior (selecting both instance type and GPU name) and documented direct overrides via NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME environment variables.
Test Coverage
test/cli.test.js
Added CLI dispatch test validating that deploy command translates GPU configuration to brev create with --type and --gpu-name flags, confirms --gpu flag is absent, and verifies process exit code and invocation recording.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The flags have changed, the API renewed,
Old --gpu syntax bid adieu,
With --type and --gpu-name so bright,
Our Brev commands now dance just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: replacing deprecated Brev CLI flags with current ones, and references the fixed issue.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #998: replaces deprecated --gpu flag with --type and --gpu-name, preserves legacy NEMOCLAW_GPU compatibility, provides explicit env overrides, and adds comprehensive tests.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #998: code updates to bin/nemoclaw.js, documentation updates, and test additions for the Brev CLI flag migration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/deployment/deploy-to-remote-gpu.md (1)

85-88: Example sets redundant environment variables.

The example exports both NEMOCLAW_GPU and the direct override variables (NEMOCLAW_BREV_TYPE, NEMOCLAW_BREV_GPU_NAME).
Per the code in bin/nemoclaw.js, the direct overrides take precedence, making NEMOCLAW_GPU ignored when both are set.
This may confuse readers about which variables to use.

Consider showing two separate examples: one for legacy NEMOCLAW_GPU and one for direct overrides.

📝 Suggested documentation fix
 For direct overrides, you can also set `NEMOCLAW_BREV_TYPE` and `NEMOCLAW_BREV_GPU_NAME` before running `nemoclaw deploy`:

 ```console
-$ export NEMOCLAW_GPU="a2-highgpu-1g:nvidia-tesla-a100:1"
-$ export NEMOCLAW_BREV_TYPE="a2-highgpu-1g"
-$ export NEMOCLAW_BREV_GPU_NAME="A100"
+$ export NEMOCLAW_BREV_TYPE="a2-highgpu-1g"
+$ export NEMOCLAW_BREV_GPU_NAME="A100"
 $ nemoclaw deploy <instance-name>
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/deployment/deploy-to-remote-gpu.md around lines 85 - 88, The example
exports both NEMOCLAW_GPU and the override vars
NEMOCLAW_BREV_TYPE/NEMOCLAW_BREV_GPU_NAME which is confusing because
bin/nemoclaw.js treats the direct overrides as higher priority; split the
example into two clear, separate snippets: one showing the legacy usage with
only NEMOCLAW_GPU set, and a second showing the preferred direct override usage
with only NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME set, and update the
surrounding text to state that direct overrides take precedence.


</details>

</blockquote></details>
<details>
<summary>test/cli.test.js (1)</summary><blockquote>

`150-191`: **Test correctly validates the core fix, but coverage is incomplete.**

The test verifies that `NEMOCLAW_GPU` is correctly parsed into `--type` and `--gpu-name` flags.
However, `resolveBrevCreateConfig()` has three code paths, and only the legacy `NEMOCLAW_GPU` path is tested:

1. Direct overrides via `NEMOCLAW_BREV_TYPE` / `NEMOCLAW_BREV_GPU_NAME` — **not tested**
2. Legacy `NEMOCLAW_GPU` split — **tested here** ✓
3. Defaults when no env vars are set — **not tested**

Consider adding tests for the other paths to ensure full coverage.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @test/cli.test.js around lines 150 - 191, The test only covers the legacy
NEMOCLAW_GPU parsing path; add two more tests that call the CLI (using
runWithEnv as in the existing test) to exercise resolveBrevCreateConfig()'s
other branches: (1) set NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME
environment variables and assert the generated brev create call uses those
values (e.g., --type and --gpu-name match the provided vars), and (2) run with
neither NEMOCLAW_GPU nor the BREV-specific env vars and assert the default brev
create arguments are produced; ensure each test stubs the local brev binary the
same way the current test does and checks the marker file for the expected
command.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @docs/deployment/deploy-to-remote-gpu.md:

  • Around line 85-88: The example exports both NEMOCLAW_GPU and the override vars
    NEMOCLAW_BREV_TYPE/NEMOCLAW_BREV_GPU_NAME which is confusing because
    bin/nemoclaw.js treats the direct overrides as higher priority; split the
    example into two clear, separate snippets: one showing the legacy usage with
    only NEMOCLAW_GPU set, and a second showing the preferred direct override usage
    with only NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME set, and update the
    surrounding text to state that direct overrides take precedence.

In @test/cli.test.js:

  • Around line 150-191: The test only covers the legacy NEMOCLAW_GPU parsing
    path; add two more tests that call the CLI (using runWithEnv as in the existing
    test) to exercise resolveBrevCreateConfig()'s other branches: (1) set
    NEMOCLAW_BREV_TYPE and NEMOCLAW_BREV_GPU_NAME environment variables and assert
    the generated brev create call uses those values (e.g., --type and --gpu-name
    match the provided vars), and (2) run with neither NEMOCLAW_GPU nor the
    BREV-specific env vars and assert the default brev create arguments are
    produced; ensure each test stubs the local brev binary the same way the current
    test does and checks the marker file for the expected command.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Path: .coderabbit.yaml

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `3f6c5d68-1a70-46ad-9580-89454642d9b7`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between eb4ba8c486ad97ea3ca67bea388690b641dc134e and 6c1dcb22894e6d91456c9a320f1a13f48f529f73.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `bin/nemoclaw.js`
* `docs/deployment/deploy-to-remote-gpu.md`
* `test/cli.test.js`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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.

[NeMoClaw][Linux] nemoclaw deploy fails: Brev CLI does not support --gpu flag

1 participant