Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
phd: automatically fetch
crucible-downstairs
from Buildomat (#604)
Currently, in order to run the `phd` tests that involve Crucible disks, the path to a local `crucible-downstairs` binary must be provided via a command-line argument. When no `crucible-downstairs` binary path is provided, the tests that use Crucible are skipped. This means that the tests which use Crucible disks are not currently able to run on CI, as no `crucible-downstairs` binary is present. This branch extends the `phd-framework` crate's artifact store to support automatically fetch a `crucible-downstairs` binary from Buildomat when configured via the command line. This PR adds a new `--crucible-downstairs-commit` CLI argument to `phd-runner`. If present, this argument configures PHD to fetch a `crucible-downstairs` binary from Buildomat. The `--crucible-downstairs-commit` argument can either be the string `auto`, or a 40-character Git hash. When `auto` is passed, Git revision to fetch from Buildomat is determined automatically based on the `propolis` workspace's Git dependency on the `crucible` crate, to ensure that the downstairs binary matches the version of the upstairs library that Propolis was built against. Otherwise, if a Git hash is provided, the artifact for that commit hash is fetched from Buildomat, instead. The behavior of the existing `--crucible-downstairs-cmd` is unchanged, so a local `crucible-downstairs` binary can still be used rather than downloading it from Buildomat. This way, users can still run `phd` tests against a local Crucible build, if necessary. The new `--crucible-downstairs-commit` argument conflicts with `--crucible-downstairs-cmd`, so if both are provided, `phd-runner` will print an error. If _neither_ argument is provided, tests that require Crucible are skipped, maintaining the default behavior of not downloading anything unless explicitly configured to. The Buildomat job for Crucible publishes the entire Illumos Crucible zone as a tarball, rather than separate files for each artifact. Therefore, it was necessary to extend the `phd-framework` artifact store to support a configuration for extracting an individual file from within a tarball. The SHA256 used for the artifact is the SHA of the entire tarball, since Crucible's Buildomat job publishes the tarball's SHA, but once the tarball is downloaded, the `crucible-downstairs` binary is extracted from the tarball into the object store.
- Loading branch information