Skip to content

Implement firmware upgrade in scout#590

Open
rahmonov wants to merge 1 commit intoNVIDIA:mainfrom
rahmonov:scout-firmware-upgrade
Open

Implement firmware upgrade in scout#590
rahmonov wants to merge 1 commit intoNVIDIA:mainfrom
rahmonov:scout-firmware-upgrade

Conversation

@rahmonov
Copy link
Contributor

Description

This is an alternative to #484 which is approved but not merged yet.

One question remaining is whether we want to use the stream or polling approach for upgrading the firmware. That PR uses the stream approach but @Matthias247 mentioned that since upgrade is a long process the polling approach could be a better approach than streaming.

This PR does that - uses the polling approach to upgrade firmware. If we prefer this approach I will close the other PR.

The whole upgrade-through-scout needs changes on both carbide-api and scout, so I will be coming back to these parts of the codebase to fill up the blanks (marked with TODOs) later once the dependencies are done. This is also the reason why I haven't yet done an integration test and thus some small details may be wrong. They will be fixed once I do an integration test with the whole flow.

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@rahmonov rahmonov requested a review from Matthias247 March 17, 2026 15:54
@rahmonov rahmonov requested a review from a team as a code owner March 17, 2026 15:54
Copilot AI review requested due to automatic review settings March 17, 2026 15:54
@rahmonov rahmonov force-pushed the scout-firmware-upgrade branch from b238116 to c9794c7 Compare March 17, 2026 15:55
@github-actions
Copy link

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-03-17 15:57:29 UTC | Commit: c9794c7

@github-actions
Copy link

🛡️ Vulnerability Scan

🚨 Found 72 vulnerability(ies)
📊 vs main: 72 (no change)

Severity Breakdown:

  • 🔴 Critical/High: 72
  • 🟡 Medium: 0
  • 🔵 Low/Info: 0

🔗 View full details in Security tab

🕐 Last updated: 2026-03-17 15:57:43 UTC | Commit: c9794c7

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in scout for a new ForgeAgentControlResponse.Action::FIRMWARE_UPGRADE flow, where scout downloads firmware artifacts + an upgrade script over HTTP (mTLS-configured reqwest client) and executes the script, intended to support a polling-based firmware upgrade mechanism.

Changes:

  • Add FIRMWARE_UPGRADE to the ForgeAgentControlResponse action enum and handle it in scout’s action dispatcher.
  • Introduce a new firmware_upgrade module to download artifacts, verify SHA256 for artifacts, and execute an upgrade script with timeouts.
  • Add HTTP client helper in scout to reuse the same mTLS material as the gRPC client; add unit tests and new deps.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
crates/scout/src/main.rs Wires new Action::FirmwareUpgrade handling and task parsing from extra info.
crates/scout/src/firmware_upgrade.rs Implements download/verify/execute flow with timeouts + unit tests.
crates/scout/src/client.rs Adds create_http_client for mTLS-enabled reqwest usage.
crates/scout/Cargo.toml Adds sha2, tempfile, and axum (dev-dep) for firmware upgrade + tests.
crates/rpc/proto/forge.proto Extends action enum with FIRMWARE_UPGRADE.
Cargo.lock Locks new dependency additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rahmonov rahmonov force-pushed the scout-firmware-upgrade branch from c9794c7 to 7fe8814 Compare March 17, 2026 16:47
@rahmonov rahmonov force-pushed the scout-firmware-upgrade branch from 7fe8814 to fac0edd Compare March 18, 2026 08:57

// create_http_client builds a reqwest HTTP client configured with the same
// mTLS certificates used for gRPC communication with carbide-api.
pub(crate) fn create_http_client(config: &Options) -> CarbideClientResult<reqwest::Client> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we had a crate somewhere in crates/ that has this logic already.

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.

3 participants