Skip to content

[sled-agent] Support bundle storage api#6782

Merged
smklein merged 55 commits into
mainfrom
support-bundle-storage-api
Nov 25, 2024
Merged

[sled-agent] Support bundle storage api#6782
smklein merged 55 commits into
mainfrom
support-bundle-storage-api

Conversation

@smklein

@smklein smklein commented Oct 5, 2024

Copy link
Copy Markdown
Collaborator

This PR implements raw bundle storage for support bundles.

In the future, I expect that Nexus will invoke these APIs to store and later access portions of storage bundles.

  • Provides an API to create, list, query, and delete support bundles
  • Implements range request support for these APIs

Fixes #1599

Comment thread range-requests/Cargo.toml
Comment thread sled-storage/src/manager.rs
Comment thread sled-storage/src/manager_test_harness.rs
@smklein smklein marked this pull request as ready for review November 20, 2024 01:03
Comment on lines +700 to +703
/// Accesses the [SupportBundleManager] API.
pub(crate) fn as_support_bundle_storage(&self) -> SupportBundleManager<'_> {
SupportBundleManager::new(&self.log, self.storage())
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Rather than directly implementing the support bundle API as part of the Sled Agent, I split it into a different structure to make testing easier.

That's why I'm calling this function in the http_entrypoints

// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

pub mod queries;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

FYI @papertigers - we both used the support_bundle.rs module, so I split your stuff into "queries" and my stuff into "storage". Hopefully the re-organization makes sense?

Comment thread sled-agent/src/support_bundle/storage.rs

@wfchandler wfchandler 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.

Thanks @smklein, just a few small suggestions from me.

Comment thread sled-agent/src/support_bundle/storage.rs Outdated
Comment thread sled-agent/src/support_bundle/storage.rs Outdated
Comment thread sled-agent/src/support_bundle/storage.rs Outdated
Comment thread sled-agent/src/support_bundle/storage.rs Outdated
Comment thread sled-agent/src/support_bundle/storage.rs Outdated
Comment thread sled-agent/src/support_bundle/storage.rs
Comment thread sled-agent/api/src/lib.rs Outdated
Comment thread sled-agent/api/src/lib.rs Outdated
Comment thread sled-agent/api/src/lib.rs Outdated
Comment thread sled-agent/api/src/lib.rs Outdated
smklein added a commit that referenced this pull request Nov 21, 2024
This library is used as a part of
#1599 , I'm pulling it
out of #6782 to help make
the diff smaller.

This PR adds a `range-requests` crate for dropshot-based range requests.

Heavily inspired by @jclulow 's work in
https://github.com/oxidecomputer/buildomat/blob/main/download/src/lib.rs
@smklein

smklein commented Nov 22, 2024

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback! All the responses to review comments should be contained within e1e185b

@wfchandler wfchandler 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.

LGTM, thanks @smklein!

@smklein smklein merged commit e87ac05 into main Nov 25, 2024
@smklein smklein deleted the support-bundle-storage-api branch November 25, 2024 20:26
smklein added a commit that referenced this pull request Jan 13, 2025
PR 4 / ???

Adds a background task to manage support bundle lifecycle, and perform
collection

In this PR:
- [x] Actually perform the work of collection in a background task
- [x] Invoke the API from
#6782 to store bundles
- [x] Add tests to confirm the background task is working as intended
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.

[sled agent] Figure out how to store/manage Service Bundles

2 participants