Skip to content

Commit

Permalink
trying to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Glauber Costa authored and glommer committed Aug 16, 2023
1 parent 517326b commit 9570106
Show file tree
Hide file tree
Showing 38 changed files with 93 additions and 334 deletions.
65 changes: 3 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache setup
uses: ./.github/actions/cache-setup
Expand All @@ -26,24 +26,6 @@ jobs:
- name: Generate documentation
run: cargo doc --all

doc-nightly:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache setup
uses: ./.github/actions/cache-setup

- name: Install cargo-deadlinks
run: which deadlinks || cargo install cargo-deadlinks

- name: Generate documentation
run: |
rustup install nightly
cargo +nightly doc --all
# temporarily disabled.
# - name: Validate links
# run: cargo deadlinks --dir target/doc/glommio
Expand All @@ -53,35 +35,20 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache setup
uses: ./.github/actions/cache-setup

- name: Build all targets
run: cargo build --all --all-targets

build-nightly:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache setup
uses: ./.github/actions/cache-setup

- name: Build all targets on the nigthly channel
run: >
rustup install nightly;
cargo +nightly build --all --all-targets --features=nightly
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache setup
uses: ./.github/actions/cache-setup
Expand All @@ -91,36 +58,10 @@ jobs:
cat << EOF > "run-gha-workflow.sh"
PATH=$PATH:/usr/share/rust/.cargo/bin
echo "`nproc` CPU(s) available"
rustup install nightly
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
rustup install 1.58
rustup show
rustup default stable
cargo install cargo-sort
cargo test -- --test-threads=`nproc`
EOF
sudo -E bash -c "ulimit -Sl 512 && ulimit -Hl 512 && bash run-gha-workflow.sh"
test-nightly:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache setup
uses: ./.github/actions/cache-setup

- name: Install cargo helpers and test all targets on the nigthly channel
run: |
cat << EOF > "run-gha-workflow.sh"
PATH=$PATH:/usr/share/rust/.cargo/bin
echo "`nproc` CPU(s) available"
rustup install nightly
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
rustup install 1.58
cargo install cargo-sort
rustup show
cargo +nightly test --features=nightly -- --test-threads=`nproc`
EOF
sudo -E bash -c "ulimit -Sl 512 && ulimit -Hl 512 && bash run-gha-workflow.sh"
17 changes: 4 additions & 13 deletions examples/storage.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
use clap::{App, Arg};
use futures_lite::{
stream::{self, StreamExt},
AsyncReadExt,
AsyncWriteExt,
AsyncReadExt, AsyncWriteExt,
};
use glommio::{
enclose,
io::{
BufferedFile,
DmaFile,
DmaStreamReader,
DmaStreamReaderBuilder,
DmaStreamWriterBuilder,
MergedBufferLimit,
ReadAmplificationLimit,
StreamReaderBuilder,
StreamWriterBuilder,
BufferedFile, DmaFile, DmaStreamReader, DmaStreamReaderBuilder, DmaStreamWriterBuilder,
MergedBufferLimit, ReadAmplificationLimit, StreamReaderBuilder, StreamWriterBuilder,
},
LocalExecutorBuilder,
Placement,
LocalExecutorBuilder, Placement,
};
use pretty_bytes::converter;
use std::{
Expand Down
2 changes: 2 additions & 0 deletions glommio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ homepage = "https://github.com/DataDog/glommio"
keywords = ["linux", "rust", "async", "iouring", "thread-per-core"]
categories = ["asynchronous", "concurrency", "os", "filesystem", "network-programming"]
readme = "../README.md"
# This is also documented in the README.md under "Supported Rust Versions"
rust-version = "1.58"

[dependencies]
ahash = "0.7"
Expand Down
6 changes: 1 addition & 5 deletions glommio/benches/competing_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ use futures_lite::AsyncWriteExt;
use glommio::{
enclose,
io::{ImmutableFile, ImmutableFileBuilder},
Latency,
LocalExecutorBuilder,
Placement,
Shares,
Latency, LocalExecutorBuilder, Placement, Shares,
};
use rand::Rng;
use std::{
Expand Down Expand Up @@ -102,7 +99,6 @@ async fn run_io(name: &str, file: &ImmutableFile, count: usize, size: usize) {
let started_at = Instant::now();

let tasks: Vec<_> = (0..2 << 10)
.into_iter()
.map(|_| {
let file = file.clone();
let hist = hist.clone();
Expand Down
3 changes: 1 addition & 2 deletions glommio/benches/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use futures_lite::{
use glommio::{
enclose,
net::{TcpListener, TcpStream},
LocalExecutorBuilder,
Placement,
LocalExecutorBuilder, Placement,
};
use std::{
cell::Cell,
Expand Down
3 changes: 1 addition & 2 deletions glommio/src/channels/channel_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ use std::sync::{Arc, RwLock};

use crate::{
channels::shared_channel::{self, *},
GlommioError,
Result,
GlommioError, Result,
};

/// Sender side
Expand Down
8 changes: 1 addition & 7 deletions glommio/src/channels/local_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ use std::{
};

use intrusive_collections::{
container_of,
linked_list::LinkOps,
offset_of,
Adapter,
LinkedList,
LinkedListLink,
PointerOps,
container_of, linked_list::LinkOps, offset_of, Adapter, LinkedList, LinkedListLink, PointerOps,
};

use std::{collections::VecDeque, marker::PhantomPinned, ptr::NonNull};
Expand Down
4 changes: 1 addition & 3 deletions glommio/src/channels/sharding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use futures_lite::{Future, Stream, StreamExt};
use crate::{
channels::channel_mesh::{FullMesh, Senders},
task::JoinHandle,
GlommioError,
ResourceType,
Result,
GlommioError, ResourceType, Result,
};

/// Alias for return type of `Handler`
Expand Down
6 changes: 2 additions & 4 deletions glommio/src/channels/shared_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use crate::{
enclose,
reactor::Reactor,
sys::{self, SleepNotifier},
GlommioError,
ResourceType,
GlommioError, ResourceType,
};
use futures_lite::{future, stream::Stream};
use std::{
Expand Down Expand Up @@ -491,8 +490,7 @@ mod test {
use super::*;
use crate::{
timer::{sleep, Timer},
LocalExecutorBuilder,
Placement,
LocalExecutorBuilder, Placement,
};
use futures_lite::{FutureExt, StreamExt};
use std::{
Expand Down
7 changes: 1 addition & 6 deletions glommio/src/controllers/deadline_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
use crate::{
channels::local_channel::{self, LocalReceiver, LocalSender},
controllers::ControllerStatus,
enclose,
task,
Latency,
Shares,
SharesManager,
TaskQueueHandle,
enclose, task, Latency, Shares, SharesManager, TaskQueueHandle,
};
use futures_lite::StreamExt;
use log::{trace, warn};
Expand Down
10 changes: 2 additions & 8 deletions glommio/src/executor/latch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
Condvar,
Mutex,
Arc, Condvar, Mutex,
};

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -156,10 +154,7 @@ mod test {
#[test]
fn cancel() {
let n = 1 << 10;
let cxl_ids = (n / 2..n + 1)
.into_iter()
.step_by(n / 2 / 5)
.collect::<HashSet<_>>();
let cxl_ids = (n / 2..n + 1).step_by(n / 2 / 5).collect::<HashSet<_>>();
assert_eq!(6, cxl_ids.len());

let (w, a, t) = helper(cxl_ids, n);
Expand Down Expand Up @@ -193,7 +188,6 @@ mod test {
let latch = Latch::new(count);
let cxl_ids = Arc::new(cxl_ids);
let res = (0..count)
.into_iter()
.map(|id| {
std::thread::spawn({
let l = Latch::clone(&latch);
Expand Down
28 changes: 9 additions & 19 deletions glommio/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,9 @@ use crate::{
error::BuilderErrorKind,
executor::stall::StallDetector,
io::DmaBuffer,
parking,
reactor,
sys,
parking, reactor, sys,
task::{self, waker_fn::dummy_waker},
GlommioError,
IoRequirements,
IoStats,
Latency,
Reactor,
Shares,
GlommioError, IoRequirements, IoStats, Latency, Reactor, Shares,
};
use ahash::AHashMap;
use futures_lite::pin;
Expand Down Expand Up @@ -1459,7 +1452,7 @@ impl LocalExecutor {
let spin_before_park = self.spin_before_park().unwrap_or_default();

let future = this
.spawn_into(async move { future.await }, TaskQueueHandle::default())
.spawn_into(future, TaskQueueHandle::default())
.unwrap()
.detach();
pin!(future);
Expand Down Expand Up @@ -2843,8 +2836,7 @@ mod test {
collections::HashMap,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
Mutex,
Arc, Mutex,
},
task::Waker,
};
Expand Down Expand Up @@ -3696,18 +3688,16 @@ mod test {

fut_output.sort_unstable();

assert_eq!(fut_output, (0..nr_cpus).into_iter().collect::<Vec<_>>());
assert_eq!(fut_output, (0..nr_cpus).collect::<Vec<_>>());

assert_eq!(nr_cpus, count.load(Ordering::Relaxed));
}

#[test]
fn executor_invalid_executor_count() {
assert!(
LocalExecutorPoolBuilder::new(PoolPlacement::Unbound(0))
.on_all_shards(|| async move {})
.is_err()
);
assert!(LocalExecutorPoolBuilder::new(PoolPlacement::Unbound(0))
.on_all_shards(|| async move {})
.is_err());
}

#[test]
Expand Down Expand Up @@ -3887,7 +3877,7 @@ mod test {
.collect::<Vec<_>>();

values.sort_unstable();
assert_eq!(values, (0..nr_execs).into_iter().collect::<Vec<_>>());
assert_eq!(values, (0..nr_execs).collect::<Vec<_>>());
}

#[test]
Expand Down
3 changes: 1 addition & 2 deletions glommio/src/executor/placement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ use crate::{error::BuilderErrorKind, sys::hardware_topology, CpuLocation, Glommi

use pq_tree::{
marker::{Pack, Priority, Spread},
Level,
Node,
Level, Node,
};
use std::{
collections::{
Expand Down
4 changes: 2 additions & 2 deletions glommio/src/executor/placement/pq_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ mod test {
assert_eq!(node_root.nr_slots(), total_cpus);
assert_eq!(node_root.nr_slots_selected(), 0);

let mut set = (0..total_cpus).into_iter().collect::<HashSet<_>>();
let mut set = (0..total_cpus).collect::<HashSet<_>>();

for ii in 0..total_cpus {
if let Some(Level::Cpu(cpu_id)) = node_root.select_cpu().last() {
Expand Down Expand Up @@ -329,7 +329,7 @@ mod test {
assert_eq!(node_root.nr_slots(), total_cpus);
assert_eq!(node_root.nr_slots_selected(), 0);

let mut set = (0..total_cpus).into_iter().collect::<HashSet<_>>();
let mut set = (0..total_cpus).collect::<HashSet<_>>();

for ii in 0..total_cpus {
if let Some(Level::Cpu(cpu_id)) = node_root.select_cpu().last() {
Expand Down
Loading

0 comments on commit 9570106

Please sign in to comment.