Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuftool: feature to dump stats #156

Open
webern opened this issue Jun 19, 2020 · 2 comments
Open

tuftool: feature to dump stats #156

webern opened this issue Jun 19, 2020 · 2 comments
Labels
crate/tuftool enhancement New feature or request

Comments

@webern
Copy link
Contributor

webern commented Jun 19, 2020

As mentioned by @bcressey

We should have a way to track these sizes over time so we'll know if we're getting close to any of these limits. Maybe a tuftool feature to dump stats.

That is, we should have a tuftool feature to dump the size stats as they relate to REPOSITORY_LIMITS. That way when we use tuftool we can make sure Bottlerocket repos are not approaching the size limits.

@iliana
Copy link
Contributor

iliana commented Jun 19, 2020

tough/tough/src/lib.rs

Lines 124 to 128 in 7e86574

/// The [`Default`] implementation sets the following values:
/// * `max_root_size`: 1 MiB
/// * `max_targets_size`: 10 MiB
/// * `max_timestamp_size`: 1 MiB
/// * `max_root_updates`: 1024

max_targets_size is the only concern here, right? timestamp.json is essentially a pointer to the current snapshot.json version, and root.json only contains the keys. These files measured in dozens of kilobytes would be absurdly large; they should never reach 1 MiB. 1024 root updates seems equally ridiculous.

max_targets_size is only used when the size of targets.json is not specified in snapshot.json (this field is optional per the spec), but repositories generated by tough list this size.

tough/tough/src/lib.rs

Lines 791 to 794 in 7e86574

let (max_targets_size, specifier) = match targets_meta.length {
Some(length) => (length, "snapshot.json"),
None => (max_targets_size, "max_targets_size parameter"),
};

SnapshotMeta {
hashes: Some(Hashes {
sha256: role.sha256.to_vec().into(),
_extra: HashMap::new(),
}),
length: Some(role.length),
version: role.signed.signed.version(),
_extra: HashMap::new(),
}

@webern
Copy link
Contributor Author

webern commented Jun 19, 2020

I transferred the ask without thinking about it too much. It may not be necessary if it's as simple as looking at the size of targets.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/tuftool enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants