Skip to content
Merged
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
32 changes: 30 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ rand = "0.8.5"
backoff = "0.4"
mg-common = { path = "mg-common" }
chrono = { version = "0.4.41", features = ["serde"] }
oxide-tokio-rt = "0.1.2"
oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main"}
oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "main"}
oxnet = { version = "0.1.2", default-features = false, features = ["schemars", "serde"] }
Expand Down
4 changes: 4 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[disallowed-macros]]
path = "tokio::main"
reason = "prefer `oxide_tokio_rt` for production software"
replacement = "oxide_tokio_rt::run"
1 change: 1 addition & 0 deletions ddmadm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ anstyle.workspace = true
anyhow.workspace = true
clap.workspace = true
colored.workspace = true
oxide-tokio-rt.workspace = true
oxnet.workspace = true
slog-async.workspace = true
slog-envlogger.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions ddmadm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ struct Peer {
addr: Ipv6Addr,
}

#[tokio::main]
async fn main() -> Result<()> {
run().await
fn main() -> Result<()> {
oxide_tokio_rt::run(run())
}

async fn run() -> Result<()> {
Expand Down
1 change: 1 addition & 0 deletions ddmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mg-common = { path = "../mg-common" }
anyhow.workspace = true
clap.workspace = true
libnet.workspace = true
oxide-tokio-rt.workspace = true
slog.workspace = true
slog-bunyan.workspace = true
slog-async.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions ddmd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ struct Dendrite {
port: u16,
}

#[tokio::main]
async fn main() {
fn main() {
oxide_tokio_rt::run(run())
}

async fn run() {
let arg = Arg::parse();
let log = init_logger();

Expand Down
1 change: 1 addition & 0 deletions lab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2018"
libfalcon = { git = "https://github.com/oxidecomputer/falcon", branch = "main" }
anyhow.workspace = true
tokio.workspace = true
oxide-tokio-rt.workspace = true

[[bin]]
name = "solo"
Expand Down
7 changes: 5 additions & 2 deletions lab/src/2x2/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ use libfalcon::error::Error;
use libfalcon::unit::gb;
use libfalcon::Runner;

#[tokio::main]
async fn main() -> Result<(), Error> {
fn main() -> Result<(), Error> {
oxide_tokio_rt::run(main_impl())
}

async fn main_impl() -> Result<(), Error> {
let mut d = Runner::new("mg2x2");

// routers
Expand Down
7 changes: 5 additions & 2 deletions lab/src/duo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ use libfalcon::error::Error;
use libfalcon::unit::gb;
use libfalcon::Runner;

#[tokio::main]
async fn main() -> Result<(), Error> {
fn main() -> Result<(), Error> {
oxide_tokio_rt::run(main_impl())
}

async fn main_impl() -> Result<(), Error> {
let mut d = Runner::new("duo");

// nodes
Expand Down
7 changes: 5 additions & 2 deletions lab/src/quartet/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ use libfalcon::error::Error;
use libfalcon::unit::gb;
use libfalcon::Runner;

#[tokio::main]
async fn main() -> Result<(), Error> {
fn main() -> Result<(), Error> {
oxide_tokio_rt::run(main_impl())
}

async fn main_impl() -> Result<(), Error> {
let mut d = Runner::new("quartet");

// nodes
Expand Down
7 changes: 5 additions & 2 deletions lab/src/solo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ use libfalcon::error::Error;
use libfalcon::unit::gb;
use libfalcon::Runner;

#[tokio::main]
async fn main() -> Result<(), Error> {
fn main() -> Result<(), Error> {
oxide_tokio_rt::run(main_impl())
}

async fn main_impl() -> Result<(), Error> {
let mut d = Runner::new("mgsolo");

// nodes
Expand Down
7 changes: 5 additions & 2 deletions lab/src/trio/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ use libfalcon::error::Error;
use libfalcon::unit::gb;
use libfalcon::Runner;

#[tokio::main]
async fn main() -> Result<(), Error> {
fn main() -> Result<(), Error> {
oxide_tokio_rt::run(main_impl())
}

async fn main_impl() -> Result<(), Error> {
let mut d = Runner::new("trio");

// nodes
Expand Down
1 change: 1 addition & 0 deletions mg-ddm-verify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2021"
[dependencies]
anyhow.workspace = true
reqwest.workspace = true
oxide-tokio-rt.workspace = true
tokio.workspace = true
serde.workspace = true
serde_json.workspace = true
7 changes: 5 additions & 2 deletions mg-ddm-verify/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ pub struct Sled {
ip: String,
}

#[tokio::main]
async fn main() -> Result<()> {
fn main() -> Result<()> {
oxide_tokio_rt::run(run())
}

async fn run() -> Result<()> {
let sleds: Vec<Sled> =
serde_json::from_str(&std::fs::read_to_string("sleds.json")?)?;

Expand Down
1 change: 1 addition & 0 deletions mgadm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mg-admin-client = { path = "../mg-admin-client" }
tokio.workspace = true
clap.workspace = true
anyhow.workspace = true
oxide-tokio-rt.workspace = true
slog.workspace = true
slog-term.workspace = true
slog-async.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions mgadm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ enum Commands {
Bfd(bfd::Commands),
}

#[tokio::main]
async fn main() -> Result<()> {
fn main() -> Result<()> {
oxide_tokio_rt::run(run())
}

async fn run() -> Result<()> {
let cli = Cli::parse();
let log = init_logger();

Expand Down
1 change: 1 addition & 0 deletions mgd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tokio.workspace = true
http.workspace = true
thiserror.workspace = true
rand.workspace = true
oxide-tokio-rt.workspace = true
oximeter.workspace = true
oximeter-producer.workspace = true
chrono.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions mgd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ struct RunArgs {
sled_uuid: Option<Uuid>,
}

#[tokio::main]
async fn main() {
fn main() {
let args = Cli::parse();
match args.command {
Commands::Run(run_args) => run(run_args).await,
Commands::Run(run_args) => oxide_tokio_rt::run(run(run_args)),
Commands::Apigen => admin::apigen(),
}
}
Expand Down
5 changes: 5 additions & 0 deletions package/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use anyhow::Result;
use omicron_zone_package::package::BuildConfig;
use std::fs::create_dir_all;

#[expect(
clippy::disallowed_macros,
reason = "using `#[tokio::main]` to avoid an extra dependency \
is worth more than a prod-like configuration in a build tool"
)]
#[tokio::main]
async fn main() -> Result<()> {
let cfg = omicron_zone_package::config::parse("package-manifest.toml")?;
Expand Down