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
488 changes: 121 additions & 367 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions ofborg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ build = "build.rs"
edition = "2024"

[dependencies]
async-std = { version = "=1.12.0", features = ["unstable", "tokio1"] }
brace-expand = "0.1.0"
chrono = { version = "0.4.38", default-features = false, features = [
"clock",
Expand All @@ -15,25 +14,28 @@ chrono = { version = "0.4.38", default-features = false, features = [
either = "1.13.0"
fs2 = "0.4.3"
futures-util = "0.3.31"
hex = "0.4.3"
hmac = "0.12.1"
http = "1"
http-body-util = "0.1"
#hubcaps = "0.6"
# for Conclusion::Skipped which is in master
hubcaps = { git = "https://github.com/ofborg/hubcaps.git", rev = "50dbe6ec45c9dfea4e3cfdf27bbadfa565f69dec", default-features = false, features = ["app", "rustls-tls"] }
http = "1"
# hyper = { version = "0.14", features = ["full"] }
hyper = "=0.10.*"
# maybe can be removed when hyper is updated
hyper = { version = "1.0", features = ["full", "server", "http1"] }
hyper-util = { version = "0.1", features = ["server", "tokio", "http1"] }
lapin = "2.5.4"
lru-cache = "0.1.2"
md5 = "0.8.0"
mime = "0.3"
nom = "4.2.3"
regex = "1.11.1"
rustls-pemfile = "2.2.0"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.135"
sha2 = "0.10.8"
tempfile = "3.15.0"
tokio = { version = "1", features = ["rt-multi-thread", "net", "macros", "sync"] }
tokio-stream = "0.1"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.19", features = ["json", "env-filter"] }
uuid = { version = "1.12", features = ["v4"] }
rustls-pemfile = "2.2.0"
hmac = "0.12.1"
sha2 = "0.10.8"
hex = "0.4.3"
9 changes: 4 additions & 5 deletions ofborg/src/bin/build-faker.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::env;
use std::error::Error;

use async_std::task;
use lapin::BasicProperties;
use lapin::message::Delivery;
use std::env;
use std::error::Error;

use ofborg::block_on;
use ofborg::commentparser;
use ofborg::config;
use ofborg::easylapin;
Expand All @@ -19,7 +18,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let cfg = config::load(arg.as_ref());

let conn = easylapin::from_config(&cfg.builder.unwrap().rabbitmq)?;
let mut chan = task::block_on(conn.create_channel())?;
let mut chan = block_on(conn.create_channel())?;

let repo_msg = Repo {
clone_url: "https://github.com/nixos/ofborg.git".to_owned(),
Expand Down
15 changes: 9 additions & 6 deletions ofborg/src/bin/builder.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use std::env;
use std::error::Error;
use std::future::Future;
use std::path::Path;
use std::pin::Pin;

use async_std::task::{self, JoinHandle};
use futures_util::future;
use ofborg::block_on;
use tracing::{error, info, warn};

use ofborg::easyamqp::{self, ChannelExt, ConsumerExt};
Expand All @@ -24,26 +26,27 @@ fn main() -> Result<(), Box<dyn Error>> {
};

let conn = easylapin::from_config(&builder_cfg.rabbitmq)?;
let mut handles = Vec::new();
let mut handles: Vec<Pin<Box<dyn Future<Output = ()> + Send>>> = Vec::new();

for system in &cfg.nix.system {
let handle_ext = self::create_handle(&conn, &cfg, system.to_string())?;
handles.push(handle_ext);
}

task::block_on(future::join_all(handles));
block_on(future::join_all(handles));

drop(conn); // Close connection.
info!("Closed the session... EOF");
Ok(())
}

#[allow(clippy::type_complexity)]
fn create_handle(
conn: &lapin::Connection,
cfg: &config::Config,
system: String,
) -> Result<JoinHandle<()>, Box<dyn Error>> {
let mut chan = task::block_on(conn.create_channel())?;
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, Box<dyn Error>> {
let mut chan = block_on(conn.create_channel())?;

let cloner = checkout::cached_cloner(Path::new(&cfg.checkout.root));
let nix = cfg.nix().with_system(system.clone());
Expand Down Expand Up @@ -104,5 +107,5 @@ fn create_handle(
)?;

info!("Fetching jobs from {}", &queue_name);
Ok(task::spawn(handle))
Ok(handle)
}
6 changes: 3 additions & 3 deletions ofborg/src/bin/evaluation-filter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::error::Error;

use async_std::task;
use ofborg::block_on;
use tracing::{error, info};

use ofborg::config;
Expand All @@ -23,7 +23,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

let conn = easylapin::from_config(&filter_cfg.rabbitmq)?;
let mut chan = task::block_on(conn.create_channel())?;
let mut chan = block_on(conn.create_channel())?;

chan.declare_exchange(easyamqp::ExchangeConfig {
exchange: "github-events".to_owned(),
Expand Down Expand Up @@ -74,7 +74,7 @@ fn main() -> Result<(), Box<dyn Error>> {
)?;

info!("Fetching jobs from {}", &queue_name);
task::block_on(handle);
block_on(handle);

drop(conn); // Close connection.
info!("Closed the session... EOF");
Expand Down
6 changes: 3 additions & 3 deletions ofborg/src/bin/github-comment-filter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::error::Error;

use async_std::task;
use ofborg::block_on;
use ofborg::systems::System;
use tracing::{error, info};

Expand All @@ -24,7 +24,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

let conn = easylapin::from_config(&filter_cfg.rabbitmq)?;
let mut chan = task::block_on(conn.create_channel())?;
let mut chan = block_on(conn.create_channel())?;

chan.declare_exchange(easyamqp::ExchangeConfig {
exchange: "github-events".to_owned(),
Expand Down Expand Up @@ -98,7 +98,7 @@ fn main() -> Result<(), Box<dyn Error>> {
)?;

info!("Fetching jobs from {}", &queue_name);
task::block_on(handle);
block_on(handle);

drop(conn); // Close connection.
info!("Closed the session... EOF");
Expand Down
6 changes: 3 additions & 3 deletions ofborg/src/bin/github-comment-poster.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::error::Error;

use async_std::task;
use ofborg::block_on;
use tracing::{error, info};

use ofborg::config;
Expand All @@ -23,7 +23,7 @@ fn main() -> Result<(), Box<dyn Error>> {
};

let conn = easylapin::from_config(&poster_cfg.rabbitmq)?;
let mut chan = task::block_on(conn.create_channel())?;
let mut chan = block_on(conn.create_channel())?;

chan.declare_exchange(easyamqp::ExchangeConfig {
exchange: "build-results".to_owned(),
Expand Down Expand Up @@ -63,7 +63,7 @@ fn main() -> Result<(), Box<dyn Error>> {
},
)?;

task::block_on(handle);
block_on(handle);

drop(conn); // Close connection.
info!("Closed the session... EOF");
Expand Down
Loading