-
Notifications
You must be signed in to change notification settings - Fork 22
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
PHD: improve artifact store #529
Conversation
Rework the PHD artifact store to reduce complexity and add some features: - Instead of specifying a single remote URI per downloadable artifact, have the artifact manifest specify a list of remote URI bases from which any downloadable artifact with the "remote server" source type can be obtained. - Instead of having separate tables for guest OS images and bootroms, create one table of artifacts whose kinds are distinguished by an enum. - Make the store remember whether it has previously verified the hash of an extant artifact. This substantially reduces runtime for tests that work with large disk images. - Add support for a "Propolis server" artifact type. The runner doesn't use this yet but will begin making use of this in a future PR. Update the PHD README and default artifact file to reflect these changes. Also convert from PathBuf to camino::Utf8PathBuf in a few places to eliminate some awkward type conversions.
This is a slightly nicer way to avoid dropping the inner artifact store error when a store lookup fails.
phd-tests/README.md
Outdated
# Remote artifacts are required to specify an expected SHA256 digest as a | ||
# string. | ||
[artifacts.alpine.source.remote_server] | ||
sha256 = "alpine_digest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the digest fields, maybe have fake data which at least resembles (in length) a sha256.
show me your war face
sha256 = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
use crate::guest_os::GuestOsKind; | ||
|
||
use super::{manifest::Manifest, ArtifactSource}; | ||
use anyhow::bail; | ||
use camino::{Utf8Path, Utf8PathBuf}; | ||
use ring::digest::{Digest, SHA256}; | ||
use std::collections::BTreeMap; | ||
use std::fs::File; | ||
use std::io::{BufReader, Read, Seek, SeekFrom, Write}; | ||
use std::sync::Mutex; | ||
use std::time::Duration; | ||
use tracing::info; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small style nit: group the crate-local (crate::
and super::
), std
, and cargo imports together in their own sections to stay consistent the rest of the existing style?
Rework the PHD artifact store to reduce complexity and add some features:
artifact manifest specify a list of remote URI bases from which any
downloadable artifact with the "remote server" source type can be obtained.
table of artifacts whose kinds are distinguished by an enum.
extant artifact. This substantially reduces runtime for runs that work with
large disk images.
yet but will begin making use of this in a future PR. See PHD: want support for migration between distinct Propolis binaries #528.
Update the PHD README and default artifact file to reflect these changes.
Also convert from PathBuf to camino::Utf8PathBuf in a few places to eliminate
some awkward type conversions.