Skip to content

refactor(e2e): simplify Brev E2E to use bare CPU instances - #1205

Merged
cv merged 2 commits into
NVIDIA:mainfrom
jyaunches:fix/brev-e2e-workflow-improvements
Mar 31, 2026
Merged

refactor(e2e): simplify Brev E2E to use bare CPU instances#1205
cv merged 2 commits into
NVIDIA:mainfrom
jyaunches:fix/brev-e2e-workflow-improvements

Conversation

@jyaunches

@jyaunches jyaunches commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Simplifies the Brev E2E test infrastructure by using bare CPU instances instead of the launchable startup script.

Changes

  • Update Brev CLI from v0.6.310 to v0.6.322
  • Fix CPU instance creation: Replace broken --cpu flag with brev search cpu | brev create pattern
  • Remove launchable startup script: Use direct brev-setup.sh instead of OpenShell-Community launch script
  • Simplify secret passing: Use plain env vars instead of stdin piping (ephemeral CI VM)
  • Add brev_token input: Allow manual token override in workflow dispatch
  • Increase SSH timeout: 5 min → 7.5 min for slower cloud providers

Rationale

CPU Instance Fix

The --cpu flag in Brev CLI v0.6.310 was silently ignored, always creating GPU instances (expensive). The new approach uses brev search cpu to find CPU-only instance types and pipes them to brev create.

Launchable Removal

The startup script from OpenShell-Community was unreliable, causing 40-minute timeouts waiting for log files that were never created. Direct SSH-based setup via brev-setup.sh is more reliable and easier to debug.

Files Changed

File Changes
.github/workflows/e2e-brev.yaml Update CLI, remove launchable inputs
test/e2e/brev-e2e.test.js Simplify instance creation and secret handling

Summary by CodeRabbit

  • Chores

    • Updated Brev CLI version and added an optional brev_token workflow input for flexible token handling.
    • Removed legacy workflow input to simplify CI configuration.
  • Tests

    • Simplified instance provisioning to a single bare-instance flow and increased SSH retry allowance.
    • Streamlined remote SSH credential handling and made long-running bootstrap/test execution use streaming.

Changes:
- Update Brev CLI from v0.6.310 to v0.6.322
- Replace broken --cpu flag with 'brev search cpu | brev create' pattern
- Remove launchable startup script in favor of direct brev-setup.sh
- Simplify secret passing to use plain env vars (ephemeral CI VM)
- Add brev_token input for manual token override
- Increase SSH wait timeout from 5 min to 7.5 min

The --cpu flag in Brev CLI v0.6.310 was silently ignored, always creating
GPU instances. The new approach uses 'brev search cpu' to find CPU-only
instance types and pipes them to 'brev create'.

The launchable startup script from OpenShell-Community was unreliable,
causing 40-minute timeouts. Direct SSH-based setup is more reliable and
easier to debug.
@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c7808667-fc06-4f98-b0b6-ad17b2db5d9f

📥 Commits

Reviewing files that changed from the base of the PR and between 13eb338 and 4fdbc23.

📒 Files selected for processing (1)
  • test/e2e/brev-e2e.test.js

📝 Walkthrough

Walkthrough

Removes launchable VM provisioning from the e2e workflow, adds an optional brev_token input and updates Brev CLI version, and consolidates test bootstrapping and SSH handling into a single brev-based provisioning flow with environment-based secret injection.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/e2e-brev.yaml
Removed use_launchable input, added optional brev_token input (falls back to secrets.BREV_API_TOKEN), stopped exporting USE_LAUNCHABLE, and bumped Brev CLI download from 0.6.310 to 0.6.322.
E2E test suite & helpers
test/e2e/brev-e2e.test.js
Replaced BREV_CPU with BREV_MIN_VCPU/BREV_MIN_RAM; added telegram-injection suite option; removed launchable/legacy bootstrap branches; unified instance creation via `brev search cpu ...

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Workflow
    participant Brev as Brev API/CLI
    participant Instance as Provisioned VM
    participant SSH as SSH Runner
    participant Tests as E2E Test Runner

    CI->>Brev: call `brev search cpu --min-vcpu/--min-ram ... | brev create --detached` (use `brev_token` or secret)
    Brev-->>CI: returns instance metadata/IP
    CI->>Instance: wait for SSH (up to 90 attempts)
    CI->>SSH: connect (sshEnv: export env vars then run remote bootstrap) --streaming
    SSH->>Instance: run `brev-setup.sh` and install nemoclaw CLI, write sandbox registry
    SSH-->>CI: stream logs/stdout (streaming mode)
    CI->>SSH: run remote E2E tests (streaming)
    SSH-->>Tests: execute tests on Instance
    Tests-->>CI: test results/exit status
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through CI with a joyous cheer,
brev called, a VM did soon appear,
One path now leads where two once ran,
Secrets in env, ssh streaming—oh what a plan! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: simplifying Brev E2E tests to use bare CPU instances instead of the previous complex launchable/legacy branching and GPU-prone approach.

✏️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/e2e/brev-e2e.test.js`:
- Around line 61-71: The sshEnv helper embeds env values into a single-quoted
shell string which breaks if NVIDIA_API_KEY or GITHUB_TOKEN contain single
quotes; update sshEnv to sanitize/escape those values before building envPrefix
(e.g., replace each single quote in process.env.NVIDIA_API_KEY and
process.env.GITHUB_TOKEN with the shell-safe sequence '\'' or alternatively
base64-encode the values and decode in the remote command) so that the envPrefix
construction in sshEnv never produces an unbalanced/invalid quoted string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7169957e-68c0-42ed-a64f-dc9e796056c2

📥 Commits

Reviewing files that changed from the base of the PR and between 08cccd4 and 13eb338.

📒 Files selected for processing (2)
  • .github/workflows/e2e-brev.yaml
  • test/e2e/brev-e2e.test.js

Comment thread test/e2e/brev-e2e.test.js
Addresses CodeRabbit review feedback: if NVIDIA_API_KEY or GITHUB_TOKEN
contain single quotes, the shell string would break. Add shellEscape()
helper to properly escape single quotes with the '\'' sequence.
@cv
cv merged commit 3009600 into NVIDIA:main Mar 31, 2026
8 checks passed
laitingsheng pushed a commit that referenced this pull request Apr 2, 2026
## Summary

Simplifies the Brev E2E test infrastructure by using bare CPU instances
instead of the launchable startup script.

## Changes

- **Update Brev CLI** from v0.6.310 to v0.6.322
- **Fix CPU instance creation**: Replace broken `--cpu` flag with `brev
search cpu | brev create` pattern
- **Remove launchable startup script**: Use direct `brev-setup.sh`
instead of OpenShell-Community launch script
- **Simplify secret passing**: Use plain env vars instead of stdin
piping (ephemeral CI VM)
- **Add `brev_token` input**: Allow manual token override in workflow
dispatch
- **Increase SSH timeout**: 5 min → 7.5 min for slower cloud providers

## Rationale

### CPU Instance Fix
The `--cpu` flag in Brev CLI v0.6.310 was silently ignored, always
creating GPU instances (expensive). The new approach uses `brev search
cpu` to find CPU-only instance types and pipes them to `brev create`.

### Launchable Removal
The startup script from OpenShell-Community was unreliable, causing
40-minute timeouts waiting for log files that were never created. Direct
SSH-based setup via `brev-setup.sh` is more reliable and easier to
debug.

## Files Changed

| File | Changes |
|------|---------|
| `.github/workflows/e2e-brev.yaml` | Update CLI, remove launchable
inputs |
| `test/e2e/brev-e2e.test.js` | Simplify instance creation and secret
handling |


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated Brev CLI version and added an optional brev_token workflow
input for flexible token handling.
  * Removed legacy workflow input to simplify CI configuration.

* **Tests**
* Simplified instance provisioning to a single bare-instance flow and
increased SSH retry allowance.
* Streamlined remote SSH credential handling and made long-running
bootstrap/test execution use streaming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
lakamsani pushed a commit to lakamsani/NemoClaw that referenced this pull request Apr 4, 2026
## Summary

Simplifies the Brev E2E test infrastructure by using bare CPU instances
instead of the launchable startup script.

## Changes

- **Update Brev CLI** from v0.6.310 to v0.6.322
- **Fix CPU instance creation**: Replace broken `--cpu` flag with `brev
search cpu | brev create` pattern
- **Remove launchable startup script**: Use direct `brev-setup.sh`
instead of OpenShell-Community launch script
- **Simplify secret passing**: Use plain env vars instead of stdin
piping (ephemeral CI VM)
- **Add `brev_token` input**: Allow manual token override in workflow
dispatch
- **Increase SSH timeout**: 5 min → 7.5 min for slower cloud providers

## Rationale

### CPU Instance Fix
The `--cpu` flag in Brev CLI v0.6.310 was silently ignored, always
creating GPU instances (expensive). The new approach uses `brev search
cpu` to find CPU-only instance types and pipes them to `brev create`.

### Launchable Removal
The startup script from OpenShell-Community was unreliable, causing
40-minute timeouts waiting for log files that were never created. Direct
SSH-based setup via `brev-setup.sh` is more reliable and easier to
debug.

## Files Changed

| File | Changes |
|------|---------|
| `.github/workflows/e2e-brev.yaml` | Update CLI, remove launchable
inputs |
| `test/e2e/brev-e2e.test.js` | Simplify instance creation and secret
handling |


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated Brev CLI version and added an optional brev_token workflow
input for flexible token handling.
  * Removed legacy workflow input to simplify CI configuration.

* **Tests**
* Simplified instance provisioning to a single bare-instance flow and
increased SSH retry allowance.
* Streamlined remote SSH credential handling and made long-running
bootstrap/test execution use streaming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
gemini2026 pushed a commit to gemini2026/NemoClaw that referenced this pull request Apr 14, 2026
## Summary

Simplifies the Brev E2E test infrastructure by using bare CPU instances
instead of the launchable startup script.

## Changes

- **Update Brev CLI** from v0.6.310 to v0.6.322
- **Fix CPU instance creation**: Replace broken `--cpu` flag with `brev
search cpu | brev create` pattern
- **Remove launchable startup script**: Use direct `brev-setup.sh`
instead of OpenShell-Community launch script
- **Simplify secret passing**: Use plain env vars instead of stdin
piping (ephemeral CI VM)
- **Add `brev_token` input**: Allow manual token override in workflow
dispatch
- **Increase SSH timeout**: 5 min → 7.5 min for slower cloud providers

## Rationale

### CPU Instance Fix
The `--cpu` flag in Brev CLI v0.6.310 was silently ignored, always
creating GPU instances (expensive). The new approach uses `brev search
cpu` to find CPU-only instance types and pipes them to `brev create`.

### Launchable Removal
The startup script from OpenShell-Community was unreliable, causing
40-minute timeouts waiting for log files that were never created. Direct
SSH-based setup via `brev-setup.sh` is more reliable and easier to
debug.

## Files Changed

| File | Changes |
|------|---------|
| `.github/workflows/e2e-brev.yaml` | Update CLI, remove launchable
inputs |
| `test/e2e/brev-e2e.test.js` | Simplify instance creation and secret
handling |


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated Brev CLI version and added an optional brev_token workflow
input for flexible token handling.
  * Removed legacy workflow input to simplify CI configuration.

* **Tests**
* Simplified instance provisioning to a single bare-instance flow and
increased SSH retry allowance.
* Streamlined remote SSH credential handling and made long-running
bootstrap/test execution use streaming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added the refactor PR restructures code without intended behavior change label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor PR restructures code without intended behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants