Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dev-tools/omicron-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use nexus_config::NexusConfig;
use nexus_test_interface::NexusServer;
use nexus_test_utils::resource_helpers::DiskTest;
use signal_hook_tokio::Signals;
use std::fs;

fn main() -> anyhow::Result<()> {
oxide_tokio_rt::run(async {
Expand Down Expand Up @@ -50,6 +51,9 @@ struct RunAllArgs {
/// Override the gateway server configuration file.
#[clap(long, default_value = DEFAULT_SP_SIM_CONFIG)]
gateway_config: Utf8PathBuf,
/// Override the nexus configuration file.
#[clap(long, default_value = "./nexus/examples/config.toml")]
nexus_config: Utf8PathBuf,
}

impl RunAllArgs {
Expand All @@ -60,9 +64,10 @@ impl RunAllArgs {
let mut signal_stream = signals.fuse();

// Read configuration.
let config_str = include_str!("../../../nexus/examples/config.toml");
let mut config: NexusConfig =
toml::from_str(config_str).context("parsing example config")?;
let config_str = fs::read_to_string(&self.nexus_config)?;
let mut config: NexusConfig = toml::from_str(&config_str).context(
format!("parsing config: {}", self.nexus_config.as_str()),
)?;
config.pkg.log = dropshot::ConfigLogging::File {
// See LogContext::new(),
path: "UNUSED".to_string().into(),
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omicron-dev/tests/test-omicron-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async fn test_run_all() {
let cmd_path = path_to_omicron_dev();

let cmdstr = format!(
"( set -o monitor; {} run-all --nexus-listen-port 0 && true )",
"( set -o monitor; {} run-all --nexus-listen-port 0 --nexus-config ../../nexus/examples/config.toml && true )",
cmd_path.display()
);
let exec =
Expand Down
15 changes: 11 additions & 4 deletions tools/install_builder_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ function usage

ASSUME_YES="false"
SKIP_PATH_CHECK="false"
OMIT_SUDO="false"
RETRY_ATTEMPTS=3
while getopts ypr: flag
while getopts ypsr: flag
do
case "${flag}" in
y) ASSUME_YES="true" ;;
p) SKIP_PATH_CHECK="true" ;;
s) OMIT_SUDO="true" ;;
r) RETRY_ATTEMPTS=${OPTARG} ;;
*) usage
esac
Expand Down Expand Up @@ -130,11 +132,16 @@ function install_packages {
'libclang-dev'
'libsqlite3-dev'
)
sudo apt-get update
if [[ "${OMIT_SUDO}" == "false" ]]; then
maybe_sudo="sudo"
else
maybe_sudo=""
fi
$maybe_sudo apt-get update
if [[ "${ASSUME_YES}" == "true" ]]; then
sudo apt-get install -y "${packages[@]}"
$maybe_sudo apt-get install -y "${packages[@]}"
else
confirm "Install (or update) [${packages[*]}]?" && sudo apt-get install "${packages[@]}"
confirm "Install (or update) [${packages[*]}]?" && $maybe_sudo apt-get install "${packages[@]}"
fi
elif [[ "${HOST_OS}" == "SunOS" ]]; then
CLANGVER=15
Expand Down
15 changes: 11 additions & 4 deletions tools/install_runner_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ function usage
}

ASSUME_YES="false"
OMIT_SUDO="false"
RETRY_ATTEMPTS=3
while getopts ypr: flag
while getopts ypsr: flag
do
case "${flag}" in
y) ASSUME_YES="true" ;;
p) continue ;;
s) OMIT_SUDO="true" ;;
r) RETRY_ATTEMPTS=${OPTARG} ;;
*) usage
esac
Expand Down Expand Up @@ -139,11 +141,16 @@ function install_packages {
'libssl3'
'libxmlsec1-openssl'
)
sudo apt-get update
if [[ "${OMIT_SUDO}" == "false" ]]; then
maybe_sudo="sudo"
else
maybe_sudo=""
fi
$maybe_sudo apt-get update
if [[ "${ASSUME_YES}" == "true" ]]; then
sudo apt-get install -y "${packages[@]}"
$maybe_sudo apt-get install -y "${packages[@]}"
else
confirm "Install (or update) [${packages[*]}]?" && sudo apt-get install "${packages[@]}"
confirm "Install (or update) [${packages[*]}]?" && $maybe_sudo apt-get install "${packages[@]}"
fi
else
echo "Unsupported OS: ${HOST_OS}"
Expand Down
Loading